SOPE/0000755000000000000000000000000012242733417010327 5ustar rootrootSOPE/sope-gdl1/0000755000000000000000000000000012242733417012122 5ustar rootrootSOPE/sope-gdl1/GNUmakefile0000644000000000000000000000110412242733417014170 0ustar rootroot# GNUstep makefile include ../config.make include $(GNUSTEP_MAKEFILES)/common.make PACKAGE_NAME=sope-gdl1 VERSION=4.7.0 SUBPROJECTS += GDLAccess ifeq ($(HAS_LIBRARY_pq),yes) SUBPROJECTS += PostgreSQL endif ifeq ($(HAS_LIBRARY_sqlite3),yes) SUBPROJECTS += SQLite3 endif ifeq ($(HAS_LIBRARY_mysqlclient),yes) SUBPROJECTS += MySQL endif ifeq ($(HAS_LIBRARY_oracle),yes) SUBPROJECTS += Oracle endif -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/aggregate.make -include GNUmakefile.postamble # package macosx-pkg :: all ../maintenance/make-osxpkg.sh sope-gdl1 SOPE/sope-gdl1/Oracle8/0000755000000000000000000000000012242733417013417 5ustar rootrootSOPE/sope-gdl1/Oracle8/OracleSQLExpression.m0000644000000000000000000000173012242733417017443 0ustar rootroot/* ** OracleSQLExpression.m ** ** Copyright (c) 2007 Inverse groupe conseil inc. and Ludovic Marcotte ** ** Author: Ludovic Marcotte ** ** 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 */ #import "OracleSQLExpression.h" @implementation OracleSQLExpression @end SOPE/sope-gdl1/Oracle8/README0000644000000000000000000000356312242733417014306 0ustar rootrootOracle 10g GDL Adaptor Copyright (c) 2007 Inverse groupe conseil inc. and Ludovic Marcotte ==================================================================== This adaptor allows you to use an Oracle 10g (or above/below) server togeter with GDL. It makes use of the new OCI API from Oracle. In order to compile and use this adaptor, you must install the Oracle Instant Client. For Linux-based operating systems, please refer to the following page for installation instructions: http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/linuxsoft.html You'll have to install the following packages from Oracle: * oracle-instantclient-basic * oracle-instantclient-devel Once you've installed the requirements, follow the installation and configuration instructions to get the adaptor working. Installation and Configuration ============================== 1- Based on where you've installed the Oracle dependancies, modify the GNUmakefile so gnustep-make can find the location of Oracle's headers and client librairies. You would want to modify at least: ORACLE_VERSION -lnnz 2- Compile and install the adaptor: % make % make install Testing the Oracle Adaptor ========================== The adaptor comes with a simple testing tool called 'otest'. To try it, first modify the database connection parameters specified in the 'condict.plist' file. Then, simply run the tool: % ./obj/otest This will do a simple "SELECT * FROM all_tables" Current limitations =================== The adaptor currently supports only the following data types: - CLOB - DATE - INTEGER - NUMBER - STRING - VARCHAR2 CLOB are read as strings. The adaptor does not yet support the EOModel kungfu. The following improvements are also coming soon: - primary key generation support - schema selection support - delegate calls, when required - more datatypes support SOPE/sope-gdl1/Oracle8/GNUmakefile0000644000000000000000000000525212242733417015475 0ustar rootroot# # GNUmakefile # # Copyright (c) 2007 Inverse groupe conseil inc. and Ludovic Marcotte # # Author: Ludovic Marcotte # # 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 # include ../../config.make include $(GNUSTEP_MAKEFILES)/common.make include ../Version include ./Version # Global properties and dependancies SOPE_ROOT=../.. ORACLE_VERSION=$(shell echo /usr/include/oracle/* | awk '{ print $$NF }' | awk -F / '{ print $$NF }') #ORACLE_VERSION=10.2.0.3 #ORACLE_VERSION=11.1.0.1 ADDITIONAL_INCLUDE_DIRS += -I../../sope-core -I../../sope-core/NGExtensions -I../GDLAccess -I.. -I/usr/include/oracle/$(ORACLE_VERSION)/client64 -I/usr/include/oracle/$(ORACLE_VERSION)/client local_arch = $(subst 64,,$(shell uname -m)) ifeq ($(local_arch),ppc) PPC_LDFLAGS=-L/opt/ibmcmp/lib -libmc++ else PPC_LDFLAGS= endif ifneq ($(frameworks),yes) common_LIBS = -L/usr/lib/oracle/$(ORACLE_VERSION)/client64/lib/ -L/usr/lib/oracle/$(ORACLE_VERSION)/client/lib/ -locci -lociei -lclntsh -lnnz11 -L../GDLAccess/obj -lGDLAccess -L../../sope-core/EOControl/obj -lEOControl $(PPC_LDFLAGS) else common_LIBS = -L/usr/lib/oracle/$(ORACLE_VERSION)/client64/lib/ -L/usr/lib/oracle/$(ORACLE_VERSION)/client/lib/ -locci -lociei -lclntsh -lnnz11 -framework GDLAccess -framework EOControl $(PPC_LDFLAGS) endif Oracle8_BUNDLE_LIBS += $(common_LIBS) otest_TOOL_LIBS += $(common_LIBS) # Bundle BUNDLE_NAME = Oracle8 ifeq ($(frameworks),yes) BUNDLE_INSTALL_DIR := $(FRAMEWORK_INSTALL_DIR)/GDLAccess.framework/Resources/GDLAdaptors/ else BUNDLE_INSTALL_DIR = $(SOPE_DBADAPTORS)/ endif Oracle8_OBJC_FILES = \ EOAttribute+Oracle.m \ OracleAdaptor.m \ OracleAdaptorChannel.m \ OracleAdaptorChannelController.m \ OracleAdaptorContext.m \ OracleSQLExpression.m \ OracleValues.m \ err.m Oracle8_PRINCIPAL_CLASS = OracleAdaptor BUNDLE_INSTALL = Oracle8 BUNDLE_EXTENSION = .gdladaptor Oracle8_RESOURCE_FILES += Version # Tool TOOL_NAME = otest otest_OBJC_FILES = otest.m include $(GNUSTEP_MAKEFILES)/bundle.make include $(GNUSTEP_MAKEFILES)/tool.make SOPE/sope-gdl1/Oracle8/OracleAdaptorChannel.h0000644000000000000000000000345212242733417017605 0ustar rootroot/* ** OracleAdaptorChannel.h ** ** Copyright (c) 2007 Inverse groupe conseil inc. and Ludovic Marcotte ** ** Author: Ludovic Marcotte ** ** 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 */ #ifndef _OracleAdaptorChannel_H #define _OracleAdaptorChannel_H #include #import //#import "../GDLContentStore/EOAdaptorChannel+GCS.h" @class NSMutableArray; typedef struct { OCIDefine *def; // The define information handle of the column dvoid *value; // The value of the column (the buffer size is max_width bytes) ub2 type; // The type of the column ub2 width; // The current width of the value that has been read ub2 max_width; // The maximum width of the column } column_info; @interface OracleAdaptorChannel : EOAdaptorChannel { @private // Oracle's related ivars OCIEnv* _oci_env; OCISvcCtx* _oci_ctx; OCIError* _oci_err; OCIStmt* _current_stm; // ... NSMutableArray *_resultSetProperties; NSMutableArray *_row_buffer; } - (OCIEnv *) environment; - (OCISvcCtx *) serviceContext; - (OCIError *) errorHandle; @end #endif SOPE/sope-gdl1/Oracle8/EOAttribute+Oracle.m0000644000000000000000000000572612242733417017177 0ustar rootroot/* ** OracleEOAttribute.m ** ** Copyright (c) 2007 Inverse groupe conseil inc. and Ludovic Marcotte ** ** Author: Ludovic Marcotte ** ** 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 */ #import "EOAttribute+Oracle.h" @implementation EOAttribute (OracleExtensions) + (id) attributeWithOracleType: (ub2) theType name: (text *) theName length: (ub4) theLength width: (ub4) theWidth { EOAttribute *attr; NSString *s; attr = [[EOAttribute alloc] init]; s = AUTORELEASE([[NSString alloc] initWithBytes: theName length: theLength encoding: NSASCIIStringEncoding]); // Oracle returns us the column names using uppercase strings. // We change that to avoid lameness in other parts of GDL. s = [s lowercaseString]; [attr setName: s]; [attr setColumnName: s]; [attr setWidth: (unsigned)theWidth]; switch (theType) { case SQLT_CHR: [attr setExternalType: @"VARCHAR2"]; [attr setValueClassName: @"NSString"]; break; case SQLT_CLOB: [attr setExternalType: @"CLOB"]; [attr setValueClassName: @"NSString"]; break; case SQLT_DAT: // char[7] that contains the date and time but no time zone information. [attr setExternalType: @"DATE"]; [attr setValueClassName: @"NSDate"]; break; case SQLT_INT: [attr setExternalType: @"INTEGER"]; [attr setValueClassName: @"NSNumber"]; [attr setValueType: @"d"]; break; case SQLT_NUM: // char[22] [attr setExternalType: @"NUMBER"]; [attr setValueClassName: @"NSNumber"]; [attr setValueType: @"d"]; break; case SQLT_STR: [attr setExternalType: @"STRING"]; [attr setValueClassName: @"NSString"]; break; case SQLT_TIMESTAMP: [attr setExternalType: @"TIMESTAMP"]; [attr setValueClassName: @"NSCalendarDate"]; break; case SQLT_TIMESTAMP_TZ: [attr setExternalType: @"TIMESTAMP WITH TIME ZONE"]; [attr setValueClassName: @"NSCalendarDate"]; break; case SQLT_TIMESTAMP_LTZ: [attr setExternalType: @"TIMESTAMP WITH LOCAL TIME ZONE"]; [attr setValueClassName: @"NSCalendarDate"]; break; default: NSLog(@"Unsupported type! %d\n", theType); } return AUTORELEASE(attr); } @end SOPE/sope-gdl1/Oracle8/condict.plist0000644000000000000000000000021212242733417016112 0ustar rootroot{ hostName = "oracle"; userName = "focus"; password = "focusrocks"; databaseName = "oracle"; port = 1521; } SOPE/sope-gdl1/Oracle8/OracleAdaptor.m0000644000000000000000000001062112242733417016315 0ustar rootroot/* ** OracleAdaptor.h ** ** Copyright (c) 2007 Inverse groupe conseil inc. Ludovic Marcotte ** ** Author: Ludovic Marcotte ** ** 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 */ #include "OracleAdaptor.h" #import "OracleAdaptorChannel.h" #import "OracleAdaptorContext.h" #import "OracleSQLExpression.h" #import "OracleValues.h" // // // @interface OracleAdaptor (Private) - (ub2) typeForName: (NSString *) theName; @end @implementation OracleAdaptor (Private) - (ub2) typeForName: (NSString *) theName { ub2 t; theName = [theName uppercaseString]; if ([theName hasPrefix: @"VARCHAR2"]) { t = SQLT_CHR; } else if ([theName hasPrefix: @"VARCHAR"]) { t = SQLT_VCS; } else if ([theName isEqualToString: @"LONG VARCHAR"]) { t = SQLT_LVC; } else if ([theName isEqualToString: @"CLOB"]) { t = SQLT_CLOB; } else if ([theName isEqualToString: @"DATE"]) { t = SQLT_DAT; } else if ([theName isEqualToString: @"INTEGER"]) { t = SQLT_INT; } else if ([theName isEqualToString: @"NUMBER"]) { t = SQLT_NUM; } else if ([theName isEqualToString: @"STRING"]) { t = SQLT_STR; } else if ([theName isEqualToString: @"TIMESTAMP"]) { t = SQLT_TIMESTAMP; } else if ([theName isEqualToString: @"TIMESTAMP WITH TIME ZONE"]) { t = SQLT_TIMESTAMP_TZ; } else if ([theName isEqualToString: @"TIMESTAMP WITH LOCAL TIME ZONE"]) { t = SQLT_TIMESTAMP_LTZ; } else { [self logWithFormat: @"unknown Oracle type: %@ (fallback to SQLT_CHR)", theName]; t = SQLT_CHR; } return t; } @end // // // @implementation OracleAdaptor - (id) initWithName: (NSString *) theName { if ((self = [super initWithName: theName])) { // On Oracle, we must set the NLS_LANG in order to let Oracle perform // charset transformations for us. Since, when we write data to the database // and when we read data from it we assume that we are using UTF-8, we // set NLS_LANG to the proper value. setenv("NLS_LANG", "AMERICAN_AMERICA.UTF8", 1); return self; } return nil; } // // // - (id) copyWithZone: (NSZone *) theZone { return [self retain]; } // // // - (Class) adaptorContextClass { return [OracleAdaptorContext class]; } // // // - (Class) adaptorChannelClass { return [OracleAdaptorChannel class]; } // // // - (Class) expressionClass { return [OracleSQLExpression class]; } // // // - (EOAdaptorContext *) createAdaptorContext { return AUTORELEASE([[OracleAdaptorContext alloc] initWithAdaptor: self]); } // // // - (NSString *) databaseName { return [[self connectionDictionary] objectForKey: @"databaseName"]; } // // // - (id) formatValue: (id) theValue forAttribute: (EOAttribute *) theAttribute { NSString *s; s = [theValue stringValueForOracleType: [self typeForName: [theAttribute externalType]] attribute: theAttribute]; // NSLog(@"Formatted %@ (%@) to %@ (NSString)", theValue, NSStringFromClass([theValue class]), s); return s; } // // We don't check the values inside the connection // dictionary for now.s // - (BOOL) hasValidConnectionDictionary { return ([self connectionDictionary] ? YES : NO); } // // // - (BOOL) isValidQualifierType: (NSString *) theTypeName { return YES; } // // // - (NSString *) loginName; { return [[self connectionDictionary] objectForKey: @"userName"]; } // // // - (NSString *) loginPassword { return [[self connectionDictionary] objectForKey: @"password"]; } // // // - (NSString *) port { return [[self connectionDictionary] objectForKey: @"port"]; } // // // - (NSString *) serverName { return [[self connectionDictionary] objectForKey: @"hostName"]; } @end SOPE/sope-gdl1/Oracle8/OracleAdaptorContext.m0000644000000000000000000000472012242733417017665 0ustar rootroot/* ** OracleAdaptorContext.m ** ** Copyright (c) 2007 Inverse groupe conseil inc. and Ludovic Marcotte ** ** Author: Ludovic Marcotte ** ** 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 */ #import "OracleAdaptorContext.h" #import "OracleAdaptorChannel.h" #define DEFAULT_TRANSACTION_TIMEOUT 60 // // // @implementation OracleAdaptorContext - (id) copyWithZone: (NSZone *) theZone { return [self retain]; } // // // - (BOOL) canNestTransactions { return NO; } // // // - (void) channelDidInit: (id) theChannel { if ([[self channels] count] > 0) { [NSException raise: @"OracleContextException" format: @"Channel already initiated for the actual context"]; } [super channelDidInit: theChannel]; } // // // - (EOAdaptorChannel *) createAdaptorChannel { return AUTORELEASE([[OracleAdaptorChannel alloc] initWithAdaptorContext: self]); } // // // - (id) initWithAdaptor: (EOAdaptor *) theAdaptor { self = [super initWithAdaptor: theAdaptor]; _autocommit = YES; return self; } // // // - (BOOL) primaryBeginTransaction { id o; o = [[self channels] lastObject]; return (OCITransStart([o serviceContext], [o errorHandle], (uword)DEFAULT_TRANSACTION_TIMEOUT, OCI_TRANS_NEW) == OCI_ERROR ? NO : YES); } // // // - (BOOL) primaryCommitTransaction { id o; o = [[self channels] lastObject]; return (OCITransCommit([o serviceContext], [o errorHandle], OCI_DEFAULT) == OCI_ERROR ? NO : YES); } // // // - (BOOL) primaryRollbackTransaction { id o; o = [[self channels] lastObject]; return (OCITransRollback([o serviceContext], [o errorHandle], OCI_DEFAULT) == OCI_ERROR ? NO : YES); } // // // - (BOOL) autoCommit { return _autocommit; } // // // - (void) setAutoCommit: (BOOL) theBOOL { _autocommit = theBOOL; } @end SOPE/sope-gdl1/Oracle8/ChangeLog0000644000000000000000000000315612242733417015176 0ustar rootroot2011-11-14 Francis Lachapelle * OracleValues.m (-stringValueForOracleType:attribute:): boolean values are now converted to 0 or 1. 2010-03-31 Wolfgang Sourdeau * OracleAdaptorChannel.m (+initialize): set the prefetch memory size from a new "OracleAdaptorPrefetchMemorySize" userdefault. Use "16 * 1024" by default. (-evaluateExpression:): make use of the new prefetchMemorySize variable to configure the OCI_ATTR_PREFETCH_MEMORY on the statement. We also set OCI_ATTR_PREFETCH_ROWS to an unreasonably high number to ensure the memory size always has precedence. 2007-11-15 Ludovic Marcotte * fixes 2007-10-19 Ludovic Marcotte * We call OCITerminate() in OracleAdaptorChannel: -closeChannel: * Some formatting cleanups. 2007-10-05 Ludovic Marcotte * Fixed otest wrt bundle name. * Modified sqlFolderFormat so that for the c_deleted columns, we default the value to 0. * Added full CLOB support for reading / writing more than 4000 characters in a CLOB column. 2007-09-20 Ludovic Marcotte * Small fix for 64-bit platforms. 2007-08-29 Helge Hess * Changed bundle name from Oracle to Oracle8 to avoid clashes with older adaptors. 2007-07-25 Ludovic Marcotte * Initial version of the SOPE GDL1 Oracle connector which makes use of the new Oracle OCI API. The initial version has been tested extensively with the Inverse edition of SOGo. See the READMe file for all details. SOPE/sope-gdl1/Oracle8/OracleAdaptorContext.h0000644000000000000000000000227512242733417017663 0ustar rootroot/* ** OracleAdaptorContext.h ** ** Copyright (c) 2007 Inverse groupe conseil inc. and Ludovic Marcotte ** ** Author: Ludovic Marcotte ** ** 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 */ #ifndef _OracleAdaptorContext_H #define _OracleAdaptorContext_H #import #import @interface OracleAdaptorContext : EOAdaptorContext { @private BOOL _autocommit; } - (BOOL) autoCommit; - (void) setAutoCommit: (BOOL) theBOOL; @end #endif SOPE/sope-gdl1/Oracle8/OracleValues.m0000644000000000000000000000400512242733417016161 0ustar rootroot/* ** OracleValues.m ** ** Copyright (c) 2007 Inverse groupe conseil inc. and Ludovic Marcotte ** ** Author: Ludovic Marcotte ** ** 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 */ #include "OracleValues.h" // // // @implementation NSNumber (OracleExtensions) - (NSString *) stringValueForOracleType: (ub2) theType attribute: (EOAttribute *) theAttribute { #if GNUSTEP_BASE_LIBRARY /* on gstep-base -stringValue of bool's return YES or NO, which seems to be different on Cocoa and liBFoundation. */ if (theType == SQLT_INT) { static Class BoolClass = Nil; if (BoolClass == Nil) BoolClass = NSClassFromString(@"NSBoolNumber"); if ([self isKindOfClass: BoolClass]) return [self boolValue] ? @"1" : @"0"; } #endif return [self stringValue]; } @end // // // @implementation NSString (OracleExtensions) - (NSString *) stringValueForOracleType: (ub2) theType attribute: (EOAttribute *) theAttribute { NSString *value; if (theType == SQLT_CHR || theType == SQLT_STR || theType == SQLT_CLOB || theType == SQLT_VCS || theType == SQLT_LVC) value = [NSString stringWithFormat: @"'%@'", [self stringByReplacingString: @"'" withString: @"''"]]; else value = self; return value; } @end SOPE/sope-gdl1/Oracle8/OracleAdaptorChannelController.h0000644000000000000000000000277412242733417021657 0ustar rootroot/* ** OracleAdaptorChannelController.h ** ** Copyright (c) 2007 Inverse groupe conseil inc. and Ludovic Marcotte ** ** Author: Ludovic Marcotte ** ** 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 */ #ifndef _OracleAdaptorChannelController_H #define _OracleAdaptorChannelController_H #import #import @interface OracleAdaptorChannelController : NSObject - (EODelegateResponse) adaptorChannel: (id) theChannel willInsertRow: (NSMutableDictionary *) theRow forEntity: (EOEntity *) theEntity; - (EODelegateResponse) adaptorChannel: (id) theChannel willUpdateRow: (NSMutableDictionary *) theRow describedByQualifier: (EOSQLQualifier *) theQualifier; @end #endif SOPE/sope-gdl1/Oracle8/OracleAdaptorChannelController.m0000644000000000000000000001706012242733417021656 0ustar rootroot/* ** OracleAdaptorChannelController.m ** ** Copyright (c) 2007 Inverse groupe conseil inc. and Ludovic Marcotte ** ** Author: Ludovic Marcotte ** ** 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 */ #import "OracleAdaptorChannelController.h" #include #include "err.h" #include "OracleAdaptorChannel.h" #include "OracleAdaptorContext.h" #import #import static BOOL debugOn = NO; // // // @interface OracleAdaptorChannelController (Private) - (BOOL) _evaluateExpression: (NSString *) theExpression keys: (NSArray *) theKeys values: (NSMutableDictionary *) theValues channel: (id) theChannel; @end // // // @implementation OracleAdaptorChannelController + (void) initialize { NSUserDefaults *ud; ud = [NSUserDefaults standardUserDefaults]; debugOn = [ud boolForKey: @"OracleAdaptorDebug"]; } - (EODelegateResponse) adaptorChannel: (id) theChannel willInsertRow: (NSMutableDictionary *) theRow forEntity: (EOEntity *) theEntity { NSMutableString *s; NSArray *keys; int i, c; if (debugOn) NSLog(@"willInsertRow: %@ %@", [theRow description], [theEntity description]); s = AUTORELEASE([[NSMutableString alloc] init]); [s appendFormat: @"INSERT INTO %@ (", [theEntity externalName]]; keys = [theRow allKeys]; c = [keys count]; for (i = 0; i < c; i++) { [s appendString: [keys objectAtIndex: i]]; if (i < c-1) [s appendString: @", "]; } [s appendString: @") VALUES ("]; for (i = 0; i < c; i++) { [s appendFormat: @":%d", i+1]; if (i < c-1) [s appendString: @", "]; } [s appendString: @")"]; if ([self _evaluateExpression: s keys: keys values: theRow channel: theChannel]) { return EODelegateOverrides; } return EODelegateRejects; } // // // - (EODelegateResponse) adaptorChannel: (id) theChannel willUpdateRow: (NSMutableDictionary *) theRow describedByQualifier: (EOSQLQualifier *) theQualifier { NSMutableString *s; NSArray *keys; int i, c; if (debugOn) NSLog(@"willUpdateRow: %@ %@", [theRow description], [theQualifier description]); s = AUTORELEASE([[NSMutableString alloc] init]); [s appendFormat: @"UPDATE %@ SET ", [[theQualifier entity] externalName]]; keys = [theRow allKeys]; c = [keys count]; for (i = 0; i < c; i++) { [s appendFormat: @"%@ = :%d", [keys objectAtIndex: i], i+1]; if (i < c-1) [s appendString: @", "]; } [s appendFormat: @" WHERE %@", [theQualifier expressionValueForContext: AUTORELEASE([[EOSQLExpression alloc] initWithEntity: [theQualifier entity]])]];; if ([self _evaluateExpression: s keys: keys values: theRow channel: theChannel]) { return EODelegateOverrides; } return EODelegateRejects; } @end // // // @implementation OracleAdaptorChannelController (Private) - (void) _cleanup: (NSArray *) theColumns statement: (OCIStmt *) theStatement channel: (id) theChannel { column_info *info; int c; c = [theColumns count]; while (c--) { info = [[theColumns objectAtIndex: c] pointerValue]; if (info->type == SQLT_INT) { free(info->value); } else if (info->type == SQLT_CLOB) { OCILobFreeTemporary([theChannel serviceContext], [theChannel errorHandle], info->value); OCIDescriptorFree((dvoid *)info->value, (ub4)OCI_DTYPE_LOB); } free(info); } [theColumns release]; OCIHandleFree(theStatement, OCI_HTYPE_STMT); } // // // - (BOOL) _evaluateExpression: (NSString *) theExpression keys: (NSArray *) theKeys values: (NSMutableDictionary *) theValues channel: (id) theChannel { NSMutableArray *columns;; OCIStmt* current_stm; OCIBind* bind; column_info *info; sword status; text *sql; int i,c; id v; sql = (text *)[theExpression UTF8String]; // We alloc our statement handle if (OCIHandleAlloc((dvoid *)[theChannel environment], (dvoid **)¤t_stm, (ub4)OCI_HTYPE_STMT, (CONST size_t) 0, (dvoid **) 0)) { NSLog(@"Can't allocate statement."); return NO; } // We prepare the statement if (OCIStmtPrepare(current_stm, [theChannel errorHandle], sql, (ub4)strlen((char *)sql), (ub4) OCI_NTV_SYNTAX, (ub4) OCI_DEFAULT)) { NSLog(@"FAILED: OCIStmtPrepare() insert\n"); return NO; } columns = [[NSMutableArray alloc] init]; c = [theKeys count]; // We bind all input variables for (i = 0; i < c; i++) { info = (void *)malloc(sizeof(column_info)); [columns addObject: [NSValue valueWithPointer: info]]; v = [theValues objectForKey: [theKeys objectAtIndex: i]]; bind = (OCIBind *)0; if ([v isKindOfClass: [NSString class]]) { const char *buf; ub4 len; buf = [v UTF8String]; len = strlen(buf); if (len <= 4000) { info->type = SQLT_CHR; info->value = (dvoid *)buf; info->width = len; } else { info->type = SQLT_CLOB; info->width = sizeof(OCILobLocator *); if ((status = OCIDescriptorAlloc((dvoid *)[theChannel environment], &(info->value), (ub4)OCI_DTYPE_LOB, (size_t)0, (dvoid **)0)) != OCI_SUCCESS) { [self _cleanup: columns statement: current_stm channel: theChannel]; checkerr([theChannel errorHandle], status); return NO; } OCILobCreateTemporary([theChannel serviceContext], [theChannel errorHandle], info->value, OCI_DEFAULT, SQLCS_IMPLICIT, OCI_TEMP_CLOB, FALSE, OCI_DURATION_SESSION); OCILobWrite([theChannel serviceContext], [theChannel errorHandle], info->value, &len, 1, (dvoid *)buf, len, OCI_ONE_PIECE, (dvoid *)0, (sb4 (*)())0, (ub2)0, (ub1)SQLCS_IMPLICIT); } } else { int x; info->type = SQLT_INT; x = [v intValue]; info->width = sizeof(x); info->value = calloc(info->width, 1); *(int *)info->value = x; } if ((status = (OCIBindByPos(current_stm, &bind, [theChannel errorHandle], (ub4)i+1, (info->type == SQLT_CLOB ? &info->value : (dvoid *)info->value), (sb4)info->width, info->type, (dvoid *)0, (ub2 *)0, (ub2 *)0, (ub4)0, (ub4 *)0, (ub4)OCI_DEFAULT))) != OCI_SUCCESS) { [self _cleanup: columns statement: current_stm channel: theChannel]; checkerr([theChannel errorHandle], status); return NO; } } // We execute the statement if ((status = OCIStmtExecute([theChannel serviceContext], current_stm, [theChannel errorHandle], (ub4)1, (ub4)0, (CONST OCISnapshot*)0, (OCISnapshot*)0, ([(OracleAdaptorContext *)[theChannel adaptorContext] autoCommit] ? OCI_COMMIT_ON_SUCCESS : OCI_DEFAULT))) != OCI_SUCCESS) { [self _cleanup: columns statement: current_stm channel: theChannel]; checkerr([theChannel errorHandle], status); return NO; } [self _cleanup: columns statement: current_stm channel: theChannel]; return YES; } @end SOPE/sope-gdl1/Oracle8/otest.m0000644000000000000000000001034512242733417014736 0ustar rootroot/* ** otest.m ** ** Copyright (c) 2007 Inverse groupe conseil inc. and Ludovic Marcotte ** ** Author: Ludovic Marcotte ** ** 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #import #import // // // void evaluate(EOAdaptorChannel *c, NSString *s) { NSLog(@"Evaluating:\t%@",s); if ([c evaluateExpression: s] && [c isFetchInProgress]) { NSDictionary *record; NSArray *attributes; attributes = [c describeResults]; NSLog(@"attributes = %@", [attributes description]); while ((record = [c fetchAttributes: attributes withZone: NULL])) { NSLog(@"record = %@", record); } } } // // // void insert(EOAdaptorChannel *channel, EOEntity *entity, NSMutableDictionary *row) { [row setObject: @"foo" forKey: @"c_name"]; [row setObject: @"barrr" forKey: @"c_content"]; [row setObject: [NSNumber numberWithInt: 1] forKey: @"c_creationdate"]; [row setObject: [NSNumber numberWithInt: 2] forKey: @"c_lastmodified"]; [row setObject: [NSNumber numberWithInt: 0] forKey: @"c_version"]; [channel insertRow: row forEntity: entity]; } // // // void update(EOAdaptorChannel *channel, EOEntity *entity, NSMutableDictionary *row) { EOSQLQualifier *qualifier; qualifier = [[EOSQLQualifier alloc] initWithEntity: entity qualifierFormat: @"%A = 'foo'", @"c_name"]; [row setObject: @"bazzzzzzzzzzz" forKey: @"c_content"]; [row setObject: [NSNumber numberWithInt: 2] forKey: @"c_creationdate"]; [row setObject: [NSNumber numberWithInt: 3] forKey: @"c_lastmodified"]; [row setObject: [NSNumber numberWithInt: 1] forKey: @"c_version"]; [channel updateRow: row describedByQualifier: qualifier]; } // // // int main (int argc, char **argv, char **env) { NSAutoreleasePool *pool; EOAdaptorChannel *channel; NSMutableDictionary *row; EOAdaptorContext *ctx; EOAdaptor *adaptor; EOEntity *entity; EOAttribute *attribute; pool = [[NSAutoreleasePool alloc] init]; [NSProcessInfo initializeWithArguments: argv count: argc environment: env]; adaptor = [EOAdaptor adaptorWithName: @"Oracle8"]; [adaptor setConnectionDictionary: [NSDictionary dictionaryWithContentsOfFile: @"condict.plist"]]; ctx = [adaptor createAdaptorContext]; channel = [ctx createAdaptorChannel]; [channel openChannel]; [ctx beginTransaction]; //evaluate(channel, @"SELECT * FROM all_tables"); evaluate(channel, @"SELECT COUNT(*) FROM all_tables"); evaluate(channel, @"SELECT 1 FROM dual"); evaluate(channel, @"SELECT sysdate FROM dual"); evaluate(channel, @"DROP table otest_demo"); evaluate(channel, @"CREATE TABLE otest_demo (\nc_name VARCHAR2 (256) NOT NULL,\n c_content CLOB NOT NULL,\n c_creationdate INTEGER NOT NULL,\n c_lastmodified INTEGER NOT NULL,\n c_version INTEGER NOT NULL,\n c_deleted INTEGER DEFAULT 0 NOT NULL\n)"); evaluate(channel, @"DELETE FROM otest_demo where c_name = 'foo'"); entity = [[EOEntity alloc] init]; [entity setName: @"otest_demo"]; [entity setExternalName: @"otest_demo"]; // table name attribute = AUTORELEASE([[EOAttribute alloc] init]); [attribute setName: @"c_name"]; [attribute setColumnName: @"c_name"]; [entity addAttribute: attribute]; row = [[NSMutableDictionary alloc] init]; insert(channel, entity, row); evaluate(channel, @"SELECT * FROM otest_demo where c_name = 'foo'"); update(channel, entity, row); evaluate(channel, @"SELECT * FROM otest_demo where c_name = 'foo'"); RELEASE(entity); RELEASE(row); [ctx commitTransaction]; [channel closeChannel]; [pool release]; return 0; } SOPE/sope-gdl1/Oracle8/err.m0000644000000000000000000000375712242733417014401 0ustar rootroot/* ** err.m ** ** Copyright (c) 2007 Inverse groupe conseil inc. and Ludovic Marcotte ** ** Author: Ludovic Marcotte ** ** 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 */ #include "err.h" #include void checkerr(OCIError *errhp, sword status) { text errbuf[512]; sb4 errcode; if (status == OCI_SUCCESS) return; switch (status) { case OCI_SUCCESS_WITH_INFO: NSLog(@"Error - OCI_SUCCESS_WITH_INFO\n"); OCIErrorGet ((dvoid *) errhp, (ub4) 1, (text *) NULL, &errcode, errbuf, (ub4) sizeof(errbuf), (ub4) OCI_HTYPE_ERROR); NSLog(@"Error - %s\n", errbuf); break; case OCI_NEED_DATA: NSLog(@"Error - OCI_NEED_DATA\n"); break; case OCI_NO_DATA: NSLog(@"Error - OCI_NO_DATA\n"); break; case OCI_ERROR: OCIErrorGet ((dvoid *) errhp, (ub4) 1, (text *) NULL, &errcode, errbuf, (ub4) sizeof(errbuf), (ub4) OCI_HTYPE_ERROR); NSLog(@"Error - %s\n", errbuf); break; case OCI_INVALID_HANDLE: NSLog(@"Error - OCI_INVALID_HANDLE\n"); break; case OCI_STILL_EXECUTING: NSLog(@"Error - OCI_STILL_EXECUTING\n"); break; case OCI_CONTINUE: NSLog(@"Error - OCI_CONTINUE\n"); break; default: NSLog(@"Error - %d\n", status); break; } } SOPE/sope-gdl1/Oracle8/EOAttribute+Oracle.h0000644000000000000000000000236412242733417017165 0ustar rootroot/* ** EOAttribute+Oracle.h ** ** Copyright (c) 2007 Inverse groupe conseil inc. and Ludovic Marcotte ** ** Author: Ludovic Marcotte ** ** 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 */ #ifndef _OracleEOAttribute_H #define _OracleEOAttribute_H #import #include @interface EOAttribute (OracleExtensions) + (id) attributeWithOracleType: (ub2) theType name: (text *) theName length: (ub4) theLength width: (ub4) theWidth; @end #endif SOPE/sope-gdl1/Oracle8/OracleValues.h0000644000000000000000000000255512242733417016164 0ustar rootroot/* ** OracleValues.h ** ** Copyright (c) 2007 Inverse groupe conseil inc. and Ludovic Marcotte ** ** Author: Ludovic Marcotte ** ** 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 */ #ifndef _OracleValues_H #define _OracleValues_H #import #import #include @interface NSNumber (OracleExtensions) - (NSString *) stringValueForOracleType: (ub2) theType attribute: (EOAttribute *) theAttribute; @end @interface NSString (OracleExtensions) - (NSString *) stringValueForOracleType: (ub2) theType attribute: (EOAttribute *) theAttribute; @end #endif SOPE/sope-gdl1/Oracle8/Version0000644000000000000000000000004412242733417014765 0ustar rootroot# Version file SUBMINOR_VERSION:=2 SOPE/sope-gdl1/Oracle8/COPYING.LIB0000644000000000000000000006126112242733417015065 0ustar rootroot GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, 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 library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] 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 Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, 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 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 a program 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. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, 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 companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. 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, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library 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 compile 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) 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. c) 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. d) 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 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. 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 to 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 Library 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 Appendix: 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 Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, 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! SOPE/sope-gdl1/Oracle8/OracleAdaptor.h0000644000000000000000000000227212242733417016313 0ustar rootroot/* ** OracleAdaptor.h ** ** Copyright (c) 2007 Inverse groupe conseil inc. and Ludovic Marcotte ** ** Author: Ludovic Marcotte ** ** 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 */ #ifndef _OracleAdaptor_H #define _OracleAdaptor_H #import #import @interface OracleAdaptor : EOAdaptor { } - (NSString *) serverName; - (NSString *) loginName; - (NSString *) loginPassword; - (NSString *) databaseName; - (NSString *) port; @end #endif SOPE/sope-gdl1/Oracle8/err.h0000644000000000000000000000174412242733417014366 0ustar rootroot/* ** err.h ** ** Copyright (c) 2007 Inverse groupe conseil inc. and Ludovic Marcotte ** ** Author: Ludovic Marcotte ** ** 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 */ #ifndef _err_H #define _err_H #include void checkerr(OCIError *errhp, sword status); #endif SOPE/sope-gdl1/Oracle8/OracleAdaptorChannel.m0000644000000000000000000004374412242733417017622 0ustar rootroot/* ** OracleAdaptorChannel.m ** ** Copyright (c) 2007-2009 Inverse inc. and Ludovic Marcotte ** ** Author: Ludovic Marcotte ** ** 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 */ #import "OracleAdaptorChannel.h" #include "err.h" #include "OracleAdaptor.h" #include "OracleAdaptorChannelController.h" #include "OracleAdaptorContext.h" #include "EOAttribute+Oracle.h" #import #include static BOOL debugOn = NO; static int prefetchMemorySize; static int maxTry = 3; static int maxSleep = 500; // // // @interface OracleAdaptorChannel (Private) - (void) _cleanup; @end @implementation OracleAdaptorChannel (Private) - (void) _cleanup { column_info *info; int c; sword result; [_resultSetProperties removeAllObjects]; c = [_row_buffer count]; while (c--) { info = [[_row_buffer objectAtIndex: c] pointerValue]; // We free our LOB object. If it fails, it likely mean it isn't a LOB // so we just free the value instead. if (info->value) { if (info->type == SQLT_CLOB || info->type == SQLT_BLOB || info->type == SQLT_BFILEE || info->type == SQLT_CFILEE) { result = OCIDescriptorFree((dvoid *)info->value, (ub4) OCI_DTYPE_LOB); if (result != OCI_SUCCESS) { NSLog (@"value was not a LOB descriptor"); abort(); } } else free(info->value); info->value = NULL; } else { NSLog (@"trying to free an already freed value!"); abort(); } free(info); [_row_buffer removeObjectAtIndex: c]; } OCIHandleFree(_current_stm, OCI_HTYPE_STMT); _current_stm = (OCIStmt *)0; } @end // // // @implementation OracleAdaptorChannel static void DBTerminate() { if (OCITerminate(OCI_DEFAULT)) NSLog(@"FAILED: OCITerminate()"); else NSLog(@"Oracle8: environment shut down"); } + (void) initialize { NSUserDefaults *ud; ud = [NSUserDefaults standardUserDefaults]; debugOn = [ud boolForKey: @"OracleAdaptorDebug"]; prefetchMemorySize = [ud integerForKey: @"OracleAdaptorPrefetchMemorySize"]; if (!prefetchMemorySize) prefetchMemorySize = 16 * 1024; /* 16Kb */ // We Initialize the OCI process environment. if (OCIInitialize((ub4)OCI_DEFAULT, (dvoid *)0, (dvoid * (*)(dvoid *, size_t)) 0, (dvoid * (*)(dvoid *, dvoid *, size_t))0, (void (*)(dvoid *, dvoid *)) 0 )) NSLog(@"FAILED: OCIInitialize()"); else { NSLog(@"Oracle8: environment initialized"); atexit(DBTerminate); } } - (id) initWithAdaptorContext: (EOAdaptorContext *) theAdaptorContext { if ((self = [super initWithAdaptorContext: theAdaptorContext])) { _resultSetProperties = [[NSMutableArray alloc] init]; _row_buffer = [[NSMutableArray alloc] init]; _oci_env = (OCIEnv *)0; _oci_err = (OCIError *)0; _current_stm = (OCIStmt *)0; // This will also initialize ivars in EOAdaptorChannel for // delegate calls so it's important to call -setDelegate: [self setDelegate: [[OracleAdaptorChannelController alloc] init]]; return self; } return nil; } // // // - (id) copyWithZone: (NSZone *) theZone { return [self retain]; } // // // - (void) cancelFetch { // Oracle's doc says: "If you call OCIStmtFetch2() with the nrows parameter set to 0, this cancels the cursor." if (OCIStmtFetch2(_current_stm, _oci_err, (ub4)0, (ub4)OCI_FETCH_NEXT, (sb4)0, (ub4)OCI_DEFAULT)) { NSLog(@"Fetch cancellation failed"); } [self _cleanup]; [super cancelFetch]; } // // // - (void) closeChannel { if ([self isOpen]) { [super closeChannel]; // We logoff from the database. if (!_oci_ctx || !_oci_err || OCILogoff(_oci_ctx, _oci_err)) { NSLog(@"FAILED: OCILogoff()"); } if (_oci_ctx) OCIHandleFree(_oci_ctx, OCI_HTYPE_SVCCTX); if (_oci_err) OCIHandleFree(_oci_err, OCI_HTYPE_ERROR); // OCIHandleFree(_oci_env, OCI_HTYPE_ENV); _oci_ctx = (OCISvcCtx *)0; _oci_err = (OCIError *)0; _oci_env = (OCIEnv *)0; } } // // // - (void) dealloc { if (debugOn) NSLog(@"OracleAdaptorChannel: -dealloc"); [self _cleanup]; RELEASE(_resultSetProperties); RELEASE(delegate); [super dealloc]; } // // TODO later // - (EOModel*) describeModelWithTableNames: (NSArray *) theTableNames { return nil; } // // TODO later // - (NSArray *) describeTableNames { return nil; } // // This breaks EOF 4.5 support. // - (NSArray *) describeResults: (BOOL) theBOOL { return [NSArray arrayWithArray: _resultSetProperties]; } // // This breaks EOF 4.5 support. // // We must: 1. send the database request // 2. process the results // 3. call -adaptorChannel:didEvaluateExpression: // - (BOOL) evaluateExpression: (NSString *) theExpression { EOAttribute *attribute; OCIParam *param; int rCount; column_info *info; ub4 i, clen, count; text *sql, *cname; sword status; ub2 type; ub4 memory, prefetchrows; [self _cleanup]; if (debugOn) [self logWithFormat: @"expression: %@", theExpression]; if (!theExpression || ![theExpression length]) { [NSException raise: @"OracleInvalidExpressionException" format: @"Passed an invalid (nil or length == 0) SQL expression"]; } if (![self isOpen]) { [NSException raise: @"OracleChannelNotOpenException" format: @"Called -evaluateExpression: prior to -openChannel"]; } sql = (text *)[theExpression UTF8String]; rCount = 0; retry: // We alloc our statement handle if ((status = OCIHandleAlloc((dvoid *)_oci_env, (dvoid **)&_current_stm, (ub4)OCI_HTYPE_STMT, (CONST size_t) 0, (dvoid **) 0))) { checkerr(_oci_err, status); NSLog(@"Can't allocate statement."); return NO; } prefetchrows = 100000; /* huge numbers here force a fallback on the memory limit below, which is what we really are interested in */ if ((status = OCIAttrSet(_current_stm, (ub4)OCI_HTYPE_STMT, (dvoid *)&prefetchrows, (ub4) sizeof(ub4), (ub4)OCI_ATTR_PREFETCH_ROWS, _oci_err))) { checkerr(_oci_err, status); NSLog(@"Can't set prefetch rows (%d).", prefetchrows); return NO; } memory = prefetchMemorySize; if ((status = OCIAttrSet(_current_stm, (ub4)OCI_HTYPE_STMT, (dvoid *)&memory, (ub4) sizeof(ub4), (ub4)OCI_ATTR_PREFETCH_MEMORY, _oci_err))) { checkerr(_oci_err, status); NSLog(@"Can't set prefetch memory (%d).", memory); return NO; } // We prepare our statement if ((status = OCIStmtPrepare(_current_stm, _oci_err, sql, strlen((const char *)sql), OCI_NTV_SYNTAX, OCI_DEFAULT))) { checkerr(_oci_err, status); NSLog(@"Prepare failed: OCI_ERROR"); return NO; } // We check if we're doing a SELECT and if so, we're fetching data! OCIAttrGet(_current_stm, OCI_HTYPE_STMT, &type, 0, OCI_ATTR_STMT_TYPE, _oci_err); self->isFetchInProgress = (type == OCI_STMT_SELECT ? YES : NO); // We execute our statement. Not that we _MUST_ set iter to 0 for non-SELECT statements. if ((status = OCIStmtExecute(_oci_ctx, _current_stm, _oci_err, (self->isFetchInProgress ? (ub4)0 : (ub4)1), (ub4)0, (CONST OCISnapshot *)NULL, (OCISnapshot *)NULL, ([(OracleAdaptorContext *)[self adaptorContext] autoCommit] ? OCI_COMMIT_ON_SUCCESS : OCI_DEFAULT)))) { ub4 serverStatus; checkerr(_oci_err, status); NSLog(@"Statement execute failed (OCI_ERROR): %@", theExpression); // We check to see if we lost connection and need to reconnect. serverStatus = 0; OCIAttrGet((dvoid *)_oci_env, OCI_HTYPE_SERVER, (dvoid *)&serverStatus, (ub4 *)0, OCI_ATTR_SERVER_STATUS, _oci_err); if (serverStatus == OCI_SERVER_NOT_CONNECTED) { // We cleanup our previous handles [self cancelFetch]; [self closeChannel]; // We try to reconnect a couple of times before giving up... while (rCount < maxTry) { usleep(maxSleep); rCount++; if ([self openChannel]) { NSLog(@"Connection re-established to Oracle - retrying to process the statement."); goto retry; } } } return NO; } // We check the number of params (ie., columns) if ((status = OCIAttrGet((dvoid *)_current_stm, OCI_HTYPE_STMT, (dvoid *)&count, (ub4 *)0, OCI_ATTR_PARAM_COUNT, _oci_err))) { checkerr(_oci_err, status); NSLog(@"Attribute get failed (OCI_ERROR): %@", theExpression); return NO; } // We decode the columns' types for (i = 1; i < count+1; i++) { // We alloc our info structure. This will hold the values being // read when we fetch data from the result set. info = (void *)malloc(sizeof(column_info)); // We fetch the parameter status = OCIParamGet((dvoid *)_current_stm, OCI_HTYPE_STMT, _oci_err, (dvoid **)¶m, (ub4)i); // We get the param's type status = OCIAttrGet((dvoid*)param, (ub4)OCI_DTYPE_PARAM, (dvoid*)&(info->type), (ub4 *)0, (ub4)OCI_ATTR_DATA_TYPE, (OCIError *)_oci_err); // We read the column's name (name of the param) and name's length clen = 0; status = OCIAttrGet((dvoid*)param, (ub4)OCI_DTYPE_PARAM, (dvoid**)&cname, (ub4 *)&clen, (ub4)OCI_ATTR_NAME, (OCIError *)_oci_err); // We read the maximum width of a column info->max_width = 0; status = OCIAttrGet((dvoid*)param, (ub4)OCI_DTYPE_PARAM, (dvoid*)&(info->max_width), (ub4 *)0, (ub4)OCI_ATTR_DATA_SIZE, (OCIError *)_oci_err); if (debugOn) NSLog(@"name: %s, type: %d", cname, info->type); attribute = [EOAttribute attributeWithOracleType: info->type name: cname length: clen width: info->max_width]; [_resultSetProperties addObject: attribute]; // We now must bind our column name with a buffer in which we'll read into info->value = calloc(info->max_width, 1); // // Oracle's doc says: "SQLT_CHAR and SQLT_LNG can be specified for CLOB columns, and SQLT_BIN sand SQLT_LBI for BLOB columns." // Also, for LOB, it says: "The bind of more than 4 kilobytes of data to a LOB column uses space from the temporary tablespace." // // For now, we read - SQLT_CLOB as SQLT_CHR // - SQLT_NUM as SQLT_INT // switch (info->type) { case SQLT_CLOB: //type = SQLT_CHR; type = SQLT_CLOB; free(info->value); if (OCIDescriptorAlloc((dvoid *)_oci_env, &(info->value), (ub4)OCI_DTYPE_LOB, (size_t)0, (dvoid **)0) != OCI_SUCCESS) { NSLog(@"Unable to alloc descriptor"); abort(); } // "For descriptors, locators, or REFs, whose size is unknown to client applications, use the size of the structure you // are passing in: for example, sizeof (OCILobLocator *). info->max_width = sizeof(OCILobLocator *); break; case SQLT_NUM: type = SQLT_INT; info->max_width = 4; break; default: type = info->type; } // // Oracle's documentation says:"For a LOB, the buffer pointer must be a pointer to a LOB locator of type OCILobLocator. // Give the address of the pointer." // info->def = (OCIDefine*)0; #warning cleanup if ((status = OCIDefineByPos(_current_stm, &(info->def), _oci_err, i, (info->type == SQLT_CLOB ? &info->value : (dvoid *)info->value), info->max_width, type, (dvoid *)0, (ub2 *)&(info->width), (ub2 *)0, OCI_DEFAULT))) { NSLog(@"OCIDefineByPos FAILED"); abort(); } [_row_buffer addObject: [NSValue valueWithPointer: info]]; // We free up our param handle. OCIHandleFree((dvoid*)param, OCI_HTYPE_STMT); } return YES; } // // // - (OCIError *) errorHandle { return _oci_err; } // // // - (BOOL) isOpen { return (_oci_env ? YES : NO); } // // This breaks EOF 4.5 support. // - (BOOL) openChannel { OracleAdaptor *o; const char *username, *password, *database; sword status; if (![super openChannel] || [self isOpen]) { return NO; } if (OCIEnvInit((OCIEnv **)&_oci_env, (ub4)OCI_DEFAULT, (size_t)0, (dvoid **)0)) { NSLog(@"FAILED: OCIEnvInit()"); [self closeChannel]; return NO; } if (OCIHandleAlloc((dvoid *)_oci_env, (dvoid *)&_oci_err, (ub4)OCI_HTYPE_ERROR, (size_t)0, (dvoid **)0)) { NSLog(@"FAILED: OCIHandleAlloc() on errhp"); [self closeChannel]; return NO; } o = (OracleAdaptor *)[[self adaptorContext] adaptor]; username = [[o loginName] UTF8String]; password = [[o loginPassword] UTF8String]; // Under Oracle 10g, the third parameter of OCILogon() has the form: [//]host[:port][/service_name] // See http://download-west.oracle.com/docs/cd/B12037_01/network.101/b10775/naming.htm#i498306 for // all juicy details. if ([o serverName] && [o port]) database = [[NSString stringWithFormat:@"%@:%@/%@", [o serverName], [o port], [o databaseName]] UTF8String]; else database = [[o databaseName] UTF8String]; // We logon to the database. if ((status = OCILogon(_oci_env, _oci_err, &_oci_ctx, (const OraText*)username, strlen(username), (const OraText*)password, strlen(password), (const OraText*)database, strlen(database)))) { NSLog(@"FAILED: OCILogon(). username = %s password = %s" @" database = %s", username, password, database); checkerr(_oci_err, status); [self closeChannel]; return NO; } return YES; } // // We map the attributes to the values. // // For now, we ignore the passed attributes and we initialize the full row. // - (NSMutableDictionary *) primaryFetchAttributes: (NSArray *) theAttributes withZone: (NSZone *) theZone { sword status; // We check if our connection is open prior to trying to fetch any data. OCIStmtFetch2() returns // NO error code if the OCI environment is set up but the OCILogon() has failed. if (![self isOpen]) return nil; status = OCIStmtFetch2(_current_stm, _oci_err, (ub4)1, (ub4)OCI_FETCH_NEXT, (sb4)0, (ub4)OCI_DEFAULT); if (status == OCI_NO_DATA) { self->isFetchInProgress = NO; } else { NSMutableDictionary *row; column_info *info; int i, c; id o; c = [_resultSetProperties count]; row = [NSMutableDictionary dictionaryWithCapacity: c]; // We decode all column values we got in our result set for (i = 0; i < c; i++) { info = [[_row_buffer objectAtIndex: i] pointerValue]; //NSLog(@"========== NEW COLUMN =============="); //NSLog(@"Read type %d, width %d at %d", info->type, info->width, info->value); o = nil; // On Oracle, if we've read a lenght of 0, it means that we got a NULL. if (info->type != SQLT_CLOB && info->width == 0) { o = [NSNull null]; } else { switch (info->type) { case SQLT_CHR: case SQLT_STR: o = AUTORELEASE([[NSString alloc] initWithBytes: info->value length: info->width encoding: NSUTF8StringEncoding]); break; case SQLT_CLOB: { ub4 len; status = OCILobGetLength(_oci_ctx, _oci_err, info->value, &len); // We might get a OCI_INVALID_HANDLE if we try to read a NULL CLOB. // This would be avoided if folks using CLOB would use Oracle's empty_clob() // function but instead of relying on this, we check for invalid handles. if (status != OCI_INVALID_HANDLE && status != OCI_SUCCESS) { checkerr(_oci_err, status); o = [NSString string]; } else { // We alloc twice the size of the LOB length. OCILobGetLength() returns us the LOB length in UTF-16 characters. o = calloc(len*2, 1); OCILobRead(_oci_ctx, _oci_err, info->value, &len, 1, o, len*2, (dvoid *)0, (sb4 (*)(dvoid *, CONST dvoid *, ub4, ub1))0, (ub2)0, (ub1)SQLCS_IMPLICIT); o = AUTORELEASE([[NSString alloc] initWithBytesNoCopy: o length: len encoding: NSUTF8StringEncoding freeWhenDone: YES]); } } break; case SQLT_DAT: { signed char *buf; buf = (signed char*)info->value; o = [NSCalendarDate dateWithYear: (buf[0]-100)*100+buf[1]-100 month: buf[2] day: buf[3] hour: buf[4]-1 minute: buf[5]-1 second: buf[6]-1 timeZone: [NSTimeZone timeZoneWithAbbreviation:@"GMT"]]; } break; case SQLT_INT: case SQLT_NUM: switch (info->width) { case 1: o = [NSNumber numberWithChar: *(char*)(info->value)]; break; case 2: o = [NSNumber numberWithShort: *(short*)(info->value)]; break; case 8: o = [NSNumber numberWithLongLong: *(long long*)(info->value)]; break; case 4: default: o = [NSNumber numberWithInt: *(int*)(info->value)]; break; } break; case SQLT_TIMESTAMP: case SQLT_TIMESTAMP_TZ: case SQLT_TIMESTAMP_LTZ: { // FIXME implement //o = [NSDate date]; } break; default: NSLog(@"Unknown type! %d", info->type); } } if (!o) o = [NSNull null]; [row setObject: o forKey: [[_resultSetProperties objectAtIndex: i] name]]; } return row; } return nil; } // // TODO later // #if 0 - (NSDictionary *) primaryKeyForNewRowWithEntity: (EOEntity *) theEntity { } #endif // // TODO later // #if 0 - (BOOL) readTypesForEntity: (EOEntity *) theEntity { return NO; } #endif // // TODO later // #if 0 - (BOOL) readTypeForAttribute: (EOAttribute *) theAttribute { return NO; } #endif // // // - (OCIEnv *) environment { return _oci_env; } // // // - (OCISvcCtx *) serviceContext { return _oci_ctx; } @end SOPE/sope-gdl1/Oracle8/OracleSQLExpression.h0000644000000000000000000000213012242733417017431 0ustar rootroot/* ** OracleSQLExpression.h ** ** Copyright (c) 2007 Inverse groupe conseil inc. and Ludovic Marcotte ** ** Author: Ludovic Marcotte ** ** 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 */ #ifndef _OracleSQLExpression_H #define _OracleSQLExpression_H #import #import @interface OracleSQLExpression : EOSQLExpression { } @end #endif SOPE/sope-gdl1/Oracle8/obj/0000755000000000000000000000000012242733417014171 5ustar rootrootSOPE/sope-gdl1/Oracle8/obj/err.d0000644000000000000000000002652112242733417015134 0ustar rootrootobj/err.o: err.m err.h /usr/include/oracle/10.2.0.3/client/oci.h \ /usr/include/oracle/10.2.0.3/client/oratypes.h \ /usr/include/oracle/10.2.0.3/client/ocidfn.h \ /usr/include/oracle/10.2.0.3/client/oci1.h \ /usr/include/oracle/10.2.0.3/client/oro.h \ /usr/include/oracle/10.2.0.3/client/ori.h \ /usr/include/oracle/10.2.0.3/client/ort.h \ /usr/include/oracle/10.2.0.3/client/orl.h \ /usr/include/oracle/10.2.0.3/client/ociextp.h \ /usr/include/oracle/10.2.0.3/client/ociapr.h \ /usr/include/oracle/10.2.0.3/client/ociap.h \ /usr/include/oracle/10.2.0.3/client/nzt.h \ /usr/include/oracle/10.2.0.3/client/nzerror.h \ /usr/include/oracle/10.2.0.3/client/ocixmldb.h \ /usr/include/oracle/10.2.0.3/client/oci8dp.h \ /usr/include/GNUstep/Foundation/Foundation.h \ /usr/include/GNUstep/GNUstepBase/GSVersionMacros.h \ /usr/include/GNUstep/Foundation/FoundationErrors.h \ /usr/include/GNUstep/Foundation/NSObject.h \ /usr/include/GNUstep/Foundation/NSObjCRuntime.h \ /usr/include/GNUstep/GNUstepBase/preface.h \ /usr/include/GNUstep/GNUstepBase/objc-gnu2next.h \ /usr/include/GNUstep/GNUstepBase/GSConfig.h \ /usr/include/GNUstep/GNUstepBase/GSObjCRuntime.h \ /usr/include/GNUstep/Foundation/NSZone.h \ /usr/include/GNUstep/GNUstepBase/GNUstep.h \ /usr/include/GNUstep/Foundation/NSDate.h \ /usr/include/GNUstep/Foundation/NSDebug.h \ /usr/include/GNUstep/Foundation/NSProcessInfo.h \ /usr/include/GNUstep/Foundation/NSAffineTransform.h \ /usr/include/GNUstep/Foundation/NSGeometry.h \ /usr/include/GNUstep/Foundation/NSString.h \ /usr/include/GNUstep/Foundation/NSRange.h \ /usr/include/GNUstep/Foundation/NSArchiver.h \ /usr/include/GNUstep/Foundation/NSCoder.h \ /usr/include/GNUstep/Foundation/NSArray.h \ /usr/include/GNUstep/Foundation/NSAttributedString.h \ /usr/include/GNUstep/Foundation/NSDictionary.h \ /usr/include/GNUstep/Foundation/NSAutoreleasePool.h \ /usr/include/GNUstep/Foundation/NSBundle.h \ /usr/include/GNUstep/Foundation/NSByteOrder.h \ /usr/include/GNUstep/Foundation/NSCalendarDate.h \ /usr/include/GNUstep/Foundation/NSCharacterSet.h \ /usr/include/GNUstep/Foundation/NSClassDescription.h \ /usr/include/GNUstep/Foundation/NSException.h \ /usr/include/GNUstep/Foundation/NSComparisonPredicate.h \ /usr/include/GNUstep/Foundation/NSExpression.h \ /usr/include/GNUstep/Foundation/NSPredicate.h \ /usr/include/GNUstep/Foundation/NSCompoundPredicate.h \ /usr/include/GNUstep/Foundation/NSConnection.h \ /usr/include/GNUstep/Foundation/NSTimer.h \ /usr/include/GNUstep/Foundation/NSRunLoop.h \ /usr/include/GNUstep/Foundation/NSMapTable.h \ /usr/include/GNUstep/Foundation/NSData.h \ /usr/include/GNUstep/Foundation/NSSerialization.h \ /usr/include/GNUstep/Foundation/NSDateFormatter.h \ /usr/include/GNUstep/Foundation/NSFormatter.h \ /usr/include/GNUstep/Foundation/NSDecimalNumber.h \ /usr/include/GNUstep/Foundation/NSDecimal.h \ /usr/include/GNUstep/Foundation/NSValue.h \ /usr/include/GNUstep/Foundation/NSDistantObject.h \ /usr/include/GNUstep/Foundation/NSProxy.h \ /usr/include/GNUstep/Foundation/NSDistributedLock.h \ /usr/include/GNUstep/Foundation/NSDistributedNotificationCenter.h \ /usr/include/GNUstep/Foundation/NSLock.h \ /usr/include/GNUstep/Foundation/NSNotification.h \ /usr/include/GNUstep/Foundation/NSEnumerator.h \ /usr/include/GNUstep/Foundation/NSError.h \ /usr/include/GNUstep/Foundation/NSFileHandle.h \ /usr/include/GNUstep/Foundation/NSFileManager.h \ /usr/include/GNUstep/Foundation/NSHashTable.h \ /usr/include/GNUstep/Foundation/NSHost.h \ /usr/include/GNUstep/Foundation/NSHTTPCookie.h \ /usr/include/GNUstep/Foundation/NSHTTPCookieStorage.h \ /usr/include/GNUstep/Foundation/NSIndexPath.h \ /usr/include/GNUstep/Foundation/NSIndexSet.h \ /usr/include/GNUstep/Foundation/NSInvocation.h \ /usr/include/GNUstep/Foundation/NSMethodSignature.h \ /usr/include/GNUstep/Foundation/NSKeyedArchiver.h \ /usr/include/GNUstep/Foundation/NSPropertyList.h \ /usr/include/GNUstep/Foundation/NSKeyValueCoding.h \ /usr/include/GNUstep/Foundation/NSNotificationQueue.h \ /usr/include/GNUstep/Foundation/NSNetServices.h \ /usr/include/GNUstep/Foundation/NSNull.h \ /usr/include/GNUstep/Foundation/NSNumberFormatter.h \ /usr/include/GNUstep/Foundation/NSPathUtilities.h \ /usr/include/GNUstep/Foundation/NSPortCoder.h \ /usr/include/GNUstep/Foundation/NSPortMessage.h \ /usr/include/GNUstep/Foundation/NSPort.h \ /usr/include/GNUstep/Foundation/NSPortNameServer.h \ /usr/include/GNUstep/Foundation/NSProtocolChecker.h \ /usr/include/GNUstep/Foundation/NSScanner.h \ /usr/include/GNUstep/Foundation/NSSet.h \ /usr/include/GNUstep/Foundation/NSSortDescriptor.h \ /usr/include/GNUstep/Foundation/NSSpellServer.h \ /usr/include/GNUstep/Foundation/NSStream.h \ /usr/include/GNUstep/Foundation/NSTask.h \ /usr/include/GNUstep/Foundation/NSThread.h \ /usr/include/GNUstep/Foundation/NSTimeZone.h \ /usr/include/GNUstep/Foundation/NSUndoManager.h \ /usr/include/GNUstep/Foundation/NSURLAuthenticationChallenge.h \ /usr/include/GNUstep/Foundation/NSURLCache.h \ /usr/include/GNUstep/Foundation/NSURLConnection.h \ /usr/include/GNUstep/Foundation/NSURLCredential.h \ /usr/include/GNUstep/Foundation/NSURLCredentialStorage.h \ /usr/include/GNUstep/Foundation/NSURLDownload.h \ /usr/include/GNUstep/Foundation/NSURLError.h \ /usr/include/GNUstep/Foundation/NSURL.h \ /usr/include/GNUstep/Foundation/NSURLHandle.h \ /usr/include/GNUstep/Foundation/NSURLProtectionSpace.h \ /usr/include/GNUstep/Foundation/NSURLProtocol.h \ /usr/include/GNUstep/Foundation/NSURLRequest.h \ /usr/include/GNUstep/Foundation/NSURLResponse.h \ /usr/include/GNUstep/Foundation/NSUserDefaults.h \ /usr/include/GNUstep/Foundation/NSValueTransformer.h \ /usr/include/GNUstep/Foundation/NSXMLParser.h err.h: /usr/include/oracle/10.2.0.3/client/oci.h: /usr/include/oracle/10.2.0.3/client/oratypes.h: /usr/include/oracle/10.2.0.3/client/ocidfn.h: /usr/include/oracle/10.2.0.3/client/oci1.h: /usr/include/oracle/10.2.0.3/client/oro.h: /usr/include/oracle/10.2.0.3/client/ori.h: /usr/include/oracle/10.2.0.3/client/ort.h: /usr/include/oracle/10.2.0.3/client/orl.h: /usr/include/oracle/10.2.0.3/client/ociextp.h: /usr/include/oracle/10.2.0.3/client/ociapr.h: /usr/include/oracle/10.2.0.3/client/ociap.h: /usr/include/oracle/10.2.0.3/client/nzt.h: /usr/include/oracle/10.2.0.3/client/nzerror.h: /usr/include/oracle/10.2.0.3/client/ocixmldb.h: /usr/include/oracle/10.2.0.3/client/oci8dp.h: /usr/include/GNUstep/Foundation/Foundation.h: /usr/include/GNUstep/GNUstepBase/GSVersionMacros.h: /usr/include/GNUstep/Foundation/FoundationErrors.h: /usr/include/GNUstep/Foundation/NSObject.h: /usr/include/GNUstep/Foundation/NSObjCRuntime.h: /usr/include/GNUstep/GNUstepBase/preface.h: /usr/include/GNUstep/GNUstepBase/objc-gnu2next.h: /usr/include/GNUstep/GNUstepBase/GSConfig.h: /usr/include/GNUstep/GNUstepBase/GSObjCRuntime.h: /usr/include/GNUstep/Foundation/NSZone.h: /usr/include/GNUstep/GNUstepBase/GNUstep.h: /usr/include/GNUstep/Foundation/NSDate.h: /usr/include/GNUstep/Foundation/NSDebug.h: /usr/include/GNUstep/Foundation/NSProcessInfo.h: /usr/include/GNUstep/Foundation/NSAffineTransform.h: /usr/include/GNUstep/Foundation/NSGeometry.h: /usr/include/GNUstep/Foundation/NSString.h: /usr/include/GNUstep/Foundation/NSRange.h: /usr/include/GNUstep/Foundation/NSArchiver.h: /usr/include/GNUstep/Foundation/NSCoder.h: /usr/include/GNUstep/Foundation/NSArray.h: /usr/include/GNUstep/Foundation/NSAttributedString.h: /usr/include/GNUstep/Foundation/NSDictionary.h: /usr/include/GNUstep/Foundation/NSAutoreleasePool.h: /usr/include/GNUstep/Foundation/NSBundle.h: /usr/include/GNUstep/Foundation/NSByteOrder.h: /usr/include/GNUstep/Foundation/NSCalendarDate.h: /usr/include/GNUstep/Foundation/NSCharacterSet.h: /usr/include/GNUstep/Foundation/NSClassDescription.h: /usr/include/GNUstep/Foundation/NSException.h: /usr/include/GNUstep/Foundation/NSComparisonPredicate.h: /usr/include/GNUstep/Foundation/NSExpression.h: /usr/include/GNUstep/Foundation/NSPredicate.h: /usr/include/GNUstep/Foundation/NSCompoundPredicate.h: /usr/include/GNUstep/Foundation/NSConnection.h: /usr/include/GNUstep/Foundation/NSTimer.h: /usr/include/GNUstep/Foundation/NSRunLoop.h: /usr/include/GNUstep/Foundation/NSMapTable.h: /usr/include/GNUstep/Foundation/NSData.h: /usr/include/GNUstep/Foundation/NSSerialization.h: /usr/include/GNUstep/Foundation/NSDateFormatter.h: /usr/include/GNUstep/Foundation/NSFormatter.h: /usr/include/GNUstep/Foundation/NSDecimalNumber.h: /usr/include/GNUstep/Foundation/NSDecimal.h: /usr/include/GNUstep/Foundation/NSValue.h: /usr/include/GNUstep/Foundation/NSDistantObject.h: /usr/include/GNUstep/Foundation/NSProxy.h: /usr/include/GNUstep/Foundation/NSDistributedLock.h: /usr/include/GNUstep/Foundation/NSDistributedNotificationCenter.h: /usr/include/GNUstep/Foundation/NSLock.h: /usr/include/GNUstep/Foundation/NSNotification.h: /usr/include/GNUstep/Foundation/NSEnumerator.h: /usr/include/GNUstep/Foundation/NSError.h: /usr/include/GNUstep/Foundation/NSFileHandle.h: /usr/include/GNUstep/Foundation/NSFileManager.h: /usr/include/GNUstep/Foundation/NSHashTable.h: /usr/include/GNUstep/Foundation/NSHost.h: /usr/include/GNUstep/Foundation/NSHTTPCookie.h: /usr/include/GNUstep/Foundation/NSHTTPCookieStorage.h: /usr/include/GNUstep/Foundation/NSIndexPath.h: /usr/include/GNUstep/Foundation/NSIndexSet.h: /usr/include/GNUstep/Foundation/NSInvocation.h: /usr/include/GNUstep/Foundation/NSMethodSignature.h: /usr/include/GNUstep/Foundation/NSKeyedArchiver.h: /usr/include/GNUstep/Foundation/NSPropertyList.h: /usr/include/GNUstep/Foundation/NSKeyValueCoding.h: /usr/include/GNUstep/Foundation/NSNotificationQueue.h: /usr/include/GNUstep/Foundation/NSNetServices.h: /usr/include/GNUstep/Foundation/NSNull.h: /usr/include/GNUstep/Foundation/NSNumberFormatter.h: /usr/include/GNUstep/Foundation/NSPathUtilities.h: /usr/include/GNUstep/Foundation/NSPortCoder.h: /usr/include/GNUstep/Foundation/NSPortMessage.h: /usr/include/GNUstep/Foundation/NSPort.h: /usr/include/GNUstep/Foundation/NSPortNameServer.h: /usr/include/GNUstep/Foundation/NSProtocolChecker.h: /usr/include/GNUstep/Foundation/NSScanner.h: /usr/include/GNUstep/Foundation/NSSet.h: /usr/include/GNUstep/Foundation/NSSortDescriptor.h: /usr/include/GNUstep/Foundation/NSSpellServer.h: /usr/include/GNUstep/Foundation/NSStream.h: /usr/include/GNUstep/Foundation/NSTask.h: /usr/include/GNUstep/Foundation/NSThread.h: /usr/include/GNUstep/Foundation/NSTimeZone.h: /usr/include/GNUstep/Foundation/NSUndoManager.h: /usr/include/GNUstep/Foundation/NSURLAuthenticationChallenge.h: /usr/include/GNUstep/Foundation/NSURLCache.h: /usr/include/GNUstep/Foundation/NSURLConnection.h: /usr/include/GNUstep/Foundation/NSURLCredential.h: /usr/include/GNUstep/Foundation/NSURLCredentialStorage.h: /usr/include/GNUstep/Foundation/NSURLDownload.h: /usr/include/GNUstep/Foundation/NSURLError.h: /usr/include/GNUstep/Foundation/NSURL.h: /usr/include/GNUstep/Foundation/NSURLHandle.h: /usr/include/GNUstep/Foundation/NSURLProtectionSpace.h: /usr/include/GNUstep/Foundation/NSURLProtocol.h: /usr/include/GNUstep/Foundation/NSURLRequest.h: /usr/include/GNUstep/Foundation/NSURLResponse.h: /usr/include/GNUstep/Foundation/NSUserDefaults.h: /usr/include/GNUstep/Foundation/NSValueTransformer.h: /usr/include/GNUstep/Foundation/NSXMLParser.h: SOPE/sope-gdl1/Oracle8/obj/OracleValues.d0000644000000000000000000002666112242733417016736 0ustar rootrootobj/OracleValues.o: OracleValues.m OracleValues.h \ /usr/include/GNUstep/Foundation/Foundation.h \ /usr/include/GNUstep/GNUstepBase/GSVersionMacros.h \ /usr/include/GNUstep/Foundation/FoundationErrors.h \ /usr/include/GNUstep/Foundation/NSObject.h \ /usr/include/GNUstep/Foundation/NSObjCRuntime.h \ /usr/include/GNUstep/GNUstepBase/preface.h \ /usr/include/GNUstep/GNUstepBase/objc-gnu2next.h \ /usr/include/GNUstep/GNUstepBase/GSConfig.h \ /usr/include/GNUstep/GNUstepBase/GSObjCRuntime.h \ /usr/include/GNUstep/Foundation/NSZone.h \ /usr/include/GNUstep/GNUstepBase/GNUstep.h \ /usr/include/GNUstep/Foundation/NSDate.h \ /usr/include/GNUstep/Foundation/NSDebug.h \ /usr/include/GNUstep/Foundation/NSProcessInfo.h \ /usr/include/GNUstep/Foundation/NSAffineTransform.h \ /usr/include/GNUstep/Foundation/NSGeometry.h \ /usr/include/GNUstep/Foundation/NSString.h \ /usr/include/GNUstep/Foundation/NSRange.h \ /usr/include/GNUstep/Foundation/NSArchiver.h \ /usr/include/GNUstep/Foundation/NSCoder.h \ /usr/include/GNUstep/Foundation/NSArray.h \ /usr/include/GNUstep/Foundation/NSAttributedString.h \ /usr/include/GNUstep/Foundation/NSDictionary.h \ /usr/include/GNUstep/Foundation/NSAutoreleasePool.h \ /usr/include/GNUstep/Foundation/NSBundle.h \ /usr/include/GNUstep/Foundation/NSByteOrder.h \ /usr/include/GNUstep/Foundation/NSCalendarDate.h \ /usr/include/GNUstep/Foundation/NSCharacterSet.h \ /usr/include/GNUstep/Foundation/NSClassDescription.h \ /usr/include/GNUstep/Foundation/NSException.h \ /usr/include/GNUstep/Foundation/NSComparisonPredicate.h \ /usr/include/GNUstep/Foundation/NSExpression.h \ /usr/include/GNUstep/Foundation/NSPredicate.h \ /usr/include/GNUstep/Foundation/NSCompoundPredicate.h \ /usr/include/GNUstep/Foundation/NSConnection.h \ /usr/include/GNUstep/Foundation/NSTimer.h \ /usr/include/GNUstep/Foundation/NSRunLoop.h \ /usr/include/GNUstep/Foundation/NSMapTable.h \ /usr/include/GNUstep/Foundation/NSData.h \ /usr/include/GNUstep/Foundation/NSSerialization.h \ /usr/include/GNUstep/Foundation/NSDateFormatter.h \ /usr/include/GNUstep/Foundation/NSFormatter.h \ /usr/include/GNUstep/Foundation/NSDecimalNumber.h \ /usr/include/GNUstep/Foundation/NSDecimal.h \ /usr/include/GNUstep/Foundation/NSValue.h \ /usr/include/GNUstep/Foundation/NSDistantObject.h \ /usr/include/GNUstep/Foundation/NSProxy.h \ /usr/include/GNUstep/Foundation/NSDistributedLock.h \ /usr/include/GNUstep/Foundation/NSDistributedNotificationCenter.h \ /usr/include/GNUstep/Foundation/NSLock.h \ /usr/include/GNUstep/Foundation/NSNotification.h \ /usr/include/GNUstep/Foundation/NSEnumerator.h \ /usr/include/GNUstep/Foundation/NSError.h \ /usr/include/GNUstep/Foundation/NSFileHandle.h \ /usr/include/GNUstep/Foundation/NSFileManager.h \ /usr/include/GNUstep/Foundation/NSHashTable.h \ /usr/include/GNUstep/Foundation/NSHost.h \ /usr/include/GNUstep/Foundation/NSHTTPCookie.h \ /usr/include/GNUstep/Foundation/NSHTTPCookieStorage.h \ /usr/include/GNUstep/Foundation/NSIndexPath.h \ /usr/include/GNUstep/Foundation/NSIndexSet.h \ /usr/include/GNUstep/Foundation/NSInvocation.h \ /usr/include/GNUstep/Foundation/NSMethodSignature.h \ /usr/include/GNUstep/Foundation/NSKeyedArchiver.h \ /usr/include/GNUstep/Foundation/NSPropertyList.h \ /usr/include/GNUstep/Foundation/NSKeyValueCoding.h \ /usr/include/GNUstep/Foundation/NSNotificationQueue.h \ /usr/include/GNUstep/Foundation/NSNetServices.h \ /usr/include/GNUstep/Foundation/NSNull.h \ /usr/include/GNUstep/Foundation/NSNumberFormatter.h \ /usr/include/GNUstep/Foundation/NSPathUtilities.h \ /usr/include/GNUstep/Foundation/NSPortCoder.h \ /usr/include/GNUstep/Foundation/NSPortMessage.h \ /usr/include/GNUstep/Foundation/NSPort.h \ /usr/include/GNUstep/Foundation/NSPortNameServer.h \ /usr/include/GNUstep/Foundation/NSProtocolChecker.h \ /usr/include/GNUstep/Foundation/NSScanner.h \ /usr/include/GNUstep/Foundation/NSSet.h \ /usr/include/GNUstep/Foundation/NSSortDescriptor.h \ /usr/include/GNUstep/Foundation/NSSpellServer.h \ /usr/include/GNUstep/Foundation/NSStream.h \ /usr/include/GNUstep/Foundation/NSTask.h \ /usr/include/GNUstep/Foundation/NSThread.h \ /usr/include/GNUstep/Foundation/NSTimeZone.h \ /usr/include/GNUstep/Foundation/NSUndoManager.h \ /usr/include/GNUstep/Foundation/NSURLAuthenticationChallenge.h \ /usr/include/GNUstep/Foundation/NSURLCache.h \ /usr/include/GNUstep/Foundation/NSURLConnection.h \ /usr/include/GNUstep/Foundation/NSURLCredential.h \ /usr/include/GNUstep/Foundation/NSURLCredentialStorage.h \ /usr/include/GNUstep/Foundation/NSURLDownload.h \ /usr/include/GNUstep/Foundation/NSURLError.h \ /usr/include/GNUstep/Foundation/NSURL.h \ /usr/include/GNUstep/Foundation/NSURLHandle.h \ /usr/include/GNUstep/Foundation/NSURLProtectionSpace.h \ /usr/include/GNUstep/Foundation/NSURLProtocol.h \ /usr/include/GNUstep/Foundation/NSURLRequest.h \ /usr/include/GNUstep/Foundation/NSURLResponse.h \ /usr/include/GNUstep/Foundation/NSUserDefaults.h \ /usr/include/GNUstep/Foundation/NSValueTransformer.h \ /usr/include/GNUstep/Foundation/NSXMLParser.h \ ../GDLAccess/EOAttribute.h /usr/include/oracle/10.2.0.3/client/oci.h \ /usr/include/oracle/10.2.0.3/client/oratypes.h \ /usr/include/oracle/10.2.0.3/client/ocidfn.h \ /usr/include/oracle/10.2.0.3/client/oci1.h \ /usr/include/oracle/10.2.0.3/client/oro.h \ /usr/include/oracle/10.2.0.3/client/ori.h \ /usr/include/oracle/10.2.0.3/client/ort.h \ /usr/include/oracle/10.2.0.3/client/orl.h \ /usr/include/oracle/10.2.0.3/client/ociextp.h \ /usr/include/oracle/10.2.0.3/client/ociapr.h \ /usr/include/oracle/10.2.0.3/client/ociap.h \ /usr/include/oracle/10.2.0.3/client/nzt.h \ /usr/include/oracle/10.2.0.3/client/nzerror.h \ /usr/include/oracle/10.2.0.3/client/ocixmldb.h \ /usr/include/oracle/10.2.0.3/client/oci8dp.h OracleValues.h: /usr/include/GNUstep/Foundation/Foundation.h: /usr/include/GNUstep/GNUstepBase/GSVersionMacros.h: /usr/include/GNUstep/Foundation/FoundationErrors.h: /usr/include/GNUstep/Foundation/NSObject.h: /usr/include/GNUstep/Foundation/NSObjCRuntime.h: /usr/include/GNUstep/GNUstepBase/preface.h: /usr/include/GNUstep/GNUstepBase/objc-gnu2next.h: /usr/include/GNUstep/GNUstepBase/GSConfig.h: /usr/include/GNUstep/GNUstepBase/GSObjCRuntime.h: /usr/include/GNUstep/Foundation/NSZone.h: /usr/include/GNUstep/GNUstepBase/GNUstep.h: /usr/include/GNUstep/Foundation/NSDate.h: /usr/include/GNUstep/Foundation/NSDebug.h: /usr/include/GNUstep/Foundation/NSProcessInfo.h: /usr/include/GNUstep/Foundation/NSAffineTransform.h: /usr/include/GNUstep/Foundation/NSGeometry.h: /usr/include/GNUstep/Foundation/NSString.h: /usr/include/GNUstep/Foundation/NSRange.h: /usr/include/GNUstep/Foundation/NSArchiver.h: /usr/include/GNUstep/Foundation/NSCoder.h: /usr/include/GNUstep/Foundation/NSArray.h: /usr/include/GNUstep/Foundation/NSAttributedString.h: /usr/include/GNUstep/Foundation/NSDictionary.h: /usr/include/GNUstep/Foundation/NSAutoreleasePool.h: /usr/include/GNUstep/Foundation/NSBundle.h: /usr/include/GNUstep/Foundation/NSByteOrder.h: /usr/include/GNUstep/Foundation/NSCalendarDate.h: /usr/include/GNUstep/Foundation/NSCharacterSet.h: /usr/include/GNUstep/Foundation/NSClassDescription.h: /usr/include/GNUstep/Foundation/NSException.h: /usr/include/GNUstep/Foundation/NSComparisonPredicate.h: /usr/include/GNUstep/Foundation/NSExpression.h: /usr/include/GNUstep/Foundation/NSPredicate.h: /usr/include/GNUstep/Foundation/NSCompoundPredicate.h: /usr/include/GNUstep/Foundation/NSConnection.h: /usr/include/GNUstep/Foundation/NSTimer.h: /usr/include/GNUstep/Foundation/NSRunLoop.h: /usr/include/GNUstep/Foundation/NSMapTable.h: /usr/include/GNUstep/Foundation/NSData.h: /usr/include/GNUstep/Foundation/NSSerialization.h: /usr/include/GNUstep/Foundation/NSDateFormatter.h: /usr/include/GNUstep/Foundation/NSFormatter.h: /usr/include/GNUstep/Foundation/NSDecimalNumber.h: /usr/include/GNUstep/Foundation/NSDecimal.h: /usr/include/GNUstep/Foundation/NSValue.h: /usr/include/GNUstep/Foundation/NSDistantObject.h: /usr/include/GNUstep/Foundation/NSProxy.h: /usr/include/GNUstep/Foundation/NSDistributedLock.h: /usr/include/GNUstep/Foundation/NSDistributedNotificationCenter.h: /usr/include/GNUstep/Foundation/NSLock.h: /usr/include/GNUstep/Foundation/NSNotification.h: /usr/include/GNUstep/Foundation/NSEnumerator.h: /usr/include/GNUstep/Foundation/NSError.h: /usr/include/GNUstep/Foundation/NSFileHandle.h: /usr/include/GNUstep/Foundation/NSFileManager.h: /usr/include/GNUstep/Foundation/NSHashTable.h: /usr/include/GNUstep/Foundation/NSHost.h: /usr/include/GNUstep/Foundation/NSHTTPCookie.h: /usr/include/GNUstep/Foundation/NSHTTPCookieStorage.h: /usr/include/GNUstep/Foundation/NSIndexPath.h: /usr/include/GNUstep/Foundation/NSIndexSet.h: /usr/include/GNUstep/Foundation/NSInvocation.h: /usr/include/GNUstep/Foundation/NSMethodSignature.h: /usr/include/GNUstep/Foundation/NSKeyedArchiver.h: /usr/include/GNUstep/Foundation/NSPropertyList.h: /usr/include/GNUstep/Foundation/NSKeyValueCoding.h: /usr/include/GNUstep/Foundation/NSNotificationQueue.h: /usr/include/GNUstep/Foundation/NSNetServices.h: /usr/include/GNUstep/Foundation/NSNull.h: /usr/include/GNUstep/Foundation/NSNumberFormatter.h: /usr/include/GNUstep/Foundation/NSPathUtilities.h: /usr/include/GNUstep/Foundation/NSPortCoder.h: /usr/include/GNUstep/Foundation/NSPortMessage.h: /usr/include/GNUstep/Foundation/NSPort.h: /usr/include/GNUstep/Foundation/NSPortNameServer.h: /usr/include/GNUstep/Foundation/NSProtocolChecker.h: /usr/include/GNUstep/Foundation/NSScanner.h: /usr/include/GNUstep/Foundation/NSSet.h: /usr/include/GNUstep/Foundation/NSSortDescriptor.h: /usr/include/GNUstep/Foundation/NSSpellServer.h: /usr/include/GNUstep/Foundation/NSStream.h: /usr/include/GNUstep/Foundation/NSTask.h: /usr/include/GNUstep/Foundation/NSThread.h: /usr/include/GNUstep/Foundation/NSTimeZone.h: /usr/include/GNUstep/Foundation/NSUndoManager.h: /usr/include/GNUstep/Foundation/NSURLAuthenticationChallenge.h: /usr/include/GNUstep/Foundation/NSURLCache.h: /usr/include/GNUstep/Foundation/NSURLConnection.h: /usr/include/GNUstep/Foundation/NSURLCredential.h: /usr/include/GNUstep/Foundation/NSURLCredentialStorage.h: /usr/include/GNUstep/Foundation/NSURLDownload.h: /usr/include/GNUstep/Foundation/NSURLError.h: /usr/include/GNUstep/Foundation/NSURL.h: /usr/include/GNUstep/Foundation/NSURLHandle.h: /usr/include/GNUstep/Foundation/NSURLProtectionSpace.h: /usr/include/GNUstep/Foundation/NSURLProtocol.h: /usr/include/GNUstep/Foundation/NSURLRequest.h: /usr/include/GNUstep/Foundation/NSURLResponse.h: /usr/include/GNUstep/Foundation/NSUserDefaults.h: /usr/include/GNUstep/Foundation/NSValueTransformer.h: /usr/include/GNUstep/Foundation/NSXMLParser.h: ../GDLAccess/EOAttribute.h: /usr/include/oracle/10.2.0.3/client/oci.h: /usr/include/oracle/10.2.0.3/client/oratypes.h: /usr/include/oracle/10.2.0.3/client/ocidfn.h: /usr/include/oracle/10.2.0.3/client/oci1.h: /usr/include/oracle/10.2.0.3/client/oro.h: /usr/include/oracle/10.2.0.3/client/ori.h: /usr/include/oracle/10.2.0.3/client/ort.h: /usr/include/oracle/10.2.0.3/client/orl.h: /usr/include/oracle/10.2.0.3/client/ociextp.h: /usr/include/oracle/10.2.0.3/client/ociapr.h: /usr/include/oracle/10.2.0.3/client/ociap.h: /usr/include/oracle/10.2.0.3/client/nzt.h: /usr/include/oracle/10.2.0.3/client/nzerror.h: /usr/include/oracle/10.2.0.3/client/ocixmldb.h: /usr/include/oracle/10.2.0.3/client/oci8dp.h: SOPE/sope-gdl1/Oracle8/obj/OracleSQLExpression.d0000644000000000000000000002432712242733417020213 0ustar rootrootobj/OracleSQLExpression.o: OracleSQLExpression.m OracleSQLExpression.h \ /usr/include/GNUstep/Foundation/Foundation.h \ /usr/include/GNUstep/GNUstepBase/GSVersionMacros.h \ /usr/include/GNUstep/Foundation/FoundationErrors.h \ /usr/include/GNUstep/Foundation/NSObject.h \ /usr/include/GNUstep/Foundation/NSObjCRuntime.h \ /usr/include/GNUstep/GNUstepBase/preface.h \ /usr/include/GNUstep/GNUstepBase/objc-gnu2next.h \ /usr/include/GNUstep/GNUstepBase/GSConfig.h \ /usr/include/GNUstep/GNUstepBase/GSObjCRuntime.h \ /usr/include/GNUstep/Foundation/NSZone.h \ /usr/include/GNUstep/GNUstepBase/GNUstep.h \ /usr/include/GNUstep/Foundation/NSDate.h \ /usr/include/GNUstep/Foundation/NSDebug.h \ /usr/include/GNUstep/Foundation/NSProcessInfo.h \ /usr/include/GNUstep/Foundation/NSAffineTransform.h \ /usr/include/GNUstep/Foundation/NSGeometry.h \ /usr/include/GNUstep/Foundation/NSString.h \ /usr/include/GNUstep/Foundation/NSRange.h \ /usr/include/GNUstep/Foundation/NSArchiver.h \ /usr/include/GNUstep/Foundation/NSCoder.h \ /usr/include/GNUstep/Foundation/NSArray.h \ /usr/include/GNUstep/Foundation/NSAttributedString.h \ /usr/include/GNUstep/Foundation/NSDictionary.h \ /usr/include/GNUstep/Foundation/NSAutoreleasePool.h \ /usr/include/GNUstep/Foundation/NSBundle.h \ /usr/include/GNUstep/Foundation/NSByteOrder.h \ /usr/include/GNUstep/Foundation/NSCalendarDate.h \ /usr/include/GNUstep/Foundation/NSCharacterSet.h \ /usr/include/GNUstep/Foundation/NSClassDescription.h \ /usr/include/GNUstep/Foundation/NSException.h \ /usr/include/GNUstep/Foundation/NSComparisonPredicate.h \ /usr/include/GNUstep/Foundation/NSExpression.h \ /usr/include/GNUstep/Foundation/NSPredicate.h \ /usr/include/GNUstep/Foundation/NSCompoundPredicate.h \ /usr/include/GNUstep/Foundation/NSConnection.h \ /usr/include/GNUstep/Foundation/NSTimer.h \ /usr/include/GNUstep/Foundation/NSRunLoop.h \ /usr/include/GNUstep/Foundation/NSMapTable.h \ /usr/include/GNUstep/Foundation/NSData.h \ /usr/include/GNUstep/Foundation/NSSerialization.h \ /usr/include/GNUstep/Foundation/NSDateFormatter.h \ /usr/include/GNUstep/Foundation/NSFormatter.h \ /usr/include/GNUstep/Foundation/NSDecimalNumber.h \ /usr/include/GNUstep/Foundation/NSDecimal.h \ /usr/include/GNUstep/Foundation/NSValue.h \ /usr/include/GNUstep/Foundation/NSDistantObject.h \ /usr/include/GNUstep/Foundation/NSProxy.h \ /usr/include/GNUstep/Foundation/NSDistributedLock.h \ /usr/include/GNUstep/Foundation/NSDistributedNotificationCenter.h \ /usr/include/GNUstep/Foundation/NSLock.h \ /usr/include/GNUstep/Foundation/NSNotification.h \ /usr/include/GNUstep/Foundation/NSEnumerator.h \ /usr/include/GNUstep/Foundation/NSError.h \ /usr/include/GNUstep/Foundation/NSFileHandle.h \ /usr/include/GNUstep/Foundation/NSFileManager.h \ /usr/include/GNUstep/Foundation/NSHashTable.h \ /usr/include/GNUstep/Foundation/NSHost.h \ /usr/include/GNUstep/Foundation/NSHTTPCookie.h \ /usr/include/GNUstep/Foundation/NSHTTPCookieStorage.h \ /usr/include/GNUstep/Foundation/NSIndexPath.h \ /usr/include/GNUstep/Foundation/NSIndexSet.h \ /usr/include/GNUstep/Foundation/NSInvocation.h \ /usr/include/GNUstep/Foundation/NSMethodSignature.h \ /usr/include/GNUstep/Foundation/NSKeyedArchiver.h \ /usr/include/GNUstep/Foundation/NSPropertyList.h \ /usr/include/GNUstep/Foundation/NSKeyValueCoding.h \ /usr/include/GNUstep/Foundation/NSNotificationQueue.h \ /usr/include/GNUstep/Foundation/NSNetServices.h \ /usr/include/GNUstep/Foundation/NSNull.h \ /usr/include/GNUstep/Foundation/NSNumberFormatter.h \ /usr/include/GNUstep/Foundation/NSPathUtilities.h \ /usr/include/GNUstep/Foundation/NSPortCoder.h \ /usr/include/GNUstep/Foundation/NSPortMessage.h \ /usr/include/GNUstep/Foundation/NSPort.h \ /usr/include/GNUstep/Foundation/NSPortNameServer.h \ /usr/include/GNUstep/Foundation/NSProtocolChecker.h \ /usr/include/GNUstep/Foundation/NSScanner.h \ /usr/include/GNUstep/Foundation/NSSet.h \ /usr/include/GNUstep/Foundation/NSSortDescriptor.h \ /usr/include/GNUstep/Foundation/NSSpellServer.h \ /usr/include/GNUstep/Foundation/NSStream.h \ /usr/include/GNUstep/Foundation/NSTask.h \ /usr/include/GNUstep/Foundation/NSThread.h \ /usr/include/GNUstep/Foundation/NSTimeZone.h \ /usr/include/GNUstep/Foundation/NSUndoManager.h \ /usr/include/GNUstep/Foundation/NSURLAuthenticationChallenge.h \ /usr/include/GNUstep/Foundation/NSURLCache.h \ /usr/include/GNUstep/Foundation/NSURLConnection.h \ /usr/include/GNUstep/Foundation/NSURLCredential.h \ /usr/include/GNUstep/Foundation/NSURLCredentialStorage.h \ /usr/include/GNUstep/Foundation/NSURLDownload.h \ /usr/include/GNUstep/Foundation/NSURLError.h \ /usr/include/GNUstep/Foundation/NSURL.h \ /usr/include/GNUstep/Foundation/NSURLHandle.h \ /usr/include/GNUstep/Foundation/NSURLProtectionSpace.h \ /usr/include/GNUstep/Foundation/NSURLProtocol.h \ /usr/include/GNUstep/Foundation/NSURLRequest.h \ /usr/include/GNUstep/Foundation/NSURLResponse.h \ /usr/include/GNUstep/Foundation/NSUserDefaults.h \ /usr/include/GNUstep/Foundation/NSValueTransformer.h \ /usr/include/GNUstep/Foundation/NSXMLParser.h \ ../GDLAccess/EOSQLExpression.h ../GDLAccess/EOExpressionArray.h \ ../GDLAccess/EOJoinTypes.h OracleSQLExpression.h: /usr/include/GNUstep/Foundation/Foundation.h: /usr/include/GNUstep/GNUstepBase/GSVersionMacros.h: /usr/include/GNUstep/Foundation/FoundationErrors.h: /usr/include/GNUstep/Foundation/NSObject.h: /usr/include/GNUstep/Foundation/NSObjCRuntime.h: /usr/include/GNUstep/GNUstepBase/preface.h: /usr/include/GNUstep/GNUstepBase/objc-gnu2next.h: /usr/include/GNUstep/GNUstepBase/GSConfig.h: /usr/include/GNUstep/GNUstepBase/GSObjCRuntime.h: /usr/include/GNUstep/Foundation/NSZone.h: /usr/include/GNUstep/GNUstepBase/GNUstep.h: /usr/include/GNUstep/Foundation/NSDate.h: /usr/include/GNUstep/Foundation/NSDebug.h: /usr/include/GNUstep/Foundation/NSProcessInfo.h: /usr/include/GNUstep/Foundation/NSAffineTransform.h: /usr/include/GNUstep/Foundation/NSGeometry.h: /usr/include/GNUstep/Foundation/NSString.h: /usr/include/GNUstep/Foundation/NSRange.h: /usr/include/GNUstep/Foundation/NSArchiver.h: /usr/include/GNUstep/Foundation/NSCoder.h: /usr/include/GNUstep/Foundation/NSArray.h: /usr/include/GNUstep/Foundation/NSAttributedString.h: /usr/include/GNUstep/Foundation/NSDictionary.h: /usr/include/GNUstep/Foundation/NSAutoreleasePool.h: /usr/include/GNUstep/Foundation/NSBundle.h: /usr/include/GNUstep/Foundation/NSByteOrder.h: /usr/include/GNUstep/Foundation/NSCalendarDate.h: /usr/include/GNUstep/Foundation/NSCharacterSet.h: /usr/include/GNUstep/Foundation/NSClassDescription.h: /usr/include/GNUstep/Foundation/NSException.h: /usr/include/GNUstep/Foundation/NSComparisonPredicate.h: /usr/include/GNUstep/Foundation/NSExpression.h: /usr/include/GNUstep/Foundation/NSPredicate.h: /usr/include/GNUstep/Foundation/NSCompoundPredicate.h: /usr/include/GNUstep/Foundation/NSConnection.h: /usr/include/GNUstep/Foundation/NSTimer.h: /usr/include/GNUstep/Foundation/NSRunLoop.h: /usr/include/GNUstep/Foundation/NSMapTable.h: /usr/include/GNUstep/Foundation/NSData.h: /usr/include/GNUstep/Foundation/NSSerialization.h: /usr/include/GNUstep/Foundation/NSDateFormatter.h: /usr/include/GNUstep/Foundation/NSFormatter.h: /usr/include/GNUstep/Foundation/NSDecimalNumber.h: /usr/include/GNUstep/Foundation/NSDecimal.h: /usr/include/GNUstep/Foundation/NSValue.h: /usr/include/GNUstep/Foundation/NSDistantObject.h: /usr/include/GNUstep/Foundation/NSProxy.h: /usr/include/GNUstep/Foundation/NSDistributedLock.h: /usr/include/GNUstep/Foundation/NSDistributedNotificationCenter.h: /usr/include/GNUstep/Foundation/NSLock.h: /usr/include/GNUstep/Foundation/NSNotification.h: /usr/include/GNUstep/Foundation/NSEnumerator.h: /usr/include/GNUstep/Foundation/NSError.h: /usr/include/GNUstep/Foundation/NSFileHandle.h: /usr/include/GNUstep/Foundation/NSFileManager.h: /usr/include/GNUstep/Foundation/NSHashTable.h: /usr/include/GNUstep/Foundation/NSHost.h: /usr/include/GNUstep/Foundation/NSHTTPCookie.h: /usr/include/GNUstep/Foundation/NSHTTPCookieStorage.h: /usr/include/GNUstep/Foundation/NSIndexPath.h: /usr/include/GNUstep/Foundation/NSIndexSet.h: /usr/include/GNUstep/Foundation/NSInvocation.h: /usr/include/GNUstep/Foundation/NSMethodSignature.h: /usr/include/GNUstep/Foundation/NSKeyedArchiver.h: /usr/include/GNUstep/Foundation/NSPropertyList.h: /usr/include/GNUstep/Foundation/NSKeyValueCoding.h: /usr/include/GNUstep/Foundation/NSNotificationQueue.h: /usr/include/GNUstep/Foundation/NSNetServices.h: /usr/include/GNUstep/Foundation/NSNull.h: /usr/include/GNUstep/Foundation/NSNumberFormatter.h: /usr/include/GNUstep/Foundation/NSPathUtilities.h: /usr/include/GNUstep/Foundation/NSPortCoder.h: /usr/include/GNUstep/Foundation/NSPortMessage.h: /usr/include/GNUstep/Foundation/NSPort.h: /usr/include/GNUstep/Foundation/NSPortNameServer.h: /usr/include/GNUstep/Foundation/NSProtocolChecker.h: /usr/include/GNUstep/Foundation/NSScanner.h: /usr/include/GNUstep/Foundation/NSSet.h: /usr/include/GNUstep/Foundation/NSSortDescriptor.h: /usr/include/GNUstep/Foundation/NSSpellServer.h: /usr/include/GNUstep/Foundation/NSStream.h: /usr/include/GNUstep/Foundation/NSTask.h: /usr/include/GNUstep/Foundation/NSThread.h: /usr/include/GNUstep/Foundation/NSTimeZone.h: /usr/include/GNUstep/Foundation/NSUndoManager.h: /usr/include/GNUstep/Foundation/NSURLAuthenticationChallenge.h: /usr/include/GNUstep/Foundation/NSURLCache.h: /usr/include/GNUstep/Foundation/NSURLConnection.h: /usr/include/GNUstep/Foundation/NSURLCredential.h: /usr/include/GNUstep/Foundation/NSURLCredentialStorage.h: /usr/include/GNUstep/Foundation/NSURLDownload.h: /usr/include/GNUstep/Foundation/NSURLError.h: /usr/include/GNUstep/Foundation/NSURL.h: /usr/include/GNUstep/Foundation/NSURLHandle.h: /usr/include/GNUstep/Foundation/NSURLProtectionSpace.h: /usr/include/GNUstep/Foundation/NSURLProtocol.h: /usr/include/GNUstep/Foundation/NSURLRequest.h: /usr/include/GNUstep/Foundation/NSURLResponse.h: /usr/include/GNUstep/Foundation/NSUserDefaults.h: /usr/include/GNUstep/Foundation/NSValueTransformer.h: /usr/include/GNUstep/Foundation/NSXMLParser.h: ../GDLAccess/EOSQLExpression.h: ../GDLAccess/EOExpressionArray.h: ../GDLAccess/EOJoinTypes.h: SOPE/sope-gdl1/Oracle8/obj/OracleAdaptorChannelController.d0000644000000000000000000003026312242733417022417 0ustar rootrootobj/OracleAdaptorChannelController.o: OracleAdaptorChannelController.m \ OracleAdaptorChannelController.h ../GDLAccess/EODelegateResponse.h \ ../GDLAccess/EOEntity.h /usr/include/GNUstep/Foundation/NSString.h \ /usr/include/GNUstep/GNUstepBase/GSVersionMacros.h \ /usr/include/GNUstep/Foundation/NSObject.h \ /usr/include/GNUstep/Foundation/NSObjCRuntime.h \ /usr/include/GNUstep/GNUstepBase/preface.h \ /usr/include/GNUstep/GNUstepBase/objc-gnu2next.h \ /usr/include/GNUstep/GNUstepBase/GSConfig.h \ /usr/include/GNUstep/GNUstepBase/GSObjCRuntime.h \ /usr/include/GNUstep/Foundation/NSZone.h \ /usr/include/GNUstep/GNUstepBase/GNUstep.h \ /usr/include/GNUstep/Foundation/NSDate.h \ /usr/include/GNUstep/Foundation/NSRange.h \ ../../sope-core/EOControl/EOClassDescription.h \ /usr/include/GNUstep/Foundation/Foundation.h \ /usr/include/GNUstep/Foundation/FoundationErrors.h \ /usr/include/GNUstep/Foundation/NSDebug.h \ /usr/include/GNUstep/Foundation/NSProcessInfo.h \ /usr/include/GNUstep/Foundation/NSAffineTransform.h \ /usr/include/GNUstep/Foundation/NSGeometry.h \ /usr/include/GNUstep/Foundation/NSArchiver.h \ /usr/include/GNUstep/Foundation/NSCoder.h \ /usr/include/GNUstep/Foundation/NSArray.h \ /usr/include/GNUstep/Foundation/NSAttributedString.h \ /usr/include/GNUstep/Foundation/NSDictionary.h \ /usr/include/GNUstep/Foundation/NSAutoreleasePool.h \ /usr/include/GNUstep/Foundation/NSBundle.h \ /usr/include/GNUstep/Foundation/NSByteOrder.h \ /usr/include/GNUstep/Foundation/NSCalendarDate.h \ /usr/include/GNUstep/Foundation/NSCharacterSet.h \ /usr/include/GNUstep/Foundation/NSClassDescription.h \ /usr/include/GNUstep/Foundation/NSException.h \ /usr/include/GNUstep/Foundation/NSComparisonPredicate.h \ /usr/include/GNUstep/Foundation/NSExpression.h \ /usr/include/GNUstep/Foundation/NSPredicate.h \ /usr/include/GNUstep/Foundation/NSCompoundPredicate.h \ /usr/include/GNUstep/Foundation/NSConnection.h \ /usr/include/GNUstep/Foundation/NSTimer.h \ /usr/include/GNUstep/Foundation/NSRunLoop.h \ /usr/include/GNUstep/Foundation/NSMapTable.h \ /usr/include/GNUstep/Foundation/NSData.h \ /usr/include/GNUstep/Foundation/NSSerialization.h \ /usr/include/GNUstep/Foundation/NSDateFormatter.h \ /usr/include/GNUstep/Foundation/NSFormatter.h \ /usr/include/GNUstep/Foundation/NSDecimalNumber.h \ /usr/include/GNUstep/Foundation/NSDecimal.h \ /usr/include/GNUstep/Foundation/NSValue.h \ /usr/include/GNUstep/Foundation/NSDistantObject.h \ /usr/include/GNUstep/Foundation/NSProxy.h \ /usr/include/GNUstep/Foundation/NSDistributedLock.h \ /usr/include/GNUstep/Foundation/NSDistributedNotificationCenter.h \ /usr/include/GNUstep/Foundation/NSLock.h \ /usr/include/GNUstep/Foundation/NSNotification.h \ /usr/include/GNUstep/Foundation/NSEnumerator.h \ /usr/include/GNUstep/Foundation/NSError.h \ /usr/include/GNUstep/Foundation/NSFileHandle.h \ /usr/include/GNUstep/Foundation/NSFileManager.h \ /usr/include/GNUstep/Foundation/NSHashTable.h \ /usr/include/GNUstep/Foundation/NSHost.h \ /usr/include/GNUstep/Foundation/NSHTTPCookie.h \ /usr/include/GNUstep/Foundation/NSHTTPCookieStorage.h \ /usr/include/GNUstep/Foundation/NSIndexPath.h \ /usr/include/GNUstep/Foundation/NSIndexSet.h \ /usr/include/GNUstep/Foundation/NSInvocation.h \ /usr/include/GNUstep/Foundation/NSMethodSignature.h \ /usr/include/GNUstep/Foundation/NSKeyedArchiver.h \ /usr/include/GNUstep/Foundation/NSPropertyList.h \ /usr/include/GNUstep/Foundation/NSKeyValueCoding.h \ /usr/include/GNUstep/Foundation/NSNotificationQueue.h \ /usr/include/GNUstep/Foundation/NSNetServices.h \ /usr/include/GNUstep/Foundation/NSNull.h \ /usr/include/GNUstep/Foundation/NSNumberFormatter.h \ /usr/include/GNUstep/Foundation/NSPathUtilities.h \ /usr/include/GNUstep/Foundation/NSPortCoder.h \ /usr/include/GNUstep/Foundation/NSPortMessage.h \ /usr/include/GNUstep/Foundation/NSPort.h \ /usr/include/GNUstep/Foundation/NSPortNameServer.h \ /usr/include/GNUstep/Foundation/NSProtocolChecker.h \ /usr/include/GNUstep/Foundation/NSScanner.h \ /usr/include/GNUstep/Foundation/NSSet.h \ /usr/include/GNUstep/Foundation/NSSortDescriptor.h \ /usr/include/GNUstep/Foundation/NSSpellServer.h \ /usr/include/GNUstep/Foundation/NSStream.h \ /usr/include/GNUstep/Foundation/NSTask.h \ /usr/include/GNUstep/Foundation/NSThread.h \ /usr/include/GNUstep/Foundation/NSTimeZone.h \ /usr/include/GNUstep/Foundation/NSUndoManager.h \ /usr/include/GNUstep/Foundation/NSURLAuthenticationChallenge.h \ /usr/include/GNUstep/Foundation/NSURLCache.h \ /usr/include/GNUstep/Foundation/NSURLConnection.h \ /usr/include/GNUstep/Foundation/NSURLCredential.h \ /usr/include/GNUstep/Foundation/NSURLCredentialStorage.h \ /usr/include/GNUstep/Foundation/NSURLDownload.h \ /usr/include/GNUstep/Foundation/NSURLError.h \ /usr/include/GNUstep/Foundation/NSURL.h \ /usr/include/GNUstep/Foundation/NSURLHandle.h \ /usr/include/GNUstep/Foundation/NSURLProtectionSpace.h \ /usr/include/GNUstep/Foundation/NSURLProtocol.h \ /usr/include/GNUstep/Foundation/NSURLRequest.h \ /usr/include/GNUstep/Foundation/NSURLResponse.h \ /usr/include/GNUstep/Foundation/NSUserDefaults.h \ /usr/include/GNUstep/Foundation/NSValueTransformer.h \ /usr/include/GNUstep/Foundation/NSXMLParser.h \ ../../sope-core/EOControl/EOGlobalID.h \ /usr/include/oracle/10.2.0.3/client/oci.h \ /usr/include/oracle/10.2.0.3/client/oratypes.h \ /usr/include/oracle/10.2.0.3/client/ocidfn.h \ /usr/include/oracle/10.2.0.3/client/oci1.h \ /usr/include/oracle/10.2.0.3/client/oro.h \ /usr/include/oracle/10.2.0.3/client/ori.h \ /usr/include/oracle/10.2.0.3/client/ort.h \ /usr/include/oracle/10.2.0.3/client/orl.h \ /usr/include/oracle/10.2.0.3/client/ociextp.h \ /usr/include/oracle/10.2.0.3/client/ociapr.h \ /usr/include/oracle/10.2.0.3/client/ociap.h \ /usr/include/oracle/10.2.0.3/client/nzt.h \ /usr/include/oracle/10.2.0.3/client/nzerror.h \ /usr/include/oracle/10.2.0.3/client/ocixmldb.h \ /usr/include/oracle/10.2.0.3/client/oci8dp.h err.h \ OracleAdaptorChannel.h ../GDLAccess/EOAdaptorChannel.h \ OracleAdaptorContext.h ../GDLAccess/EOAdaptorContext.h \ ../GDLAccess/EOSQLExpression.h ../GDLAccess/EOExpressionArray.h \ ../GDLAccess/EOJoinTypes.h OracleAdaptorChannelController.h: ../GDLAccess/EODelegateResponse.h: ../GDLAccess/EOEntity.h: /usr/include/GNUstep/Foundation/NSString.h: /usr/include/GNUstep/GNUstepBase/GSVersionMacros.h: /usr/include/GNUstep/Foundation/NSObject.h: /usr/include/GNUstep/Foundation/NSObjCRuntime.h: /usr/include/GNUstep/GNUstepBase/preface.h: /usr/include/GNUstep/GNUstepBase/objc-gnu2next.h: /usr/include/GNUstep/GNUstepBase/GSConfig.h: /usr/include/GNUstep/GNUstepBase/GSObjCRuntime.h: /usr/include/GNUstep/Foundation/NSZone.h: /usr/include/GNUstep/GNUstepBase/GNUstep.h: /usr/include/GNUstep/Foundation/NSDate.h: /usr/include/GNUstep/Foundation/NSRange.h: ../../sope-core/EOControl/EOClassDescription.h: /usr/include/GNUstep/Foundation/Foundation.h: /usr/include/GNUstep/Foundation/FoundationErrors.h: /usr/include/GNUstep/Foundation/NSDebug.h: /usr/include/GNUstep/Foundation/NSProcessInfo.h: /usr/include/GNUstep/Foundation/NSAffineTransform.h: /usr/include/GNUstep/Foundation/NSGeometry.h: /usr/include/GNUstep/Foundation/NSArchiver.h: /usr/include/GNUstep/Foundation/NSCoder.h: /usr/include/GNUstep/Foundation/NSArray.h: /usr/include/GNUstep/Foundation/NSAttributedString.h: /usr/include/GNUstep/Foundation/NSDictionary.h: /usr/include/GNUstep/Foundation/NSAutoreleasePool.h: /usr/include/GNUstep/Foundation/NSBundle.h: /usr/include/GNUstep/Foundation/NSByteOrder.h: /usr/include/GNUstep/Foundation/NSCalendarDate.h: /usr/include/GNUstep/Foundation/NSCharacterSet.h: /usr/include/GNUstep/Foundation/NSClassDescription.h: /usr/include/GNUstep/Foundation/NSException.h: /usr/include/GNUstep/Foundation/NSComparisonPredicate.h: /usr/include/GNUstep/Foundation/NSExpression.h: /usr/include/GNUstep/Foundation/NSPredicate.h: /usr/include/GNUstep/Foundation/NSCompoundPredicate.h: /usr/include/GNUstep/Foundation/NSConnection.h: /usr/include/GNUstep/Foundation/NSTimer.h: /usr/include/GNUstep/Foundation/NSRunLoop.h: /usr/include/GNUstep/Foundation/NSMapTable.h: /usr/include/GNUstep/Foundation/NSData.h: /usr/include/GNUstep/Foundation/NSSerialization.h: /usr/include/GNUstep/Foundation/NSDateFormatter.h: /usr/include/GNUstep/Foundation/NSFormatter.h: /usr/include/GNUstep/Foundation/NSDecimalNumber.h: /usr/include/GNUstep/Foundation/NSDecimal.h: /usr/include/GNUstep/Foundation/NSValue.h: /usr/include/GNUstep/Foundation/NSDistantObject.h: /usr/include/GNUstep/Foundation/NSProxy.h: /usr/include/GNUstep/Foundation/NSDistributedLock.h: /usr/include/GNUstep/Foundation/NSDistributedNotificationCenter.h: /usr/include/GNUstep/Foundation/NSLock.h: /usr/include/GNUstep/Foundation/NSNotification.h: /usr/include/GNUstep/Foundation/NSEnumerator.h: /usr/include/GNUstep/Foundation/NSError.h: /usr/include/GNUstep/Foundation/NSFileHandle.h: /usr/include/GNUstep/Foundation/NSFileManager.h: /usr/include/GNUstep/Foundation/NSHashTable.h: /usr/include/GNUstep/Foundation/NSHost.h: /usr/include/GNUstep/Foundation/NSHTTPCookie.h: /usr/include/GNUstep/Foundation/NSHTTPCookieStorage.h: /usr/include/GNUstep/Foundation/NSIndexPath.h: /usr/include/GNUstep/Foundation/NSIndexSet.h: /usr/include/GNUstep/Foundation/NSInvocation.h: /usr/include/GNUstep/Foundation/NSMethodSignature.h: /usr/include/GNUstep/Foundation/NSKeyedArchiver.h: /usr/include/GNUstep/Foundation/NSPropertyList.h: /usr/include/GNUstep/Foundation/NSKeyValueCoding.h: /usr/include/GNUstep/Foundation/NSNotificationQueue.h: /usr/include/GNUstep/Foundation/NSNetServices.h: /usr/include/GNUstep/Foundation/NSNull.h: /usr/include/GNUstep/Foundation/NSNumberFormatter.h: /usr/include/GNUstep/Foundation/NSPathUtilities.h: /usr/include/GNUstep/Foundation/NSPortCoder.h: /usr/include/GNUstep/Foundation/NSPortMessage.h: /usr/include/GNUstep/Foundation/NSPort.h: /usr/include/GNUstep/Foundation/NSPortNameServer.h: /usr/include/GNUstep/Foundation/NSProtocolChecker.h: /usr/include/GNUstep/Foundation/NSScanner.h: /usr/include/GNUstep/Foundation/NSSet.h: /usr/include/GNUstep/Foundation/NSSortDescriptor.h: /usr/include/GNUstep/Foundation/NSSpellServer.h: /usr/include/GNUstep/Foundation/NSStream.h: /usr/include/GNUstep/Foundation/NSTask.h: /usr/include/GNUstep/Foundation/NSThread.h: /usr/include/GNUstep/Foundation/NSTimeZone.h: /usr/include/GNUstep/Foundation/NSUndoManager.h: /usr/include/GNUstep/Foundation/NSURLAuthenticationChallenge.h: /usr/include/GNUstep/Foundation/NSURLCache.h: /usr/include/GNUstep/Foundation/NSURLConnection.h: /usr/include/GNUstep/Foundation/NSURLCredential.h: /usr/include/GNUstep/Foundation/NSURLCredentialStorage.h: /usr/include/GNUstep/Foundation/NSURLDownload.h: /usr/include/GNUstep/Foundation/NSURLError.h: /usr/include/GNUstep/Foundation/NSURL.h: /usr/include/GNUstep/Foundation/NSURLHandle.h: /usr/include/GNUstep/Foundation/NSURLProtectionSpace.h: /usr/include/GNUstep/Foundation/NSURLProtocol.h: /usr/include/GNUstep/Foundation/NSURLRequest.h: /usr/include/GNUstep/Foundation/NSURLResponse.h: /usr/include/GNUstep/Foundation/NSUserDefaults.h: /usr/include/GNUstep/Foundation/NSValueTransformer.h: /usr/include/GNUstep/Foundation/NSXMLParser.h: ../../sope-core/EOControl/EOGlobalID.h: /usr/include/oracle/10.2.0.3/client/oci.h: /usr/include/oracle/10.2.0.3/client/oratypes.h: /usr/include/oracle/10.2.0.3/client/ocidfn.h: /usr/include/oracle/10.2.0.3/client/oci1.h: /usr/include/oracle/10.2.0.3/client/oro.h: /usr/include/oracle/10.2.0.3/client/ori.h: /usr/include/oracle/10.2.0.3/client/ort.h: /usr/include/oracle/10.2.0.3/client/orl.h: /usr/include/oracle/10.2.0.3/client/ociextp.h: /usr/include/oracle/10.2.0.3/client/ociapr.h: /usr/include/oracle/10.2.0.3/client/ociap.h: /usr/include/oracle/10.2.0.3/client/nzt.h: /usr/include/oracle/10.2.0.3/client/nzerror.h: /usr/include/oracle/10.2.0.3/client/ocixmldb.h: /usr/include/oracle/10.2.0.3/client/oci8dp.h: err.h: OracleAdaptorChannel.h: ../GDLAccess/EOAdaptorChannel.h: OracleAdaptorContext.h: ../GDLAccess/EOAdaptorContext.h: ../GDLAccess/EOSQLExpression.h: ../GDLAccess/EOExpressionArray.h: ../GDLAccess/EOJoinTypes.h: SOPE/sope-gdl1/Oracle8/obj/OracleAdaptorContext.d0000644000000000000000000002723312242733417020432 0ustar rootrootobj/OracleAdaptorContext.o: OracleAdaptorContext.m OracleAdaptorContext.h \ /usr/include/GNUstep/Foundation/Foundation.h \ /usr/include/GNUstep/GNUstepBase/GSVersionMacros.h \ /usr/include/GNUstep/Foundation/FoundationErrors.h \ /usr/include/GNUstep/Foundation/NSObject.h \ /usr/include/GNUstep/Foundation/NSObjCRuntime.h \ /usr/include/GNUstep/GNUstepBase/preface.h \ /usr/include/GNUstep/GNUstepBase/objc-gnu2next.h \ /usr/include/GNUstep/GNUstepBase/GSConfig.h \ /usr/include/GNUstep/GNUstepBase/GSObjCRuntime.h \ /usr/include/GNUstep/Foundation/NSZone.h \ /usr/include/GNUstep/GNUstepBase/GNUstep.h \ /usr/include/GNUstep/Foundation/NSDate.h \ /usr/include/GNUstep/Foundation/NSDebug.h \ /usr/include/GNUstep/Foundation/NSProcessInfo.h \ /usr/include/GNUstep/Foundation/NSAffineTransform.h \ /usr/include/GNUstep/Foundation/NSGeometry.h \ /usr/include/GNUstep/Foundation/NSString.h \ /usr/include/GNUstep/Foundation/NSRange.h \ /usr/include/GNUstep/Foundation/NSArchiver.h \ /usr/include/GNUstep/Foundation/NSCoder.h \ /usr/include/GNUstep/Foundation/NSArray.h \ /usr/include/GNUstep/Foundation/NSAttributedString.h \ /usr/include/GNUstep/Foundation/NSDictionary.h \ /usr/include/GNUstep/Foundation/NSAutoreleasePool.h \ /usr/include/GNUstep/Foundation/NSBundle.h \ /usr/include/GNUstep/Foundation/NSByteOrder.h \ /usr/include/GNUstep/Foundation/NSCalendarDate.h \ /usr/include/GNUstep/Foundation/NSCharacterSet.h \ /usr/include/GNUstep/Foundation/NSClassDescription.h \ /usr/include/GNUstep/Foundation/NSException.h \ /usr/include/GNUstep/Foundation/NSComparisonPredicate.h \ /usr/include/GNUstep/Foundation/NSExpression.h \ /usr/include/GNUstep/Foundation/NSPredicate.h \ /usr/include/GNUstep/Foundation/NSCompoundPredicate.h \ /usr/include/GNUstep/Foundation/NSConnection.h \ /usr/include/GNUstep/Foundation/NSTimer.h \ /usr/include/GNUstep/Foundation/NSRunLoop.h \ /usr/include/GNUstep/Foundation/NSMapTable.h \ /usr/include/GNUstep/Foundation/NSData.h \ /usr/include/GNUstep/Foundation/NSSerialization.h \ /usr/include/GNUstep/Foundation/NSDateFormatter.h \ /usr/include/GNUstep/Foundation/NSFormatter.h \ /usr/include/GNUstep/Foundation/NSDecimalNumber.h \ /usr/include/GNUstep/Foundation/NSDecimal.h \ /usr/include/GNUstep/Foundation/NSValue.h \ /usr/include/GNUstep/Foundation/NSDistantObject.h \ /usr/include/GNUstep/Foundation/NSProxy.h \ /usr/include/GNUstep/Foundation/NSDistributedLock.h \ /usr/include/GNUstep/Foundation/NSDistributedNotificationCenter.h \ /usr/include/GNUstep/Foundation/NSLock.h \ /usr/include/GNUstep/Foundation/NSNotification.h \ /usr/include/GNUstep/Foundation/NSEnumerator.h \ /usr/include/GNUstep/Foundation/NSError.h \ /usr/include/GNUstep/Foundation/NSFileHandle.h \ /usr/include/GNUstep/Foundation/NSFileManager.h \ /usr/include/GNUstep/Foundation/NSHashTable.h \ /usr/include/GNUstep/Foundation/NSHost.h \ /usr/include/GNUstep/Foundation/NSHTTPCookie.h \ /usr/include/GNUstep/Foundation/NSHTTPCookieStorage.h \ /usr/include/GNUstep/Foundation/NSIndexPath.h \ /usr/include/GNUstep/Foundation/NSIndexSet.h \ /usr/include/GNUstep/Foundation/NSInvocation.h \ /usr/include/GNUstep/Foundation/NSMethodSignature.h \ /usr/include/GNUstep/Foundation/NSKeyedArchiver.h \ /usr/include/GNUstep/Foundation/NSPropertyList.h \ /usr/include/GNUstep/Foundation/NSKeyValueCoding.h \ /usr/include/GNUstep/Foundation/NSNotificationQueue.h \ /usr/include/GNUstep/Foundation/NSNetServices.h \ /usr/include/GNUstep/Foundation/NSNull.h \ /usr/include/GNUstep/Foundation/NSNumberFormatter.h \ /usr/include/GNUstep/Foundation/NSPathUtilities.h \ /usr/include/GNUstep/Foundation/NSPortCoder.h \ /usr/include/GNUstep/Foundation/NSPortMessage.h \ /usr/include/GNUstep/Foundation/NSPort.h \ /usr/include/GNUstep/Foundation/NSPortNameServer.h \ /usr/include/GNUstep/Foundation/NSProtocolChecker.h \ /usr/include/GNUstep/Foundation/NSScanner.h \ /usr/include/GNUstep/Foundation/NSSet.h \ /usr/include/GNUstep/Foundation/NSSortDescriptor.h \ /usr/include/GNUstep/Foundation/NSSpellServer.h \ /usr/include/GNUstep/Foundation/NSStream.h \ /usr/include/GNUstep/Foundation/NSTask.h \ /usr/include/GNUstep/Foundation/NSThread.h \ /usr/include/GNUstep/Foundation/NSTimeZone.h \ /usr/include/GNUstep/Foundation/NSUndoManager.h \ /usr/include/GNUstep/Foundation/NSURLAuthenticationChallenge.h \ /usr/include/GNUstep/Foundation/NSURLCache.h \ /usr/include/GNUstep/Foundation/NSURLConnection.h \ /usr/include/GNUstep/Foundation/NSURLCredential.h \ /usr/include/GNUstep/Foundation/NSURLCredentialStorage.h \ /usr/include/GNUstep/Foundation/NSURLDownload.h \ /usr/include/GNUstep/Foundation/NSURLError.h \ /usr/include/GNUstep/Foundation/NSURL.h \ /usr/include/GNUstep/Foundation/NSURLHandle.h \ /usr/include/GNUstep/Foundation/NSURLProtectionSpace.h \ /usr/include/GNUstep/Foundation/NSURLProtocol.h \ /usr/include/GNUstep/Foundation/NSURLRequest.h \ /usr/include/GNUstep/Foundation/NSURLResponse.h \ /usr/include/GNUstep/Foundation/NSUserDefaults.h \ /usr/include/GNUstep/Foundation/NSValueTransformer.h \ /usr/include/GNUstep/Foundation/NSXMLParser.h \ ../GDLAccess/EOAdaptorContext.h ../GDLAccess/EODelegateResponse.h \ OracleAdaptorChannel.h /usr/include/oracle/10.2.0.3/client/oci.h \ /usr/include/oracle/10.2.0.3/client/oratypes.h \ /usr/include/oracle/10.2.0.3/client/ocidfn.h \ /usr/include/oracle/10.2.0.3/client/oci1.h \ /usr/include/oracle/10.2.0.3/client/oro.h \ /usr/include/oracle/10.2.0.3/client/ori.h \ /usr/include/oracle/10.2.0.3/client/ort.h \ /usr/include/oracle/10.2.0.3/client/orl.h \ /usr/include/oracle/10.2.0.3/client/ociextp.h \ /usr/include/oracle/10.2.0.3/client/ociapr.h \ /usr/include/oracle/10.2.0.3/client/ociap.h \ /usr/include/oracle/10.2.0.3/client/nzt.h \ /usr/include/oracle/10.2.0.3/client/nzerror.h \ /usr/include/oracle/10.2.0.3/client/ocixmldb.h \ /usr/include/oracle/10.2.0.3/client/oci8dp.h \ ../GDLAccess/EOAdaptorChannel.h OracleAdaptorContext.h: /usr/include/GNUstep/Foundation/Foundation.h: /usr/include/GNUstep/GNUstepBase/GSVersionMacros.h: /usr/include/GNUstep/Foundation/FoundationErrors.h: /usr/include/GNUstep/Foundation/NSObject.h: /usr/include/GNUstep/Foundation/NSObjCRuntime.h: /usr/include/GNUstep/GNUstepBase/preface.h: /usr/include/GNUstep/GNUstepBase/objc-gnu2next.h: /usr/include/GNUstep/GNUstepBase/GSConfig.h: /usr/include/GNUstep/GNUstepBase/GSObjCRuntime.h: /usr/include/GNUstep/Foundation/NSZone.h: /usr/include/GNUstep/GNUstepBase/GNUstep.h: /usr/include/GNUstep/Foundation/NSDate.h: /usr/include/GNUstep/Foundation/NSDebug.h: /usr/include/GNUstep/Foundation/NSProcessInfo.h: /usr/include/GNUstep/Foundation/NSAffineTransform.h: /usr/include/GNUstep/Foundation/NSGeometry.h: /usr/include/GNUstep/Foundation/NSString.h: /usr/include/GNUstep/Foundation/NSRange.h: /usr/include/GNUstep/Foundation/NSArchiver.h: /usr/include/GNUstep/Foundation/NSCoder.h: /usr/include/GNUstep/Foundation/NSArray.h: /usr/include/GNUstep/Foundation/NSAttributedString.h: /usr/include/GNUstep/Foundation/NSDictionary.h: /usr/include/GNUstep/Foundation/NSAutoreleasePool.h: /usr/include/GNUstep/Foundation/NSBundle.h: /usr/include/GNUstep/Foundation/NSByteOrder.h: /usr/include/GNUstep/Foundation/NSCalendarDate.h: /usr/include/GNUstep/Foundation/NSCharacterSet.h: /usr/include/GNUstep/Foundation/NSClassDescription.h: /usr/include/GNUstep/Foundation/NSException.h: /usr/include/GNUstep/Foundation/NSComparisonPredicate.h: /usr/include/GNUstep/Foundation/NSExpression.h: /usr/include/GNUstep/Foundation/NSPredicate.h: /usr/include/GNUstep/Foundation/NSCompoundPredicate.h: /usr/include/GNUstep/Foundation/NSConnection.h: /usr/include/GNUstep/Foundation/NSTimer.h: /usr/include/GNUstep/Foundation/NSRunLoop.h: /usr/include/GNUstep/Foundation/NSMapTable.h: /usr/include/GNUstep/Foundation/NSData.h: /usr/include/GNUstep/Foundation/NSSerialization.h: /usr/include/GNUstep/Foundation/NSDateFormatter.h: /usr/include/GNUstep/Foundation/NSFormatter.h: /usr/include/GNUstep/Foundation/NSDecimalNumber.h: /usr/include/GNUstep/Foundation/NSDecimal.h: /usr/include/GNUstep/Foundation/NSValue.h: /usr/include/GNUstep/Foundation/NSDistantObject.h: /usr/include/GNUstep/Foundation/NSProxy.h: /usr/include/GNUstep/Foundation/NSDistributedLock.h: /usr/include/GNUstep/Foundation/NSDistributedNotificationCenter.h: /usr/include/GNUstep/Foundation/NSLock.h: /usr/include/GNUstep/Foundation/NSNotification.h: /usr/include/GNUstep/Foundation/NSEnumerator.h: /usr/include/GNUstep/Foundation/NSError.h: /usr/include/GNUstep/Foundation/NSFileHandle.h: /usr/include/GNUstep/Foundation/NSFileManager.h: /usr/include/GNUstep/Foundation/NSHashTable.h: /usr/include/GNUstep/Foundation/NSHost.h: /usr/include/GNUstep/Foundation/NSHTTPCookie.h: /usr/include/GNUstep/Foundation/NSHTTPCookieStorage.h: /usr/include/GNUstep/Foundation/NSIndexPath.h: /usr/include/GNUstep/Foundation/NSIndexSet.h: /usr/include/GNUstep/Foundation/NSInvocation.h: /usr/include/GNUstep/Foundation/NSMethodSignature.h: /usr/include/GNUstep/Foundation/NSKeyedArchiver.h: /usr/include/GNUstep/Foundation/NSPropertyList.h: /usr/include/GNUstep/Foundation/NSKeyValueCoding.h: /usr/include/GNUstep/Foundation/NSNotificationQueue.h: /usr/include/GNUstep/Foundation/NSNetServices.h: /usr/include/GNUstep/Foundation/NSNull.h: /usr/include/GNUstep/Foundation/NSNumberFormatter.h: /usr/include/GNUstep/Foundation/NSPathUtilities.h: /usr/include/GNUstep/Foundation/NSPortCoder.h: /usr/include/GNUstep/Foundation/NSPortMessage.h: /usr/include/GNUstep/Foundation/NSPort.h: /usr/include/GNUstep/Foundation/NSPortNameServer.h: /usr/include/GNUstep/Foundation/NSProtocolChecker.h: /usr/include/GNUstep/Foundation/NSScanner.h: /usr/include/GNUstep/Foundation/NSSet.h: /usr/include/GNUstep/Foundation/NSSortDescriptor.h: /usr/include/GNUstep/Foundation/NSSpellServer.h: /usr/include/GNUstep/Foundation/NSStream.h: /usr/include/GNUstep/Foundation/NSTask.h: /usr/include/GNUstep/Foundation/NSThread.h: /usr/include/GNUstep/Foundation/NSTimeZone.h: /usr/include/GNUstep/Foundation/NSUndoManager.h: /usr/include/GNUstep/Foundation/NSURLAuthenticationChallenge.h: /usr/include/GNUstep/Foundation/NSURLCache.h: /usr/include/GNUstep/Foundation/NSURLConnection.h: /usr/include/GNUstep/Foundation/NSURLCredential.h: /usr/include/GNUstep/Foundation/NSURLCredentialStorage.h: /usr/include/GNUstep/Foundation/NSURLDownload.h: /usr/include/GNUstep/Foundation/NSURLError.h: /usr/include/GNUstep/Foundation/NSURL.h: /usr/include/GNUstep/Foundation/NSURLHandle.h: /usr/include/GNUstep/Foundation/NSURLProtectionSpace.h: /usr/include/GNUstep/Foundation/NSURLProtocol.h: /usr/include/GNUstep/Foundation/NSURLRequest.h: /usr/include/GNUstep/Foundation/NSURLResponse.h: /usr/include/GNUstep/Foundation/NSUserDefaults.h: /usr/include/GNUstep/Foundation/NSValueTransformer.h: /usr/include/GNUstep/Foundation/NSXMLParser.h: ../GDLAccess/EOAdaptorContext.h: ../GDLAccess/EODelegateResponse.h: OracleAdaptorChannel.h: /usr/include/oracle/10.2.0.3/client/oci.h: /usr/include/oracle/10.2.0.3/client/oratypes.h: /usr/include/oracle/10.2.0.3/client/ocidfn.h: /usr/include/oracle/10.2.0.3/client/oci1.h: /usr/include/oracle/10.2.0.3/client/oro.h: /usr/include/oracle/10.2.0.3/client/ori.h: /usr/include/oracle/10.2.0.3/client/ort.h: /usr/include/oracle/10.2.0.3/client/orl.h: /usr/include/oracle/10.2.0.3/client/ociextp.h: /usr/include/oracle/10.2.0.3/client/ociapr.h: /usr/include/oracle/10.2.0.3/client/ociap.h: /usr/include/oracle/10.2.0.3/client/nzt.h: /usr/include/oracle/10.2.0.3/client/nzerror.h: /usr/include/oracle/10.2.0.3/client/ocixmldb.h: /usr/include/oracle/10.2.0.3/client/oci8dp.h: ../GDLAccess/EOAdaptorChannel.h: SOPE/sope-gdl1/Oracle8/obj/OracleAdaptorChannel.d0000644000000000000000000003042712242733417020355 0ustar rootrootobj/OracleAdaptorChannel.o: OracleAdaptorChannel.m OracleAdaptorChannel.h \ /usr/include/oracle/10.2.0.3/client/oci.h \ /usr/include/oracle/10.2.0.3/client/oratypes.h \ /usr/include/oracle/10.2.0.3/client/ocidfn.h \ /usr/include/oracle/10.2.0.3/client/oci1.h \ /usr/include/oracle/10.2.0.3/client/oro.h \ /usr/include/oracle/10.2.0.3/client/ori.h \ /usr/include/oracle/10.2.0.3/client/ort.h \ /usr/include/oracle/10.2.0.3/client/orl.h \ /usr/include/oracle/10.2.0.3/client/ociextp.h \ /usr/include/oracle/10.2.0.3/client/ociapr.h \ /usr/include/oracle/10.2.0.3/client/ociap.h \ /usr/include/oracle/10.2.0.3/client/nzt.h \ /usr/include/oracle/10.2.0.3/client/nzerror.h \ /usr/include/oracle/10.2.0.3/client/ocixmldb.h \ /usr/include/oracle/10.2.0.3/client/oci8dp.h \ ../GDLAccess/EOAdaptorChannel.h \ /usr/include/GNUstep/Foundation/NSObject.h \ /usr/include/GNUstep/Foundation/NSObjCRuntime.h \ /usr/include/GNUstep/GNUstepBase/GSVersionMacros.h \ /usr/include/GNUstep/GNUstepBase/preface.h \ /usr/include/GNUstep/GNUstepBase/objc-gnu2next.h \ /usr/include/GNUstep/GNUstepBase/GSConfig.h \ /usr/include/GNUstep/GNUstepBase/GSObjCRuntime.h \ /usr/include/GNUstep/Foundation/NSZone.h \ /usr/include/GNUstep/GNUstepBase/GNUstep.h \ /usr/include/GNUstep/Foundation/NSDate.h \ ../GDLAccess/EODelegateResponse.h err.h OracleAdaptor.h \ /usr/include/GNUstep/Foundation/Foundation.h \ /usr/include/GNUstep/Foundation/FoundationErrors.h \ /usr/include/GNUstep/Foundation/NSDebug.h \ /usr/include/GNUstep/Foundation/NSProcessInfo.h \ /usr/include/GNUstep/Foundation/NSAffineTransform.h \ /usr/include/GNUstep/Foundation/NSGeometry.h \ /usr/include/GNUstep/Foundation/NSString.h \ /usr/include/GNUstep/Foundation/NSRange.h \ /usr/include/GNUstep/Foundation/NSArchiver.h \ /usr/include/GNUstep/Foundation/NSCoder.h \ /usr/include/GNUstep/Foundation/NSArray.h \ /usr/include/GNUstep/Foundation/NSAttributedString.h \ /usr/include/GNUstep/Foundation/NSDictionary.h \ /usr/include/GNUstep/Foundation/NSAutoreleasePool.h \ /usr/include/GNUstep/Foundation/NSBundle.h \ /usr/include/GNUstep/Foundation/NSByteOrder.h \ /usr/include/GNUstep/Foundation/NSCalendarDate.h \ /usr/include/GNUstep/Foundation/NSCharacterSet.h \ /usr/include/GNUstep/Foundation/NSClassDescription.h \ /usr/include/GNUstep/Foundation/NSException.h \ /usr/include/GNUstep/Foundation/NSComparisonPredicate.h \ /usr/include/GNUstep/Foundation/NSExpression.h \ /usr/include/GNUstep/Foundation/NSPredicate.h \ /usr/include/GNUstep/Foundation/NSCompoundPredicate.h \ /usr/include/GNUstep/Foundation/NSConnection.h \ /usr/include/GNUstep/Foundation/NSTimer.h \ /usr/include/GNUstep/Foundation/NSRunLoop.h \ /usr/include/GNUstep/Foundation/NSMapTable.h \ /usr/include/GNUstep/Foundation/NSData.h \ /usr/include/GNUstep/Foundation/NSSerialization.h \ /usr/include/GNUstep/Foundation/NSDateFormatter.h \ /usr/include/GNUstep/Foundation/NSFormatter.h \ /usr/include/GNUstep/Foundation/NSDecimalNumber.h \ /usr/include/GNUstep/Foundation/NSDecimal.h \ /usr/include/GNUstep/Foundation/NSValue.h \ /usr/include/GNUstep/Foundation/NSDistantObject.h \ /usr/include/GNUstep/Foundation/NSProxy.h \ /usr/include/GNUstep/Foundation/NSDistributedLock.h \ /usr/include/GNUstep/Foundation/NSDistributedNotificationCenter.h \ /usr/include/GNUstep/Foundation/NSLock.h \ /usr/include/GNUstep/Foundation/NSNotification.h \ /usr/include/GNUstep/Foundation/NSEnumerator.h \ /usr/include/GNUstep/Foundation/NSError.h \ /usr/include/GNUstep/Foundation/NSFileHandle.h \ /usr/include/GNUstep/Foundation/NSFileManager.h \ /usr/include/GNUstep/Foundation/NSHashTable.h \ /usr/include/GNUstep/Foundation/NSHost.h \ /usr/include/GNUstep/Foundation/NSHTTPCookie.h \ /usr/include/GNUstep/Foundation/NSHTTPCookieStorage.h \ /usr/include/GNUstep/Foundation/NSIndexPath.h \ /usr/include/GNUstep/Foundation/NSIndexSet.h \ /usr/include/GNUstep/Foundation/NSInvocation.h \ /usr/include/GNUstep/Foundation/NSMethodSignature.h \ /usr/include/GNUstep/Foundation/NSKeyedArchiver.h \ /usr/include/GNUstep/Foundation/NSPropertyList.h \ /usr/include/GNUstep/Foundation/NSKeyValueCoding.h \ /usr/include/GNUstep/Foundation/NSNotificationQueue.h \ /usr/include/GNUstep/Foundation/NSNetServices.h \ /usr/include/GNUstep/Foundation/NSNull.h \ /usr/include/GNUstep/Foundation/NSNumberFormatter.h \ /usr/include/GNUstep/Foundation/NSPathUtilities.h \ /usr/include/GNUstep/Foundation/NSPortCoder.h \ /usr/include/GNUstep/Foundation/NSPortMessage.h \ /usr/include/GNUstep/Foundation/NSPort.h \ /usr/include/GNUstep/Foundation/NSPortNameServer.h \ /usr/include/GNUstep/Foundation/NSProtocolChecker.h \ /usr/include/GNUstep/Foundation/NSScanner.h \ /usr/include/GNUstep/Foundation/NSSet.h \ /usr/include/GNUstep/Foundation/NSSortDescriptor.h \ /usr/include/GNUstep/Foundation/NSSpellServer.h \ /usr/include/GNUstep/Foundation/NSStream.h \ /usr/include/GNUstep/Foundation/NSTask.h \ /usr/include/GNUstep/Foundation/NSThread.h \ /usr/include/GNUstep/Foundation/NSTimeZone.h \ /usr/include/GNUstep/Foundation/NSUndoManager.h \ /usr/include/GNUstep/Foundation/NSURLAuthenticationChallenge.h \ /usr/include/GNUstep/Foundation/NSURLCache.h \ /usr/include/GNUstep/Foundation/NSURLConnection.h \ /usr/include/GNUstep/Foundation/NSURLCredential.h \ /usr/include/GNUstep/Foundation/NSURLCredentialStorage.h \ /usr/include/GNUstep/Foundation/NSURLDownload.h \ /usr/include/GNUstep/Foundation/NSURLError.h \ /usr/include/GNUstep/Foundation/NSURL.h \ /usr/include/GNUstep/Foundation/NSURLHandle.h \ /usr/include/GNUstep/Foundation/NSURLProtectionSpace.h \ /usr/include/GNUstep/Foundation/NSURLProtocol.h \ /usr/include/GNUstep/Foundation/NSURLRequest.h \ /usr/include/GNUstep/Foundation/NSURLResponse.h \ /usr/include/GNUstep/Foundation/NSUserDefaults.h \ /usr/include/GNUstep/Foundation/NSValueTransformer.h \ /usr/include/GNUstep/Foundation/NSXMLParser.h ../GDLAccess/EOAdaptor.h \ OracleAdaptorChannelController.h ../GDLAccess/EOEntity.h \ ../../sope-core/EOControl/EOClassDescription.h \ ../../sope-core/EOControl/EOGlobalID.h OracleAdaptorContext.h \ ../GDLAccess/EOAdaptorContext.h EOAttribute+Oracle.h \ ../GDLAccess/EOAttribute.h \ ../../sope-core/NGExtensions/NGExtensions/NSObject+Logs.h OracleAdaptorChannel.h: /usr/include/oracle/10.2.0.3/client/oci.h: /usr/include/oracle/10.2.0.3/client/oratypes.h: /usr/include/oracle/10.2.0.3/client/ocidfn.h: /usr/include/oracle/10.2.0.3/client/oci1.h: /usr/include/oracle/10.2.0.3/client/oro.h: /usr/include/oracle/10.2.0.3/client/ori.h: /usr/include/oracle/10.2.0.3/client/ort.h: /usr/include/oracle/10.2.0.3/client/orl.h: /usr/include/oracle/10.2.0.3/client/ociextp.h: /usr/include/oracle/10.2.0.3/client/ociapr.h: /usr/include/oracle/10.2.0.3/client/ociap.h: /usr/include/oracle/10.2.0.3/client/nzt.h: /usr/include/oracle/10.2.0.3/client/nzerror.h: /usr/include/oracle/10.2.0.3/client/ocixmldb.h: /usr/include/oracle/10.2.0.3/client/oci8dp.h: ../GDLAccess/EOAdaptorChannel.h: /usr/include/GNUstep/Foundation/NSObject.h: /usr/include/GNUstep/Foundation/NSObjCRuntime.h: /usr/include/GNUstep/GNUstepBase/GSVersionMacros.h: /usr/include/GNUstep/GNUstepBase/preface.h: /usr/include/GNUstep/GNUstepBase/objc-gnu2next.h: /usr/include/GNUstep/GNUstepBase/GSConfig.h: /usr/include/GNUstep/GNUstepBase/GSObjCRuntime.h: /usr/include/GNUstep/Foundation/NSZone.h: /usr/include/GNUstep/GNUstepBase/GNUstep.h: /usr/include/GNUstep/Foundation/NSDate.h: ../GDLAccess/EODelegateResponse.h: err.h: OracleAdaptor.h: /usr/include/GNUstep/Foundation/Foundation.h: /usr/include/GNUstep/Foundation/FoundationErrors.h: /usr/include/GNUstep/Foundation/NSDebug.h: /usr/include/GNUstep/Foundation/NSProcessInfo.h: /usr/include/GNUstep/Foundation/NSAffineTransform.h: /usr/include/GNUstep/Foundation/NSGeometry.h: /usr/include/GNUstep/Foundation/NSString.h: /usr/include/GNUstep/Foundation/NSRange.h: /usr/include/GNUstep/Foundation/NSArchiver.h: /usr/include/GNUstep/Foundation/NSCoder.h: /usr/include/GNUstep/Foundation/NSArray.h: /usr/include/GNUstep/Foundation/NSAttributedString.h: /usr/include/GNUstep/Foundation/NSDictionary.h: /usr/include/GNUstep/Foundation/NSAutoreleasePool.h: /usr/include/GNUstep/Foundation/NSBundle.h: /usr/include/GNUstep/Foundation/NSByteOrder.h: /usr/include/GNUstep/Foundation/NSCalendarDate.h: /usr/include/GNUstep/Foundation/NSCharacterSet.h: /usr/include/GNUstep/Foundation/NSClassDescription.h: /usr/include/GNUstep/Foundation/NSException.h: /usr/include/GNUstep/Foundation/NSComparisonPredicate.h: /usr/include/GNUstep/Foundation/NSExpression.h: /usr/include/GNUstep/Foundation/NSPredicate.h: /usr/include/GNUstep/Foundation/NSCompoundPredicate.h: /usr/include/GNUstep/Foundation/NSConnection.h: /usr/include/GNUstep/Foundation/NSTimer.h: /usr/include/GNUstep/Foundation/NSRunLoop.h: /usr/include/GNUstep/Foundation/NSMapTable.h: /usr/include/GNUstep/Foundation/NSData.h: /usr/include/GNUstep/Foundation/NSSerialization.h: /usr/include/GNUstep/Foundation/NSDateFormatter.h: /usr/include/GNUstep/Foundation/NSFormatter.h: /usr/include/GNUstep/Foundation/NSDecimalNumber.h: /usr/include/GNUstep/Foundation/NSDecimal.h: /usr/include/GNUstep/Foundation/NSValue.h: /usr/include/GNUstep/Foundation/NSDistantObject.h: /usr/include/GNUstep/Foundation/NSProxy.h: /usr/include/GNUstep/Foundation/NSDistributedLock.h: /usr/include/GNUstep/Foundation/NSDistributedNotificationCenter.h: /usr/include/GNUstep/Foundation/NSLock.h: /usr/include/GNUstep/Foundation/NSNotification.h: /usr/include/GNUstep/Foundation/NSEnumerator.h: /usr/include/GNUstep/Foundation/NSError.h: /usr/include/GNUstep/Foundation/NSFileHandle.h: /usr/include/GNUstep/Foundation/NSFileManager.h: /usr/include/GNUstep/Foundation/NSHashTable.h: /usr/include/GNUstep/Foundation/NSHost.h: /usr/include/GNUstep/Foundation/NSHTTPCookie.h: /usr/include/GNUstep/Foundation/NSHTTPCookieStorage.h: /usr/include/GNUstep/Foundation/NSIndexPath.h: /usr/include/GNUstep/Foundation/NSIndexSet.h: /usr/include/GNUstep/Foundation/NSInvocation.h: /usr/include/GNUstep/Foundation/NSMethodSignature.h: /usr/include/GNUstep/Foundation/NSKeyedArchiver.h: /usr/include/GNUstep/Foundation/NSPropertyList.h: /usr/include/GNUstep/Foundation/NSKeyValueCoding.h: /usr/include/GNUstep/Foundation/NSNotificationQueue.h: /usr/include/GNUstep/Foundation/NSNetServices.h: /usr/include/GNUstep/Foundation/NSNull.h: /usr/include/GNUstep/Foundation/NSNumberFormatter.h: /usr/include/GNUstep/Foundation/NSPathUtilities.h: /usr/include/GNUstep/Foundation/NSPortCoder.h: /usr/include/GNUstep/Foundation/NSPortMessage.h: /usr/include/GNUstep/Foundation/NSPort.h: /usr/include/GNUstep/Foundation/NSPortNameServer.h: /usr/include/GNUstep/Foundation/NSProtocolChecker.h: /usr/include/GNUstep/Foundation/NSScanner.h: /usr/include/GNUstep/Foundation/NSSet.h: /usr/include/GNUstep/Foundation/NSSortDescriptor.h: /usr/include/GNUstep/Foundation/NSSpellServer.h: /usr/include/GNUstep/Foundation/NSStream.h: /usr/include/GNUstep/Foundation/NSTask.h: /usr/include/GNUstep/Foundation/NSThread.h: /usr/include/GNUstep/Foundation/NSTimeZone.h: /usr/include/GNUstep/Foundation/NSUndoManager.h: /usr/include/GNUstep/Foundation/NSURLAuthenticationChallenge.h: /usr/include/GNUstep/Foundation/NSURLCache.h: /usr/include/GNUstep/Foundation/NSURLConnection.h: /usr/include/GNUstep/Foundation/NSURLCredential.h: /usr/include/GNUstep/Foundation/NSURLCredentialStorage.h: /usr/include/GNUstep/Foundation/NSURLDownload.h: /usr/include/GNUstep/Foundation/NSURLError.h: /usr/include/GNUstep/Foundation/NSURL.h: /usr/include/GNUstep/Foundation/NSURLHandle.h: /usr/include/GNUstep/Foundation/NSURLProtectionSpace.h: /usr/include/GNUstep/Foundation/NSURLProtocol.h: /usr/include/GNUstep/Foundation/NSURLRequest.h: /usr/include/GNUstep/Foundation/NSURLResponse.h: /usr/include/GNUstep/Foundation/NSUserDefaults.h: /usr/include/GNUstep/Foundation/NSValueTransformer.h: /usr/include/GNUstep/Foundation/NSXMLParser.h: ../GDLAccess/EOAdaptor.h: OracleAdaptorChannelController.h: ../GDLAccess/EOEntity.h: ../../sope-core/EOControl/EOClassDescription.h: ../../sope-core/EOControl/EOGlobalID.h: OracleAdaptorContext.h: ../GDLAccess/EOAdaptorContext.h: EOAttribute+Oracle.h: ../GDLAccess/EOAttribute.h: ../../sope-core/NGExtensions/NGExtensions/NSObject+Logs.h: SOPE/sope-gdl1/Oracle8/obj/OracleAdaptor.d0000644000000000000000000003006112242733417017056 0ustar rootrootobj/OracleAdaptor.o: OracleAdaptor.m OracleAdaptor.h \ /usr/include/GNUstep/Foundation/Foundation.h \ /usr/include/GNUstep/GNUstepBase/GSVersionMacros.h \ /usr/include/GNUstep/Foundation/FoundationErrors.h \ /usr/include/GNUstep/Foundation/NSObject.h \ /usr/include/GNUstep/Foundation/NSObjCRuntime.h \ /usr/include/GNUstep/GNUstepBase/preface.h \ /usr/include/GNUstep/GNUstepBase/objc-gnu2next.h \ /usr/include/GNUstep/GNUstepBase/GSConfig.h \ /usr/include/GNUstep/GNUstepBase/GSObjCRuntime.h \ /usr/include/GNUstep/Foundation/NSZone.h \ /usr/include/GNUstep/GNUstepBase/GNUstep.h \ /usr/include/GNUstep/Foundation/NSDate.h \ /usr/include/GNUstep/Foundation/NSDebug.h \ /usr/include/GNUstep/Foundation/NSProcessInfo.h \ /usr/include/GNUstep/Foundation/NSAffineTransform.h \ /usr/include/GNUstep/Foundation/NSGeometry.h \ /usr/include/GNUstep/Foundation/NSString.h \ /usr/include/GNUstep/Foundation/NSRange.h \ /usr/include/GNUstep/Foundation/NSArchiver.h \ /usr/include/GNUstep/Foundation/NSCoder.h \ /usr/include/GNUstep/Foundation/NSArray.h \ /usr/include/GNUstep/Foundation/NSAttributedString.h \ /usr/include/GNUstep/Foundation/NSDictionary.h \ /usr/include/GNUstep/Foundation/NSAutoreleasePool.h \ /usr/include/GNUstep/Foundation/NSBundle.h \ /usr/include/GNUstep/Foundation/NSByteOrder.h \ /usr/include/GNUstep/Foundation/NSCalendarDate.h \ /usr/include/GNUstep/Foundation/NSCharacterSet.h \ /usr/include/GNUstep/Foundation/NSClassDescription.h \ /usr/include/GNUstep/Foundation/NSException.h \ /usr/include/GNUstep/Foundation/NSComparisonPredicate.h \ /usr/include/GNUstep/Foundation/NSExpression.h \ /usr/include/GNUstep/Foundation/NSPredicate.h \ /usr/include/GNUstep/Foundation/NSCompoundPredicate.h \ /usr/include/GNUstep/Foundation/NSConnection.h \ /usr/include/GNUstep/Foundation/NSTimer.h \ /usr/include/GNUstep/Foundation/NSRunLoop.h \ /usr/include/GNUstep/Foundation/NSMapTable.h \ /usr/include/GNUstep/Foundation/NSData.h \ /usr/include/GNUstep/Foundation/NSSerialization.h \ /usr/include/GNUstep/Foundation/NSDateFormatter.h \ /usr/include/GNUstep/Foundation/NSFormatter.h \ /usr/include/GNUstep/Foundation/NSDecimalNumber.h \ /usr/include/GNUstep/Foundation/NSDecimal.h \ /usr/include/GNUstep/Foundation/NSValue.h \ /usr/include/GNUstep/Foundation/NSDistantObject.h \ /usr/include/GNUstep/Foundation/NSProxy.h \ /usr/include/GNUstep/Foundation/NSDistributedLock.h \ /usr/include/GNUstep/Foundation/NSDistributedNotificationCenter.h \ /usr/include/GNUstep/Foundation/NSLock.h \ /usr/include/GNUstep/Foundation/NSNotification.h \ /usr/include/GNUstep/Foundation/NSEnumerator.h \ /usr/include/GNUstep/Foundation/NSError.h \ /usr/include/GNUstep/Foundation/NSFileHandle.h \ /usr/include/GNUstep/Foundation/NSFileManager.h \ /usr/include/GNUstep/Foundation/NSHashTable.h \ /usr/include/GNUstep/Foundation/NSHost.h \ /usr/include/GNUstep/Foundation/NSHTTPCookie.h \ /usr/include/GNUstep/Foundation/NSHTTPCookieStorage.h \ /usr/include/GNUstep/Foundation/NSIndexPath.h \ /usr/include/GNUstep/Foundation/NSIndexSet.h \ /usr/include/GNUstep/Foundation/NSInvocation.h \ /usr/include/GNUstep/Foundation/NSMethodSignature.h \ /usr/include/GNUstep/Foundation/NSKeyedArchiver.h \ /usr/include/GNUstep/Foundation/NSPropertyList.h \ /usr/include/GNUstep/Foundation/NSKeyValueCoding.h \ /usr/include/GNUstep/Foundation/NSNotificationQueue.h \ /usr/include/GNUstep/Foundation/NSNetServices.h \ /usr/include/GNUstep/Foundation/NSNull.h \ /usr/include/GNUstep/Foundation/NSNumberFormatter.h \ /usr/include/GNUstep/Foundation/NSPathUtilities.h \ /usr/include/GNUstep/Foundation/NSPortCoder.h \ /usr/include/GNUstep/Foundation/NSPortMessage.h \ /usr/include/GNUstep/Foundation/NSPort.h \ /usr/include/GNUstep/Foundation/NSPortNameServer.h \ /usr/include/GNUstep/Foundation/NSProtocolChecker.h \ /usr/include/GNUstep/Foundation/NSScanner.h \ /usr/include/GNUstep/Foundation/NSSet.h \ /usr/include/GNUstep/Foundation/NSSortDescriptor.h \ /usr/include/GNUstep/Foundation/NSSpellServer.h \ /usr/include/GNUstep/Foundation/NSStream.h \ /usr/include/GNUstep/Foundation/NSTask.h \ /usr/include/GNUstep/Foundation/NSThread.h \ /usr/include/GNUstep/Foundation/NSTimeZone.h \ /usr/include/GNUstep/Foundation/NSUndoManager.h \ /usr/include/GNUstep/Foundation/NSURLAuthenticationChallenge.h \ /usr/include/GNUstep/Foundation/NSURLCache.h \ /usr/include/GNUstep/Foundation/NSURLConnection.h \ /usr/include/GNUstep/Foundation/NSURLCredential.h \ /usr/include/GNUstep/Foundation/NSURLCredentialStorage.h \ /usr/include/GNUstep/Foundation/NSURLDownload.h \ /usr/include/GNUstep/Foundation/NSURLError.h \ /usr/include/GNUstep/Foundation/NSURL.h \ /usr/include/GNUstep/Foundation/NSURLHandle.h \ /usr/include/GNUstep/Foundation/NSURLProtectionSpace.h \ /usr/include/GNUstep/Foundation/NSURLProtocol.h \ /usr/include/GNUstep/Foundation/NSURLRequest.h \ /usr/include/GNUstep/Foundation/NSURLResponse.h \ /usr/include/GNUstep/Foundation/NSUserDefaults.h \ /usr/include/GNUstep/Foundation/NSValueTransformer.h \ /usr/include/GNUstep/Foundation/NSXMLParser.h ../GDLAccess/EOAdaptor.h \ OracleAdaptorChannel.h /usr/include/oracle/10.2.0.3/client/oci.h \ /usr/include/oracle/10.2.0.3/client/oratypes.h \ /usr/include/oracle/10.2.0.3/client/ocidfn.h \ /usr/include/oracle/10.2.0.3/client/oci1.h \ /usr/include/oracle/10.2.0.3/client/oro.h \ /usr/include/oracle/10.2.0.3/client/ori.h \ /usr/include/oracle/10.2.0.3/client/ort.h \ /usr/include/oracle/10.2.0.3/client/orl.h \ /usr/include/oracle/10.2.0.3/client/ociextp.h \ /usr/include/oracle/10.2.0.3/client/ociapr.h \ /usr/include/oracle/10.2.0.3/client/ociap.h \ /usr/include/oracle/10.2.0.3/client/nzt.h \ /usr/include/oracle/10.2.0.3/client/nzerror.h \ /usr/include/oracle/10.2.0.3/client/ocixmldb.h \ /usr/include/oracle/10.2.0.3/client/oci8dp.h \ ../GDLAccess/EOAdaptorChannel.h ../GDLAccess/EODelegateResponse.h \ OracleAdaptorContext.h ../GDLAccess/EOAdaptorContext.h \ OracleSQLExpression.h ../GDLAccess/EOSQLExpression.h \ ../GDLAccess/EOExpressionArray.h ../GDLAccess/EOJoinTypes.h \ OracleValues.h ../GDLAccess/EOAttribute.h OracleAdaptor.h: /usr/include/GNUstep/Foundation/Foundation.h: /usr/include/GNUstep/GNUstepBase/GSVersionMacros.h: /usr/include/GNUstep/Foundation/FoundationErrors.h: /usr/include/GNUstep/Foundation/NSObject.h: /usr/include/GNUstep/Foundation/NSObjCRuntime.h: /usr/include/GNUstep/GNUstepBase/preface.h: /usr/include/GNUstep/GNUstepBase/objc-gnu2next.h: /usr/include/GNUstep/GNUstepBase/GSConfig.h: /usr/include/GNUstep/GNUstepBase/GSObjCRuntime.h: /usr/include/GNUstep/Foundation/NSZone.h: /usr/include/GNUstep/GNUstepBase/GNUstep.h: /usr/include/GNUstep/Foundation/NSDate.h: /usr/include/GNUstep/Foundation/NSDebug.h: /usr/include/GNUstep/Foundation/NSProcessInfo.h: /usr/include/GNUstep/Foundation/NSAffineTransform.h: /usr/include/GNUstep/Foundation/NSGeometry.h: /usr/include/GNUstep/Foundation/NSString.h: /usr/include/GNUstep/Foundation/NSRange.h: /usr/include/GNUstep/Foundation/NSArchiver.h: /usr/include/GNUstep/Foundation/NSCoder.h: /usr/include/GNUstep/Foundation/NSArray.h: /usr/include/GNUstep/Foundation/NSAttributedString.h: /usr/include/GNUstep/Foundation/NSDictionary.h: /usr/include/GNUstep/Foundation/NSAutoreleasePool.h: /usr/include/GNUstep/Foundation/NSBundle.h: /usr/include/GNUstep/Foundation/NSByteOrder.h: /usr/include/GNUstep/Foundation/NSCalendarDate.h: /usr/include/GNUstep/Foundation/NSCharacterSet.h: /usr/include/GNUstep/Foundation/NSClassDescription.h: /usr/include/GNUstep/Foundation/NSException.h: /usr/include/GNUstep/Foundation/NSComparisonPredicate.h: /usr/include/GNUstep/Foundation/NSExpression.h: /usr/include/GNUstep/Foundation/NSPredicate.h: /usr/include/GNUstep/Foundation/NSCompoundPredicate.h: /usr/include/GNUstep/Foundation/NSConnection.h: /usr/include/GNUstep/Foundation/NSTimer.h: /usr/include/GNUstep/Foundation/NSRunLoop.h: /usr/include/GNUstep/Foundation/NSMapTable.h: /usr/include/GNUstep/Foundation/NSData.h: /usr/include/GNUstep/Foundation/NSSerialization.h: /usr/include/GNUstep/Foundation/NSDateFormatter.h: /usr/include/GNUstep/Foundation/NSFormatter.h: /usr/include/GNUstep/Foundation/NSDecimalNumber.h: /usr/include/GNUstep/Foundation/NSDecimal.h: /usr/include/GNUstep/Foundation/NSValue.h: /usr/include/GNUstep/Foundation/NSDistantObject.h: /usr/include/GNUstep/Foundation/NSProxy.h: /usr/include/GNUstep/Foundation/NSDistributedLock.h: /usr/include/GNUstep/Foundation/NSDistributedNotificationCenter.h: /usr/include/GNUstep/Foundation/NSLock.h: /usr/include/GNUstep/Foundation/NSNotification.h: /usr/include/GNUstep/Foundation/NSEnumerator.h: /usr/include/GNUstep/Foundation/NSError.h: /usr/include/GNUstep/Foundation/NSFileHandle.h: /usr/include/GNUstep/Foundation/NSFileManager.h: /usr/include/GNUstep/Foundation/NSHashTable.h: /usr/include/GNUstep/Foundation/NSHost.h: /usr/include/GNUstep/Foundation/NSHTTPCookie.h: /usr/include/GNUstep/Foundation/NSHTTPCookieStorage.h: /usr/include/GNUstep/Foundation/NSIndexPath.h: /usr/include/GNUstep/Foundation/NSIndexSet.h: /usr/include/GNUstep/Foundation/NSInvocation.h: /usr/include/GNUstep/Foundation/NSMethodSignature.h: /usr/include/GNUstep/Foundation/NSKeyedArchiver.h: /usr/include/GNUstep/Foundation/NSPropertyList.h: /usr/include/GNUstep/Foundation/NSKeyValueCoding.h: /usr/include/GNUstep/Foundation/NSNotificationQueue.h: /usr/include/GNUstep/Foundation/NSNetServices.h: /usr/include/GNUstep/Foundation/NSNull.h: /usr/include/GNUstep/Foundation/NSNumberFormatter.h: /usr/include/GNUstep/Foundation/NSPathUtilities.h: /usr/include/GNUstep/Foundation/NSPortCoder.h: /usr/include/GNUstep/Foundation/NSPortMessage.h: /usr/include/GNUstep/Foundation/NSPort.h: /usr/include/GNUstep/Foundation/NSPortNameServer.h: /usr/include/GNUstep/Foundation/NSProtocolChecker.h: /usr/include/GNUstep/Foundation/NSScanner.h: /usr/include/GNUstep/Foundation/NSSet.h: /usr/include/GNUstep/Foundation/NSSortDescriptor.h: /usr/include/GNUstep/Foundation/NSSpellServer.h: /usr/include/GNUstep/Foundation/NSStream.h: /usr/include/GNUstep/Foundation/NSTask.h: /usr/include/GNUstep/Foundation/NSThread.h: /usr/include/GNUstep/Foundation/NSTimeZone.h: /usr/include/GNUstep/Foundation/NSUndoManager.h: /usr/include/GNUstep/Foundation/NSURLAuthenticationChallenge.h: /usr/include/GNUstep/Foundation/NSURLCache.h: /usr/include/GNUstep/Foundation/NSURLConnection.h: /usr/include/GNUstep/Foundation/NSURLCredential.h: /usr/include/GNUstep/Foundation/NSURLCredentialStorage.h: /usr/include/GNUstep/Foundation/NSURLDownload.h: /usr/include/GNUstep/Foundation/NSURLError.h: /usr/include/GNUstep/Foundation/NSURL.h: /usr/include/GNUstep/Foundation/NSURLHandle.h: /usr/include/GNUstep/Foundation/NSURLProtectionSpace.h: /usr/include/GNUstep/Foundation/NSURLProtocol.h: /usr/include/GNUstep/Foundation/NSURLRequest.h: /usr/include/GNUstep/Foundation/NSURLResponse.h: /usr/include/GNUstep/Foundation/NSUserDefaults.h: /usr/include/GNUstep/Foundation/NSValueTransformer.h: /usr/include/GNUstep/Foundation/NSXMLParser.h: ../GDLAccess/EOAdaptor.h: OracleAdaptorChannel.h: /usr/include/oracle/10.2.0.3/client/oci.h: /usr/include/oracle/10.2.0.3/client/oratypes.h: /usr/include/oracle/10.2.0.3/client/ocidfn.h: /usr/include/oracle/10.2.0.3/client/oci1.h: /usr/include/oracle/10.2.0.3/client/oro.h: /usr/include/oracle/10.2.0.3/client/ori.h: /usr/include/oracle/10.2.0.3/client/ort.h: /usr/include/oracle/10.2.0.3/client/orl.h: /usr/include/oracle/10.2.0.3/client/ociextp.h: /usr/include/oracle/10.2.0.3/client/ociapr.h: /usr/include/oracle/10.2.0.3/client/ociap.h: /usr/include/oracle/10.2.0.3/client/nzt.h: /usr/include/oracle/10.2.0.3/client/nzerror.h: /usr/include/oracle/10.2.0.3/client/ocixmldb.h: /usr/include/oracle/10.2.0.3/client/oci8dp.h: ../GDLAccess/EOAdaptorChannel.h: ../GDLAccess/EODelegateResponse.h: OracleAdaptorContext.h: ../GDLAccess/EOAdaptorContext.h: OracleSQLExpression.h: ../GDLAccess/EOSQLExpression.h: ../GDLAccess/EOExpressionArray.h: ../GDLAccess/EOJoinTypes.h: OracleValues.h: ../GDLAccess/EOAttribute.h: SOPE/sope-gdl1/Oracle8/obj/EOAttribute+Oracle.d0000644000000000000000000000536312242733417017735 0ustar rootrootobj/EOAttribute+Oracle.o: EOAttribute+Oracle.m EOAttribute+Oracle.h \ ../GDLAccess/EOAttribute.h /usr/include/GNUstep/Foundation/NSString.h \ /usr/include/GNUstep/GNUstepBase/GSVersionMacros.h \ /usr/include/GNUstep/Foundation/NSObject.h \ /usr/include/GNUstep/Foundation/NSObjCRuntime.h \ /usr/include/GNUstep/GNUstepBase/preface.h \ /usr/include/GNUstep/GNUstepBase/objc-gnu2next.h \ /usr/include/GNUstep/GNUstepBase/GSConfig.h \ /usr/include/GNUstep/GNUstepBase/GSObjCRuntime.h \ /usr/include/GNUstep/Foundation/NSZone.h \ /usr/include/GNUstep/GNUstepBase/GNUstep.h \ /usr/include/GNUstep/Foundation/NSDate.h \ /usr/include/GNUstep/Foundation/NSRange.h \ /usr/include/GNUstep/Foundation/NSDictionary.h \ /usr/include/oracle/10.2.0.3/client/oci.h \ /usr/include/oracle/10.2.0.3/client/oratypes.h \ /usr/include/oracle/10.2.0.3/client/ocidfn.h \ /usr/include/oracle/10.2.0.3/client/oci1.h \ /usr/include/oracle/10.2.0.3/client/oro.h \ /usr/include/oracle/10.2.0.3/client/ori.h \ /usr/include/oracle/10.2.0.3/client/ort.h \ /usr/include/oracle/10.2.0.3/client/orl.h \ /usr/include/oracle/10.2.0.3/client/ociextp.h \ /usr/include/oracle/10.2.0.3/client/ociapr.h \ /usr/include/oracle/10.2.0.3/client/ociap.h \ /usr/include/oracle/10.2.0.3/client/nzt.h \ /usr/include/oracle/10.2.0.3/client/nzerror.h \ /usr/include/oracle/10.2.0.3/client/ocixmldb.h \ /usr/include/oracle/10.2.0.3/client/oci8dp.h EOAttribute+Oracle.h: ../GDLAccess/EOAttribute.h: /usr/include/GNUstep/Foundation/NSString.h: /usr/include/GNUstep/GNUstepBase/GSVersionMacros.h: /usr/include/GNUstep/Foundation/NSObject.h: /usr/include/GNUstep/Foundation/NSObjCRuntime.h: /usr/include/GNUstep/GNUstepBase/preface.h: /usr/include/GNUstep/GNUstepBase/objc-gnu2next.h: /usr/include/GNUstep/GNUstepBase/GSConfig.h: /usr/include/GNUstep/GNUstepBase/GSObjCRuntime.h: /usr/include/GNUstep/Foundation/NSZone.h: /usr/include/GNUstep/GNUstepBase/GNUstep.h: /usr/include/GNUstep/Foundation/NSDate.h: /usr/include/GNUstep/Foundation/NSRange.h: /usr/include/GNUstep/Foundation/NSDictionary.h: /usr/include/oracle/10.2.0.3/client/oci.h: /usr/include/oracle/10.2.0.3/client/oratypes.h: /usr/include/oracle/10.2.0.3/client/ocidfn.h: /usr/include/oracle/10.2.0.3/client/oci1.h: /usr/include/oracle/10.2.0.3/client/oro.h: /usr/include/oracle/10.2.0.3/client/ori.h: /usr/include/oracle/10.2.0.3/client/ort.h: /usr/include/oracle/10.2.0.3/client/orl.h: /usr/include/oracle/10.2.0.3/client/ociextp.h: /usr/include/oracle/10.2.0.3/client/ociapr.h: /usr/include/oracle/10.2.0.3/client/ociap.h: /usr/include/oracle/10.2.0.3/client/nzt.h: /usr/include/oracle/10.2.0.3/client/nzerror.h: /usr/include/oracle/10.2.0.3/client/ocixmldb.h: /usr/include/oracle/10.2.0.3/client/oci8dp.h: SOPE/sope-gdl1/MySQL/0000755000000000000000000000000012242733417013067 5ustar rootrootSOPE/sope-gdl1/MySQL/test.eomodel0000644000000000000000000000131612242733417015415 0ustar rootroot{ EOModelVersion = 1; adaptorClassName = SQLiteAdaptor; adaptorName = SQLite3; entities = ( { /* CREATE TABLE my_table ( pkey INT PRIMARY KEY ); */ name = MyEntity; externalName = my_table; className = EOGenericRecord; primaryKeyAttributes = ( pkey ); attributesUsedForLocking = ( pkey ); classProperties = ( pkey ); attributes = ( { valueClassName = NSNumber; columnName = pkey; name = pkey; valueType = i; externalType = INT; // t_id }, ); } ); } SOPE/sope-gdl1/MySQL/NSCalendarDate+MySQL4Val.m0000644000000000000000000001563012242733417017512 0ustar rootroot/* NSCalendarDate+MySQL4Val.m Copyright (C) 2003-2005 SKYRIX Software AG Author: Helge Hess (helge.hess@skyrix.com) This file is part of the MySQL4 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import #include #include "MySQL4Channel.h" #include "common.h" #if COCOA_Foundation_LIBRARY || NeXT_Foundation_LIBRARY @interface NSCalendarDate(UsedPrivates) - (id)initWithTimeIntervalSince1970:(NSTimeInterval)_tv; @end #endif static NSString *MYSQL4_DATETIME_FORMAT = @"%b %d %Y %I:%M:%S:000%p"; @implementation NSCalendarDate(MySQL4Values) /* Format: '2001-07-26 14:00:00+02' '2001-07-26 14:00:00+09:30' 0123456789012345678901234 Matthew: "07/25/2003 06:00:00 CDT". */ static NSTimeZone *DefServerTimezone = nil; #if 0 static NSTimeZone *gmt = nil; static NSTimeZone *gmt01 = nil; static NSTimeZone *gmt02 = nil; #endif - (id)initWithMySQL4Field:(MYSQL_FIELD *)_field value:(const void *)_v length:(int)_len { NSString *s; NSString *calfmt; s = [[NSString alloc] initWithCString:_v length:_len]; // Unicode calfmt = nil; // TODO: avoid using format strings switch (_len) { // as suggested by SQLClient case 14: calfmt = @"%Y%m%d%H%M%S"; break; case 12: calfmt = @"%y%m%d%H%M%S"; break; case 10: calfmt = @"%y%m%d%H%M"; break; case 8: calfmt = @"%y%m%d%H"; break; case 6: calfmt = @"%y%m%d"; break; case 4: calfmt = @"%y%m"; break; default: calfmt = _len > 14 ? @"%Y-%m-%d %H:%M:%S" : @"%y"; break; } if ((self = [self initWithString:s calendarFormat:calfmt]) == nil) { NSLog(@"WARNING(%s): got no value for string '%@' format '%@'.", __PRETTY_FUNCTION__, s, calfmt); } [s release]; [self setCalendarFormat:MYSQL4_DATETIME_FORMAT]; return self; } #if 0 - (id)initWithMySQL4Data:(const void *)_value length:(int)_length { static unsigned char buf[28]; // reused buffer, THREAD const char *_cstr = _value; unsigned char *p; NSTimeZone *attrTZ; NSCalendarDate *date; int year, month, day, hour, min, sec, tzOffset; if (_length == 0) return nil; if (_length != 22 && _length != 25) { NSLog(@"ERROR(%s): unexpected date string '%s', returning now" @" (expected format: '2001-07-26 14:00:00+02')", __PRETTY_FUNCTION__, _cstr); return [NSCalendarDate date]; } strncpy(buf, _cstr, 25); buf[25] = '\0'; /* perform on reverse, so that we don't overwrite with null-terminators */ if (_length == 22) { p = &(buf[19]); tzOffset = atoi(p) * 60; } else if (_length >= 25) { int mins; p = &(buf[23]); mins = atoi(p); buf[22] = '\0'; // the ':' p = &(buf[19]); tzOffset = atoi(p) * 60; tzOffset = tzOffset > 0 ? (tzOffset + mins) : (tzOffset - mins); } p = &(buf[17]); buf[19] = '\0'; sec = atoi(p); p = &(buf[14]); buf[16] = '\0'; min = atoi(p); p = &(buf[11]); buf[13] = '\0'; hour = atoi(p); p = &(buf[8]); buf[10] = '\0'; day = atoi(p); p = &(buf[5]); buf[7] = '\0'; month = atoi(p); p = &(buf[0]); buf[4] = '\0'; year = atoi(p); /* TODO: cache all timezones (just 26 ;-) */ switch (tzOffset) { case 0: if (gmt == nil) { gmt = [[NSTimeZone timeZoneForSecondsFromGMT:0] retain]; NSAssert(gmt, @"could not create GMT timezone?!"); } attrTZ = gmt; break; case 60: if (gmt01 == nil) { gmt01 = [[NSTimeZone timeZoneForSecondsFromGMT:3600] retain]; NSAssert(gmt01, @"could not create GMT+01 timezone?!"); } attrTZ = gmt01; break; case 120: if (gmt02 == nil) { gmt02 = [[NSTimeZone timeZoneForSecondsFromGMT:7200] retain]; NSAssert(gmt02, @"could not create GMT+02 timezone?!"); } attrTZ = gmt02; break; default: { /* cache the first, "alternative" timezone */ static int firstTZOffset = 0; // can use 0 since GMT is a separate case static NSTimeZone *firstTZ = nil; if (firstTZOffset == 0) { firstTZOffset = tzOffset; firstTZ = [[NSTimeZone timeZoneForSecondsFromGMT:(tzOffset*60)] retain]; } attrTZ = (firstTZOffset == tzOffset) ? firstTZ : [NSTimeZone timeZoneForSecondsFromGMT:(tzOffset * 60)]; break; } } if (NSCalDateClass == Nil) NSCalDateClass = [NSCalendarDate class]; date = [NSCalDateClass dateWithYear:year month:month day:day hour:hour minute:min second:sec timeZone:attrTZ]; if (date == nil) { NSLog(@"ERROR(%s): could not construct date from string '%s': " @"year=%i,month=%i,day=%i,hour=%i,minute=%i,second=%i, tz=%@", __PRETTY_FUNCTION__, _cstr, year, month, day, hour, min, sec, attrTZ); } return date; } #endif /* generating value */ - (NSString *)stringValueForMySQL4Type:(NSString *)_type attribute:(EOAttribute *)_attribute { #if 0 NSString *format; #endif EOQuotedExpression *expr; NSTimeZone *serverTimeZone; NSString *format; NSString *val; unsigned len; unichar c1; if ((len = [_type length]) == 0) c1 = 0; else c1 = [_type characterAtIndex:0]; if (c1 == 'i' || c1 == 'I') { // INTEGER char buf[64]; sprintf(buf, "%d", ((unsigned int)[self timeIntervalSince1970])); return [NSString stringWithCString:buf]; } if (c1 == 'r' || c1 == 'R') { // REAL char buf[64]; // TODO: check format sprintf(buf, "%f", [self timeIntervalSince1970]); return [NSString stringWithCString:buf]; } if ((serverTimeZone = [_attribute serverTimeZone]) == nil ) { if (DefServerTimezone == nil) { DefServerTimezone = [[NSTimeZone localTimeZone] retain]; NSLog(@"Note: MySQL4 adaptor using timezone '%@' as default", DefServerTimezone); } serverTimeZone = DefServerTimezone; } #if 0 format = [_attribute calendarFormat]; #else /* hm, why is that? */ format = @"%Y-%m-%d %H:%M:%S%z"; #endif if (format == nil) format = MYSQL4_DATETIME_FORMAT; [self setTimeZone:serverTimeZone]; val = [self descriptionWithCalendarFormat:format]; expr = [[EOQuotedExpression alloc] initWithExpression:val quote:@"\'" escape:@"\\'"]; val = [[expr expressionValueForContext:nil] retain]; [expr release]; return [val autorelease]; } @end /* NSCalendarDate(MySQL4Values) */ SOPE/sope-gdl1/MySQL/MySQL4Adaptor.h0000644000000000000000000000375512242733417015616 0ustar rootroot/* MySQL4Adaptor.h Copyright (C) 2003-2005 SKYRIX Software AG Author: Helge Hess (helge.hess@skyrix.com) This file is part of the MySQL4 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ___MySQL4_Adaptor_H___ #define ___MySQL4_Adaptor_H___ /* The MySQL4 adaptor. The connection dictionary of this adaptor understands these keys: hostName port options userName password databaseName */ #import #import #import @class NSString, NSMutableDictionary; @interface MySQL4Adaptor : EOAdaptor { } - (id)initWithName:(NSString *)_name; // connection management - (NSString *)serverName; - (NSString *)loginName; - (NSString *)loginPassword; - (NSString *)databaseName; - (NSString *)port; - (NSString *)options; - (NSString *)newKeyExpression; // sequence for primary key generation - (NSString *)primaryKeySequenceName; // value formatting - (id)formatValue:(id)value forAttribute:(EOAttribute *)attribute; // attribute typing - (BOOL)attributeAllowedInDistinctSelects:(EOAttribute *)_attr; // classes used - (Class)adaptorContextClass; // MySQL4Context - (Class)adaptorChannelClass; // MySQL4Channel - (Class)expressionClass; // MySQL4Expression @end #endif SOPE/sope-gdl1/MySQL/fhs.make0000644000000000000000000000122512242733417014506 0ustar rootroot# postprocessing # FHS support (this is a hack and is going to be done by gstep-make!) ifneq ($(FHS_INSTALL_ROOT),) FHS_LIB_DIR=$(CONFIGURE_FHS_INSTALL_LIBDIR) FHS_DB_DIR=$(FHS_LIB_DIR)sope-$(SOPE_MAJOR_VERSION).$(SOPE_MINOR_VERSION)/dbadaptors/ fhs-db-dirs :: $(MKDIRS) $(FHS_DB_DIR) move-bundles-to-fhs :: fhs-db-dirs @echo "moving bundles $(BUNDLE_INSTALL_DIR) to $(FHS_DB_DIR) .." for i in $(BUNDLE_NAME); do \ j="$(FHS_DB_DIR)/$${i}$(BUNDLE_EXTENSION)"; \ if test -d $$j; then rm -r $$j; fi; \ mv "$(BUNDLE_INSTALL_DIR)/$${i}$(BUNDLE_EXTENSION)" $$j; \ done move-to-fhs :: move-bundles-to-fhs after-install :: move-to-fhs endif SOPE/sope-gdl1/MySQL/README0000644000000000000000000000166312242733417013755 0ustar rootroot# MySQL4 Adaptor Note: this is far from being complete! The adaptor is currently a fork of the MySQL4 adaptor. http://sql-info.de/mysql/gotchas.html TODO ==== - implement Basics ====== Open a Shell: mysql --password=abc > use OGo > insert schema > select * from date_x; Configure the Adaptor (below does not work yet for MySQL4!) Defaults write ogo-webui-1.0a LSAdaptor MySQL4 Defaults write ogo-webui-1.0a LSConnectionDictionary \ '{ databaseName = OGo; }' Defaults write ogo-webui-1.0a PKeyGeneratorDictionary \ "{ newKeyExpression=\"select nextval(\\'key_generator\\');\" }" MySQL4DebugEnabled Setup gdltest Database ====================== mysql --password=abc > create database Test; > use Test; > CREATE TABLE my_table ( pkey INT PRIMARY KEY ); Notes ===== mysql_store_result - does not block the server, full result in memory vs mysql_use_result - does block the server, one row in memory SOPE/sope-gdl1/MySQL/MySQL4Exception.h0000644000000000000000000000262712242733417016157 0ustar rootroot/* MySQL4Exception.h Copyright (C) 1999-2005 MDlink online service center GmbH and Helge Hess Author: Helge Hess (helge@mdlink.de) This file is part of the MySQL4 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ___MySQL4_Exception_H___ #define ___MySQL4_Exception_H___ #import @interface MySQL4Exception : NSException { } + (void)raiseWithFormat:(NSString *)_format, ...; @end @interface MySQL4CouldNotOpenChannelException : MySQL4Exception { } @end @interface MySQL4CouldNotConnectException : MySQL4CouldNotOpenChannelException { } @end @interface MySQL4CouldNotBindException : MySQL4Exception { } @end #endif /* ___MySQL4_Exception_H___ */ SOPE/sope-gdl1/MySQL/MySQL4Values.h0000644000000000000000000000412412242733417015452 0ustar rootroot/* MySQL4Values.h Copyright (C) 1999-2005 MDlink online service center GmbH and Helge Hess Author: Helge Hess (helge@mdlink.de) This file is part of the MySQL4 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ___MySQL4_Values_H___ #define ___MySQL4_Values_H___ #import #import #import #import #import #import "MySQL4Exception.h" #include @class EOAttribute; @class MySQL4Channel; @interface MySQL4DataTypeMappingException : MySQL4Exception - (id)initWithObject:(id)_obj forAttribute:(EOAttribute *)_attr andMySQL4Type:(NSString *)_dt inChannel:(MySQL4Channel *)_channel; @end @protocol MySQL4Values - (NSString *)stringValueForMySQL4Type:(NSString *)_type attribute:(EOAttribute *)_attribute; @end @interface NSObject(MySQL4Values) - (id)initWithMySQL4Field:(MYSQL_FIELD *)_field value:(const void *)_v length:(int)_len; @end @interface NSString(MySQL4Values) < MySQL4Values > @end @interface NSNumber(MySQL4Values) < MySQL4Values > @end @interface NSData(MySQL4Values) < MySQL4Values > @end @interface NSCalendarDate(MySQL4Values) < MySQL4Values > @end @interface EONull(MySQL4Values) - (NSString *)stringValueForMySQL4Type:(NSString *)_type attribute:(EOAttribute *)_attribute; @end #endif /* ___MySQL4_Values_H___ */ SOPE/sope-gdl1/MySQL/GNUmakefile0000644000000000000000000000336712242733417015152 0ustar rootroot# # GNUmakefile # # Copyright (C) 2005 Helge Hess # # Author: Helge Hess (helge.hess@opengroupware.org) # # This file is part of the MySQL4 Adaptor Library # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; see the file COPYING.LIB. # If not, write to the Free Software Foundation, # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. include ../../config.make include $(GNUSTEP_MAKEFILES)/common.make include ../Version include ./Version BUNDLE_NAME = MySQL MySQL_PCH_FILE = common.h MySQL_OBJC_FILES = \ MySQL4Expression.m \ MySQL4Adaptor.m \ MySQL4Context.m \ MySQL4Channel.m \ MySQL4Channel+Model.m \ MySQL4Exception.m \ MySQL4Values.m \ NSString+MySQL4.m \ EOAttribute+MySQL4.m \ NSString+MySQL4Val.m \ NSData+MySQL4Val.m \ NSCalendarDate+MySQL4Val.m \ NSNumber+MySQL4Val.m \ MySQL_PRINCIPAL_CLASS = MySQL4Adaptor BUNDLE_INSTALL = MySQL # Use .gdladaptor as the bundle extension BUNDLE_EXTENSION = .gdladaptor MySQL_RESOURCE_FILES += Version # tool TOOL_NAME = gdltest gdltest_OBJC_FILES = gdltest.m -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/bundle.make ifeq ($(test),yes) include $(GNUSTEP_MAKEFILES)/tool.make endif -include GNUmakefile.postamble SOPE/sope-gdl1/MySQL/condict.plist0000644000000000000000000000015212242733417015565 0ustar rootroot{ hostName = "127.0.0.1"; userName = "OGo"; password = "OGo"; databaseName = "OGo"; } SOPE/sope-gdl1/MySQL/MySQL4Expression.m0000644000000000000000000000537612242733417016371 0ustar rootroot/* MySQL4Expression.m Copyright (C) 2003-2005 Helge Hess Author: Helge Hess (helge.hess@opengroupware.org) This file is part of the MySQL4 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include "MySQL4Expression.h" @implementation MySQL4Expression + (Class)selectExpressionClass { return [MySQL4SelectSQLExpression class]; } @end /* MySQL4Expression */ @implementation MySQL4SelectSQLExpression - (id)selectExpressionForAttributes:(NSArray *)attributes lock:(BOOL)flag qualifier:(EOSQLQualifier *)qualifier fetchOrder:(NSArray *)fetchOrder channel:(EOAdaptorChannel *)channel { lock = flag; [super selectExpressionForAttributes:attributes lock:flag qualifier:qualifier fetchOrder:fetchOrder channel:channel]; return self; } - (NSString *)fromClause { NSMutableString *fromClause; NSEnumerator *enumerator; BOOL first = YES; id key; fromClause = [NSMutableString stringWithCString:" "]; enumerator = [fromListEntities objectEnumerator]; // Compute the FROM list from all the aliases found in // entitiesAndPropertiesAliases dictionary. Note that this dictionary // contains entities and relationships. The last ones are there for // flattened attributes over reflexive relationships. while((key = [enumerator nextObject])) { if(first) first = NO; else [fromClause appendString:@", "]; [fromClause appendFormat:@"%@ %@", [key isKindOfClass:[EORelationship class]] ? [[key destinationEntity] externalName] // flattened attribute : [key externalName], // EOEntity [entitiesAndPropertiesAliases objectForKey:key]]; #if 0 if (lock) [fromClause appendString:@" HOLDLOCK"]; #endif } return fromClause; } @end /* MySQL4SelectSQLExpression */ void __link_MySQL4Expression() { // used to force linking of object file __link_MySQL4Expression(); } SOPE/sope-gdl1/MySQL/MySQL4Exception.m0000644000000000000000000000324112242733417016155 0ustar rootroot/* MySQL4Exception.m Copyright (C) 2003-2005 Helge Hess Author: Helge Hess (helge.hess@opengroupware.org) This file is part of the MySQL4 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import #import "MySQL4Exception.h" #include "common.h" @implementation MySQL4Exception + (void)raiseWithFormat:(NSString *)_format, ... { NSString *tmp = nil; va_list ap; va_start(ap, _format); tmp = [[NSString allocWithZone:[self zone]] initWithFormat:_format arguments:ap]; va_end(ap); AUTORELEASE(tmp); [[[self alloc] initWithName:NSStringFromClass([self class]) reason:tmp userInfo:nil] raise]; } @end @implementation MySQL4CouldNotOpenChannelException @end @implementation MySQL4CouldNotConnectException @end @implementation MySQL4CouldNotBindException @end void __link_MySQL4Exception() { // used to force linking of object file __link_MySQL4Exception(); } SOPE/sope-gdl1/MySQL/MySQL4Adaptor.m0000644000000000000000000000774512242733417015626 0ustar rootroot/* MySQL4Adaptor.m Copyright (C) 2003-2005 SKYRIX Software AG Author: Helge Hess (helge.hess@skyrix.com) This file is part of the MySQL4 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "MySQL4Adaptor.h" #include "MySQL4Context.h" #include "MySQL4Channel.h" #include "MySQL4Expression.h" #include "MySQL4Values.h" #include "common.h" @implementation MySQL4Adaptor - (id)initWithName:(NSString *)_name { if ((self = [super initWithName:_name])) { } return self; } /* NSCopying methods */ - (id)copyWithZone:(NSZone *)_zone { return [self retain]; } /* connections */ - (NSString *)_copyOfConDictString:(NSString *)_key { return [[[[self connectionDictionary] objectForKey:_key] copy] autorelease]; } - (NSString *)serverName { NSString *serverName; serverName = [[self connectionDictionary] objectForKey:@"hostName"]; #if 0 // do not default to something, to allow for sockets? if (serverName == nil) serverName = @"127.0.0.1"; #endif return [[serverName copy] autorelease]; } - (NSString *)loginName { return [self _copyOfConDictString:@"userName"]; } - (NSString *)loginPassword { return [self _copyOfConDictString:@"password"]; } - (NSString *)databaseName { return [[[[self connectionDictionary] objectForKey:@"databaseName"] copy] autorelease]; } - (NSString *)port { return [self _copyOfConDictString:@"port"]; } - (NSString *)options { return [[[[self connectionDictionary] objectForKey:@"options"] copy] autorelease]; } /* sequence for primary key generation */ - (NSString *)primaryKeySequenceName { NSString *seqName; seqName = [[self pkeyGeneratorDictionary] objectForKey:@"primaryKeySequenceName"]; return [[seqName copy] autorelease]; } - (NSString *)newKeyExpression { NSString *newKeyExpr; newKeyExpr = [[self pkeyGeneratorDictionary] objectForKey:@"newKeyExpression"]; return [[newKeyExpr copy] autorelease]; } /* formatting */ - (NSString *)charConvertExpressionForAttributeNamed:(NSString *)_attrName { return _attrName; } - (id)formatValue:(id)value forAttribute:(EOAttribute *)attribute { NSString *result; result = [value stringValueForMySQL4Type:[attribute externalType] attribute:attribute]; //NSLog(@"formatting value %@ result %@", value, result); //NSLog(@" value class %@ attr %@ attr type %@", // [value class], attribute, [attribute externalType]); return result; } - (BOOL)attributeAllowedInDistinctSelects:(EOAttribute *)_attr { return YES; } /* types */ - (BOOL)isValidQualifierType:(NSString *)_typeName { return YES; } /* adaptor info */ - (Class)adaptorContextClass { return [MySQL4Context class]; } - (Class)adaptorChannelClass { return [MySQL4Channel class]; } - (Class)expressionClass { return [MySQL4Expression class]; } @end /* MySQL4Adaptor */ void __linkMySQL4Adaptor(void) { extern void __link_EOAttributeMySQL4(); extern void __link_NSStringMySQL4(); extern void __link_MySQL4ChannelModel(); extern void __link_MySQL4Values(); ; [MySQL4Channel class]; [MySQL4Context class]; [MySQL4Exception class]; [MySQL4Expression class]; __link_EOAttributeMySQL4(); __link_NSStringMySQL4(); //__link_MySQL4ChannelModel(); __link_MySQL4Values(); __linkMySQL4Adaptor(); } SOPE/sope-gdl1/MySQL/ChangeLog0000644000000000000000000000501112242733417014636 0ustar rootroot2011-11-02 Francis Lachapelle * NSNumber+MySQL4Val.m (-stringValueForMySQL4Type:attribute:): boolean values are now converted to 0 or 1, as in NSNumber+PGVal.m. 2010-10-07 Wolfgang Sourdeau * EOAttribute+MySQL4.m (-loadValueClassAndTypeUsingMySQL4Type:size:modification:binary:): invalidated method. (-loadValueClassForExternalMySQL4Type:) idem. * NSNumber+MySQL4Val.m (-): added support for unsigned types. * MySQL4Channel.m (-describeResults): added support for unsigned types. 2006-07-24 Helge Hess * MySQL4Channel+Model.m: added SHOW TABLES to retrieve MySQL table names (v4.5.14) 2006-07-04 Helge Hess * use %p for pointer formats, fixed gcc 4.1 warnings (v4.5.13) 2005-07-29 Helge Hess * v4.5.12 * NSData+MySQL4Val.m: fixed handling of NSData rows (proper init was missing) * MySQL4Values.m: improved logging of unsupported types 2005-07-27 Helge Hess * fixed gcc 4.0 warnings (char signedness) (v4.5.11) 2005-04-23 Helge Hess * GNUmakefile.preamble: fixed include flags (v4.5.10) 2005-04-21 Helge Hess * v4.5.9 * GNUmakefile.preamble: use mysql_config --cflags instead of --include, the former is also available with MySQL 3.x * MySQL4Channel.m: added a -describeResults: method to allow descriptions without beautified names 2005-04-20 Helge Hess * MySQL4Channel.m: only warn if the character set could not be changed to UTF-8 (v4.5.8) * renamed MySQL4 adaptor to MySQL to avoid confusion (v4.5.7) 2005-04-19 Helge Hess * v4.5.6 * MySQL4Channel.m: added support for primary key generation * NSNumber+MySQL4Val.m: added support for basic number types * v4.5.5 * MySQL4Values.m: added a workaround to support NSTemporaryString * MySQL4Channel.m: fixed errno result handling * MySQL4Adaptor.m: do not fall back to PGHOST variable if not hostname is set 2005-04-13 Helge Hess * MySQL4Channel.m: finished fetching code (v4.5.4) 2005-04-12 Helge Hess * MySQL4Channel.m: added some fetch result processing (v4.5.3) 2005-04-12 Helge Hess * MySQL4Channel.m: implemented query (v4.5.2) 2005-04-11 Helge Hess * started MySQL4 adaptor based on SQLite one (v4.5.1) SOPE/sope-gdl1/MySQL/MySQL4Channel.h0000644000000000000000000000451612242733417015570 0ustar rootroot/* MySQL4Channel.h Copyright (C) 2003-2005 Helge Hess Author: Helge Hess (helge.hess@opengroupware.org) This file is part of the MySQL4 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ___MySQL4_Channel_H___ #define ___MySQL4_Channel_H___ #import @class NSArray, NSString, NSMutableDictionary; @interface MySQL4Channel : EOAdaptorChannel { // connection is valid after an openChannel call void *_connection; void *results; void *fields; int fieldCount; #if 0 int tupleCount; BOOL containsBinaryData; NSString *cmdStatus; NSString *cmdTuples; NSString *oidStatus; int currentTuple; #endif // turns on/off channel debugging BOOL isDebuggingEnabled; NSMutableDictionary *_attributesForTableName; NSMutableDictionary *_primaryKeysNamesForTableName; } - (void)setDebugEnabled:(BOOL)_flag; - (BOOL)isDebugEnabled; - (BOOL)isOpen; - (BOOL)openChannel; - (void)closeChannel; - (NSMutableDictionary *)primaryFetchAttributes:(NSArray *)_attributes withZone:(NSZone *)_zone; - (BOOL)evaluateExpression:(NSString *)_expression; // cancelFetch is always called to terminate a fetch // (even by primaryFetchAttributes) // it frees all fetch-local variables - (void)cancelFetch; // uses dataFormat type information to create EOAttribute objects - (NSArray *)describeResults; @end @interface NSObject(Sybase10ChannelDelegate) - (NSArray*)sqlite3Channel:(MySQL4Channel *)channel willFetchAttributes:(NSArray *)attributes; - (BOOL)sqlite3Channel:(MySQL4Channel *)channel willReturnRow:(NSDictionary *)row; @end #endif /* ___MySQL4_Channel_H___ */ SOPE/sope-gdl1/MySQL/MySQL4Values.m0000644000000000000000000001143712242733417015464 0ustar rootroot/* MySQL4Values.m Copyright (C) 1999-2005 MDlink online service center GmbH and Helge Hess Author: Helge Hess (helge@mdlink.de) This file is part of the MySQL4 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "MySQL4Values.h" #include "common.h" #include @implementation MySQL4DataTypeMappingException - (id)initWithObject:(id)_obj forAttribute:(EOAttribute *)_attr andMySQL4Type:(NSString *)_dt inChannel:(MySQL4Channel *)_channel; { NSDictionary *ui; NSString *typeName = nil; NSString *r; typeName = _dt; if (typeName == nil) typeName = [NSString stringWithFormat:@"Oid[%i]", _dt]; r = [NSString stringWithFormat: @"mapping between %@ and " @"MySQL4 type %@ is not supported", [_obj description], NSStringFromClass([_obj class]), typeName]; ui = [NSDictionary dictionaryWithObjectsAndKeys: _attr, @"attribute", _channel, @"channel", _obj, @"object", nil]; return [self initWithName:@"DataTypeMappingNotSupported" reason:r userInfo:ui]; } @end /* MySQL4DataTypeMappingException */ @implementation NSNull(MySQL4Values) - (NSString *)stringValueForMySQL4Type:(NSString *)_type attribute:(EOAttribute *)_attribute { return @"null"; } @end /* NSNull(MySQL4Values) */ @implementation NSObject(MySQL4Values) - (id)initWithMySQL4Field:(MYSQL_FIELD *)_field value:(const void *)_v length:(int)_len { /* Note: called for NSTemporaryString! */ if (![self respondsToSelector:@selector(initWithUTF8String:)]) { if (_v == NULL) { [self release]; return nil; } NSLog(@"WARNING(%s): %@ falling back to NSString for MySQL4 value" @" (type %i, 0x%p, len=%d)", __PRETTY_FUNCTION__, NSStringFromClass([self class]), _field->type, _v, _len); [self release]; return [[NSString alloc] initWithMySQL4Field:_field value:_v length:_len]; } /* we assume NSTemporaryString here */ switch (_field->type) { case FIELD_TYPE_BLOB: case FIELD_TYPE_TINY_BLOB: case FIELD_TYPE_MEDIUM_BLOB: case FIELD_TYPE_LONG_BLOB: ; /* fall through */ default: /* we always fallback to the UTF-8 string ... */ return [(NSString *)self initWithUTF8String:_v]; } } #if 0 - (id)initWithMySQL4Int:(int)_value { if ([self respondsToSelector:@selector(initWithInt:)]) return [(NSNumber *)self initWithInt:_value]; if ([self respondsToSelector:@selector(initWithDouble:)]) return [(NSNumber *)self initWithDouble:_value]; if ([self respondsToSelector:@selector(initWithString:)]) { NSString *s; char buf[256]; sprintf(buf, "%i", _value); s = [[NSString alloc] initWithCString:buf]; self = [(NSString *)self initWithString:s]; [s release]; return self; } [self release]; return nil; } - (id)initWithMySQL4Double:(double)_value { if ([self respondsToSelector:@selector(initWithDouble:)]) return [(NSNumber *)self initWithDouble:_value]; [self release]; return nil; } - (id)initWithMySQL4Text:(const unsigned char *)_value { if ([self respondsToSelector:@selector(initWithString:)]) { NSString *s; s = [[NSString alloc] initWithUTF8String:_value]; self = [(NSString *)self initWithString:s]; [s release]; return self; } [self release]; return nil; } - (id)initWithMySQL4Data:(const void *)_data length:(int)_length { if ([self respondsToSelector:@selector(initWithBytes:length:)]) return [(NSData *)self initWithBytes:_data length:_length]; if ([self respondsToSelector:@selector(initWithData:)]) { NSData *d; d = [[NSData alloc] initWithBytes:_data length:_length]; self = [(NSData *)self initWithData:d]; [d release]; return self; } [self release]; return nil; } #endif @end /* NSObject(MySQL4Values) */ void __link_MySQL4Values() { // used to force linking of object file __link_MySQL4Values(); } SOPE/sope-gdl1/MySQL/MySQL4Context.m0000644000000000000000000000444312242733417015650 0ustar rootroot/* MySQL4Context.m Copyright (C) 2003-2005 SKYRIX Software AG Author: Helge Hess (helge.hess@skyrix.com) This file is part of the MySQL4 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "MySQL4Context.h" #include "MySQL4Channel.h" #include "common.h" /* Note: MySQL doesn't know 'BEGIN TRANSACTION'. It prefers 'START TRANSACTION' which was added in 4.0.11, which is why we use just 'BEGIN' (available since 3.23.17) */ @implementation MySQL4Context - (void)channelDidInit:_channel { if ([channels count] > 0) { [NSException raise:@"TooManyOpenChannelsException" format:@"MySQL4 only supports one channel per context"]; } [super channelDidInit:_channel]; } - (BOOL)primaryBeginTransaction { BOOL result; result = [[[channels lastObject] nonretainedObjectValue] evaluateExpression:@"BEGIN"]; return result; } - (BOOL)primaryCommitTransaction { BOOL result; result = [[[channels lastObject] nonretainedObjectValue] evaluateExpression:@"COMMIT"]; return result; } - (BOOL)primaryRollbackTransaction { BOOL result; result = [[[channels lastObject] nonretainedObjectValue] evaluateExpression:@"ROLLBACK"]; return result; } - (BOOL)canNestTransactions { return NO; } // NSCopying methods - (id)copyWithZone:(NSZone *)zone { return [self retain]; } @end /* MySQL4Context */ void __link_MySQL4Context() { // used to force linking of object file __link_MySQL4Context(); } SOPE/sope-gdl1/MySQL/EOAttribute+MySQL4.m0000644000000000000000000001536412242733417016472 0ustar rootroot/* EOAttribute+MySQL4.m Copyright (C) 1999 MDlink online service center GmbH and Helge Hess Author: Helge Hess (helge@mdlink.de) This file is part of the MySQL4 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "common.h" #import "EOAttribute+MySQL4.h" static NSString *MYSQL4_DATETIME_FORMAT = @"%b %d %Y %I:%M:%S:000%p"; static NSString *MYSQL4_TIMESTAMP_FORMAT = @"%Y-%m-%d %H:%M:%S%z"; @implementation EOAttribute(MySQL4AttributeAdditions) - (void)loadValueClassAndTypeUsingMySQL4Type:(int)_type size:(int)_size modification:(int)_modification binary:(BOOL)_isBinary { /* This method makes no sense with MySQL4? */ [NSException raise: @"EOAttributeMySQL4ImplementationException" format: @"this method (%s) is not expected to be invoked", __PRETTY_FUNCTION__]; if (_isBinary) [self setValueClassName:@"NSData"]; #if 0 switch (_type) { case BOOLOID: [self setExternalType:@"bool"]; [self setValueClassName:@"NSNumber"]; [self setValueType:@"i"]; return; case NAMEOID: [self setExternalType:@"name"]; [self setValueClassName:@"NSString"]; return; case TEXTOID: [self setExternalType:@"textoid"]; [self setValueClassName:@"NSString"]; return; case INT2OID: [self setExternalType:@"int2"]; [self setValueClassName:@"NSNumber"]; [self setValueType:@"d"]; return; case INT4OID: [self setExternalType:@"int4"]; [self setValueClassName:@"NSNumber"]; [self setValueType:@"d"]; return; case INT8OID: [self setExternalType:@"int8"]; [self setValueClassName:@"NSNumber"]; [self setValueType:@"d"]; return; case CHAROID: [self setExternalType:@"char"]; [self setValueClassName:@"NSString"]; break; case VARCHAROID: [self setExternalType:@"varchar"]; [self setValueClassName:@"NSString"]; break; case NUMERICOID: [self setExternalType:@"numeric"]; [self setValueClassName:@"NSNumber"]; [self setValueType:@"d"]; break; case FLOAT4OID: [self setExternalType:@"float4"]; [self setValueClassName:@"NSNumber"]; [self setValueType:@"f"]; break; case FLOAT8OID: [self setExternalType:@"float8"]; [self setValueClassName:@"NSNumber"]; [self setValueType:@"f"]; break; case DATEOID: [self setExternalType:@"datetime"]; [self setValueClassName:@"NSCalendarDate"]; [self setCalendarFormat:MYSQL4_DATETIME_FORMAT]; break; case TIMEOID: [self setExternalType:@"time"]; [self setValueClassName:@"NSCalendarDate"]; [self setCalendarFormat:MYSQL4_DATETIME_FORMAT]; break; case TIMESTAMPOID: [self setExternalType:@"timestamp"]; [self setValueClassName:@"NSCalendarDate"]; [self setCalendarFormat:MYSQL4_DATETIME_FORMAT]; break; case TIMESTAMPTZOID: [self setExternalType:@"timestamptz"]; [self setValueClassName:@"NSCalendarDate"]; [self setCalendarFormat:MYSQL4_DATETIME_FORMAT]; break; case BITOID: [self setExternalType:@"bit"]; break; default: NSLog(@"What is MYSQL4 Oid %i ???", _type); break; } #endif } - (void)loadValueClassForExternalMySQL4Type:(NSString *)_type { /* This method makes no sense with MySQL4? */ [NSException raise: @"EOAttributeMySQL4ImplementationException" format: @"this method (%s) is not expected to be invoked", __PRETTY_FUNCTION__]; if ([_type isEqualToString:@"bool"]) { [self setValueClassName:@"NSNumber"]; [self setValueType:@"i"]; } else if ([_type isEqualToString:@"int2"]) { [self setValueClassName:@"NSNumber"]; [self setValueType:@"i"]; } else if ([_type isEqualToString:@"int2 unsigned"]) { [self setValueClassName:@"NSNumber"]; [self setValueType:@"I"]; } else if ([_type isEqualToString:@"int4"]) { [self setValueClassName:@"NSNumber"]; [self setValueType:@"i"]; } else if ([_type isEqualToString:@"int4 unsigned"]) { [self setValueClassName:@"NSNumber"]; [self setValueType:@"I"]; } else if ([_type isEqualToString:@"float4"]) { [self setValueClassName:@"NSNumber"]; [self setValueType:@"f"]; } else if ([_type isEqualToString:@"float8"]) { [self setValueClassName:@"NSNumber"]; [self setValueType:@"d"]; } else if ([_type isEqualToString:@"decimal"]) { [self setValueClassName:@"NSNumber"]; [self setValueType:@"d"]; } else if ([_type isEqualToString:@"numeric"]) { [self setValueClassName:@"NSNumber"]; [self setValueType:@"d"]; } else if ([_type isEqualToString:@"name"]) { [self setExternalType:@"name"]; [self setValueClassName:@"NSString"]; } else if ([_type isEqualToString:@"varchar"]) { [self setExternalType:@"varchar"]; [self setValueClassName:@"NSString"]; } else if ([_type isEqualToString:@"char"]) { [self setExternalType:@"char"]; [self setValueClassName:@"NSString"]; } else if ([_type isEqualToString:@"timestamp"]) { [self setValueClassName:@"NSCalendarDate"]; [self setCalendarFormat:MYSQL4_TIMESTAMP_FORMAT]; } else if ([_type isEqualToString:@"timestamptz"]) { [self setValueClassName:@"NSCalendarDate"]; [self setCalendarFormat:MYSQL4_TIMESTAMP_FORMAT]; } else if ([_type isEqualToString:@"datetime"]) { [self setValueClassName:@"NSCalendarDate"]; [self setCalendarFormat:MYSQL4_DATETIME_FORMAT]; } else if ([_type isEqualToString:@"date"]) { [self setValueClassName:@"NSString"]; } else if ([_type isEqualToString:@"time"]) { [self setValueClassName:@"NSString"]; } else if ([_type isEqualToString:@"text"]) { [self setValueClassName:@"NSString"]; } else { NSLog(@"invalid argument %@", _type); [NSException raise:@"InvalidArgumentException" format:@"invalid MySQL4 type %@ passed to %s", _type, __PRETTY_FUNCTION__]; } } @end /* EOAttribute(MySQL4) */ void __link_EOAttributeMySQL4() { // used to force linking of object file __link_EOAttributeMySQL4(); } SOPE/sope-gdl1/MySQL/NSString+MySQL4Val.m0000644000000000000000000000702412242733417016447 0ustar rootroot/* MySQL4Adaptor.h Copyright (C) 2003-2005 SKYRIX Software AG Author: Helge Hess (helge.hess@skyrix.com) This file is part of the MySQL4 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "MySQL4Channel.h" #include #import #include "common.h" #include @implementation NSString(MySQL4Values) static Class EOExprClass = Nil; - (id)initWithMySQL4Field:(MYSQL_FIELD *)_field value:(const void *)_v length:(int)_len { // Note: never used on lF (NSTemporaryString!) if (_v == NULL) { [self release]; return nil; } switch (_field->type) { case FIELD_TYPE_BLOB: case FIELD_TYPE_TINY_BLOB: case FIELD_TYPE_MEDIUM_BLOB: case FIELD_TYPE_LONG_BLOB: ; /* fall through */ default: /* we always fallback to the UTF-8 string ... */ return [self initWithUTF8String:_v]; } } #if 0 - (id)initWithMySQL4Int:(int)_value { char buf[256]; sprintf(buf, "%i", _value); return [self initWithCString:buf]; } - (id)initWithMySQL4Double:(double)_value { char buf[256]; sprintf(buf, "%g", _value); return [self initWithCString:buf]; } - (id)initWithMySQL4Text:(const unsigned char *)_value { return [self initWithUTF8String:_value]; } - (id)initWithMySQL4Data:(const void *)_value length:(int)_length { NSData *d; d = [[NSData alloc] initWithBytes:_value length:_length]; self = [self initWithData:d encoding:NSUTF8StringEncoding]; [d release]; return self; } #endif /* generate SQL value */ - (NSString *)stringValueForMySQL4Type:(NSString *)_type attribute:(EOAttribute *)_attribute { // TODO: all this looks slow ... unsigned len; unichar c1; if ((len = [_type length]) == 0) return self; c1 = [_type characterAtIndex:0]; switch (c1) { case 'c': case 'C': // char case 'v': case 'V': // varchar case 't': case 'T': { // text NSString *s; id expr; if (len < 4) return self; _type = [_type lowercaseString]; if (!([_type hasPrefix:@"char"] || [_type hasPrefix:@"varchar"] || [_type hasPrefix:@"text"])) break; /* TODO: creates too many autoreleased strings :-( */ expr = [self stringByReplacingString:@"\\" withString:@"\\\\"]; if (EOExprClass == Nil) EOExprClass = [EOQuotedExpression class]; expr = [[EOExprClass alloc] initWithExpression:expr quote:@"'" escape:@"\\'"]; s = [[(EOQuotedExpression *)expr expressionValueForContext:nil] retain]; [expr release]; return [s autorelease]; } case 'i': case 'I': { // int char buf[128]; sprintf(buf, "%i", [self intValue]); return [NSString stringWithCString:buf]; } default: NSLog(@"WARNING(%s): return string as is for type %@", __PRETTY_FUNCTION__, _type); break; } return self; } @end /* NSString(MySQL4Values) */ SOPE/sope-gdl1/MySQL/MySQL4Channel+Model.m0000644000000000000000000002505412242733417016631 0ustar rootroot/* MySQL4Channel+Model.m Copyright (C) 2003-2006 SKYRIX Software AG Copyright (C) 2006 Helge Hess Author: Helge Hess (helge.hess@skyrix.com) This file is part of the MySQL4 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "MySQL4Channel.h" #include "NSString+MySQL4.h" #include "EOAttribute+MySQL4.h" #include "common.h" @interface EORelationship(FixMe) - (void)addJoin:(id)_join; @end @implementation MySQL4Channel(ModelFetching) - (NSArray *)_attributesForTableName:(NSString *)_tableName { NSMutableArray *attributes; NSString *sqlExpr; NSArray *resultDescription; NSDictionary *row; if ([_tableName length] == 0) return nil; attributes = [self->_attributesForTableName objectForKey:_tableName]; if (attributes == nil) { #if 1 // TODO: we would need to parse the SQL field of 'sqlite_master'? NSLog(@"ERROR(%s): operation not supported on MySQL4!", __PRETTY_FUNCTION__); return nil; #else sqlExpr = [NSString stringWithFormat:sqlExpr, _tableName]; #endif if (![self evaluateExpression:sqlExpr]) { fprintf(stderr, "Couldn`t evaluate column-describe '%s' on table '%s'\n", [sqlExpr cString], [_tableName cString]); return nil; } resultDescription = [self describeResults]; attributes = [NSMutableArray arrayWithCapacity:16]; while ((row = [self fetchAttributes:resultDescription withZone:NULL])) { EOAttribute *attribute; NSString *columnName = nil; NSString *externalType = nil; NSString *attrName = nil; columnName = [[row objectForKey:@"attname"] stringValue]; attrName = [columnName _mySQL4ModelMakeInstanceVarName]; externalType = [[row objectForKey:@"typname"] stringValue]; attribute = [[EOAttribute alloc] init]; [attribute setColumnName:columnName]; [attribute setName:attrName]; [attribute setExternalType:externalType]; [attribute loadValueClassForExternalMySQL4Type:externalType]; [attributes addObject:attribute]; [attribute release]; } [self->_attributesForTableName setObject:attributes forKey:_tableName]; //NSLog(@"got attrs: %@", attributes); } return attributes; } - (NSArray *)_primaryKeysNamesForTableName:(NSString *)_tableName { //NSArray *pkNameForTableName = nil; if ([_tableName length] == 0) return nil; NSLog(@"ERROR(%s): operation not supported on MySQL4!", __PRETTY_FUNCTION__); return nil; } - (NSArray *)_foreignKeysForTableName:(NSString *)_tableName { return nil; } - (EOModel *)describeModelWithTableNames:(NSArray *)_tableNames { NSMutableArray *buildRelShips = [NSMutableArray arrayWithCapacity:64]; EOModel *model = AUTORELEASE([EOModel new]); int cnt, tc = [_tableNames count]; for (cnt = 0; cnt < tc; cnt++) { NSMutableDictionary *relNamesUsed; NSMutableArray *classProperties, *primaryKeyAttributes; NSString *tableName; NSArray *attributes, *pkeys, *fkeys; EOEntity *entity; int cnt2, ac, fkc; relNamesUsed = [NSMutableDictionary dictionaryWithCapacity:16]; classProperties = [NSMutableArray arrayWithCapacity:16]; primaryKeyAttributes = [NSMutableArray arrayWithCapacity:2]; tableName = [_tableNames objectAtIndex:cnt]; attributes = [self _attributesForTableName:tableName]; pkeys = [self _primaryKeysNamesForTableName:tableName]; fkeys = [self _foreignKeysForTableName:tableName]; entity = [[[EOEntity alloc] init] autorelease]; ac = [attributes count]; fkc = [fkeys count]; [entity setName:[tableName _mySQL4ModelMakeClassName]]; [entity setClassName: [@"EO" stringByAppendingString: [tableName _mySQL4ModelMakeClassName]]]; [entity setExternalName:tableName]; [classProperties addObjectsFromArray:[entity classProperties]]; [primaryKeyAttributes addObjectsFromArray:[entity primaryKeyAttributes]]; [model addEntity:entity]; for (cnt2 = 0; cnt2 < ac; cnt2++) { EOAttribute *attribute = [attributes objectAtIndex:cnt2]; NSString *columnName = [attribute columnName]; [entity addAttribute:attribute]; [classProperties addObject:attribute]; if ([pkeys containsObject:columnName]) [primaryKeyAttributes addObject:attribute]; } [entity setClassProperties:classProperties]; [entity setPrimaryKeyAttributes:primaryKeyAttributes]; for (cnt2 = 0; cnt2 < fkc; cnt2++) { NSDictionary *fkey; NSMutableArray *classProperties; NSString *sa, *da, *dt; EORelationship *rel; EOJoin *join; // TODO: fix me, EOJoin is deprecated NSString *relName; fkey = [fkeys objectAtIndex:cnt2]; classProperties = [NSMutableArray arrayWithCapacity:8]; sa = [fkey objectForKey:@"sourceAttr"]; da = [fkey objectForKey:@"targetAttr"]; dt = [fkey objectForKey:@"targetTable"]; rel = [[[EORelationship alloc] init] autorelease]; // TODO: fix me join = [[[NSClassFromString(@"EOJoin") alloc] init] autorelease]; if ([pkeys containsObject:sa]) { relName = [@"to" stringByAppendingString: [dt _mySQL4ModelMakeClassName]]; } else { relName = [@"to" stringByAppendingString: [[sa _mySQL4ModelMakeInstanceVarName] _mySQL4StringWithCapitalizedFirstChar]]; if ([relName hasSuffix:@"Id"]) { int cLength = [relName cStringLength]; relName = [relName substringToIndex:cLength - 2]; } } if ([relNamesUsed objectForKey:relName]) { int useCount = [[relNamesUsed objectForKey:relName] intValue]; [relNamesUsed setObject:[NSNumber numberWithInt:(useCount++)] forKey:relName]; relName = [NSString stringWithFormat:@"%s%d", [relName cString], useCount]; } else [relNamesUsed setObject:[NSNumber numberWithInt:0] forKey:relName]; [rel setName:relName]; //[rel setDestinationEntity:(EOEntity *)[dt _mySQL4ModelMakeClassName]]; [rel setToMany:NO]; // TODO: EOJoin is removed, fix this ... [(id)join setSourceAttribute: (EOAttribute *)[sa _mySQL4ModelMakeInstanceVarName]]; [(id)join setDestinationAttribute: (EOAttribute *)[da _mySQL4ModelMakeInstanceVarName]]; [rel addJoin:join]; [entity addRelationship:rel]; [classProperties addObjectsFromArray:[entity classProperties]]; [classProperties addObject:rel]; [entity setClassProperties:classProperties]; [buildRelShips addObject:rel]; } [entity setAttributesUsedForLocking:[entity attributes]]; } [buildRelShips makeObjectsPerformSelector: @selector(replaceStringsWithObjects)]; /* // make reverse relations { int cnt, rc = [buildRelShips count]; for (cnt = 0; cnt < rc; cnt++) { EORelationship *rel = [buildRelShips objectAtIndex:cnt]; NSMutableArray *classProperties = [NSMutableArray new]; EORelationship *reverse = [rel reversedRelationShip]; EOEntity *entity = [rel destinationEntity]; NSArray *pkeys = [entity primaryKeyAttributes]; BOOL isToMany = [reverse isToMany]; EOAttribute *sa = [[[reverse joins] lastObject] sourceAttribute]; NSString *relName = nil; if ([pkeys containsObject:sa] || isToMany) relName = [@"to" stringByAppendingString: [(EOEntity *)[reverse destinationEntity] name]]; else { relName = [@"to" stringByAppendingString: [[[sa name] _mySQL4ModelMakeInstanceVarName] _mySQL4StringWithCapitalizedFirstChar]]; if ([relName hasSuffix:@"Id"]) { int cLength = [relName cStringLength]; relName = [relName substringToIndex:cLength - 2]; } } if ([entity relationshipNamed:relName]) { int cnt = 1; NSString *numName; numName = [NSString stringWithFormat:@"%s%d", [relName cString], cnt]; while ([entity relationshipNamed:numName]) { cnt++; numName = [NSString stringWithFormat:@"%s%d", [relName cString], cnt]; } relName = numName; } [reverse setName:relName]; [entity addRelationship:reverse]; [classProperties addObjectsFromArray:[entity classProperties]]; [classProperties addObject:reverse]; [entity setClassProperties:classProperties]; } } */ [model setAdaptorName:@"MySQL4"]; [model setAdaptorClassName:@"MySQL4Adaptor"]; [model setConnectionDictionary: [[adaptorContext adaptor] connectionDictionary]]; return model; } - (NSArray *)describeTableNames { NSMutableArray *tableNames = nil; NSArray *resultDescription = nil; NSString *attributeName = nil; NSDictionary *row = nil; NSString *selectExpression = nil; selectExpression = @"SHOW TABLES"; if (![self evaluateExpression:selectExpression]) { fprintf(stderr, "Could not evaluate table-describe expression '%s'\n", [selectExpression cString]); return nil; } resultDescription = [self describeResults]; attributeName = [(EOAttribute *)[resultDescription objectAtIndex:0] name]; tableNames = [NSMutableArray arrayWithCapacity:16]; while ((row = [self fetchAttributes:resultDescription withZone:NULL])!=nil) [tableNames addObject:[row objectForKey:attributeName]]; return tableNames; } @end /* MySQL4Channel(ModelFetching) */ void __link_MySQL4ChannelModel() { // used to force linking of object file __link_MySQL4ChannelModel(); } SOPE/sope-gdl1/MySQL/GNUmakefile.preamble0000644000000000000000000000361112242733417016730 0ustar rootroot# # GNUmakefile # # Copyright (C) 2003-2005 Helge Hess # # Author: Helge Hess (helge.hess@opengroupware.org) # # This file is part of the SQLite3 Adaptor Library # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; see the file COPYING.LIB. # If not, write to the Free Software Foundation, # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. SOPE_ROOT=../.. ifeq ($(frameworks),yes) BUNDLE_INSTALL_DIR := $(FRAMEWORK_INSTALL_DIR)/GDLAccess.framework/Resources/GDLAdaptors/ else BUNDLE_INSTALL_DIR = $(SOPE_DBADAPTORS)/ endif MySQL_BUNDLE_LIBS += \ -lGDLAccess \ `mysql_config --libs` MySQLD_BUNDLE_LIBS += \ -lGDLAccess \ -lEOControl \ `mysql_config --libs` gdltest_TOOL_LIBS += \ -lGDLAccess \ -lNGExtensions # set compile flags and go ADDITIONAL_CFLAGS += `mysql_config --cflags` ADDITIONAL_INCLUDE_DIRS += \ -I../GDLAccess -I.. -I$(SOPE_ROOT) ADDITIONAL_INCLUDE_DIRS += \ -I$(SOPE_ROOT)/sope-core/ \ -I$(SOPE_ROOT)/sope-core/NGExtensions # dependencies # library/framework search pathes DEP_DIRS = \ ../GDLAccess \ $(SOPE_ROOT)/sope-core/EOControl ifneq ($(frameworks),yes) ADDITIONAL_LIB_DIRS += \ $(foreach dir,$(DEP_DIRS),\ -L$(GNUSTEP_BUILD_DIR)/$(dir)/$(GNUSTEP_OBJ_DIR_NAME)) else ADDITIONAL_LIB_DIRS += \ $(foreach dir,$(DEP_DIRS),-F$(GNUSTEP_BUILD_DIR)/$(dir)) endif SYSTEM_LIB_DIR += $(CONFIGURE_SYSTEM_LIB_DIR) SOPE/sope-gdl1/MySQL/gdltest.m0000644000000000000000000001234312242733417014716 0ustar rootroot/* gdltest.m Copyright (C) 1999-2005 MDlink online service center GmbH and Helge Hess Author: Helge Hess (helge@mdlink.de) This file is part of the MySQL4 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import #import #include static void fetchExprInChannel(NSString *expr, EOAdaptorChannel *ch) { NSArray *attrs; NSDictionary *record; if (![ch evaluateExpression:expr]) { NSLog(@"ERROR: failed to evaluate: %@", expr); return; } attrs = [ch describeResults]; NSLog(@"results: %@", attrs); while ((record = [ch fetchAttributes:attrs withZone:nil]) != nil) NSLog(@"fetched %@", record); } static void fetchSomePersonRecord(EOEntity *e, EOAdaptorChannel *ch) { EOSQLQualifier *q; NSArray *attrs; attrs = [e attributes]; q = [[EOSQLQualifier alloc] initWithEntity:e qualifierFormat:@"%A='helge'", @"login"]; [q autorelease]; if ([ch selectAttributes:attrs describedByQualifier:q fetchOrder:nil lock:NO]) { NSDictionary *record; record = [ch fetchAttributes:attrs withZone:nil]; } else NSLog(@"Could not select .."); } static void fetchSomeTeamRecords(EOEntity *e, EOAdaptorChannel *ch) { EOSQLQualifier *q; NSArray *attrs; q = [e qualifier]; attrs = [e attributes]; if ([ch selectAttributes:attrs describedByQualifier:q fetchOrder:nil lock:NO]) { NSDictionary *record; while ((record = [ch fetchAttributes:attrs withZone:NULL]) != nil) { NSLog(@"fetched %@ birthday %@", [record valueForKey:@"description"], [record valueForKey:@"companyId"]); } } else NSLog(@"Could not select team records .."); } static void runtestInOpenChannel(EOAdaptorChannel *ch) { NSAutoreleasePool *pool = [NSAutoreleasePool new]; EOEntity *e; EOSQLQualifier *q; NSArray *attrs; EOAdaptorContext *ctx; EOModel *m; NSString *expr; ctx = [ch adaptorContext]; m = [[ctx adaptor] model]; expr = [[NSUserDefaults standardUserDefaults] stringForKey:@"sql"]; NSLog(@"channel is open"); if (![ctx beginTransaction]) { NSLog(@"ERROR: could not begin transaction ..."); return; } NSLog(@"began tx .."); /* do something */ pool = [[NSAutoreleasePool alloc] init]; #if 1 if (expr) fetchExprInChannel(expr, ch); #endif /* fetch some MyEntity records */ e = [m entityNamed:@"MyEntity"]; NSLog(@"entity: %@", e); if (e == nil) exit(1); q = [e qualifier]; attrs = [e attributes]; // NSLog(@"ATTRS: %@", attrs); if ([ch selectAttributes:attrs describedByQualifier:q fetchOrder:nil lock:NO]) { NSDictionary *record; while ((record = [ch fetchAttributes:attrs withZone:nil]) != nil) NSLog(@"fetched record: %@", record); } else NSLog(@"Could not select .."); /* some OGo fetches */ if ((e = [m entityNamed:@"Team"]) != nil) fetchSomeTeamRecords(e, ch); if ((e = [m entityNamed:@"Person"]) != nil) fetchSomePersonRecord(e, ch); /* tear down */ [pool release]; NSLog(@"committing tx .."); if ([ctx commitTransaction]) NSLog(@" could commit."); else NSLog(@" commit failed."); } static void runtest(void) { EOModel *m = nil; EOAdaptor *a; EOAdaptorContext *ctx; EOAdaptorChannel *ch; NSDictionary *conDict; NS_DURING { conDict = [NSDictionary dictionaryWithContentsOfFile:@"condict.plist"]; NSLog(@"condict is %@", conDict); if ((a = [EOAdaptor adaptorWithName:@"MySQL4"]) == nil) { NSLog(@"found no MySQL4 adaptor .."); exit(1); } NSLog(@"got adaptor %@", a); [a setConnectionDictionary:conDict]; NSLog(@"got adaptor with condict %@", a); ctx = [a createAdaptorContext]; ch = [ctx createAdaptorChannel]; #if 1 m = AUTORELEASE([[EOModel alloc] initWithContentsOfFile:@"test.eomodel"]); if (m) { [a setModel:m]; [a setConnectionDictionary:conDict]; } #endif NSLog(@"opening channel .."); [ch setDebugEnabled:YES]; if ([ch openChannel]) { runtestInOpenChannel(ch); NSLog(@"closing channel .."); [ch closeChannel]; } } NS_HANDLER { fprintf(stderr, "exception: %s\n", [[localException description] cString]); abort(); } NS_ENDHANDLER; } int main(int argc, char **argv, char **env) { NSAutoreleasePool *pool; pool = [[NSAutoreleasePool alloc] init]; [NSProcessInfo initializeWithArguments:argv count:argc environment:env]; runtest(); [pool release]; return 0; } SOPE/sope-gdl1/MySQL/NSString+MySQL4.h0000644000000000000000000000244512242733417016001 0ustar rootroot/* NSString+MySQL4.h Copyright (C) 1999-2005 MDlink online service center GmbH and Helge Hess Author: Helge Hess (helge@mdlink.de) This file is part of the MySQL4 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ___MySQL4_NSString_H___ #define ___MySQL4_NSString_H___ #import @interface NSString(MySQL4MiscStrings) - (NSString *)_mySQL4ModelMakeInstanceVarName; - (NSString *)_mySQL4ModelMakeClassName; - (NSString *)_mySQL4StringWithCapitalizedFirstChar; - (NSString *)_mySQL4StripEndSpaces; @end #endif /* ___MySQL4_NSString_H___ */ SOPE/sope-gdl1/MySQL/NSData+MySQL4Val.m0000644000000000000000000000564212242733417016056 0ustar rootroot/* NSData+MySQL4Val.m Copyright (C) 2003-2005 SKYRIX Software AG Author: Helge Hess (helge.hess@skyrix.com) This file is part of the MySQL4 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "MySQL4Values.h" #include "MySQL4Channel.h" #import #include "common.h" @implementation NSData(MySQL4Values) - (id)initWithMySQL4Field:(MYSQL_FIELD *)_field value:(const void *)_v length:(int)_len { // Note: never used on lF (NSTemporaryString!) if (_v == NULL) { [self release]; return nil; } return [self initWithBytes:_v length:_len]; } #if 0 // unused? - (id)initWithMySQL4Int:(int)_value { return [self initWithBytes:&_value length:sizeof(int)]; } - (id)initWithMySQL4Double:(double)_value { return [self initWithBytes:&_value length:sizeof(double)]; } - (id)initWithMySQL4Text:(const unsigned char *)_value { return [self initWithBytes:_value length:strlen((char *)_value)]; } - (id)initWithMySQL4Data:(const void *)_value length:(int)_length { return [self initWithBytes:_value length:_length]; } #endif - (NSString *)stringValueForMySQL4Type:(NSString *)_type attribute:(EOAttribute *)_attribute { // TODO: UNICODE // TODO: this method looks slow static NSStringEncoding enc = 0; NSString *str, *t; unsigned len; unichar c1; if ((len = [self length]) == 0) return @""; if (enc == 0) { enc = [NSString defaultCStringEncoding]; NSLog(@"Note: MySQL4 adaptor using '%@' encoding for data=>string " @"conversion.", [NSString localizedNameOfStringEncoding:enc]); } str = [[NSString alloc] initWithData:self encoding:enc]; if (((len = [_type length]) == 0) || (len != 4 && len != 5 && len != 7)) return [str autorelease]; c1 = [_type characterAtIndex:0]; switch (c1) { case 'c': case 'C': case 'v': case 'V': case 'm': case 'M': case 't': case 'T': t = [_type lowercaseString]; if ([t hasPrefix:@"char"] || [t hasPrefix:@"varchar"] || [t hasPrefix:@"money"] || [t hasPrefix:@"text"]) { t = [[str stringValueForMySQL4Type:_type attribute:_attribute] retain]; [str release]; return [t autorelease]; } } return [str autorelease];; } @end /* NSData(MySQL4Values) */ SOPE/sope-gdl1/MySQL/MySQL4Channel.m0000644000000000000000000005253612242733417015602 0ustar rootroot/* MySQL4Channel.m Copyright (C) 2003-2005 SKYRIX Software AG Author: Helge Hess (helge.hess@skyrix.com) This file is part of the MySQL4 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include "MySQL4Channel.h" #include "MySQL4Adaptor.h" #include "MySQL4Exception.h" #include "NSString+MySQL4.h" #include "MySQL4Values.h" #include "EOAttribute+MySQL4.h" #include "common.h" #include #ifndef MIN # define MIN(x, y) ((x > y) ? y : x) #endif #define MAX_CHAR_BUF 16384 @implementation MySQL4Channel static EONull *null = nil; + (void)initialize { if (null == NULL) null = [[EONull null] retain]; } - (id)initWithAdaptorContext:(EOAdaptorContext*)_adaptorContext { if ((self = [super initWithAdaptorContext:_adaptorContext])) { [self setDebugEnabled:[[NSUserDefaults standardUserDefaults] boolForKey:@"MySQL4DebugEnabled"]]; self->_attributesForTableName = [[NSMutableDictionary alloc] initWithCapacity:16]; self->_primaryKeysNamesForTableName = [[NSMutableDictionary alloc] initWithCapacity:16]; } return self; } - (void)_adaptorWillFinalize:(id)_adaptor { } - (void)dealloc { if ([self isOpen]) [self closeChannel]; [self->_attributesForTableName release]; [self->_primaryKeysNamesForTableName release]; [super dealloc]; } /* NSCopying methods */ - (id)copyWithZone:(NSZone *)zone { return [self retain]; } // debugging - (void)setDebugEnabled:(BOOL)_flag { self->isDebuggingEnabled = _flag; } - (BOOL)isDebugEnabled { return self->isDebuggingEnabled; } - (void)receivedMessage:(NSString *)_message { NSLog(@"%@: message %@.", _message); } /* open/close */ static int openConnectionCount = 0; - (BOOL)isOpen { return (self->_connection != NULL) ? YES : NO; } - (int)maxOpenConnectionCount { static int MaxOpenConnectionCount = -1; if (MaxOpenConnectionCount != -1) return MaxOpenConnectionCount; MaxOpenConnectionCount = [[NSUserDefaults standardUserDefaults] integerForKey:@"MySQL4MaxOpenConnectionCount"]; if (MaxOpenConnectionCount == 0) MaxOpenConnectionCount = 150; return MaxOpenConnectionCount; } - (BOOL)openChannel { const char *cDBName; MySQL4Adaptor *adaptor; NSString *host, *socket; BOOL reconnect; void *rc; if (self->_connection != NULL) { NSLog(@"%s: Connection already open !!!", __PRETTY_FUNCTION__); return NO; } adaptor = (MySQL4Adaptor *)[adaptorContext adaptor]; if (![super openChannel]) return NO; if (openConnectionCount > [self maxOpenConnectionCount]) { [MySQL4CouldNotOpenChannelException raise:@"NoMoreConnections" format:@"cannot open a additional connection !"]; return NO; } cDBName = [[adaptor databaseName] UTF8String]; if ((self->_connection = mysql_init(NULL)) == NULL) { NSLog(@"ERROR(%s): could not allocate MySQL4 connection!"); return NO; } // TODO: could change options using mysql_options() host = [adaptor serverName]; if ([host hasPrefix:@"/"]) { /* treat hostname as Unix socket path */ socket = host; host = nil; } else socket = nil; reconnect = YES; mysql_options(self->_connection, MYSQL_OPT_RECONNECT, &reconnect); rc = mysql_real_connect(self->_connection, [host UTF8String], [[adaptor loginName] UTF8String], [[adaptor loginPassword] UTF8String], cDBName, [[adaptor port] intValue], [socket cString], 0); if (rc == NULL) { NSLog(@"ERROR: could not open MySQL4 connection to database '%@': %s", [adaptor databaseName], mysql_error(self->_connection)); mysql_close(self->_connection); self->_connection = NULL; return NO; } if (mysql_query(self->_connection, "SET CHARACTER SET utf8") != 0) { NSLog(@"WARNING(%s): could not put MySQL4 connection into UTF-8 mode: %s", __PRETTY_FUNCTION__, mysql_error(self->_connection)); #if 0 mysql_close(self->_connection); self->_connection = NULL; return NO; #endif } if (isDebuggingEnabled) NSLog(@"MySQL4 connection established 0x%p", self->_connection); #if 0 NSLog(@"---------- %s: %@ opens channel count[%d]", __PRETTY_FUNCTION__, self, openConnectionCount); #endif openConnectionCount++; #if LIB_FOUNDATION_BOEHM_GC [GarbageCollector registerForFinalizationObserver:self selector:@selector(_adaptorWillFinalize:) object:[[self adaptorContext] adaptor]]; #endif if (isDebuggingEnabled) { NSLog(@"MySQL4 channel 0x%p opened (connection=0x%p,%s)", self, self->_connection, cDBName); } return YES; } - (void)primaryCloseChannel { if ([self isFetchInProgress]) [self cancelFetch]; if (self->_connection != NULL) { mysql_close(self->_connection); #if 0 NSLog(@"---------- %s: %@ close channel count[%d]", __PRETTY_FUNCTION__, self, openConnectionCount); #endif openConnectionCount--; if (isDebuggingEnabled) { fprintf(stderr, "MySQL4 connection dropped 0x%p (channel=0x%p)\n", self->_connection, self); } self->_connection = NULL; } } - (void)closeChannel { [super closeChannel]; [self primaryCloseChannel]; } /* fetching rows */ - (void)cancelFetch { self->fields = NULL; /* apparently we do not need to free those */ if (self->results != NULL) { mysql_free_result(self->results); self->results = NULL; } [super cancelFetch]; } - (MYSQL_FIELD *)_fetchFields { if (self->results == NULL) return NULL; if (self->fields != NULL) return self->fields; self->fields = mysql_fetch_fields(self->results); self->fieldCount = mysql_num_fields(self->results); return self->fields; } - (NSArray *)describeResults:(BOOL)_beautifyNames { // TODO: make exception-less method MYSQL_FIELD *mfields; int cnt; NSMutableArray *result = nil; NSMutableDictionary *usedNames = nil; NSNumber *yesObj; yesObj = [NSNumber numberWithBool:YES]; if (![self isFetchInProgress]) { [MySQL4Exception raise:@"NoFetchInProgress" format:@"No fetch in progress (channel=%@)", self]; return nil; } if ((mfields = [self _fetchFields]) == NULL) { [MySQL4Exception raise:@"NoFieldInfo" format:@"Failed to fetch field info (channel=%@)", self]; return nil; } result = [[NSMutableArray alloc] initWithCapacity:fieldCount]; usedNames = [[NSMutableDictionary alloc] initWithCapacity:fieldCount]; for (cnt = 0; cnt < fieldCount; cnt++) { EOAttribute *attribute = nil; NSString *columnName = nil; NSString *attrName = nil; columnName = [NSString stringWithUTF8String:mfields[cnt].name]; attrName = _beautifyNames ? [columnName _mySQL4ModelMakeInstanceVarName] : columnName; if ([[usedNames objectForKey:attrName] boolValue]) { int cnt2 = 0; char buf[64]; NSString *newAttrName = nil; for (cnt2 = 2; cnt2 < 100; cnt2++) { NSString *s; sprintf(buf, "%i", cnt2); // TODO: unicode s = [[NSString alloc] initWithCString:buf]; newAttrName = [attrName stringByAppendingString:s]; [s release]; if (![[usedNames objectForKey:newAttrName] boolValue]) { attrName = newAttrName; break; } } } [usedNames setObject:yesObj forKey:attrName]; attribute = [[EOAttribute alloc] init]; [attribute setName:attrName]; [attribute setColumnName:columnName]; [attribute setAllowsNull: (mfields[cnt].flags & NOT_NULL_FLAG) ? NO : YES]; /* We also know whether a field: is primary is unique is auto-increment is zero-fill is unsigned */ switch (mfields[cnt].type) { case FIELD_TYPE_STRING: [attribute setExternalType:@"CHAR"]; [attribute setValueClassName:@"NSString"]; // TODO: length etc break; case FIELD_TYPE_VAR_STRING: [attribute setExternalType:@"VARCHAR"]; [attribute setValueClassName:@"NSString"]; // TODO: length etc break; case FIELD_TYPE_TINY: if ((mfields[cnt].flags & UNSIGNED_FLAG)) { [attribute setExternalType:@"TINY UNSIGNED"]; [attribute setValueClassName:@"NSNumber"]; [attribute setValueType:@"C"]; } else { [attribute setExternalType:@"TINY"]; [attribute setValueClassName:@"NSNumber"]; [attribute setValueType:@"c"]; } break; case FIELD_TYPE_SHORT: if ((mfields[cnt].flags & UNSIGNED_FLAG)) { [attribute setExternalType:@"SHORT UNSIGNED"]; [attribute setValueClassName:@"NSNumber"]; [attribute setValueType:@"S"]; } else { [attribute setExternalType:@"SHORT"]; [attribute setValueClassName:@"NSNumber"]; [attribute setValueType:@"s"]; } break; case FIELD_TYPE_LONG: if ((mfields[cnt].flags & UNSIGNED_FLAG)) { [attribute setExternalType:@"LONG UNSIGNED"]; [attribute setValueClassName:@"NSNumber"]; [attribute setValueType:@"L"]; } else { [attribute setExternalType:@"LONG"]; [attribute setValueClassName:@"NSNumber"]; [attribute setValueType:@"l"]; } break; case FIELD_TYPE_INT24: if ((mfields[cnt].flags & UNSIGNED_FLAG)) { [attribute setExternalType:@"INT UNSIGNED"]; [attribute setValueClassName:@"NSNumber"]; [attribute setValueType:@"I"]; } else { [attribute setExternalType:@"INT"]; [attribute setValueClassName:@"NSNumber"]; [attribute setValueType:@"i"]; // bumped } break; case FIELD_TYPE_LONGLONG: if ((mfields[cnt].flags & UNSIGNED_FLAG)) { [attribute setExternalType:@"LONGLONG UNSIGNED"]; [attribute setValueClassName:@"NSNumber"]; [attribute setValueType:@"Q"]; } else { [attribute setExternalType:@"LONGLONG"]; [attribute setValueClassName:@"NSNumber"]; [attribute setValueType:@"q"]; } break; case FIELD_TYPE_DECIMAL: [attribute setExternalType:@"DECIMAL"]; [attribute setValueClassName:@"NSNumber"]; [attribute setValueType:@"f"]; // TODO: need NSDecimalNumber here ... break; case FIELD_TYPE_FLOAT: [attribute setExternalType:@"FLOAT"]; [attribute setValueClassName:@"NSNumber"]; [attribute setValueType:@"f"]; break; case FIELD_TYPE_DOUBLE: [attribute setExternalType:@"DOUBLE"]; [attribute setValueClassName:@"NSNumber"]; [attribute setValueType:@"d"]; break; case FIELD_TYPE_TIMESTAMP: [attribute setExternalType:@"TIMESTAMP"]; [attribute setValueClassName:@"NSCalendarDate"]; break; case FIELD_TYPE_DATE: [attribute setExternalType:@"DATE"]; [attribute setValueClassName:@"NSCalendarDate"]; break; case FIELD_TYPE_DATETIME: [attribute setExternalType:@"DATETIME"]; [attribute setValueClassName:@"NSCalendarDate"]; break; case FIELD_TYPE_BLOB: case FIELD_TYPE_TINY_BLOB: case FIELD_TYPE_MEDIUM_BLOB: case FIELD_TYPE_LONG_BLOB: // TODO: length etc if (mfields[cnt].flags & BINARY_FLAG) { [attribute setExternalType:@"BLOB"]; [attribute setValueClassName:@"NSData"]; } else { [attribute setExternalType:@"TEXT"]; [attribute setValueClassName:@"NSString"]; } break; case FIELD_TYPE_NULL: // TODO: whats that? case FIELD_TYPE_TIME: case FIELD_TYPE_YEAR: case FIELD_TYPE_SET: case FIELD_TYPE_ENUM: default: NSLog(@"ERROR(%s): unexpected MySQL4 type at column %i: %@", __PRETTY_FUNCTION__, cnt, attribute); break; } [result addObject:attribute]; [attribute release]; } [usedNames release]; usedNames = nil; return [result autorelease]; } - (NSArray *)describeResults { return [self describeResults:NO]; } - (NSMutableDictionary *)primaryFetchAttributes:(NSArray *)_attributes withZone:(NSZone *)_zone { /* Note: we expect that the attributes match the generated SQL. This is because auto-generated SQL can contain SQL table prefixes (like alias.column-name which cannot be detected using the attributes schema) */ // TODO: add a primaryFetchAttributesX method? MYSQL_ROW rawRow; NSMutableDictionary *row = nil; unsigned attrCount = [_attributes count]; unsigned cnt; unsigned long *lengths; if (self->results == NULL) { NSLog(@"ERROR(%s): no fetch in progress?", __PRETTY_FUNCTION__); [self cancelFetch]; return nil; } /* raw fetch */ if ((rawRow = mysql_fetch_row(self->results)) == NULL) { // TODO: might need to close channel on connect exceptions unsigned int merrno; if ((merrno = mysql_errno(self->_connection)) != 0) { const char *error; error = mysql_error(self->_connection); [MySQL4Exception raise:@"FetchFailed" format:@"%@",[NSString stringWithUTF8String:error]]; return nil; } /* regular end of result set */ [self cancelFetch]; return nil; } /* ensure field info */ if ([self _fetchFields] == NULL) { [self cancelFetch]; [MySQL4Exception raise:@"FetchFailed" format:@"could not fetch field info!"]; return nil; } if ((lengths = mysql_fetch_lengths(self->results)) == NULL) { [self cancelFetch]; [MySQL4Exception raise:@"FetchFailed" format:@"could not fetch field lengths!"]; return nil; } /* build row */ row = [NSMutableDictionary dictionaryWithCapacity:attrCount]; for (cnt = 0; cnt < attrCount; cnt++) { EOAttribute *attribute; NSString *attrName; id value = nil; MYSQL_FIELD mfield; attribute = [_attributes objectAtIndex:cnt]; attrName = [attribute name]; mfield = ((MYSQL_FIELD *)self->fields)[cnt]; if (rawRow[cnt] == NULL) { value = [null retain]; } else { Class valueClass; valueClass = NSClassFromString([attribute valueClassName]); if (valueClass == Nil) { NSLog(@"ERROR(%s): %@: got no value class for column:\n" @" attribute=%@\n type=%@", __PRETTY_FUNCTION__, self, attrName, [attribute externalType]); value = null; continue; } value = [[valueClass alloc] initWithMySQL4Field:&mfield value:rawRow[cnt] length:lengths[cnt]]; if (value == nil) { NSLog(@"ERROR(%s): %@: got no value for column:\n" @" attribute=%@\n valueClass=%@\n type=%@", __PRETTY_FUNCTION__, self, attrName, NSStringFromClass(valueClass), [attribute externalType]); continue; } } if (value != nil) { [row setObject:value forKey:attrName]; [value release]; } } return row; } /* sending SQL to server */ - (NSException *)evaluateExpressionX:(NSString *)_expression { NSMutableString *sql; BOOL result; const char *s; int rc; *(&result) = YES; if (_expression == nil) { return [NSException exceptionWithName:@"InvalidArgumentException" reason: @"parameter for evaluateExpression: must not be null" userInfo:nil]; } sql = [[_expression mutableCopy] autorelease]; [sql appendString:@";"]; /* ask delegate */ if (delegateRespondsTo.willEvaluateExpression) { EODelegateResponse response; response = [delegate adaptorChannel:self willEvaluateExpression:sql]; if (response == EODelegateRejects) { return [NSException exceptionWithName:@"EODelegateRejects" reason:@"delegate rejected insert" userInfo:nil]; } if (response == EODelegateOverrides) return nil; } /* check some preconditions */ if (![self isOpen]) { return [MySQL4Exception exceptionWithName:@"ChannelNotOpenException" reason:@"MySQL4 connection is not open" userInfo:nil]; } if (self->results != NULL) { return [MySQL4Exception exceptionWithName:@"CommandInProgressException" reason:@"an evaluation is in progress" userInfo:nil]; return NO; } if ([self isFetchInProgress]) { NSLog(@"WARNING: a fetch is still in progress: %@", self); [self cancelFetch]; } if (isDebuggingEnabled) NSLog(@"%@ SQL: %@", self, sql); /* reset environment */ self->isFetchInProgress = NO; /* start query */ s = [sql UTF8String]; if ((rc = mysql_real_query(self->_connection, s, strlen(s))) != 0) { // TODO: might need to close channel on connect exceptions const char *error; error = mysql_error(self->_connection); if (isDebuggingEnabled) NSLog(@"%@ ERROR: %s", self, error); return [MySQL4Exception exceptionWithName:@"ExecutionFailed" reason:[NSString stringWithUTF8String:error] userInfo:nil]; } /* fetch */ if ((self->results = mysql_use_result(self->_connection)) != NULL) { if (isDebuggingEnabled) NSLog(@"%@ query has results, entering fetch-mode.", self); self->isFetchInProgress = YES; } else { /* error _OR_ statement without result-set */ unsigned int merrno; if ((merrno = mysql_errno(self->_connection)) != 0) { const char *error; error = mysql_error(self->_connection); if (isDebuggingEnabled) NSLog(@"%@ cannot use result: '%s'", self, error); return [MySQL4Exception exceptionWithName:@"FetchFailed" reason:[NSString stringWithUTF8String:error] userInfo:nil]; } if (isDebuggingEnabled) NSLog(@"%@ query has no results.", self); } if (delegateRespondsTo.didEvaluateExpression) [delegate adaptorChannel:self didEvaluateExpression:sql]; return nil /* everything is OK */; } - (BOOL)evaluateExpression:(NSString *)_sql { NSException *e; NSString *n; if ((e = [self evaluateExpressionX:_sql]) == nil) return YES; /* for compatibility with non-X methods, translate some errors to a bool */ n = [e name]; if ([n isEqualToString:@"EOEvaluationError"]) return NO; if ([n isEqualToString:@"EODelegateRejects"]) return NO; NSLog(@"ERROR eval '%@': %@", _sql, e); [e raise]; return NO; } /* description */ - (NSString *)description { NSMutableString *ms; ms = [NSMutableString stringWithCapacity:64]; [ms appendFormat:@"<%@[0x%p] connection=0x%p", NSStringFromClass([self class]), self, self->_connection]; [ms appendString:@">"]; return ms; } /* PrimaryKeyGeneration */ - (NSDictionary *)primaryKeyForNewRowWithEntity:(EOEntity *)_entity { NSException *error; NSArray *pkeys; MySQL4Adaptor *adaptor; NSString *seqName, *seq; NSArray *seqs; NSDictionary *pkey; unsigned i, count; id key; pkeys = [_entity primaryKeyAttributeNames]; adaptor = (id)[[self adaptorContext] adaptor]; seqName = [adaptor primaryKeySequenceName]; pkey = nil; seq = nil; if ([seqName length] > 0) { // TODO: if we do this, we also need to make the 'id' configurable ... seq = [@"UPDATE " stringByAppendingString:seqName]; seq = [seq stringByAppendingString:@" SET id=LAST_INSERT_ID(id+1)"]; seqs = [NSArray arrayWithObjects: seq, @"SELECT_LAST_INSERT_ID()", nil]; } else seqs = [[adaptor newKeyExpression] componentsSeparatedByString:@";"]; if ((count = [seqs count]) == 0) { NSLog(@"ERROR(%@): got no primary key expressions %@: %@", self, seqName, _entity); return nil; } for (i = 0; i < count - 1; i++) { if ((error = [self evaluateExpressionX:[seqs objectAtIndex:i]]) != nil) { NSLog(@"ERROR(%@): could not prepare next pkey value %@: %@", self, [seqs objectAtIndex:i], error); return nil; } } seq = [seqs lastObject]; if ((error = [self evaluateExpressionX:seq]) != nil) { NSLog(@"ERROR(%@): could not select next pkey value from sequence %@: %@", self, seqName, error); return nil; } if (![self isFetchInProgress]) { NSLog(@"ERROR(%@): primary key expression returned no result: '%@'", self, seq); return nil; } // TODO: this is kinda slow key = [self describeResults]; pkey = [self fetchAttributes:key withZone:NULL]; [self cancelFetch]; if (pkey != nil) { pkey = [[pkey allValues] lastObject]; pkey = [NSDictionary dictionaryWithObject:pkey forKey:[pkeys objectAtIndex:0]]; } return pkey; } @end /* MySQL4Channel */ void __link_MySQL4Channel() { // used to force linking of object file __link_MySQL4Channel(); } SOPE/sope-gdl1/MySQL/MySQL4Expression.h0000644000000000000000000000304412242733417016352 0ustar rootroot/* MySQL4Expression.h Copyright (C) 1999-2005 MDlink online service center GmbH and Helge Hess Author: Helge Hess (helge@mdlink.de) This file is part of the MySQL4 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ___MySQL4_SQLExpression_H___ #define ___MySQL4_SQLExpression_H___ #include @class NSString, NSArray; @class EOSQLQualifier, EOAdaptorChannel; @interface MySQL4Expression : EOSQLExpression + (Class)selectExpressionClass; @end @interface MySQL4SelectSQLExpression : EOSelectSQLExpression { BOOL lock; } - (id)selectExpressionForAttributes:(NSArray *)attributes lock:(BOOL)flag qualifier:(EOSQLQualifier *)qualifier fetchOrder:(NSArray *)fetchOrder channel:(EOAdaptorChannel *)channel; - (NSString *)fromClause; @end #endif /* ___MySQL4_SQLExpression_H___ */ SOPE/sope-gdl1/MySQL/common.h0000644000000000000000000000223312242733417014530 0ustar rootroot/* common.h Copyright (C) 1999-2005 MDlink online service center GmbH and Helge Hess Author: Helge Hess (helge@mdlink.de) This file is part of the MySQL4 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ___MySQL4_common_H___ #define ___MySQL4_common_H___ #include #include #include #include #include #endif /* ___MySQL4_common_H___ */ SOPE/sope-gdl1/MySQL/Version0000644000000000000000000000004512242733417014436 0ustar rootroot# Version file SUBMINOR_VERSION:=14 SOPE/sope-gdl1/MySQL/MySQL4Context.h0000644000000000000000000000225412242733417015641 0ustar rootroot/* MySQL4Context.h Copyright (C) 2003-2005 SKYRIX Software AG Author: Helge Hess (helge.hess@skyrix.com) This file is part of the MySQL4 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ___MySQL4_Context_H___ #define ___MySQL4_Context_H___ #import @interface MySQL4Context : EOAdaptorContext - (BOOL)primaryBeginTransaction; - (BOOL)primaryCommitTransaction; - (BOOL)primaryRollbackTransaction; @end #endif SOPE/sope-gdl1/MySQL/COPYING.LIB0000644000000000000000000006126112242733417014535 0ustar rootroot GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, 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 library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] 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 Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, 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 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 a program 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. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, 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 companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. 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, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library 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 compile 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) 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. c) 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. d) 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 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. 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 to 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 Library 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 Appendix: 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 Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, 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! SOPE/sope-gdl1/MySQL/NSNumber+MySQL4Val.m0000644000000000000000000000755312242733417016440 0ustar rootroot/* MySQL4Adaptor.h Copyright (C) 2003-2005 SKYRIX Software AG Author: Helge Hess (helge.hess@skyrix.com) This file is part of the MySQL4 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import #include "MySQL4Channel.h" #include "common.h" #include @implementation NSNumber(MySQL4Values) - (id)initWithMySQL4Field:(MYSQL_FIELD *)_field value:(const void *)_v length:(int)_len { if (_v == NULL) { [self release]; return nil; } switch (_field->type) { case FIELD_TYPE_TINY: return ((_field->flags & UNSIGNED_FLAG) ? [self initWithUnsignedChar:atoi(_v)] : [self initWithChar:atoi(_v)]); case FIELD_TYPE_SHORT: return ((_field->flags & UNSIGNED_FLAG) ? [self initWithUnsignedShort:atoi(_v)] : [self initWithShort:atoi(_v)]); case FIELD_TYPE_LONG: return ((_field->flags & UNSIGNED_FLAG) ? [self initWithUnsignedLong:strtoul(_v, NULL, 10)] : [self initWithLong:strtol(_v, NULL, 10)]); case FIELD_TYPE_LONGLONG: return ((_field->flags & UNSIGNED_FLAG) ? [self initWithUnsignedLong:strtoull(_v, NULL, 10)] : [self initWithLongLong:strtoll(_v, NULL, 10)]); case FIELD_TYPE_FLOAT: return [self initWithFloat:atof(_v)]; case FIELD_TYPE_DOUBLE: return [self initWithDouble:atof(_v)]; default: NSLog(@"ERROR(%s): unsupported MySQL type: %i (len=%d)", __PRETTY_FUNCTION__, _field->type, _len); [self release]; return nil; } } /* generation */ - (NSString *)stringValueForMySQL4Type:(NSString *)_type attribute:(EOAttribute *)_attribute { // TODO: can we avoid the lowercaseString? unsigned len; unichar c1; if ((len = [_type length]) == 0) return [self stringValue]; if (len < 4) { #if GNUSTEP_BASE_LIBRARY /* on gstep-base -stringValue of bool's return YES or NO, which seems to be different on Cocoa and liBFoundation. */ { static Class BoolClass = Nil; if (BoolClass == Nil) BoolClass = NSClassFromString(@"NSBoolNumber"); if ([self isKindOfClass:BoolClass]) return [self boolValue] ? @"1" : @"0"; } #endif return [self stringValue]; } c1 = [_type characterAtIndex:0]; switch (c1) { case 'b': case 'B': if (![[_type lowercaseString] hasPrefix:@"bool"]) break; return [self boolValue] ? @"true" : @"false"; case 'm': case 'M': { if (![[_type lowercaseString] hasPrefix:@"money"]) break; return [@"$" stringByAppendingString:[self stringValue]]; } case 'c': case 'C': case 't': case 'T': case 'v': case 'V': { static NSMutableString *ms = nil; // reuse mstring, THREAD _type = [_type lowercaseString]; if (!([_type hasPrefix:@"char"] || [_type hasPrefix:@"varchar"] || [_type hasPrefix:@"text"])) break; // TODO: can we get this faster?! if (ms == nil) ms = [[NSMutableString alloc] initWithCapacity:256]; [ms setString:@"'"]; [ms appendString:[self stringValue]]; [ms appendString:@"'"]; return [[ms copy] autorelease]; } } return [self stringValue]; } @end /* NSNumber(MySQL4Values) */ SOPE/sope-gdl1/MySQL/EOAttribute+MySQL4.h0000644000000000000000000000251212242733417016454 0ustar rootroot/* EOAttribute+MySQL4.h Copyright (C) 2003-2004 Helge Hess Author: Helge Hess (helge.hess@opengroupware.org) This file is part of the MySQL4 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ___MySQL4_EOAttribute_H___ #define ___MySQL4_EOAttribute_H___ #import @class NSString; @interface EOAttribute(MySQL4AttributeAdditions) - (void)loadValueClassAndTypeUsingMySQL4Type:(int)_type size:(int)_size modification:(int)_modification binary:(BOOL)_isBinary; - (void)loadValueClassForExternalMySQL4Type:(NSString *)_type; @end #endif /* ___MySQL4_EOAttribute_H___ */ SOPE/sope-gdl1/MySQL/MySQL4Channel+Model.h0000644000000000000000000000231112242733417016613 0ustar rootroot/* MySQL4Channel+Model.h Copyright (C) 2003-2005 SKYRIX Software AG Author: Helge Hess (helge.hess@skyrix.com) This file is part of the MySQL4 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ___MySQL4_ModelFetching_H___ #define ___MySQL4_ModelFetching_H___ #import "MySQL4Channel.h" @class NSArray; @class EOModel; @interface MySQL4Channel(ModelFetching) - (EOModel *)describeModelWithTableNames:(NSArray *)_tableNames; - (NSArray *)describeTableNames; @end #endif SOPE/sope-gdl1/MySQL/NSString+MySQL4.m0000644000000000000000000001030012242733417015773 0ustar rootroot/* NSString+MySQL4.m Copyright (C) 1999 MDlink online service center GmbH and Helge Hess Author: Helge Hess (helge@mdlink.de) This file is part of the MySQL4 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #if LIB_FOUNDATION_BOEHM_GC # include #endif #include "NSString+MySQL4.h" #include "common.h" @implementation NSString(MySQL4MiscStrings) - (NSString *)_mySQL4ModelMakeInstanceVarName { unsigned clen = 0; char *s = NULL; int cnt, cnt2; if ([self length] == 0) return @""; clen = [self cStringLength]; s = malloc(clen + 10); [self getCString:s maxLength:clen]; for (cnt = cnt2 = 0; cnt < clen; cnt++, cnt2++) { if ((s[cnt] == '_') && (s[cnt + 1] != '\0')) { s[cnt2] = toupper(s[cnt + 1]); cnt++; } else if ((s[cnt] == '2') && (s[cnt + 1] != '\0')) { s[cnt2] = s[cnt]; cnt++; cnt2++; s[cnt2] = toupper(s[cnt]); } else s[cnt2] = tolower(s[cnt]); } s[cnt2] = '\0'; return [[[NSString alloc] initWithCStringNoCopy:s length:strlen(s) freeWhenDone:YES] autorelease]; } - (NSString *)_mySQL4ModelMakeClassName { unsigned clen = 0; char *s = NULL; int cnt, cnt2; if ([self length] == 0) return @""; clen = [self cStringLength]; s = malloc(clen + 10); [self getCString:s maxLength:clen]; for (cnt = cnt2 = 0; cnt < clen; cnt++, cnt2++) { if ((s[cnt] == '_') && (s[cnt + 1] != '\0')) { s[cnt2] = toupper(s[cnt + 1]); cnt++; } else if ((s[cnt] == '2') && (s[cnt + 1] != '\0')) { s[cnt2] = s[cnt]; cnt++; cnt2++; s[cnt2] = toupper(s[cnt]); } else s[cnt2] = tolower(s[cnt]); } s[cnt2] = '\0'; s[0] = toupper(s[0]); return [[[NSString alloc] initWithCStringNoCopy:s length:strlen(s) freeWhenDone:YES] autorelease]; } - (NSString *)_mySQL4StringWithCapitalizedFirstChar { NSCharacterSet *upperSet; NSMutableString *str; if ([self length] == 0) return @""; upperSet = [NSCharacterSet uppercaseLetterCharacterSet]; if ([upperSet characterIsMember:[self characterAtIndex:0]]) return [[self copy] autorelease]; str = [NSMutableString stringWithCapacity:[self length]]; [str appendString:[[self substringToIndex:1] uppercaseString]]; [str appendString:[self substringFromIndex:1]]; return [[str copy] autorelease]; } - (NSString *)_mySQL4StripEndSpaces { NSCharacterSet *spaceSet; NSMutableString *str; unichar (*charAtIndex)(id, SEL, int); NSRange range; if ([self length] == 0) return [[self copy] autorelease]; spaceSet = [NSCharacterSet whitespaceCharacterSet]; str = [NSMutableString stringWithCapacity:[self length]]; charAtIndex = (unichar (*)(id, SEL, int)) [self methodForSelector:@selector(characterAtIndex:)]; range.length = 0; for (range.location = ([self length] - 1); range.location >= 0; range.location++, range.length++) { unichar c; c = charAtIndex(self, @selector(characterAtIndex:), range.location); if (![spaceSet characterIsMember:c]) break; } if (range.length > 0) { [str appendString:self]; [str deleteCharactersInRange:range]; return [[str copy] autorelease]; } return [[self copy] autorelease]; } @end void __link_NSStringMySQL4() { // used to force linking of object file __link_NSStringMySQL4(); } SOPE/sope-gdl1/common.make0000644000000000000000000000120012242733417014242 0ustar rootroot# GNUstep makefile SKYROOT=.. include $(GNUSTEP_MAKEFILES)/common.make include $(SKYROOT)/Version -include ./Version GNUSTEP_INSTALLATION_DIR = $(GNUSTEP_LOCAL_ROOT) ADDITIONAL_CPPFLAGS += -pipe -Wall -Wno-protocol SOPEDIR="../.." ADDITIONAL_INCLUDE_DIRS += \ -I.. \ -I$(SOPEDIR)/sope-xml \ -I$(SOPEDIR)/sope-core \ -I$(SOPEDIR)/sope-core/NGExtensions ADDITIONAL_LIB_DIRS += \ -L./$(GNUSTEP_OBJ_DIR) \ -L$(SOPEDIR)/sope-xml/SaxObjC/$(GNUSTEP_OBJ_DIR) \ -L$(SOPEDIR)/sope-xml/DOM/$(GNUSTEP_OBJ_DIR) \ -L$(SOPEDIR)/sope-core/EOControl/$(GNUSTEP_OBJ_DIR) \ -L$(SOPEDIR)/sope-core/NGExtensions/$(GNUSTEP_OBJ_DIR) SOPE/sope-gdl1/GDLAccess/0000755000000000000000000000000012242733417013652 5ustar rootrootSOPE/sope-gdl1/GDLAccess/EOKeySortOrdering.h0000644000000000000000000000312012242733417017335 0ustar rootroot/* EOKeySortOrdering.h Copyright (C) 1996 Free Software Foundation, Inc. Author: Mircea Oancea Date: 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import #import @interface EOKeySortOrdering : NSObject { NSString* key; NSComparisonResult ordering; } + keyOrderingWithKey:(NSString*)aKey ordering:(NSComparisonResult)anOrdering; - initWithKey:(NSString*)aKey ordering:(NSComparisonResult)anOrdering; - (NSString*)key; - (NSComparisonResult)ordering; @end @interface NSArray(EOKeyBasedSorting) - (NSArray*)sortedArrayUsingKeyOrderArray:(NSArray*)orderArray; @end @interface NSMutableArray(EOKeyBasedSorting) - (void)sortUsingKeyOrderArray:(NSArray *)orderArray; @end /* Local Variables: c-basic-offset: 4 tab-width: 8 End: */ SOPE/sope-gdl1/GDLAccess/EOPrimaryKeyDictionary.m0000644000000000000000000002474312242733417020410 0ustar rootroot/* EOPrimaryKeyDictionary.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Mircea Oancea Date: 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import "common.h" #import "EOPrimaryKeyDictionary.h" #import /* * Concrete Classes declaration */ @interface EOSinglePrimaryKeyDictionary : EOPrimaryKeyDictionary { id key; id value; } - (id)initWithObject:(id)anObject forKey:(id)aKey; - (id)key; @end @interface EOSinglePrimaryKeyDictionaryEnumerator : NSEnumerator { id key; } - (id)iniWithObject:(id)_key; @end @interface EOMultiplePrimaryKeyDictionary : EOPrimaryKeyDictionary { int count; NSArray *keys; id values[0]; } + (id)allocWithZone:(NSZone *)_zone capacity:(int)_capacity; - (id)initWithKeys:(NSArray *)_keys fromDictionary:(NSDictionary *)_dict; @end /* * Single key dictionary */ @implementation EOSinglePrimaryKeyDictionary - (id)initWithObject:(id)_object forKey:(id)_key { NSAssert(_key, @"provided invalid key (is nil)"); NSAssert1(_object, @"provided invalid value (is nil), key=%@", _key); if ([_object isKindOfClass:[EONull class]]) { NSLog(@"value of primary key %@ is null ..", _key); RELEASE(self); return nil; } NSAssert(![_object isKindOfClass:[EONull class]], @"value of primary key may not be null !"); self->key = RETAIN(_key); self->value = RETAIN(_object); self->fastHash = [_object hash]; return self; } - (void)dealloc { RELEASE(self->key); RELEASE(self->value); [super dealloc]; } /* operations */ - (NSEnumerator *)keyEnumerator { return AUTORELEASE([[EOSinglePrimaryKeyDictionaryEnumerator alloc] iniWithObject:self->key]); } - (id)objectForKey:(id)_key { return [key isEqual:_key] ? value : nil; } - (NSUInteger)count { return 1; } - (BOOL)isNotEmpty { return YES; } - (NSUInteger)hash { return 1; } - (id)key { return self->key; } - (NSArray *)allKeys { return [NSArray arrayWithObject:key]; } - (NSArray *)allValues { return [NSArray arrayWithObject:value]; } - (BOOL)isEqualToDictionary:(NSDictionary *)other { if (self == (EOSinglePrimaryKeyDictionary*)other) return YES; if (self->isa == ((EOSinglePrimaryKeyDictionary*)other)->isa) { if (fastHash == ((EOSinglePrimaryKeyDictionary*)other)->fastHash && [key isEqual:((EOSinglePrimaryKeyDictionary*)other)->key] && [value isEqual:((EOSinglePrimaryKeyDictionary*)other)->value]) return YES; else return NO; } if ([other count] != 1) return NO; return [value isEqual:[other objectForKey:key]]; } - (id)copyWithZone:(NSZone*)zone { if ([self zone] == (zone ? zone : NSDefaultMallocZone())) return RETAIN(self); else return [[[self class] allocWithZone:zone] initWithObject:value forKey:key]; } - (id)copy { return [self copyWithZone:NULL]; } - (BOOL)fastIsEqual:(id)other { if (self == other) return YES; if (self->isa == ((EOSinglePrimaryKeyDictionary*)other)->isa) { if (fastHash == ((EOSinglePrimaryKeyDictionary*)other)->fastHash && key == ((EOSinglePrimaryKeyDictionary*)other)->key && [value isEqual:((EOSinglePrimaryKeyDictionary*)other)->value]) return YES; else return NO; } [NSException raise:NSInvalidArgumentException format: @"fastIsEqual: compares only " @"EOPrimaryKeyDictionary instances !"]; return NO; } @end /* EOSinglePrimaryKeyDictionary */ @implementation EOSinglePrimaryKeyDictionaryEnumerator - (id)iniWithObject:(id)aKey { self->key = RETAIN(aKey); return self; } - (void)dealloc { RELEASE(self->key); [super dealloc]; } /* operations */ - (id)nextObject { id tmp = self->key; self->key = nil; return AUTORELEASE(tmp); } @end /* EOSinglePrimaryKeyDictionaryEnumerator */ /* * Multiple key dictionary is very time-memory efficient */ @implementation EOMultiplePrimaryKeyDictionary + (id)allocWithZone:(NSZone *)zone capacity:(int)capacity { return NSAllocateObject(self, sizeof(id)*capacity, zone); } - (id)initWithKeys:(NSArray*)theKeys fromDictionary:(NSDictionary*)dict; { int i; self->count = [theKeys count]; self->keys = RETAIN(theKeys); self->fastHash = 0; for (i = 0; i < count; i++) { self->values[i] = [dict objectForKey:[keys objectAtIndex:i]]; RETAIN(self->values[i]); NSAssert(![values[i] isKindOfClass:[EONull class]], @"primary key values may not be null !"); if (self->values[i] == nil) { AUTORELEASE(self); return nil; } self->fastHash += [self->values[i] hash]; } return self; } - (void)dealloc { int i; for (i = 0; i < count; i++) RELEASE(self->values[i]); RELEASE(self->keys); [super dealloc]; } /* operations */ - (NSEnumerator *)keyEnumerator { return [self->keys objectEnumerator]; } - (id)objectForKey:(id)aKey { int max, min, mid; // Binary search for key's index for (min = 0, max = count-1; min <= max; ) { NSComparisonResult ord; mid = (min+max) >> 1; ord = [(NSString*)aKey compare:(NSString*)[keys objectAtIndex:mid]]; if (ord == NSOrderedSame) return values[mid]; if (ord == NSOrderedDescending) min = mid+1; else max = mid-1; } return nil; } - (unsigned int)count { return self->count; } - (BOOL)isNotEmpty { return self->count > 0 ? YES : NO; } - (unsigned int)hash { return self->count; } - (NSArray *)allKeys { return self->keys; } - (NSArray *)allValues { return AUTORELEASE([[NSArray alloc] initWithObjects:values count:count]); } - (BOOL)isEqualToDictionary:(NSDictionary *)other { int i; if (self == (EOMultiplePrimaryKeyDictionary*)other) return YES; if ((unsigned)self->count != [other count]) return NO; for (i = 0; i < self->count; i++) { if (![values[i] isEqual:[other objectForKey:[keys objectAtIndex:i]]]) return NO; } return YES; } - (id)copyWithZone:(NSZone *)zone { if ([self zone] == (zone ? zone : NSDefaultMallocZone())) return RETAIN(self); else { return [[[self class] allocWithZone:zone capacity:count] initWithKeys:keys fromDictionary:self]; } } - (id)copy { return [self copyWithZone:NULL]; } - (unsigned)fastHash { return self->fastHash; } - (BOOL)fastIsEqual:(id)aDict { int i; if (self->isa != ((EOMultiplePrimaryKeyDictionary*)aDict)->isa) { [NSException raise:NSInvalidArgumentException format:@"fastIsEqual: can compare only " @"EOPrimaryKeyDictionary instances"]; } if (self->count != ((EOMultiplePrimaryKeyDictionary*)aDict)->count || self->fastHash != ((EOMultiplePrimaryKeyDictionary*)aDict)->fastHash || self->keys != ((EOMultiplePrimaryKeyDictionary*)aDict)->keys) return NO; for (i = count - 1; i >= 0; i--) { if (![values[i] isEqual: ((EOMultiplePrimaryKeyDictionary*)aDict)->values[i]]) return NO; } return YES; } @end /* EOMultiplePrimaryKeyDictionary */ /* * Cluster Abstract class */ @implementation EOPrimaryKeyDictionary + (id)allocWithZone:(NSZone *)_zone { return NSAllocateObject(self, 0, _zone); } + (id)dictionaryWithKeys:(NSArray *)keys fromDictionary:(NSDictionary *)dict { if ([dict count] == 0) return nil; if ([keys count] == 1) { id key = [keys objectAtIndex:0]; id keyValue = [dict objectForKey:key]; NSAssert2(keyValue, @"dictionary %@ contained no value for key %@ ..", dict, key); // Check if already an EOSinglePrimaryKeyDictionary from same entity // return it since the new one will be identical to it; we have // no problem regarding its correctness since it was built by this // method ! if ([dict isKindOfClass:[EOSinglePrimaryKeyDictionary class]]) { if ([(EOSinglePrimaryKeyDictionary*)dict key]==key) return dict; } //HH: // Check if the keyValue is EONull. If this is the case, return nil. // Primary keys are always 'not null'. if ([keyValue isKindOfClass:[EONull class]]) return nil; // Alloc single key dictionary return AUTORELEASE([[EOSinglePrimaryKeyDictionary alloc] initWithObject:keyValue forKey:key]); } else { // Check if already an EOMultiplePrimaryKeyDictionary from same entity // return it since the new one will be identical to it; we have // no problem regarding its correctness since it was built by this // method ! if ([dict isKindOfClass:[EOMultiplePrimaryKeyDictionary class]] && [dict allKeys] == keys) return dict; // Alloc multi-key dictionary return AUTORELEASE([[EOMultiplePrimaryKeyDictionary allocWithZone:NULL capacity:[keys count]] initWithKeys:keys fromDictionary:dict]); } } + (id)dictionaryWithObject:(id)object forKey:(id)key { return AUTORELEASE([[EOSinglePrimaryKeyDictionary alloc] initWithObject:object forKey:key]); } - (unsigned)fastHash { return self->fastHash; } - (BOOL)fastIsEqual:aDict { // TODO - request concrete implementation return NO; } @end /* EOPrimaryKeyDictionary */ SOPE/sope-gdl1/GDLAccess/test.py0000755000000000000000000001711512242733417015213 0ustar rootroot#!/usr/bin/env python # $Id: test.py 2 2004-08-20 10:48:47Z znek $ from sys import * from Foundation import * from eoaccess import * from EOControl import * from NGExtensions import * from GDLExtensions import * import resource; defaults = NSUserDefaults(); connDict = defaults["LSConnectionDictionary"]; if connDict is None: print "missing connection dictionary\n"; exit(1); primKeyGenDict = defaults["pkeyGeneratorDictionary"]; print primKeyGenDict; if primKeyGenDict is None: print "missing pkeyGeneratorDictionary\n"; exit(1); print "ConnectionDictionary: "; print connDict.description(); adaptorName = defaults["LSAdaptor"]; if adaptorName is None: adaptorName = "Sybase10"; adaptor = EOAdaptor(adaptorName); adaptor.setConnectionDictionary(connDict); adaptor.setPkeyGeneratorDictionary(primKeyGenDict); adContext = adaptor.createAdaptorContext(); adChannel = adContext.createAdaptorChannel(); def test_database_channel(): print "adChannel " + adChannel.description() + "\n"; print "channel "; print "attributesForTableName doc"; print adChannel.invoke1("attributesForTableName:", "doc"); print "primaryKeyAttributesForTableName document _______________________________________\n"; print adChannel.invoke1("primaryKeyAttributesForTableName:", "document"); print "primaryKeyAttributesForTableName:, doc _______________________________________\n"; print adChannel.invoke1("primaryKeyAttributesForTableName:", "doc"); print "primaryKeyAttributesForTableName company _______________________________________\n"; print adChannel.invoke1("primaryKeyAttributesForTableName:", "company"); print "primaryKeyAttributesForTableName person_______________________________________\n"; print adChannel.invoke1("primaryKeyAttributesForTableName:", "person"); print "_______________________________________\n"; def test_adaptor_data_source(): adaptor = adChannel.adaptorContext().adaptor(); dict = NSMutableDictionary(); dict["login"] = "jan_1"; dict["name"] = "JR"; dict["firstname"] = "jan"; dict["is_person"] = 1; dict["number"] = "12345_1"; dict["birthday"] = NSCalendarDate('1999-09-21 13:23', '%Y-%m-%d %H:%M'); dict["middlename"] = "Ein Unnuetzer middlename"; dataSource = EOAdaptorDataSource(adChannel); hints = NSMutableDictionary(); pks = NSMutableArray(); pks.addObject("company_id"); hints.setObjectForKey(pks, "EOPrimaryKeyAttributeNamesHint") fetchSpec = EOFetchSpecification(); fetchSpec.setEntityName("company"); fetchSpec.setHints(hints); dataSource.setFetchSpecification(fetchSpec); print "-------------------- {insert ---------------------\n"; dataSource.insertObject(dict); print "-------------------- insert} ---------------------\n"; print "-------------------- {select with hints ---------------------\n"; qualifier = EOQualifier("login = %@", ("jan_1", )) fetchSpec = EOFetchSpecification(); fetchSpec.setQualifier(qualifier); fetchSpec.setEntityName("company"); hints = NSMutableDictionary(); pks.addObject("company_id"); hints.setObjectForKey(NSTimeZone('MET'), "EOFetchResultTimeZoneHint") fetchSpec.setHints(hints); sortOrderings = NSMutableArray(); sortOrderings.addObject(EOSortOrdering("login", "compareCaseInsensitiveAscending:")); sortOrderings.addObject(EOSortOrdering("company_id", "compareCaseInsensitiveDescending:")); fetchSpec.setSortOrderings(sortOrderings); dataSource = EOAdaptorDataSource(adChannel); dataSource.setFetchSpecification(fetchSpec); objs = dataSource.fetchObjects(); print objs; print "-------------------- select} ---------------------\n"; obj = objs[0]; print "-------------------- {update ---------------------\n"; print obj; obj["login"] = "jan_1_1"; obj["middlename"] = EONull(); dataSource.updateObject(obj); print "-------------------- update} ---------------------\n"; qualifier = EOQualifier("login caseInsensitiveLike %@", ("jan_1_*", )) fetchSpec.setQualifier(qualifier); dataSource.setFetchSpecification(fetchSpec); print "-------------------- {select ---------------------\n"; objs = dataSource.fetchObjects(); print objs; print "-------------------- select} ---------------------\n"; print "-------------------- {delete ---------------------\n"; obj = objs[0]; dataSource.deleteObject(obj); print "-------------------- delete} ---------------------\n"; print "-------------------- {select ---------------------\n"; objs = dataSource.fetchObjects(); print objs; print "-------------------- select} ---------------------\n"; def test_cascaded_datasources(): adaptor = adChannel.adaptorContext().adaptor(); dict = NSMutableDictionary(); dict["login"] = "jan_1"; dict["name"] = "JR"; dict["firstname"] = "jan"; dict["is_person"] = 1; dict["number"] = "12345_1"; dataSource = EOAdaptorDataSource(adChannel); fetchSpec = EOFetchSpecification(); fetchSpec.setEntityName("company"); qualifier = EOQualifier("login like %@", ("j%", )) fetchSpec = EOFetchSpecification(); fetchSpec.setQualifier(qualifier); fetchSpec.setEntityName("company"); sortOrderings = NSMutableArray(); sortOrderings.addObject(EOSortOrdering("login", "compareCaseInsensitiveAscending:")); fetchSpec.setSortOrderings(sortOrderings); hints = NSMutableDictionary(); pks = NSMutableArray(); pks.addObject("company_id"); hints.setObjectForKey(pks, "EOPrimaryKeyAttributeNamesHint") fetchSpec.setHints(hints); dataSource.setFetchSpecification(fetchSpec); cacheDataSource = EOCacheDataSource(dataSource); objs = dataSource.fetchObjects(); print objs; print cacheDataSource.fetchObjects(); print "-----------------------------\n"; print cacheDataSource.fetchObjects(); dataSource.insertObject(dict); print "++++++++++++++++++++++++++++\n"; fetchSpec = EOFetchSpecification(); fetchSpec.setEntityName("company"); qualifier = EOQualifier("login = %@", ("jan_1", )) fetchSpec = EOFetchSpecification(); fetchSpec.setQualifier(qualifier); fetchSpec.setEntityName("company"); dataSource.setFetchSpecification(fetchSpec); cacheDataSource = EOCacheDataSource(dataSource); objs = dataSource.fetchObjects(); obj = objs[0]; print objs; print "-----------------------------\n"; print cacheDataSource.deleteObject(obj); print "++++++++++++++++++++++++++++\n"; print cacheDataSource.fetchObjects(); def echo_logins(objs): for o in objs: print o['login']; def test_sort_datasource(): dataSource = EOAdaptorDataSource(adChannel); fetchSpec = EOFetchSpecification(); fetchSpec.setEntityName("company"); qualifier = EOQualifier("login like %@", ("%a%", )) fetchSpec.setQualifier(qualifier); dataSource.setFetchSpecification(fetchSpec); echo_logins(dataSource.fetchObjects()); sortOrderings = NSMutableArray(); sO = EOSortOrdering("login", "compareDescending:"); sortOrderings.addObject(sO); fetchSpec.setSortOrderings(sortOrderings); dataSource.setFetchSpecification(fetchSpec); echo_logins(dataSource.fetchObjects()); print resource.getrlimit(resource.RLIMIT_CORE); if adChannel.openChannel(): print "open channel ok"; else: print "open channel failed"; exit(1); print "adChannel ", adChannel; #test_database_channel(); test_adaptor_data_source(); #test_cascaded_datasources(); #test_sort_datasource(); SOPE/sope-gdl1/GDLAccess/fhs.make0000644000000000000000000000226212242733417015273 0ustar rootroot# postprocessing # FHS support (this is a hack and is going to be done by gstep-make!) ifneq ($(FHS_INSTALL_ROOT),) FHS_INCLUDE_DIR=$(FHS_INSTALL_ROOT)/include/ FHS_BIN_DIR=$(FHS_INSTALL_ROOT)/bin/ FHS_LIB_DIR=$(CONFIGURE_FHS_INSTALL_LIBDIR) NONFHS_LIBDIR="$(GNUSTEP_LIBRARIES)/$(GNUSTEP_TARGET_LDIR)/" NONFHS_LIBNAME="$(LIBRARY_NAME)$(LIBRARY_NAME_SUFFIX)$(SHARED_LIBEXT)" NONFHS_BINDIR="$(GNUSTEP_TOOLS)/$(GNUSTEP_TARGET_LDIR)" fhs-header-dirs :: $(MKDIRS) $(FHS_INCLUDE_DIR)$(libGDLAccess_HEADER_FILES_INSTALL_DIR) fhs-bin-dirs :: $(MKDIRS) $(FHS_BIN_DIR) move-headers-to-fhs :: fhs-header-dirs @echo "moving headers to $(FHS_INCLUDE_DIR) .." mv $(GNUSTEP_HEADERS)$(libGDLAccess_HEADER_FILES_INSTALL_DIR)/*.h \ $(FHS_INCLUDE_DIR)$(libGDLAccess_HEADER_FILES_INSTALL_DIR)/ move-libs-to-fhs :: @echo "moving libs to $(FHS_LIB_DIR) .." mv $(NONFHS_LIBDIR)/$(NONFHS_LIBNAME)* $(FHS_LIB_DIR)/ move-tools-to-fhs :: fhs-bin-dirs @echo "moving tools from $(NONFHS_BINDIR) to $(FHS_BIN_DIR) .." for i in $(TOOL_NAME); do \ mv "$(NONFHS_BINDIR)/$${i}" $(FHS_BIN_DIR); \ done move-to-fhs :: move-headers-to-fhs move-libs-to-fhs move-tools-to-fhs after-install :: move-to-fhs endif SOPE/sope-gdl1/GDLAccess/README0000644000000000000000000001357412242733417014544 0ustar rootrootNOTE: this file is outdated! GNU Database Library Access Layer - MDlink patch Version Contained code is derived from GDL - GNU Database Library and is therefore LGPL license. Copyright for GDL has the Free Software Foundation. Changes There are no EOJoin's anymore (only for compability). EORelationships cannot be compound and store source and destination themselves. No compound primary keys are allowed. Uniquing is always enabled. Added "abcX" methods which do not raise exceptions but return them. Static Linking uncomment '#imports' in EOModel.m Intro The GNUstep Database Library is a hierarchy of Objective-C classes that provide a three-tiered architecture for developing database applications. The three-tier architecture is a flexible paradigm for building robust and scalable client/server applications; the three tiers refer to the database, the Application Objects, and the user interface. The separation of the database from the user interface through intermediary Application Objects allows the data to be distributed appropriately across database servers and still have the user interface display data cohesively for the end-user. Business logic, as implemented in the Application Objects, provides the mechanism for consistency and reusability across all your business applications. Entity-relationship modelling is used for describing the Application Objects and how they are mapped to database fields. The GNUstep Database Library represents these models as plain ASCII text files; this allows external programs to be used for constructing and maintaining the models separate from the applications which use them. Differences to GNUstep gdl Datasource objects are missing. ToDo EOQualifier: `isValidQualifierType' from EOAdaptor is not used now. This method is supposed to verify, when a qualifier is constructed, if an attribute can appear inside an expression. Make the relationshipPaths of type GCMutableSet. EOSQLExpresion There is no support now for specifying properties for the tables that appear in the FROM clause; I am thinking specifically at the OUTER specifier required by some servers when you use outer joins. Optimize the generated WHERE clause when the same relationship appears more than one time in the entity. The external query from EOEntity is not used when a fetch operation is unrestricted, i.e. it fetches all the records from the table Class Hierachy NSObject DefaultScannerHandler EOInsertUpdateScannerHandler EOQualifierScannerHandler EOSelectScannerHandler EOAdaptor EOAdaptorChannel EOAdaptorContext EOAttributeOrdering EODatabase EODatabaseChannel EODatabaseContext EOFaultResolver EOArrayFault EOObjectFault EOGenericRecord EOKeySortOrdering EONull < NSCopying > EOObjectUniquer EOQualifierJoinHolder EOQuotedExpression < NSCopying > EOSQLExpression < EOExpressionContext > EODeleteSQLExpression EOInsertSQLExpression EOSelectSQLExpression EOUpdateSQLExpression NSDictionary EOPrimaryKeyDictionary EOSinglePrimaryKeyDictionary EOMultiplePrimaryKeyDictionary NSEnumerator EOSinglePrimaryKeyDictionaryEnumerator EOAttribute EOEntity EOModel EOQualifier EOSQLQualifier < NSCopying > EORelationship EOExpressionArray GCObject GCMutableArray EOFault NSException EOFException DestinationEntityDoesntMatchDefinitionException EOAdaptorException InvalidAttributeException InvalidQualifierException ObjectNotAvailableException PropertyDefinitionException PropertyDefinitionException InvalidNameException InvalidPropertyException InvalidValueTypeException RelationshipMustBeToOneException EOAdaptorException CannotFindAdaptorBundleException DataTypeMappingNotSupportedException InvalidAdaptorBundleException InvalidAdaptorStateException InvalidAdaptorStateException AdaptorIsFetchingException AdaptorIsNotFetchingException ChannelIsNotOpenedException NoTransactionInProgressException TooManyOpenedChannelsException Categories EOAdaptor+Private EOAdaptorContext+Private EOAttribute+EOAttributePrivate EOAttribute+ValuesConversion EODatabase+Private EODatabaseChannel+Private EODatabaseContext+Private EOEntity+EOEntityPrivate EOEntity+ValuesConversion EOJoin+EOJoinPrivate EOModel+EOModelPrivate EORelationship+EORelationshipPrivate NSArray+EOKeyBasedSorting NSData+EOCustomValues NSDictionary+EOKeyValueCoding NSMutableArray+EOKeyBasedSorting NSMutableDictionary+EOKeyValueCoding NSNumber+EOCustomValues NSObject+EOExpression NSObject+EOAdaptorChannelDelegation NSObject+EOAdaptorContextDelegate NSObject+EOAdaptorDelegate NSObject+EOCustomValues NSObject+EODatabaseChannelDelegateProtocol NSObject+EODatabaseChannelNotification NSObject+EODatabaseCustomValues NSObject+EOGenericRecord NSObject+EOKeyValueCoding NSObject+EOKeyValueCodingEONull NSObject+EOUnableToFaultToOne NSString+EOAttributeTypeCheck NSString+EOCustomValues Protocols EOExpressionContext Informal Protocols EOClassMapping EOCustomValues EODatabaseChannelNotification EODatabaseCustomValues EOExpression EOKeyValueCoding EOKeyValueCodingEONull EOUnableToFaultToOne -- Helge Hess (helge@mdlink.de) MDlink online service center, 1998-11-01 SOPE/sope-gdl1/GDLAccess/EOKeyComparisonQualifier+SQL.m0000644000000000000000000000440512242733417021337 0ustar rootroot/* EOAdaptorChannel.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: October 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // $Id: EOKeyComparisonQualifier+SQL.m 1 2004-08-20 10:38:46Z znek $ #import "EOSQLQualifier.h" #include "common.h" @implementation EOKeyComparisonQualifier(SQLQualifier) /* SQL qualifier generation */ - (EOSQLQualifier *)sqlQualifierForEntity:(EOEntity *)_entity { EOSQLQualifier *q; NSString *format; if (SEL_EQ(self->operator, EOQualifierOperatorEqual)) format = @"%A = %A"; else if (SEL_EQ(self->operator, EOQualifierOperatorNotEqual)) format = @"%A <> %A"; else if (SEL_EQ(self->operator, EOQualifierOperatorLessThan)) format = @"%A < %A"; else if (SEL_EQ(self->operator, EOQualifierOperatorGreaterThan)) format = @"%A > %A"; else if (SEL_EQ(self->operator, EOQualifierOperatorLessThanOrEqualTo)) format = @"%A <= %A"; else if (SEL_EQ(self->operator, EOQualifierOperatorGreaterThanOrEqualTo)) format = @"%A >= %A"; else if (SEL_EQ(self->operator, EOQualifierOperatorLike)) format = @"%A LIKE %A"; else { format = [NSString stringWithFormat:@"%%A %@ %%A", NSStringFromSelector(self->operator)]; } q = [[EOSQLQualifier alloc] initWithEntity:_entity qualifierFormat:format, self->leftKey, self->rightKey]; return AUTORELEASE(q); } @end /* EOKeyComparisonQualifier(SQLQualifier) */ SOPE/sope-gdl1/GDLAccess/EOAdaptorDataSource.m0000644000000000000000000012651412242733417017632 0ustar rootroot/* EOAdaptorDataSource.m Copyright (C) SKYRIX Software AG and Helge Hess Date: 1999-2005 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* column-names must have small letterso hints: EOPrimaryKeyAttributeNamesHint - name of primary key attributes EOPrimaryKeyAttributesHint - primary key attributes EOFetchResultTimeZone - NSTimeZone object for dates */ #define EOAdaptorDataSource_DEBUG 0 #include #include #include #include "common.h" NSString *EOPrimaryKeyAttributeNamesHint = @"EOPrimaryKeyAttributeNamesHint"; NSString *EOPrimaryKeyAttributesHint = @"EOPrimaryKeyAttributesHint"; NSString *EOFetchResultTimeZone = @"EOFetchResultTimeZoneHint"; @interface NSObject(Private) - (NSString *)newKeyExpression; - (NSArray *)_primaryKeyAttributesForTableName:(NSString *)_entityName channel:(EOAdaptorChannel *)_adChannel; - (NSArray *)_primaryKeyAttributeNamesForTableName:(NSString *)_entityName channel:(EOAdaptorChannel *)_adChannel; @end static EONull *null = nil; @interface EOAdaptorChannel(Internals) - (NSArray *)_sortAttributesForSelectExpression:(NSArray *)_attrs; @end /* EOAdaptorChannel(Internals) */ @interface EOQualifier(SqlExpression) - (NSString *)sqlExpressionWithAdaptor:(EOAdaptor *)_adaptor attributes:(NSArray *)_attrs; @end /* EOQualifier(SqlExpression) */ @interface EOAdaptorDataSource(Private) - (NSMutableString *)_selectListWithChannel:(EOAdaptorChannel *)_adChan; - (NSString *)_whereExprWithChannel:(EOAdaptorChannel *)_adChan; - (NSString *)_whereClauseForGlobaID:(EOKeyGlobalID *)_gid adaptor:(EOAdaptor *)_adaptor channel:(EOAdaptorChannel *)_adChan; - (NSString *)_orderByExprForAttributes:(NSArray *)_attrs andPatchSelectList:(NSMutableString *)selectList withChannel:(EOAdaptorChannel *)_adChan; - (NSDictionary *)_mapAttrsWithValues:(NSDictionary *)_keyValues tableName:(NSString *)_tableName channel:(EOAdaptorChannel *)_adChan; @end /* EOAdaptorDataSource(Private) */ @interface EOAdaptorDataSource(Internals) - (id)initWithAdaptorChannel:(EOAdaptorChannel *)_channel connectionDictionary:(NSDictionary *)_connDict; @end /* EOAdaptorDataSource(Internals) */ @interface EODataSource(Notificiations) - (void)postDataSourceChangedNotification; @end @implementation EOAdaptorDataSource static Class NSCalendarDateClass = nil; static NSNotificationCenter *nc = nil; static NSNotificationCenter *getNC(void ) { if (nc == nil) nc = [[NSNotificationCenter defaultCenter] retain]; return nc; } + (void)initialize { null = [[EONull null] retain]; NSCalendarDateClass = [NSCalendarDate class]; } - (id)initWithAdaptorName:(NSString *)_adName connectionDictionary:(NSDictionary *)_dict primaryKeyGenerationDictionary:(NSDictionary *)_pkGen { EOAdaptor *ad = nil; EOAdaptorContext *ctx = nil; EOAdaptorChannel *adc = nil; ad = [EOAdaptor adaptorWithName:_adName]; [ad setConnectionDictionary:_dict]; [ad setPkeyGeneratorDictionary:_pkGen]; ctx = [ad createAdaptorContext]; adc = [ctx createAdaptorChannel]; return [self initWithAdaptorChannel:adc connectionDictionary:_dict]; } - (id)initWithAdaptorChannel:(EOAdaptorChannel *)_channel { return [self initWithAdaptorChannel:_channel connectionDictionary:nil]; } - (id)initWithAdaptorChannel:(EOAdaptorChannel *)_channel connectionDictionary:(NSDictionary *)_connDict { if ((self = [super init])) { self->adChannel = [_channel retain]; self->connectionDictionary = [_connDict copy]; self->commitTransaction = NO; [getNC() addObserver:self selector:@selector(_adDataSourceChanged:) name:@"EOAdaptorDataSourceChanged" object:nil]; } return self; } - (void)dealloc { [getNC() removeObserver:self]; [self->fetchSpecification release]; [self->connectionDictionary release]; [self->adChannel release]; [self->__attributes release]; [self->__qualifier release]; [super dealloc]; } /* notifications */ - (void)postDataSourceItselfChangedNotification { [super postDataSourceChangedNotification]; } - (void)postDataSourceChangedNotification { [getNC() postNotificationName:@"EOAdaptorDataSourceChanged" object:self]; [self postDataSourceItselfChangedNotification]; } - (void)_adDataSourceChanged:(NSNotification *)_notification { EOAdaptorDataSource *ads; if ((ads = [_notification object]) == self) return; if (ads == nil) return; [self postDataSourceItselfChangedNotification]; #if 0 if (![ads->connectionDictionary isEqual:self->connectionDictionary]) /* different database ... */ return; if ((ads->fetchSpecification == nil) || (self->fetchSpecification == nil)) { [self postDataSourceChangedNotification]; return; } /* check fspecs for entity ... */ if ([[ads->fetchSpecification entityName] isEqualToString: [self->fetchSpecification entityName]]) { [self postDataSourceChangedNotification]; return; } #endif } /* fetching */ - (EOAdaptorChannel *)beginTransaction { EOAdaptorContext *ctx = nil; [self openChannel]; ctx = [self->adChannel adaptorContext]; if ([ctx hasOpenTransaction] == NO) { [ctx beginTransaction]; self->commitTransaction = YES; } return self->adChannel; } - (void)commitTransaction { if (self->commitTransaction) { [[self->adChannel adaptorContext] commitTransaction]; // [self->adChannel closeChannel]; self->commitTransaction = NO; } } - (void)rollbackTransaction { [[self->adChannel adaptorContext] rollbackTransaction]; // [self->adChannel closeChannel]; self->commitTransaction = NO; } - (void)openChannel { if (![self->adChannel isOpen]) { [self->adChannel openChannel]; } } - (void)closeChannel { if (![self->adChannel isOpen]) return; if ([[self->adChannel adaptorContext] transactionNestingLevel]) { NSLog(@"%s was called while transaction in progress, rollback will called", __PRETTY_FUNCTION__); [self rollbackTransaction]; } [self->adChannel closeChannel]; } - (NSArray *)fetchObjects { // TODO: split up this HUGE method! // TODO: all the SQL gen code should be moved to an appropriate object NSString *entityName = nil; NSString *whereExpr = nil; NSString *orderByExpr = nil; NSMutableString *selectList = nil; NSMutableString *expression = nil; NSMutableArray *result = nil; NSArray *attrs = nil; NSArray *pKeys = nil; EOQualifier *qual = nil; EOAdaptorChannel *adChan = nil; int pKeyCnt = 0; NSTimeZone *tz = nil; BOOL localComTrans; if (self->fetchSpecification == nil) { // TODO: make that a lastException and just return nil [NSException raise:NSInvalidArgumentException format:@"fetchSpecification required for table name"]; return nil; } entityName = [self->fetchSpecification entityName]; if (entityName == nil || [entityName length] == 0) { [NSException raise:NSInvalidArgumentException format:@"missing entity name"]; } localComTrans = [[self->adChannel adaptorContext] hasOpenTransaction] ? NO : YES; adChan = [self beginTransaction]; pKeys = [self _primaryKeyAttributeNamesForTableName:entityName channel:adChan]; if ((pKeyCnt = [pKeys count]) == 0) { NSLog(@"ERROR[%s]: missing primary keys for table %@", __PRETTY_FUNCTION__, entityName); return nil; } qual = [self->fetchSpecification qualifier]; if (qual == nil) qual = [EOQualifier qualifierWithQualifierFormat:@"1=1"]; ASSIGN(self->__qualifier, qual); attrs = [adChan attributesForTableName:entityName]; if (attrs == nil) { RELEASE(self->__qualifier); self->__qualifier = nil; NSLog(@"ERROR[%s]: could not find table '%@' in database.", __PRETTY_FUNCTION__, entityName); [self rollbackTransaction]; return nil; } if ([attrs count] == 0) { RELEASE(self->__qualifier); self->__qualifier = nil; NSLog(@"ERROR[%s]: missing columns in table '%@'.", __PRETTY_FUNCTION__, entityName); [self rollbackTransaction]; return nil; } tz = [[self->fetchSpecification hints] objectForKey:EOFetchResultTimeZone]; ASSIGN(self->__attributes, attrs); { NSArray *a; NSSet *tableKeys = nil; NSSet *qualifierKeys = nil; a = [[[qual allQualifierKeys] allObjects] map:@selector(lowercaseString)]; qualifierKeys = [[NSSet alloc] initWithArray:a]; a = [[attrs map:@selector(columnName)] map:@selector(lowercaseString)]; tableKeys = [[NSSet alloc] initWithArray:a]; if ([qualifierKeys isSubsetOfSet:tableKeys] == NO) { NSString *format = nil; format = [NSString stringWithFormat: @"EOAdaptorDataSource: using unmapped key in " @"qualifier tableKeys <%@> qualifierKeys <%@> " @"qualifier <%@>", tableKeys, qualifierKeys, qual]; RELEASE(self->__attributes); self->__attributes = nil; RELEASE(self->__qualifier); self->__qualifier = nil; RELEASE(tableKeys); tableKeys = nil; [self rollbackTransaction]; [[[InvalidQualifierException alloc] initWithFormat:format] raise]; } RELEASE(tableKeys); tableKeys = nil; RELEASE(qualifierKeys); qualifierKeys = nil; } whereExpr = [self _whereExprWithChannel:adChan]; selectList = [self _selectListWithChannel:adChan]; orderByExpr = [self _orderByExprForAttributes:attrs andPatchSelectList:selectList withChannel:adChan]; expression = [[NSMutableString alloc] initWithCapacity:256]; [expression appendString:@"SELECT "]; if ([self->fetchSpecification usesDistinct]) [expression appendString:@"DISTINCT "]; [expression appendString:selectList]; [expression appendString:@" FROM "]; [expression appendString:entityName]; if ([whereExpr length] > 0) { [expression appendString:@" WHERE "]; [expression appendString:whereExpr]; } if (orderByExpr != nil && [orderByExpr length] > 0) { [expression appendString:@" ORDER BY "]; [expression appendString:orderByExpr]; } if (![adChan evaluateExpression:expression]) { RELEASE(self->__attributes); self->__attributes = nil; RELEASE(self->__qualifier); self->__qualifier = nil; AUTORELEASE(expression); [adChan cancelFetch]; [self rollbackTransaction]; [[[EOAdaptorException alloc] initWithFormat:@"evaluateExpression of %@ failed", expression] raise]; } result = [NSMutableArray arrayWithCapacity:64]; { NSMutableDictionary *row = nil; unsigned fetchCnt = 0; unsigned fetchLimit = 0; unsigned attrCnt = 0; id *values = NULL; id *keys = NULL; /* Note: those are reused in the inner loop */ attrCnt = [attrs count]; values = calloc(attrCnt + 2, sizeof(id)); keys = calloc(attrCnt + 2, sizeof(id)); fetchLimit = [self->fetchSpecification fetchLimit]; while ((row = [adChan fetchAttributes:attrs withZone:NULL]) != nil) { NSEnumerator *enumerator = nil; id attr = nil; int rowCnt = 0; NSDictionary *r = nil; id *pKeyVs = NULL; int pKeyVCnt = 0; pKeyVs = calloc(pKeyCnt, sizeof(id)); enumerator = [attrs objectEnumerator]; while ((attr = [enumerator nextObject]) != nil) { id obj; NSString *cn; obj = [row objectForKey:[(EOAttribute *)attr name]]; if (obj == nil) continue; if (tz != nil && [obj isKindOfClass:NSCalendarDateClass]) [obj setTimeZone:tz]; cn = [[attr columnName] lowercaseString]; values[rowCnt] = obj; keys[rowCnt] = cn; rowCnt++; if ([pKeys containsObject:cn]) { int idx; idx = [pKeys indexOfObject:cn]; NSAssert4(idx <= (pKeyCnt - 1) && pKeyVs[idx] == nil, @"internal inconsistency in EOAdaptorDataSource " @"while fetch idx[%d] > (pKeyCnt - 1)[%d] " @"pKeyVs[idx] (%@[%d]);", idx, (pKeyCnt - 1), pKeyVs[idx], idx); pKeyVs[idx] = obj; pKeyVCnt++; } } if (pKeyCnt != pKeyVCnt) NSAssert(NO, @"internal inconsistency in EOAdaptorDataSource " @"while fetch"); { EOGlobalID *gid; gid = [EOKeyGlobalID globalIDWithEntityName:entityName keys:pKeyVs keyCount:pKeyVCnt zone:NULL]; if (self->connectionDictionary) { gid = [[EOAdaptorGlobalID alloc] initWithGlobalID:gid connectionDictionary: self->connectionDictionary]; AUTORELEASE(gid); } values[rowCnt] = gid; keys[rowCnt] = @"globalID"; rowCnt++; } fetchCnt++; r = [[NSMutableDictionary alloc] initWithObjects:values forKeys:keys count:rowCnt]; [result addObject:r]; [r release]; r = nil; if (pKeyVs) free(pKeyVs); pKeyVs = NULL; if (fetchLimit == fetchCnt) break; } if (values) free(values); values = NULL; if (keys) free(keys); keys = NULL; } [adChan cancelFetch]; if (localComTrans) [self commitTransaction]; [expression release]; expression = nil; [self->__qualifier release]; self->__qualifier = nil; [self->__attributes release]; self->__attributes = nil; return result; } - (id)createObject { return [NSMutableDictionary dictionary]; } - (void)insertObject:(id)_obj { NSString *key = nil; NSString *tableName = nil; NSMutableString *expression = nil; EOAdaptor *adaptor = nil; NSArray *pKeys = nil; id obj = nil; EOAdaptorChannel *adChan = nil; int oVCnt = 0; NSString **objectKeyAttrValue = NULL; NSEnumerator *enumerator = nil; id pKey = nil; BOOL localComTrans; if ([[self->adChannel adaptorContext] hasOpenTransaction]) localComTrans = NO; else localComTrans = YES; adChan = [self beginTransaction]; adaptor = [[adChan adaptorContext] adaptor]; if ((tableName = [self->fetchSpecification entityName]) == nil) { [self rollbackTransaction]; [NSException raise:NSInvalidArgumentException format:@"couldn`t insert obj %@ missing entityName in " @"fetchSpecification", _obj]; } /* create or apply primary keys */ #if EOAdaptorDataSource_DEBUG NSLog(@"insert obj %@", _obj); #endif pKeys = [self _primaryKeyAttributeNamesForTableName:tableName channel:adChan]; #if EOAdaptorDataSource_DEBUG NSLog(@"got primary keys %@", pKeys); #endif objectKeyAttrValue = calloc([pKeys count], sizeof(id)); enumerator = [pKeys objectEnumerator]; while ((pKey = [enumerator nextObject])) { id pKeyObj; pKeyObj = [_obj valueForKey:pKey]; #if EOAdaptorDataSource_DEBUG NSLog(@"pk in obj %@:<%@> ", pKey, pKeyObj); #endif if (![pKeyObj isNotNull]) { /* try to build primary key */ NSString *newKeyExpr = nil; NSDictionary *row = nil; #if EOAdaptorDataSource_DEBUG NSLog(@"pKeyObj !isNotNull"); #endif if ([pKeys count] != 1) { [self rollbackTransaction]; [NSException raise:NSInternalInconsistencyException format:@"more than one primary key, " @"and primary key for %@ is not set", pKey]; } if (![adaptor respondsToSelector:@selector(newKeyExpression)]) { [self rollbackTransaction]; [NSException raise:NSInternalInconsistencyException format:@"got no newkey expression, insert failed"]; } newKeyExpr = [(id)adaptor newKeyExpression]; if (newKeyExpr == nil) { [self rollbackTransaction]; [NSException raise:NSInternalInconsistencyException format:@"missing newKeyExpression for adaptor[%@] %@...", NSStringFromClass([adaptor class]), adaptor]; } if (![adChan evaluateExpression:newKeyExpr]) { [adChan cancelFetch]; [self rollbackTransaction]; [[[EOAdaptorException alloc] initWithFormat:@"couldn`t evaluate new key expression %@", newKeyExpr] raise]; } row = [adChan fetchAttributes:[adChan describeResults] withZone:NULL]; [adChan cancelFetch]; if ((key = [[row objectEnumerator] nextObject]) == nil) { [self rollbackTransaction]; [[[EOAdaptorException alloc] initWithFormat:@"couldn`t fetch primary key"] raise];; } objectKeyAttrValue[oVCnt++] = key; [_obj takeValue:key forKey:pKey]; #if EOAdaptorDataSource_DEBUG NSLog(@"_obj %@ after takeValue:%@ forKey:%@", _obj, key, pKey); #endif } else { objectKeyAttrValue[oVCnt++] = pKeyObj; #if EOAdaptorDataSource_DEBUG NSLog(@"objectKeyAttrValue takeValue %@ for idx %d", pKeyObj, oVCnt); #endif } } /* construct SQL INSERT expression .. */ expression = [[NSMutableString alloc] initWithCapacity:256]; [expression appendString:@"INSERT INTO "]; [expression appendString:tableName]; [expression appendString:@"("]; { NSDictionary *objects = nil; NSEnumerator *enumerator = nil; NSArray *allKeys = nil; BOOL isFirst = YES; objects = [self _mapAttrsWithValues:_obj tableName:tableName channel:adChan]; allKeys = [objects allKeys]; enumerator = [allKeys objectEnumerator]; while ((obj = [enumerator nextObject])) { if (isFirst) isFirst = NO; else [expression appendString:@", "]; [expression appendString:[adaptor formatAttribute:obj]]; } [expression appendString:@") VALUES ("]; enumerator = [allKeys objectEnumerator]; isFirst = YES; while ((obj = [enumerator nextObject])) { id value; if (isFirst) isFirst = NO; else [expression appendString:@", "]; value = [objects objectForKey:obj]; if (value == nil) value = null; [expression appendString:[adaptor formatValue:value forAttribute:obj]]; } } [expression appendString:@")"]; /* execute insert in SQL server .. */ if (![adChan evaluateExpression:expression]) { [adChan cancelFetch]; enumerator = [pKeys objectEnumerator]; while ((pKey = [enumerator nextObject])) { [_obj takeValue:[EONull null] forKey:pKey]; } [self rollbackTransaction]; AUTORELEASE(expression); [[[EOAdaptorException alloc] initWithFormat:@"evaluateExpression %@ failed", expression] raise]; } [adChan cancelFetch]; if (localComTrans) [self commitTransaction]; /* construct new global id for record */ { EOGlobalID *gid; gid = [EOKeyGlobalID globalIDWithEntityName:tableName keys:objectKeyAttrValue keyCount:oVCnt zone:NULL]; if (self->connectionDictionary != nil) { EOAdaptorGlobalID *agid = nil; agid = [[EOAdaptorGlobalID alloc] initWithGlobalID:gid connectionDictionary: self->connectionDictionary]; AUTORELEASE(agid); gid = agid; } [_obj takeValue:gid forKey:@"globalID"]; } RELEASE(expression); expression = NULL; /* mark datasource as changed */ [self postDataSourceChangedNotification]; } - (void)updateObject:(id)_obj { NSString *whereClause = nil; NSMutableString *expression = nil; EOAdaptor *adaptor = nil; EOKeyGlobalID *gid = nil; NSEnumerator *enumerator = nil; NSString *tableName = nil; EOAttribute *attr = nil; BOOL isFirst = YES; NSDictionary *objects = nil; EOAdaptorChannel *adChan = nil; BOOL localComTrans; if ((gid = [_obj valueForKey:@"globalID"]) == nil) { [NSException raise:NSInvalidArgumentException format:@"missing globalID, couldn`t update"]; } if ([gid isKindOfClass:[EOAdaptorGlobalID class]]) { NSDictionary *conD = nil; conD = [(EOAdaptorGlobalID *)gid connectionDictionary]; if (![conD isEqualToDictionary:self->connectionDictionary]) { [NSException raise:NSInvalidArgumentException format:@"try to update object %@ in " @"wrong AdaptorDataSource %@", _obj, self]; } gid = (EOKeyGlobalID *)[(EOAdaptorGlobalID *)gid globalID]; } if ([[self->adChannel adaptorContext] hasOpenTransaction]) localComTrans = NO; else localComTrans = YES; adChan = [self beginTransaction]; tableName = [gid entityName]; adaptor = [[adChan adaptorContext] adaptor]; whereClause = [self _whereClauseForGlobaID:gid adaptor:adaptor channel:adChan]; if (whereClause == nil) { [self rollbackTransaction]; return; } expression = [[NSMutableString alloc] initWithCapacity:256]; [expression appendString:@"UPDATE "]; [expression appendString:[gid entityName]]; [expression appendString:@" SET "]; objects = [self _mapAttrsWithValues:_obj tableName:tableName channel:adChan]; enumerator = [objects keyEnumerator]; while ((attr = [enumerator nextObject])) { id value; if (isFirst) isFirst = NO; else [expression appendString:@", "]; [expression appendString:[adaptor formatAttribute:attr]]; [expression appendString:@"="]; value = [objects objectForKey:attr]; if (value == nil) value = null; [expression appendString:[adaptor formatValue:value forAttribute:attr]]; } [expression appendString:@" WHERE "]; [expression appendString:whereClause]; if (![adChan evaluateExpression:expression]) { [adChan cancelFetch]; [self rollbackTransaction]; AUTORELEASE(expression); [[[EOAdaptorException alloc] initWithFormat:@"evaluate expression %@ failed", expression] raise]; } [adChan cancelFetch]; if (localComTrans) [self commitTransaction]; RELEASE(expression); expression = nil; { EOGlobalID *newGID; NSArray *attrs; NSEnumerator *enumerator; id *objs; int objCnt; NSString *attr; attrs = [self _primaryKeyAttributeNamesForTableName:[gid entityName] channel:adChan]; enumerator = [attrs objectEnumerator]; objCnt = 0; objs = calloc([attrs count], sizeof(id)); while ((attr = [enumerator nextObject])) { objs[objCnt] = [_obj valueForKey:attr]; objCnt++; } newGID = [EOKeyGlobalID globalIDWithEntityName:[gid entityName] keys:objs keyCount:objCnt zone:NULL]; if (self->connectionDictionary != nil) { newGID = [[EOAdaptorGlobalID alloc] initWithGlobalID:newGID connectionDictionary: self->connectionDictionary]; [newGID autorelease]; } [(NSMutableDictionary *)_obj setObject:newGID forKey:@"globalID"]; } [self postDataSourceChangedNotification]; } - (void)deleteObject:(id)_obj { NSString *whereClause = nil; NSMutableString *expression = nil; EOKeyGlobalID *gid = nil; EOAdaptorChannel *adChan = nil; BOOL localComTrans; if ((gid = [_obj valueForKey:@"globalID"]) == nil) { [NSException raise:NSInvalidArgumentException format:@"missing globalID, could not delete"]; } if ([gid isKindOfClass:[EOAdaptorGlobalID class]]) { NSDictionary *conD = nil; conD = [(EOAdaptorGlobalID *)gid connectionDictionary]; if (![conD isEqualToDictionary:self->connectionDictionary]) { [NSException raise:NSInvalidArgumentException format:@"try to delete object %@ in wrong " @"AdaptorDataSource %@", _obj, self]; } gid = (EOKeyGlobalID *)[(EOAdaptorGlobalID *)gid globalID]; } if ([[self->adChannel adaptorContext] hasOpenTransaction]) localComTrans = NO; else localComTrans = YES; adChan = [self beginTransaction]; whereClause = [self _whereClauseForGlobaID:gid adaptor:[[adChan adaptorContext] adaptor] channel:adChan]; if (whereClause == nil) { [self rollbackTransaction]; return; } expression = [[NSMutableString alloc] initWithCapacity:256]; [expression appendString:@"DELETE FROM "]; [expression appendString:[gid entityName]]; [expression appendString:@" WHERE "]; [expression appendString:whereClause]; if (![adChan evaluateExpression:expression]) { [adChan cancelFetch]; [self rollbackTransaction]; AUTORELEASE(expression); [[[EOAdaptorException alloc] initWithFormat:@"couldn`t evaluate expression %@ failed", expression] raise]; } [adChan cancelFetch]; if (localComTrans) [self commitTransaction]; RELEASE(expression); expression = nil; [self postDataSourceChangedNotification]; } - (void)setFetchSpecification:(EOFetchSpecification *)_fs { if (![self->fetchSpecification isEqual:_fs]) { #if DEBUG && 0 NSLog(@"%s: 0x%p: fetch-spec mismatch:\n%@\n%@", __PRETTY_FUNCTION__, self, self->fetchSpecification, _fs); #endif ASSIGNCOPY(self->fetchSpecification, _fs); [self postDataSourceItselfChangedNotification]; } #if DEBUG && 0 else { NSLog(@"%s: 0x%p: no fetch-spec mismatch:\n%@\n%@\n", __PRETTY_FUNCTION__, self, self->fetchSpecification, _fs); } #endif } - (EOFetchSpecification *)fetchSpecification { /* Note: the copy is intended, since the fetchspec is mutable, the consumer could otherwise modify it "behind the scenes" */ return [[self->fetchSpecification copy] autorelease]; } /* description */ - (NSString *)description { NSMutableString *ms; ms = [NSMutableString stringWithCapacity:128]; [ms appendFormat:@"<%@[0x%p]:", NSStringFromClass([self class]), self]; if (self->fetchSpecification != nil) [ms appendFormat:@" fspec=%@", self->fetchSpecification]; if (self->adChannel != nil) [ms appendFormat:@" channel=%@", self->adChannel]; [ms appendString:@">"]; return ms; } @end /* EOAdaptorDataSource */ @implementation EOAdaptorDataSource(Private) - (NSArray *)_primaryKeyAttributeNamesForTableName:(NSString *)_entityName channel:(EOAdaptorChannel *)_adChannel { NSDictionary *hints; NSArray *attrs; hints = [self->fetchSpecification hints]; attrs = [hints objectForKey:EOPrimaryKeyAttributeNamesHint]; if (attrs) return attrs; attrs = [hints objectForKey:EOPrimaryKeyAttributesHint]; if (attrs == nil) { if (!(attrs = [_adChannel primaryKeyAttributesForTableName:_entityName])) { attrs = [_adChannel attributesForTableName:_entityName]; } } attrs = [[attrs map:@selector(columnName)] map:@selector(lowercaseString)]; attrs = [attrs sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)]; return attrs; } - (NSArray *)_primaryKeyAttributesForTableName:(NSString *)_entityName channel:(EOAdaptorChannel *)_adChannel { NSArray *attrs; NSDictionary *hints; hints = [self->fetchSpecification hints]; attrs = [hints objectForKey:EOPrimaryKeyAttributesHint]; if (attrs != nil) return attrs; attrs = [hints objectForKey:EOPrimaryKeyAttributeNamesHint]; if (attrs != nil) { NSArray *allAttrs; NSEnumerator *enumerator; id *objs; int objCnt; id obj; allAttrs = [_adChannel attributesForTableName:_entityName]; objs = malloc(sizeof(id) * [allAttrs count]); enumerator = [allAttrs objectEnumerator]; objCnt = 0; while ((obj = [enumerator nextObject])) { if ([attrs containsObject:[[obj columnName] lowercaseString]]) { objs[objCnt++] = obj; } } attrs = [NSArray arrayWithObjects:objs count:objCnt]; free(objs); objs = NULL; return attrs; } if (!(attrs = [_adChannel primaryKeyAttributesForTableName:_entityName])) { attrs = [_adChannel attributesForTableName:_entityName]; } return attrs; } - (NSString *)_whereExprWithChannel:(EOAdaptorChannel *)_adChan { EOQualifier *qual = nil; NSArray *attrs = nil; NSString *entityName = nil; EOAdaptor *adaptor; entityName = [self->fetchSpecification entityName]; if ((attrs = self->__attributes) == nil) attrs = [_adChan attributesForTableName:entityName]; if ((qual = self->__qualifier) == nil) qual = [self->fetchSpecification qualifier]; if (qual == nil) return nil; adaptor = [[_adChan adaptorContext] adaptor]; return [qual sqlExpressionWithAdaptor:adaptor attributes:attrs]; } - (NSException *)_couldNotFindSortAttributeInAttributes:(NSArray *)_attrs forSortOrdering:(EOSortOrdering *)_so { return [[InvalidAttributeException alloc] initWithFormat:@"could not find EOAttribute for SortOrdering" @" %@ Attributes %@", _so, _attrs]; } - (EOAttribute *)findAttributeForKey:(NSString *)key inAttributes:(NSArray *)_attrs { NSEnumerator *en; EOAttribute *obj; key = [key lowercaseString]; en = [_attrs objectEnumerator]; while ((obj = [en nextObject]) != nil) { if ([[[obj columnName] lowercaseString] isEqualToString:key]) break; } return obj; } - (NSString *)_orderByExprForAttributes:(NSArray *)_attrs andPatchSelectList:(NSMutableString *)selectList withChannel:(EOAdaptorChannel *)_adChan { NSMutableString *orderByExpr; NSEnumerator *enumerator = nil; EOSortOrdering *sortOrdering = nil; int orderCnt = 0; EOAdaptor *adaptor; adaptor = [[_adChan adaptorContext] adaptor]; orderByExpr = nil; enumerator = [[self->fetchSpecification sortOrderings] objectEnumerator]; while ((sortOrdering = [enumerator nextObject]) != nil) { SEL selector = NULL; NSString *key = nil; EOAttribute *keyAttr = nil; int order = 0; /* 0 - not used; 1 - asc; 2 - desc */ BOOL inSensitive = NO; NSString *orderTmp = nil; if (orderByExpr == nil) orderByExpr = [NSMutableString stringWithCapacity:64]; else [orderByExpr appendString:@", "]; if ((selector = [sortOrdering selector])) { if (SEL_EQ(selector, EOCompareAscending)) order = 1; else if (SEL_EQ(selector, EOCompareDescending)) order = 2; else if (SEL_EQ(selector, EOCompareCaseInsensitiveAscending)) { order = 1; inSensitive = YES; } else if (SEL_EQ(selector, EOCompareCaseInsensitiveDescending)) { order = 2; inSensitive = YES; } } key = [sortOrdering key]; if (key == nil || [key length] == 0) { NSLog(@"WARNING[%s]: no key in sortordering %@", __PRETTY_FUNCTION__, key); continue; } { EOAttribute *obj; key = [key lowercaseString]; obj = [self findAttributeForKey:key inAttributes:_attrs]; if (obj == nil) { [self->__attributes release]; self->__attributes = nil; [self->__qualifier release]; self->__qualifier = nil; #if 0 // TODO: memleak in error case [expression release]; expression = nil; #endif [self rollbackTransaction]; [[self _couldNotFindSortAttributeInAttributes:_attrs forSortOrdering:sortOrdering] raise]; return nil; } keyAttr = obj; } key = [adaptor formatAttribute:keyAttr]; orderTmp = [NSString stringWithFormat:@"order%d", orderCnt]; orderCnt++; [orderByExpr appendString:orderTmp]; if (order == 1) [orderByExpr appendString:@" ASC"]; else if (order == 2) [orderByExpr appendString:@" DESC"]; /* manipulate select expr */ if (inSensitive) { if ([[keyAttr valueClassName] isEqualToString:@"NSString"]) { key = [NSString stringWithFormat:@"LOWER(%@)", key]; } else NSLog(@"WARNING[%s]: inSensitive expression for no text attribute", __PRETTY_FUNCTION__); } { NSString *str = nil; str = [key stringByAppendingString:@" AS "]; str = [str stringByAppendingString:orderTmp]; str = [str stringByAppendingString:@", "]; [selectList insertString:str atIndex:0]; } } return orderByExpr; } - (NSMutableString *)_selectListWithChannel:(EOAdaptorChannel *)_adChan { NSArray *attrs = nil; NSEnumerator *enumerator = nil; EOAttribute *attribute = nil; BOOL first = YES; NSMutableString *select = nil; EOAdaptor *adaptor = nil; NSString *entityName = nil; adaptor = [[_adChan adaptorContext] adaptor]; entityName = [self->fetchSpecification entityName]; if ((attrs = self->__attributes) == nil) attrs = [_adChan attributesForTableName:entityName]; attrs = [_adChan _sortAttributesForSelectExpression:attrs]; select = [NSMutableString stringWithCapacity:128]; enumerator = [attrs objectEnumerator]; while ((attribute = [enumerator nextObject])) { if (first) first = NO; else [select appendString:@", "]; [select appendString:[adaptor formatAttribute:attribute]]; } return select; } - (NSString *)_whereClauseForGlobaID:(EOKeyGlobalID *)_gid adaptor:(EOAdaptor *)_adaptor channel:(EOAdaptorChannel *)_adChan { NSEnumerator *enumerator; NSMutableString *result; NSArray *pKeys; NSArray *pkAttrs; NSString *pKey; int pkCnt; pKeys = [self _primaryKeyAttributeNamesForTableName:[_gid entityName] channel:_adChan]; pkAttrs = [self _primaryKeyAttributesForTableName:[_gid entityName] channel:_adChan]; if ([pKeys count] != [_gid keyCount]) { NSLog(@"ERROR[%s]: internal inconsitency pkeys %@ gid %@", __PRETTY_FUNCTION__, pKeys, _gid); return nil; } enumerator = [pKeys objectEnumerator]; pkCnt = 0; result = nil; while ((pKey = [enumerator nextObject])) { EOAttribute *attr; id value; if (result == nil) result = [NSMutableString stringWithCapacity:128]; else [result appendString:@" AND "]; { NSEnumerator *enumerator; enumerator = [pkAttrs objectEnumerator]; while ((attr = [enumerator nextObject])) { if ([[[attr columnName] lowercaseString] isEqual:pKey]) break; } NSAssert2(attr != nil, @"missing attribute for pkName %@ attrs %@", pKey, pkAttrs); } [result appendString:[_adaptor formatAttribute:attr]]; value = [(EOKeyGlobalID *)_gid keyValues][pkCnt++]; if (value == nil) value = null; [result appendString:[value isNotNull] ? @"=" : @" IS "]; [result appendString:[_adaptor formatValue:value forAttribute:attr]]; } return result; } - (NSDictionary *)_mapAttrsWithValues:(NSDictionary *)_keyValues tableName:(NSString *)_tableName channel:(EOAdaptorChannel *)_adChan { id *keys, *values; int mapCnt; NSEnumerator *en; EOAttribute *attr; NSDictionary *result; NSArray *attrs; attrs = [_adChan attributesForTableName:_tableName]; mapCnt = [attrs count]; keys = calloc(mapCnt + 1, sizeof(id)); values = calloc(mapCnt + 1, sizeof(id)); en = [attrs objectEnumerator]; mapCnt = 0; while ((attr = [en nextObject])) { id v; v = (v = [_keyValues valueForKey:[[attr columnName] lowercaseString]]) ? v : (id)null; keys[mapCnt] = attr; values[mapCnt] = v; mapCnt++; } result = [[NSDictionary alloc] initWithObjects:values forKeys:keys count:mapCnt]; free(keys); keys = NULL; free(values); values = NULL; return [result autorelease]; } @end /* EOAdaptorDataSource(Private) */ @implementation EOAndQualifier(SqlExpression) - (NSString *)sqlExpressionWithAdaptor:(EOAdaptor *)_adaptor attributes:(NSArray *)_attributes { NSMutableString *str = nil; NSEnumerator *enumerator = nil; EOQualifier *qual = nil; BOOL isFirst = YES; NSString *result = nil; str = [[NSMutableString alloc] initWithCapacity:128]; enumerator = [self->qualifiers objectEnumerator]; while ((qual = [enumerator nextObject])) { NSString *s; s = [qual sqlExpressionWithAdaptor:_adaptor attributes:_attributes]; if (isFirst) { [str appendFormat:@"(%@)", s]; isFirst = NO; } else [str appendFormat:@" AND (%@)", s]; } result = [str copy]; [str release]; str = nil; return [result autorelease]; } @end /* EOAndQualifier(SqlExpression) */ @implementation EOOrQualifier(SqlExpression) - (NSString *)sqlExpressionWithAdaptor:(EOAdaptor *)_adaptor attributes:(NSArray *)_attributes { NSMutableString *str = nil; NSEnumerator *enumerator = nil; EOQualifier *qual = nil; BOOL isFirst = YES; NSString *result = nil; str = [[NSMutableString alloc] initWithCapacity:128]; enumerator = [self->qualifiers objectEnumerator]; while ((qual = [enumerator nextObject])) { NSString *s; s = [qual sqlExpressionWithAdaptor:_adaptor attributes:_attributes]; if (isFirst) { [str appendFormat:@"(%@)", s]; isFirst = NO; } else [str appendFormat:@" OR (%@)", s]; } result = [str copy]; [str release]; str = nil; return [result autorelease]; } @end /* EOOrQualifier(SqlExpression) */ @implementation EOKeyValueQualifier(SqlExpression) + (NSString *)sqlStringForOperatorSelector:(SEL)_sel { static NSMapTable *selectorToOperator = NULL; NSString *s, *ss; if ((s = NSStringFromSelector(_sel)) == nil) return nil; if (selectorToOperator == NULL) { selectorToOperator = NSCreateMapTable(NSObjectMapKeyCallBacks, NSObjectMapValueCallBacks, 10); NSMapInsert(selectorToOperator, NSStringFromSelector(EOQualifierOperatorEqual), @"="); NSMapInsert(selectorToOperator, NSStringFromSelector(EOQualifierOperatorNotEqual), @"<>"); NSMapInsert(selectorToOperator, NSStringFromSelector(EOQualifierOperatorLessThan), @"<"); NSMapInsert(selectorToOperator, NSStringFromSelector(EOQualifierOperatorGreaterThan), @">"); NSMapInsert(selectorToOperator, NSStringFromSelector(EOQualifierOperatorLessThanOrEqualTo), @"<="); NSMapInsert(selectorToOperator, NSStringFromSelector(EOQualifierOperatorGreaterThanOrEqualTo), @">="); } if ((ss = NSMapGet(selectorToOperator, s))) return ss; return nil; } - (NSString *)sqlExpressionWithAdaptor:(EOAdaptor *)_adaptor attributes:(NSArray *)_attributes { EOAttribute *attr = nil; NSEnumerator *en = nil; NSString *k = nil; NSString *sql = nil; NSString *sqlKey, *sqlValue; k = [self->key lowercaseString]; en = [_attributes objectEnumerator]; while ((attr = [en nextObject])) { if ([[[attr columnName] lowercaseString] isEqualToString:k]) { break; } } if (!attr) { en = [_attributes objectEnumerator]; while ((attr = [en nextObject])) { if ([[attr name] isEqualToString:self->key]) break; } } if (!attr) { NSLog(@"WARNING[%s]: missing attribute [%@] for qualifier %@", __PRETTY_FUNCTION__, _attributes, self); return @"1=2"; } sqlKey = [_adaptor formatAttribute:attr]; sqlValue = [_adaptor formatValue:(self->value ? self->value : (id)null) forAttribute:attr]; sql = nil; if (SEL_EQ(EOQualifierOperatorEqual, self->operator)) { if ([self->value isNotNull]) sql = [NSString stringWithFormat:@"%@ = %@", sqlKey, sqlValue]; else sql = [NSString stringWithFormat:@"%@ IS NULL", sqlKey]; } else if (SEL_EQ(EOQualifierOperatorNotEqual, self->operator)) { if ([self->value isNotNull]) sql = [NSString stringWithFormat:@"NOT (%@ = %@)", sqlKey, sqlValue]; else sql = [NSString stringWithFormat:@"%@ IS NOT NULL", sqlKey]; } else if (SEL_EQ(EOQualifierOperatorLessThan, self->operator)) { sql = [NSString stringWithFormat:@"%@ < %@", sqlKey, sqlValue]; } else if (SEL_EQ(EOQualifierOperatorLessThanOrEqualTo, self->operator)) { sql = [NSString stringWithFormat:@"%@ <= %@", sqlKey, sqlValue]; } else if (SEL_EQ(EOQualifierOperatorGreaterThan, self->operator)) { sql = [NSString stringWithFormat:@"%@ > %@", sqlKey, sqlValue]; } else if (SEL_EQ(EOQualifierOperatorGreaterThanOrEqualTo, self->operator)) { sql = [NSString stringWithFormat:@"%@ >= %@", sqlKey, sqlValue]; } else if (SEL_EQ(EOQualifierOperatorLike, self->operator)) { sqlValue = [[self->value stringValue] stringByReplacingString:@"*" withString:@"%"]; sqlValue = [_adaptor formatValue:sqlValue forAttribute:attr]; sql = [NSString stringWithFormat:@"%@ LIKE %@", sqlKey, sqlValue]; } else if (SEL_EQ(EOQualifierOperatorCaseInsensitiveLike, self->operator)) { sqlValue = [[self->value stringValue] stringByReplacingString:@"*" withString:@"%"]; sqlValue = [sqlValue lowercaseString]; sqlValue = [_adaptor formatValue:sqlValue forAttribute:attr]; sql = [NSString stringWithFormat:@"LOWER(%@) LIKE %@", sqlKey, sqlValue]; } #if 0 else if (SEL_EQ(EOQualifierOperatorLessThanOrEqualTo, self->operator)) { } else if (SEL_EQ(EOQualifierOperatorGreaterThanOrEqualTo, self->operator)) { } #endif else { NSLog(@"ERROR(%s): unsupported SQL operator: %@", __PRETTY_FUNCTION__, [EOQualifier stringForOperatorSelector:self->operator]); [self notImplemented:_cmd]; return nil; } return sql; } @end /* EOKeyValueQualifier(SqlExpression) */ @implementation EONotQualifier(SqlExpression) - (NSString *)sqlExpressionWithAdaptor:(EOAdaptor *)_adaptor attributes:(NSArray *)_attributes { NSString *s; s = [self->qualifier sqlExpressionWithAdaptor:_adaptor attributes:_attributes]; return [NSString stringWithFormat:@"NOT(%@)", s]; } @end /* EONotQualifier(SqlExpression) */ @implementation EOKeyComparisonQualifier(SqlExpression) - (NSString *)sqlExpressionWithAdaptor:(EOAdaptor *)_adaptor attributes:(NSArray *)_attributes { NSLog(@"ERROR(%s): subclass needs to override this method!", __PRETTY_FUNCTION__); return nil; } @end /* EOKeyComparisonQualifier(SqlExpression) */ SOPE/sope-gdl1/GDLAccess/EOAttributeOrdering.m0000644000000000000000000000314512242733417017714 0ustar rootroot/* EOAttributeOrdering.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import #import #import "common.h" @implementation EOAttributeOrdering + (id)attributeOrderingWithAttribute:(EOAttribute*)_attribute ordering:(EOOrdering)_ordering { return AUTORELEASE([[EOAttributeOrdering alloc] initWithAttribute:_attribute ordering:_ordering]); } - (id)initWithAttribute:(EOAttribute*)_attribute ordering:(EOOrdering)_ordering { ASSIGN(self->attribute, _attribute); self->ordering = _ordering; return self; } - (EOAttribute *)attribute { return self->attribute; } - (EOOrdering)ordering { return self->ordering; } @end /* EOAttributeOrdering */ SOPE/sope-gdl1/GDLAccess/EOJoinTypes.h0000644000000000000000000000253412242733417016177 0ustar rootroot/* EOSQLExpression.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: September 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __EOJoinTypes_h__ #define __EOJoinTypes_h__ typedef enum { EOInnerJoin = 0, EOFullOuterJoin, EOLeftOuterJoin, EORightOuterJoin } EOJoinSemantic; typedef enum { EOJoinEqualTo = 0, EOJoinNotEqualTo, EOJoinGreaterThan, EOJoinGreaterThanOrEqualTo, EOJoinLessThan, EOJoinLessThanOrEqualTo } EOJoinOperator; @class EOJoin; #endif /* __EOJoinTypes_h__ */ SOPE/sope-gdl1/GDLAccess/EOCustomValues.m0000644000000000000000000001165512242733417016716 0ustar rootroot/* EOAttributeOrdering.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // $Id: EOCustomValues.m 1 2004-08-20 10:38:46Z znek $ #import "common.h" #import "EOCustomValues.h" #if LIB_FOUNDATION_LIBRARY @implementation NSTemporaryString(EOCustomValues) - initWithString:(NSString*)string type:(NSString*)type { return [self initWithString:string]; } @end #endif @implementation NSString(EOCustomValues) + stringWithString:(NSString*)string type:(NSString*)type { // If mutable return a copy if not return self if ([string isKindOfClass:[NSMutableString class]]) return [[NSString alloc] initWithString:string type:type]; else return RETAIN(self); } - initWithString:(NSString*)string type:(NSString*)type { return [self initWithString:string]; } - (NSString*)stringForType:(NSString*)type { // If mutable return a copy if not return self (handled in NSString) return [self copyWithZone:[self zone]]; } - (id)initWithData:(NSData*)data type:(NSString*)type { return [self initWithCString:[data bytes] length:[data length]]; } - (NSData *)dataForType:(NSString *)type { unsigned len = [self cStringLength]; char buf[len + 1]; [self getCString:buf]; return [NSData dataWithBytes:buf length:len]; } @end /* NSString(EOCustomValues) */ @implementation NSData(EOCustomValues) - (id)initWithString:(NSString*)string type:(NSString*)type { unsigned len = [string cStringLength]; char buf[len + 1]; [string getCString:buf]; return [self initWithBytes:buf length:len]; } - (NSString*)stringForType:(NSString*)type { return [NSString stringWithCString:[self bytes] length:[self length]]; } - initWithData:(NSData*)data type:(NSString*)type { return [self initWithBytes:[data bytes] length:[data length]]; } - (NSData*)dataForType:(NSString*)type { return [self copyWithZone:[self zone]]; } @end /* NSData(EOCustomValues) */ @implementation NSNumber(EOCustomValues) + (id)numberWithString:(NSString*)string type:(NSString*)type { char buf[[string cStringLength] + 1]; const char *cstring; [string getCString:buf]; cstring = buf; if ([type cStringLength] == 1) switch ((unsigned char)[type characterAtIndex:0]) { case 'c' : { char value = atoi(cstring); return [NSNumber numberWithChar:value]; } case 'C' : { unsigned char value = atoi(cstring); return [NSNumber numberWithUnsignedChar:value]; } case 's' : { short value = atoi(cstring); return [NSNumber numberWithShort:value]; } case 'S' : { unsigned short value = atoi(cstring); return [NSNumber numberWithUnsignedShort:value]; } case 'i' : { int value = atoi(cstring); return [NSNumber numberWithInt:value]; } case 'I' : { unsigned int value = atoi(cstring); return [NSNumber numberWithUnsignedInt:value]; } case 'l' : { long value = atol(cstring); return [NSNumber numberWithLong:value]; } case 'L' : { unsigned long value = atol(cstring); return [NSNumber numberWithUnsignedLong:value]; } case 'q' : { long long value = atol(cstring); return [NSNumber numberWithLongLong:value]; } case 'Q' : { unsigned long long value = atol(cstring); return [NSNumber numberWithUnsignedLongLong:value]; } case 'f' : { float value = atof(cstring); return [NSNumber numberWithFloat:value]; } case 'd' : { double value = atof(cstring); return [NSNumber numberWithDouble:value]; } } [NSException raise:NSInvalidArgumentException format:@"invalid type `%@' for NSNumber in " @"numberWithString:type:", type]; return nil; } - initWithString:(NSString*)string type:(NSString*)type { (void)AUTORELEASE(self); return RETAIN([NSNumber numberWithString:string type:type]); } - (NSString*)stringForType:(NSString*)type { return [self stringValue]; } @end /* NSNumber(EOCustomValues) */ void EOAccess_EOCustomValues_link(void) { EOAccess_EOCustomValues_link(); } SOPE/sope-gdl1/GDLAccess/EODatabaseFault.h0000644000000000000000000000455612242733417016761 0ustar rootroot/* EODatabaseFault.h Copyright (C) 1996 Free Software Foundation, Inc. Author: Mircea Oancea Date: 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __eoaccess_EODatabaseFault_h__ #define __eoaccess_EODatabaseFault_h__ #import @class EOSQLQualifier, EOEntity, EODatabaseChannel; @class NSArray, NSDictionary, NSString; /* * EODatabaseFault class */ @interface EODatabaseFault : EOFault // Creating a fault + (id)objectFaultWithPrimaryKey:(NSDictionary*)key entity:(EOEntity*)entity databaseChannel:(EODatabaseChannel*)channel zone:(NSZone*)zone; + (NSArray *)arrayFaultWithQualifier:(EOSQLQualifier*)qualifier fetchOrder:(NSArray*)fetchOrder databaseChannel:(EODatabaseChannel*)channel zone:(NSZone*)zone; + (NSArray *)gcArrayFaultWithQualifier:(EOSQLQualifier*)qualifier fetchOrder:(NSArray*)fetchOrder databaseChannel:(EODatabaseChannel*)channel zone:(NSZone*)zone; + (NSDictionary*)primaryKeyForFault:fault; + (EOEntity*)entityForFault:fault; + (EOSQLQualifier*)qualifierForFault:fault; + (NSArray*)fetchOrderForFault:fault; + (EODatabaseChannel*)databaseChannelForFault:fault; @end /* EODatabaseFault */ /* * Informal protocol that informs an instance that a to-one * relationship could not be resoved to get data for self. * Its implementation in NSObject raises NSObjectNotAvailableException. */ @interface NSObject(EOUnableToFaultToOne) - (void)unableToFaultWithPrimaryKey:(NSDictionary*)key entity:(EOEntity*)entity databaseChannel:(EODatabaseChannel*)channel; @end #endif /* __eoaccess_EODatabaseFault_h__ */ SOPE/sope-gdl1/GDLAccess/EOKeyValueQualifier+SQL.m0000644000000000000000000000434412242733417020303 0ustar rootroot/* EOAdaptorChannel.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: October 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // $Id: EOKeyValueQualifier+SQL.m 1 2004-08-20 10:38:46Z znek $ #import "EOSQLQualifier.h" #include "common.h" @implementation EOKeyValueQualifier(SQLQualifier) /* SQL qualifier generation */ - (EOSQLQualifier *)sqlQualifierForEntity:(EOEntity *)_entity { EOSQLQualifier *q; NSString *format; if (SEL_EQ(self->operator, EOQualifierOperatorEqual)) format = @"%A = %@"; else if (SEL_EQ(self->operator, EOQualifierOperatorNotEqual)) format = @"%A <> %@"; else if (SEL_EQ(self->operator, EOQualifierOperatorLessThan)) format = @"%A < %@"; else if (SEL_EQ(self->operator, EOQualifierOperatorGreaterThan)) format = @"%A > %@"; else if (SEL_EQ(self->operator, EOQualifierOperatorLessThanOrEqualTo)) format = @"%A <= %@"; else if (SEL_EQ(self->operator, EOQualifierOperatorGreaterThanOrEqualTo)) format = @"%A >= %@"; else if (SEL_EQ(self->operator, EOQualifierOperatorLike)) format = @"%A LIKE %@"; else { format = [NSString stringWithFormat:@"%%A %@ %%@", NSStringFromSelector(self->operator)]; } q = [[EOSQLQualifier alloc] initWithEntity:_entity qualifierFormat:format, self->key, self->value]; return AUTORELEASE(q); } @end /* EOKeyValueQualifier */ SOPE/sope-gdl1/GDLAccess/GNUmakefile0000644000000000000000000000660312242733417015731 0ustar rootroot# GNUstep makefile include ../../config.make include ../common.make -include ../Version -include ./Version ifneq ($(frameworks),yes) LIBRARY_NAME = libGDLAccess else FRAMEWORK_NAME = GDLAccess endif libGDLAccess_PCH_FILE = common.h libGDLAccess_INTERFACE_VERSION=$(MAJOR_VERSION).$(MINOR_VERSION) libGDLAccess_INSTALL_DIR=$(SOPE_SYSLIBDIR) libGDLAccess_VERSION=$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBMINOR_VERSION) libGDLAccess_DLL_DEF = libGDLAccess.def libGDLAccess_HEADER_FILES = \ GDLAccess.h \ EODelegateResponse.h \ EOJoinTypes.h \ EOAdaptor.h \ EOAdaptorChannel.h \ EOAdaptorContext.h \ EOArrayProxy.h \ EOAttribute.h \ EOAttributeOrdering.h \ EOCustomValues.h \ EODatabase.h \ EODatabaseChannel.h \ EODatabaseContext.h \ EOEntity.h \ EOExpressionArray.h \ EOFExceptions.h \ EODatabaseFault.h \ EODatabaseFaultResolver.h \ EOModel.h \ EOObjectUniquer.h \ EOPrimaryKeyDictionary.h \ EOSQLQualifier.h \ EOQuotedExpression.h \ EORelationship.h \ EOSQLExpression.h \ EOGenericRecord.h \ EOModelGroup.h \ EONull.h \ EOKeySortOrdering.h \ EOAdaptorDataSource.h \ EOAdaptorChannel+Attributes.h \ EOAdaptorOperation.h \ EOAdaptorGlobalID.h \ NSObject+EONullInit.h \ EOEntity+Factory.h \ EORecordDictionary.h \ EOFault.h \ EOFaultHandler.h \ libGDLAccess_OBJC_FILES = \ eoaccess.m \ EOAdaptor.m \ EOAdaptorChannel.m \ EOAdaptorContext.m \ EOArrayProxy.m \ EOAttribute.m \ EOAttributeOrdering.m \ EOCustomValues.m \ EODatabase.m \ EODatabaseChannel.m \ EODatabaseContext.m \ EOEntity.m \ EOExpressionArray.m \ EOFExceptions.m \ EODatabaseFault.m \ EODatabaseFaultResolver.m \ EOKeySortOrdering.m \ EOModel.m \ EOObjectUniquer.m \ EOPrimaryKeyDictionary.m \ EORelationship.m \ EOGenericRecord.m \ EOModelGroup.m \ EOEntityClassDescription.m \ EOAdaptorDataSource.m \ EOAdaptorChannel+Attributes.m \ EOAdaptorOperation.m \ EOAdaptorGlobalID.m \ NSObject+EONullInit.m \ EOEntity+Factory.m \ EORecordDictionary.m \ EOFault.m \ EOFaultHandler.m \ \ EOAndQualifier+SQL.m \ EOKeyComparisonQualifier+SQL.m \ EOKeyValueQualifier+SQL.m \ EONotQualifier+SQL.m \ EOOrQualifier+SQL.m \ EOQualifier+SQL.m \ \ EOSQLQualifier.m \ EOSQLExpression.m \ EOSelectSQLExpression.m \ EOQuotedExpression.m \ EOQualifierScanner.m \ ifneq ($(FOUNDATION_LIB),fd) libGDLAccess_SUBPROJECTS += FoundationExt endif libGDLAccess_HEADER_FILES_DIR = . libGDLAccess_HEADER_FILES_INSTALL_DIR = /GDLAccess # adaptor load test TOOL_NAME = load-EOAdaptor connect-EOAdaptor load-EOAdaptor_OBJC_FILES = load-EOAdaptor.m connect-EOAdaptor_OBJC_FILES = connect-EOAdaptor.m load-EOAdaptor_PCH_FILE = common.h connect-EOAdaptor_PCH_FILE = common.h load-EOAdaptor_INSTALL_DIR = $(SOPE_TOOLS)/ connect-EOAdaptor_INSTALL_DIR = $(SOPE_TOOLS)/ # framework support GDLAccess_PCH_FILE = $(libGDLAccess_PCH_FILE) GDLAccess_HEADER_FILES = $(libGDLAccess_HEADER_FILES) GDLAccess_OBJC_FILES = $(libGDLAccess_OBJC_FILES) GDLAccess_SUBPROJECTS = $(libGDLAccess_SUBPROJECTS) # building -include GNUmakefile.preamble ifneq ($(FHS_INSTALL_ROOT),) GNUSTEP_HEADERS=$(DESTDIR)$(FHS_INSTALL_ROOT)/include endif ifneq ($(frameworks),yes) include $(GNUSTEP_MAKEFILES)/library.make else include $(GNUSTEP_MAKEFILES)/framework.make endif include $(GNUSTEP_MAKEFILES)/tool.make -include GNUmakefile.postamble SOPE/sope-gdl1/GDLAccess/EOAdaptorChannel+Attributes.m0000644000000000000000000000473012242733417021265 0ustar rootroot/* EOAdaptorChannel.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: October 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // $Id: EOAdaptorChannel+Attributes.m 1 2004-08-20 10:38:46Z znek $ #import "common.h" #import "EOAdaptorChannel+Attributes.h" #import "EOAdaptorContext.h" #import "EOEntity.h" #import "EOAdaptor.h" #import "EOModel.h" @implementation EOAdaptorChannel(Attributes) - (EOEntity *)_entityForTableName:(NSString *)_tableName { EOModel *model = nil; EOEntity *entity = nil; if (_tableName == nil || [_tableName length] == 0) return nil; model = [[self->adaptorContext adaptor] model]; if ((entity = [model entityNamed:_tableName]) == nil) { NSEnumerator *enumerator = nil; enumerator = [[model entities] objectEnumerator]; while ((entity = [enumerator nextObject])) { if ([[entity externalName] isEqualToString:_tableName]) break; } } if (entity == nil) { model = [self describeModelWithTableNames: [NSArray arrayWithObject:_tableName]]; if ((entity = [model entityNamed:_tableName]) == nil) { NSEnumerator *enumerator = nil; enumerator = [[model entities] objectEnumerator]; while ((entity = [enumerator nextObject])) { if ([[entity externalName] isEqualToString:_tableName]) break; } } } return entity; } - (NSArray *)attributesForTableName:(NSString *)_tableName { return [[self _entityForTableName:_tableName] attributes]; } - (NSArray *)primaryKeyAttributesForTableName:(NSString *)_tableName { return [[self _entityForTableName:_tableName] primaryKeyAttributes]; } @end /* EOAdaptorChannel(Attributes) */ SOPE/sope-gdl1/GDLAccess/EOAdaptorOperation.h0000644000000000000000000000030212242733417017515 0ustar rootroot// $If$ #ifndef __EOAdaptorOperation_H__ #define __EOAdaptorOperation_H__ #import @interface EOAdaptorOperation : NSObject @end #endif /* __EOAdaptorOperation_H__ */ SOPE/sope-gdl1/GDLAccess/EODatabaseChannel.h0000644000000000000000000001512012242733417017243 0ustar rootroot/* EODatabaseChannel.h Copyright (C) 1996 Free Software Foundation, Inc. Author: Mircea Oancea Date: 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __EODatabaseChannel_h__ #define __EODatabaseChannel_h__ #import @class NSArray, NSMutableArray, NSDictionary, NSMutableDictionary; @class NSString, NSMutableString, NSNotificationCenter; @class EOAdaptor, EOAdaptorContext, EOAdaptorChannel; @class EOEntity, EOSQLQualifier, EORelationship; @class EOObjectUniquer, EODatabase, EODatabaseContext; @class EOGlobalID; extern NSString *EODatabaseChannelWillOpenNotificationName; extern NSString *EODatabaseChannelDidOpenNotificationName; extern NSString *EODatabaseChannelCouldNotOpenNotificationName; extern NSString *EODatabaseChannelWillCloseNotificationName; extern NSString *EODatabaseChannelDidCloseNotificationName; extern NSString *EODatabaseChannelWillInsertObjectName; extern NSString *EODatabaseChannelDidInsertObjectName; extern NSString *EODatabaseChannelWillUpdateObjectName; extern NSString *EODatabaseChannelDidUpdateObjectName; extern NSString *EODatabaseChannelWillDeleteObjectName; extern NSString *EODatabaseChannelDidDeleteObjectName; extern NSString *EODatabaseChannelWillLockObjectName; extern NSString *EODatabaseChannelDidLockObjectName; @interface EODatabaseChannel : NSObject { @private NSNotificationCenter *notificationCenter; EOAdaptorChannel *adaptorChannel; EODatabaseContext *databaseContext; id delegate; EOEntity *currentEntity; Class currentClass; NSArray *currentAttributes; NSArray *currentRelations; BOOL currentReady; id currentEditingContext; /* statistics */ unsigned int successfulOpenCount; unsigned int failedOpenCount; unsigned int closeCount; unsigned int insertCount; unsigned int updateCount; unsigned int deleteCount; unsigned int lockCount; } // Initializing a new instance - (id)initWithDatabaseContext:(EODatabaseContext*)aDatabaseContext; // Getting the adaptor channel - (EOAdaptorChannel*)adaptorChannel; // Getting the database context - (EODatabaseContext*)databaseContext; // Setting the delegate - (void)setDelegate:(id)aDelegate; - (id)delegate; // Opening and closing a channel - (BOOL)isOpen; - (BOOL)openChannel; - (void)closeChannel; // Modifying objects - (BOOL)insertObject:(id)anObj; - (BOOL)updateObject:(id)anObj; - (BOOL)deleteObject:(id)anObj; - (BOOL)lockObject:(id)anObj; - (BOOL)refetchObject:(id)anObj; - (id)allocateObjectForRow:(NSDictionary*)row entity:(EOEntity*)anEntity zone:(NSZone*)zone; - (id)initializedObjectForRow:(NSDictionary*)row entity:(EOEntity*)anEntity zone:(NSZone*)zone; // Fetching objects - (BOOL)selectObjectsDescribedByQualifier:(EOSQLQualifier*)qualifier fetchOrder:(NSArray*)fetchOrder; - (id)fetchWithZone:(NSZone*)zone; - (BOOL)isFetchInProgress; - (void)cancelFetch; - (void)setCurrentEntity:(EOEntity*)anEntity; @end /* EODatabaseChannel */ /* statistics */ @interface EODatabaseChannel(Statistics) - (unsigned int)successfulOpenCount; - (unsigned int)failedOpenCount; - (unsigned int)closeCount; - (unsigned int)insertCount; - (unsigned int)updateCount; - (unsigned int)deleteCount; - (unsigned int)lockCount; @end /* * Delegate methods */ @interface NSObject(EODatabaseChannelDelegateProtocol) - (id)databaseChannel:aChannel willInsertObject:anObj; - (void)databaseChannel:aChannel didInsertObject:anObj; - (id)databaseChannel:aChannel willDeleteObject:anObj; - (void)databaseChannel:aChannel didDeleteObject:anObj; - (id)databaseChannel:aChannel willUpdateObject:anObj; - (void)databaseChannel:aChannel didUpdateObject:anObj; - (NSDictionary*)databaseChannel:aChannel willRefetchObject:anObj; - (NSDictionary*)databaseChannel:aChannel didRefetchObject:anObj; - (NSDictionary*)databaseChannel:aChannel willRefetchObject:anObj fromSnapshot:(NSDictionary*)snapshot; - (NSDictionary*)databaseChannel:aChannel willRefetchConflictingObject:anObj withSnapshot:(NSMutableDictionary*)snapshot; - (BOOL)databaseChannel:aChannel willSelectObjectsDescribedByQualifier:(EOSQLQualifier*)qualifier fetchOrder:(NSArray*)fetchOrder; - (void)databaseChannel:aChannel didSelectObjectsDescribedByQualifier:(EOSQLQualifier*)qualifier fetchOrder:(NSArray*)fetchOrder; - (void)databaseChannel:aChannel willFetchObjectOfClass:(Class)class withZone:(NSZone*)zone; - (void)databaseChannel:aChannel didFetchObject:anObj; - databaseChannel:aChannel willLockObject:anObj; - (void)databaseChannel:aChannel didLockObject:anObj; - (Class)databaseChannel:aChannel failedToLookupClassNamed:(const char*)name; - (EORelationship*)databaseChannel:aChannel relationshipForRow:(NSDictionary*)row relationship:(EORelationship*)relationship; @end @interface NSObject(EODatabaseChannelEONotifications) - (BOOL)prepareForDeleteInChannel:(EODatabaseChannel *)_channel context:(EODatabaseContext *)_ctx; - (void)wasDeletedInChannel:(EODatabaseChannel *)_channel context:(EODatabaseContext *)_ctx; - (BOOL)prepareForInsertInChannel:(EODatabaseChannel *)_channel context:(EODatabaseContext *)_ctx; - (void)wasInsertedInChannel:(EODatabaseChannel *)_channel context:(EODatabaseContext *)_ctx; - (BOOL)prepareForUpdateInChannel:(EODatabaseChannel *)_channel context:(EODatabaseContext *)_ctx; - (void)wasUpdatedInChannel:(EODatabaseChannel *)_channel context:(EODatabaseContext *)_ctx; - (BOOL)prepareForLockInChannel:(EODatabaseChannel *)_channel context:(EODatabaseContext *)_ctx; - (void)wasLockedInChannel:(EODatabaseChannel *)_channel context:(EODatabaseContext *)_ctx; @end /* * Object Awaking (EODatabaseChannelNotification protocol) */ @interface NSObject(EODatabaseChannelNotification) - (void)awakeForDatabaseChannel:(EODatabaseChannel*)channel; @end #endif /* __EODatabaseChannel_h__ */ SOPE/sope-gdl1/GDLAccess/EOGenericRecord.m0000644000000000000000000000461412242733417016774 0ustar rootroot/* EOGenericRecord.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Mircea Oancea Date: 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #import #import #import #import "common.h" #import "EOEntity.h" #import "EOGenericRecord.h" #import "EODatabase.h" #import #import @interface EOClassDescription(ClassDesc) /* TODO: check, whether this can be removed */ + (NSClassDescription *)classDescriptionForEntityName:(NSString *)_entityName; @end @implementation EOGenericRecord(EOAccess) - (id)initWithPrimaryKey:(NSDictionary *)_key entity:(EOEntity *)_entity { /* TODO: is this method ever used? Maybe remove */ EOClassDescription *cd; NSEnumerator *e; NSString *key; if (_entity == nil) { AUTORELEASE(self); NSLog(@"WARNING: tried to create generic record with entity !"); return nil; } cd = (id)[EOClassDescription classDescriptionForEntityName:[_entity name]]; #if DEBUG NSAssert1(cd, @"did not find class description for entity %@", _entity); #endif self = [self initWithEditingContext:nil classDescription:cd globalID:nil]; e = [_key keyEnumerator]; while ((key = [e nextObject])) [self setObject:[_key objectForKey:key] forKey:key]; return self; } - (void)_letDatabasesForget { [EODatabase forgetObject:self]; } /* model */ - (EOEntity *)entity { return [(EOEntityClassDescription *)[self classDescription] entity]; } @end /* EOGenericRecord(EOAccess) */ SOPE/sope-gdl1/GDLAccess/EOModel.m0000644000000000000000000003165512242733417015326 0ustar rootroot/* EOModel.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: August 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import "common.h" #import "EOModel.h" #import "EOEntity.h" /* Include the code from EOKeyValueCoding.m and EOCustomValues.m here because they contain categories to various classes from Foundation that don't get linked into the client application since no one refers them. The NeXT linker knows how to deal with this but all the other linkers don't... */ #if 0 # import "EOCustomValues.m" #endif void EOModel_linkCategories(void) { void EOAccess_EOCustomValues_link(void); EOAccess_EOCustomValues_link(); } @implementation EOModel - (id)copyWithZone:(NSZone *)_zone { return RETAIN(self); } + (NSString*)findPathForModelNamed:(NSString*)modelName { int i; NSBundle* bundle = [NSBundle mainBundle]; NSString* modelPath = [bundle pathForResource:modelName ofType:@"eomodel"]; NSString* paths[] = { @"~/Library/Models", @"/LocalLibrary/Models", @"/NextLibrary/Models", nil }; if(modelPath) return modelPath; for(i = 0; paths[i]; i++) { bundle = [NSBundle bundleWithPath:paths[i]]; modelPath = [bundle pathForResource:modelName ofType:@"eomodel"]; if(modelPath) return modelPath; } return nil; } - (id)init { if ((self = [super init])) { NSNotificationCenter *nc; nc = [NSNotificationCenter defaultCenter]; [nc addObserver:self selector:@selector(_requireClassDescriptionForClass:) name:@"EOClassDescriptionNeededForClass" object:nil]; [nc addObserver:self selector:@selector(_requireClassDescriptionForEntityName:) name:@"EOClassDescriptionNeededForEntityName" object:nil]; self->entities = [[NSArray alloc] init]; self->entitiesByName = [[NSMutableDictionary alloc] initWithCapacity:4]; self->entitiesByClassName = [[NSMutableDictionary alloc] initWithCapacity:4]; } return self; } - (void)resetEntities { [self->entities makeObjectsPerformSelector:@selector(resetModel)]; } - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; [self resetEntities]; RELEASE(self->entities); RELEASE(self->entitiesByName); RELEASE(self->entitiesByClassName); RELEASE(self->name); RELEASE(self->path); RELEASE(self->adaptorName); RELEASE(self->adaptorClassName); RELEASE(self->connectionDictionary); RELEASE(self->pkeyGeneratorDictionary); RELEASE(self->userDictionary); [super dealloc]; } - (id)initWithContentsOfFile:(NSString*)filename { NSDictionary *propList; propList = [[[NSDictionary alloc] initWithContentsOfFile:filename] autorelease]; if (propList == nil) { [NSException raise:NSInvalidArgumentException format:@"EOModel: Couldn't load model file: %@", filename]; } if ((self = [self initWithPropertyList:propList])) { self->path = [filename copy]; self->name = [[[filename lastPathComponent] stringByDeletingPathExtension] copy]; } return self; } - (id)initWithPropertyList:(id)propertyList { if ((self = [self init]) != nil) { NSDictionary *dict; int i, count; NSArray *propListEntities; if (propertyList == nil) { [NSException raise:NSInvalidArgumentException format: @"EOModel: Argument of initWithPropertyList: must " @"not be the nil object"]; } if (![(dict = propertyList) isKindOfClass:[NSDictionary class]]) { [NSException raise:NSInvalidArgumentException format:@"EOModel: Argument of initWithPropertyList: must " @"be kind of NSDictionary class"]; } self->adaptorName = [[dict objectForKey:@"adaptorName"] copy]; self->adaptorClassName = [[dict objectForKey:@"adaptorClassName"] copy]; self->connectionDictionary = [[dict objectForKey:@"connectionDictionary"] copy]; self->pkeyGeneratorDictionary = [[dict objectForKey:@"pkeyGeneratorDictionary"] copy]; self->userDictionary = [[dict objectForKey:@"userDictionary"] copy]; propListEntities = [dict objectForKey:@"entities"]; flags.errors = NO; [self setCreateMutableObjects:YES]; count = [propListEntities count]; for (i = 0; i < count; i++) { EOEntity *entity; entity = [EOEntity entityFromPropertyList: [propListEntities objectAtIndex:i] model:self]; [self addEntity:entity]; } count = [self->entities count]; for (i = 0; i < count; i++) [[self->entities objectAtIndex:i] replaceStringsWithObjects]; /* Init relationships */ for (i = 0; i < count; i++) { EOEntity *entity; NSArray *rels; entity = [self->entities objectAtIndex:i]; rels = [entity relationships]; /* Replace all the strings in relationships. */ [rels makeObjectsPerformSelector:@selector(replaceStringsWithObjects)]; } /* Another pass to allow properly initialization of flattened relationships. */ for (i = 0; i < count; i++) { EOEntity* entity = [self->entities objectAtIndex:i]; NSArray* rels = [entity relationships]; [rels makeObjectsPerformSelector:@selector(initFlattenedRelationship)]; } /* Init attributes */ for (i = 0; i < count; i++) { EOEntity *entity = [self->entities objectAtIndex:i]; NSArray *attrs = [entity attributes]; [attrs makeObjectsPerformSelector:@selector(replaceStringsWithObjects)]; } [self setCreateMutableObjects:NO]; } return flags.errors ? (void)AUTORELEASE(self), (id)nil : (id)self; } - (id)initWithName:(NSString*)_name { if ((self = [self init])) { ASSIGN(self->name, _name); } return self; } /* class-description notifications */ - (void)_requireClassDescriptionForEntityName:(NSNotification *)_notification { NSString *entityName; if ((entityName = [_notification object])) { EOEntity *entity; if ((entity = [self->entitiesByName objectForKey:entityName])) { EOClassDescription *d; d = [[EOEntityClassDescription alloc] initWithEntity:entity]; [EOClassDescription registerClassDescription:d forClass:NSClassFromString([entity className])]; RELEASE(d); d = nil; } } } - (void)_requireClassDescriptionForClass:(NSNotification *)_notification { Class clazz; NSString *className; EOEntity *entity; EOClassDescription *d; if ((clazz = [_notification object]) == nil) return; if ((className = NSStringFromClass(clazz)) == nil) return; if ((entity = [self->entitiesByClassName objectForKey:className]) == nil) return; d = [[EOEntityClassDescription alloc] initWithEntity:entity]; [EOClassDescription registerClassDescription:d forClass:clazz]; [d release]; d = nil; } /* property list */ - (id)modelAsPropertyList { NSMutableDictionary *model = [NSMutableDictionary dictionaryWithCapacity:64]; int i, count; [model setObject:[[NSNumber numberWithInt:[isa version]] stringValue] forKey:@"EOModelVersion"]; if (name) [model setObject:name forKey:@"name"]; if (adaptorName) [model setObject:adaptorName forKey:@"adaptorName"]; if (adaptorClassName) [model setObject:adaptorClassName forKey:@"adaptorClassName"]; if (connectionDictionary) [model setObject:connectionDictionary forKey:@"connectionDictionary"]; if (pkeyGeneratorDictionary) { [model setObject:pkeyGeneratorDictionary forKey:@"pkeyGeneratorDictionary"]; } if (userDictionary) [model setObject:userDictionary forKey:@"userDictionary"]; if (self->entities && (count = [self->entities count])) { id entitiesArray = [NSMutableArray arrayWithCapacity:count]; [model setObject:entitiesArray forKey:@"entities"]; for (i = 0; i < count; i++) { [entitiesArray addObject: [[entities objectAtIndex:i] propertyList]]; } } return model; } - (BOOL)addEntity:(EOEntity *)entity { NSString * entityName = [entity name]; if ([self->entitiesByName objectForKey:entityName]) return NO; if ([self createsMutableObjects]) [(NSMutableArray*)self->entities addObject:entity]; else { self->entities = [[[self->entities autorelease] mutableCopy] autorelease]; [(NSMutableArray *)self->entities addObject:entity]; self->entities = [self->entities copy]; } [self->entitiesByName setObject:entity forKey:entityName]; [self->entitiesByClassName setObject:entity forKey:[entity className]]; [entity setModel:self]; return YES; } - (void)removeEntityNamed:(NSString*)entityName { id entity; if (entityName == nil) return; entity = [self->entitiesByName objectForKey:entityName]; if ([self createsMutableObjects]) [(NSMutableArray*)self->entities removeObject:entity]; else { self->entities = [AUTORELEASE(self->entities) mutableCopy]; [(NSMutableArray*)self->entities removeObject:entity]; self->entities = [AUTORELEASE(self->entities) copy]; } [self->entitiesByName removeObjectForKey:entityName]; [entity resetModel]; } - (EOEntity *)entityNamed:(NSString *)entityName { return [self->entitiesByName objectForKey:entityName]; } - (NSArray *)referencesToProperty:property { [self notImplemented:_cmd]; return 0; } - (EOEntity *)entityForObject:object { NSString *className; className = NSStringFromClass([object class]); return [self->entitiesByClassName objectForKey:className]; } - (BOOL)incorporateModel:(EOModel*)model { [self notImplemented:_cmd]; return 0; } - (void)setAdaptorName:(NSString*)_adaptorName { id tmp = self->adaptorName; self->adaptorName = [_adaptorName copyWithZone:[self zone]]; RELEASE(tmp); tmp = nil; } - (NSString *)adaptorName { return self->adaptorName; } - (void)setAdaptorClassName:(NSString*)_adaptorClassName { id tmp = self->adaptorClassName; self->adaptorClassName = [_adaptorClassName copyWithZone:[self zone]]; RELEASE(tmp); tmp = nil; } - (NSString *)adaptorClassName { return self->adaptorClassName; } - (void)setConnectionDictionary:(NSDictionary*)_connectionDictionary { ASSIGN(self->connectionDictionary, _connectionDictionary); } - (NSDictionary *)connectionDictionary { return self->connectionDictionary; } - (void)setPkeyGeneratorDictionary:(NSDictionary *)_dict { ASSIGN(self->pkeyGeneratorDictionary, _dict); } - (NSDictionary *)pkeyGeneratorDictionary { return self->pkeyGeneratorDictionary; } - (void)setUserDictionary:(NSDictionary *)_userDictionary { ASSIGN(self->userDictionary, _userDictionary); } - (NSDictionary *)userDictionary { return self->userDictionary; } - (NSString *)path { return self->path; } - (NSString *)name { return self->name; } - (NSArray *)entities { NSMutableArray *ents; int cnt, i; cnt = [self->entities count]; ents = [NSMutableArray arrayWithCapacity:cnt]; for (i = 0; i < cnt; i++) [ents addObject:[self->entities objectAtIndex:i]]; return ents; } /* description */ - (NSString *)description { NSMutableString *ms; NSString *s; ms = [NSMutableString stringWithCapacity:256]; [ms appendFormat:@"<0x%p[%@]:", self, NSStringFromClass([self class])]; if ((s = [self name])) [ms appendFormat:@" name=%@", s]; if ((s = [self path])) [ms appendFormat:@" path=%@", s]; if ((s = [self adaptorName])) [ms appendFormat:@" adaptor=%@", s]; if ((s = [self adaptorClassName])) [ms appendFormat:@" adaptor-class=%@", s]; [ms appendFormat:@" #entities=%d", [self->entities count]]; [ms appendString:@">"]; return ms; } @end /* EOModel */ @implementation EOModel (EOModelPrivate) - (void)setCreateMutableObjects:(BOOL)flag { if(flags.createsMutableObjects == flag) return; flags.createsMutableObjects = flag; if(flags.createsMutableObjects) self->entities = [AUTORELEASE(self->entities) mutableCopy]; else self->entities = [AUTORELEASE(self->entities) copy]; } - (BOOL)createsMutableObjects { return flags.createsMutableObjects; } - (void)errorInReading { flags.errors = YES; } @end /* EOModel (EOModelPrivate) */ @implementation EOModel(NewInEOF2) - (void)loadAllModelObjects { } @end SOPE/sope-gdl1/GDLAccess/EOAdaptorGlobalID.m0000644000000000000000000000423512242733417017210 0ustar rootroot/* EOArrayProxy.h Copyright (C) 1999 MDlink online service center GmbH, Helge Hess Author: Helge Hess (hh@mdlink.de) Date: 1999 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // $Id: EOAdaptorGlobalID.m 1 2004-08-20 10:38:46Z znek $ #include #include "common.h" @implementation EOAdaptorGlobalID - (id)initWithGlobalID:(EOGlobalID *)_gid connectionDictionary:(NSDictionary *)_conDict { if ((self = [super init])) { ASSIGN(self->gid, _gid); ASSIGN(self->conDict, _conDict); } return self; } - (void)dealloc { RELEASE(self->gid); RELEASE(self->conDict); [super dealloc]; } - (EOGlobalID *)globalID { return self->gid; } - (NSDictionary *)connectionDictionary { return self->conDict; } /* NSCopying */ - (id)copyWithZone:(NSZone *)_zone { return RETAIN(self); } /* equality */ - (BOOL)isEqual:(id)_obj { if ([_obj isKindOfClass:[EOAdaptorGlobalID class]]) return [self isEqualToEOAdaptorGlobalID:_obj]; return NO; } - (BOOL)isEqualToEOAdaptorGlobalID:(EOAdaptorGlobalID *)_gid { if ([[_gid globalID] isEqual:self->gid] && [[_gid connectionDictionary] isEqual:self->conDict]) return YES; return NO; } /* description */ - (NSString *)description { return [NSString stringWithFormat:@"%@: globalID: %@ connectionDictionary: %@", [super description], self->gid, self->conDict]; } @end /* SkyDBGlobalKey */ SOPE/sope-gdl1/GDLAccess/EOQualifierScanner.h0000644000000000000000000000316412242733417017506 0ustar rootroot/* EOQualifierScanner.h Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Helge Hess Date: September 1996 November 1999 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // $Id: EOQualifierScanner.h 1 2004-08-20 10:38:46Z znek $ #ifndef __EOAccess_EOQualifierScanner_H__ #define __EOAccess_EOQualifierScanner_H__ #if !LIB_FOUNDATION_LIBRARY # import "DefaultScannerHandler.h" #else # import #endif @class EOEntity; @interface EOQualifierScannerHandler : DefaultScannerHandler { EOEntity *entity; } - (void)setEntity:(EOEntity *)entity; @end @interface EOQualifierEnumScannerHandler : DefaultEnumScannerHandler { EOEntity *entity; } - (void)setEntity:(EOEntity *)entity; @end #endif /* __EOAccess_EOQualifierScanner_H__ */ SOPE/sope-gdl1/GDLAccess/EORelationship.h0000644000000000000000000000751112242733417016714 0ustar rootroot/* EORelationship.h Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: August 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __EORelationship_h__ #define __EORelationship_h__ #import #import @class NSString, NSDictionary, NSException; @class EOModel, EOEntity, EOAttribute; @interface EORelationship : NSObject { NSString *name; NSString *definition; NSDictionary *userDictionary; /* Garbage collectable objects */ EOEntity *entity; /* non-retained */ EOEntity *destinationEntity; /* non-retained */ /* Computed values */ NSMutableArray *componentRelationships; struct { BOOL isFlattened:1; BOOL isToMany:1; BOOL createsMutableObjects:1; BOOL isMandatory:1; } flags; // EOJoin EOAttribute *sourceAttribute; EOAttribute *destinationAttribute; } /* Initializing instances */ - (id)initWithName:(NSString*)name; /* Accessing the name */ - (BOOL)setName:(NSString*)name; - (NSString*)name; + (BOOL)isValidName:(NSString*)name; /* Using joins */ - (NSArray*)joins; /* Convering source row in destination row */ - (NSDictionary*)foreignKeyForRow:(NSDictionary*)row; /* Accessing the definition */ - (NSArray*)componentRelationships; - (void)setDefinition:(NSString*)definition; - (NSString*)definition; /* Accessing the entities joined */ - (void)setEntity:(EOEntity*)entity; - (EOEntity*)entity; - (void)resetEntities; - (BOOL)hasEntity; - (BOOL)hasDestinationEntity; - (EOEntity*)destinationEntity; /* Checking type */ - (BOOL)isCompound; // always NO (no compound joins supported) - (BOOL)isFlattened; /* Accessing to-many property */ - (BOOL)setToMany:(BOOL)flag; - (BOOL)isToMany; /* Checking references */ - (BOOL)referencesProperty:(id)property; /* Accessing the user dictionary */ - (void)setUserDictionary:(NSDictionary*)dictionary; - (NSDictionary*)userDictionary; @end @interface EORelationship(EOJoin) - (void)loadJoinPropertyList:(id)propertyList; /* Accessing join properties */ - (void)setDestinationAttribute:(EOAttribute*)attribute; - (EOAttribute*)destinationAttribute; - (void)setSourceAttribute:(EOAttribute*)attribute; - (EOAttribute*)sourceAttribute; - (EORelationship*)relationship; @end @interface EORelationship (EORelationshipPrivate) + (EORelationship*)relationshipFromPropertyList:(id)propertyList model:(EOModel*)model; - (void)replaceStringsWithObjects; - (void)initFlattenedRelationship; - (id)propertyList; - (void)setCreateMutableObjects:(BOOL)flag; - (BOOL)createsMutableObjects; @end /* EORelationship (EORelationshipPrivate) */ @class NSMutableDictionary; @interface EORelationship(PropertyListCoding) - (void)encodeIntoPropertyList:(NSMutableDictionary *)_plist; @end @class NSException; @interface EORelationship(EOF2Additions) /* constraints */ - (void)setIsMandatory:(BOOL)_flag; - (BOOL)isMandatory; - (NSException *)validateValue:(id *)_value; @end #endif /* __EORelationship_h__ */ /* Local Variables: c-basic-offset: 4 tab-width: 8 End: */ SOPE/sope-gdl1/GDLAccess/EOAdaptorOperation.m0000644000000000000000000000220112242733417017522 0ustar rootroot/* EOAttributeOrdering.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // $Id: EOAdaptorOperation.m 1 2004-08-20 10:38:46Z znek $ #include #include "common.h" @implementation EOAdaptorOperation @end /* EOAdaptorOperation */ SOPE/sope-gdl1/GDLAccess/EOModelGroup.m0000644000000000000000000001343212242733417016334 0ustar rootroot/* EOAdaptorChannel.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: October 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // $Id: EOModelGroup.m 1 2004-08-20 10:38:46Z znek $ #include "EOModelGroup.h" #include "EOModel.h" #include "EOEntity.h" #import #include "common.h" @implementation EOModelGroup static EOModelGroup *defaultGroup = nil; static id classDelegate = nil; + (void)setDefaultGroup:(EOModelGroup *)_group { ASSIGN(defaultGroup, _group); } + (EOModelGroup *)defaultGroup { EOModelGroup *group; group = defaultGroup; if (group == nil) group = [[self classDelegate] defaultModelGroup]; if (group == nil) group = [self globalModelGroup]; return group; } + (EOModelGroup *)globalModelGroup { static EOModelGroup *globalModelGroup = nil; NSEnumerator *bundles; NSBundle *bundle; if (globalModelGroup) return globalModelGroup; globalModelGroup = [[EOModelGroup alloc] init]; bundles = [[NSBundle allBundles] objectEnumerator]; while ((bundle = [bundles nextObject])) { NSEnumerator *paths; NSString *path; paths = [[bundle pathsForResourcesOfType:@"eomodel" inDirectory:nil] objectEnumerator]; while ((path = [paths nextObject])) { EOModel *model; model = [[EOModel alloc] initWithContentsOfFile:path]; if (model == nil) { NSLog(@"WARNING: couldn't load model %@", path); } else { [globalModelGroup addModel:model]; RELEASE(model); } } } return globalModelGroup; } + (void)setClassDelegate:(id)_delegate { ASSIGN(classDelegate, _delegate); } + (id)classDelegate { return classDelegate; } - (id)init { self->nameToModel = [[NSMutableDictionary allocWithZone:[self zone]] init]; return self; } - (void)dealloc { RELEASE(self->nameToModel); [super dealloc]; } /* instance delegate */ - (void)setDelegate:(id)_delegate { self->delegate = _delegate; } - (id)delegate { return self->delegate; } /* accessors */ - (void)addModel:(EOModel *)_model { NSString *name; name = [_model name]; if (name == nil) name = [[_model path] lastPathComponent]; if ([self->nameToModel objectForKey:name]) { [NSException raise:@"NSInvalidArgumentException" format:@"model group %@ already contains model named %@", self, name]; } [self->nameToModel setObject:_model forKey:name]; [[NSNotificationCenter defaultCenter] postNotificationName:@"EOModelAddedNotification" object:_model]; } - (void)removeModel:(EOModel *)_model { NSArray *allNames; allNames = [self->nameToModel allKeysForObject:_model]; [self->nameToModel removeObjectsForKeys:allNames]; [[NSNotificationCenter defaultCenter] postNotificationName:@"EOModelInvalidatedNotification" object:_model]; } - (EOModel *)addModelWithFile:(NSString *)_path { EOModel *model; model = [[EOModel alloc] initWithContentsOfFile:_path]; if (model == nil) return nil; AUTORELEASE(model); [self addModel:model]; return model; } - (EOModel *)modelNamed:(NSString *)_name { return [self->nameToModel objectForKey:_name]; } - (EOModel *)modelWithPath:(NSString *)_path { NSEnumerator *e; EOModel *m; NSString *p; p = [_path stringByStandardizingPath]; if (p == nil) p = _path; e = [self->nameToModel objectEnumerator]; while ((m = [e nextObject])) { NSString *mp; mp = [[m path] stringByStandardizingPath]; if (mp == nil) mp = [m path]; if ([p isEqual:mp]) return m; } return m; } - (NSArray *)modelNames { return [self->nameToModel allKeys]; } - (NSArray *)models { return [self->nameToModel allValues]; } - (void)loadAllModelObjects { [[self->nameToModel allValues] makeObjectsPerformSelector:_cmd]; } /* entities */ - (EOEntity *)entityForObject:(id)_object { NSEnumerator *e; EOModel *m; e = [self->nameToModel objectEnumerator]; while ((m = [e nextObject])) { EOEntity *entity; if ((entity = [m entityForObject:_object])) return entity; } return nil; } - (EOEntity *)entityNamed:(NSString *)_name { NSEnumerator *e; EOModel *m; e = [self->nameToModel objectEnumerator]; while ((m = [e nextObject])) { EOEntity *entity; if ((entity = [m entityNamed:_name])) return entity; } return nil; } - (EOFetchSpecification *)fetchSpecificationNamed:(NSString *)_name entityNamed:(NSString *)_entityName { return [[self entityNamed:_entityName] fetchSpecificationNamed:_name]; } /* description */ - (NSString *)description { return [NSString stringWithFormat:@"<%@[0x%p]: models=%@>", NSStringFromClass([self class]), self, [[self modelNames] componentsJoinedByString:@","]]; } @end /* EOModelGroup */ SOPE/sope-gdl1/GDLAccess/EOAndQualifier+SQL.m0000644000000000000000000000402012242733417017247 0ustar rootroot/* EOAttributeOrdering.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // $Id: EOAndQualifier+SQL.m 1 2004-08-20 10:38:46Z znek $ #import "EOSQLQualifier.h" #include "common.h" @implementation EOAndQualifier(SQLQualifier) /* SQL qualifier generation */ - (EOSQLQualifier *)sqlQualifierForEntity:(EOEntity *)_entity { unsigned cc = [self->qualifiers count]; if (cc == 0) { return nil; } else if (cc == 1) { return [[self->qualifiers objectAtIndex:0] sqlQualifierForEntity:_entity]; } else if (cc == 2) { id left; id right; left = [[self->qualifiers objectAtIndex:0] sqlQualifierForEntity:_entity]; right = [[self->qualifiers objectAtIndex:1] sqlQualifierForEntity:_entity]; [left conjoinWithQualifier:right]; return left; } else { EOSQLQualifier *masterQ; unsigned i; for (i = 0, masterQ = nil; i < cc; i++) { EOSQLQualifier *q; q = [[self->qualifiers objectAtIndex:i] sqlQualifierForEntity:_entity]; if (masterQ == nil) masterQ = q; else [masterQ conjoinWithQualifier:q]; } return masterQ; } } @end /* EOAndQualifier */ SOPE/sope-gdl1/GDLAccess/EOEntity+Factory.m0000644000000000000000000000662712242733417017146 0ustar rootroot/* EOAttributeOrdering.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // $Id: EOEntity+Factory.m 1 2004-08-20 10:38:46Z znek $ #include #include #include #include #include "common.h" @interface NSObject(PKeyInitializer) - (id)initWithPrimaryKey:(NSDictionary *)_pkey entity:(EOEntity *)_entity; @end @implementation EOEntity(AttributeNames) - (NSArray *)attributeNames { NSMutableArray *attrNames = [[[NSMutableArray alloc] init] autorelease]; NSEnumerator *attrs = [self->attributes objectEnumerator]; EOAttribute *attr = nil; while ((attr = [attrs nextObject])) [attrNames addObject:[attr name]]; return attrNames; } @end /* EOEntity(AttributeNames) */ @implementation EOEntity(PrimaryKeys) - (BOOL)isPrimaryKeyAttribute:(EOAttribute *)_attribute { NSEnumerator *pkeys = [self->primaryKeyAttributeNames objectEnumerator]; NSString *aname = [_attribute name]; NSString *n = nil; while ((n = [pkeys nextObject])) { if ([aname isEqualToString:n]) return YES; } return NO; } - (unsigned)primaryKeyCount { return [self->primaryKeyAttributeNames count]; } @end /* EOEntity(PrimaryKeys) */ @implementation EOEntity(ObjectFactory) - (id)produceNewObjectWithPrimaryKey:(NSDictionary *)_key { /* Note: used by LSDBObjectNewCommand */ Class objectClass = Nil; id obj; objectClass = NSClassFromString([self className]); NSAssert(objectClass != nil, @"no enterprise object class set in entity"); obj = [objectClass alloc]; NSAssert(objectClass != nil, @"could not allocate enterprise object"); if ([obj respondsToSelector:@selector(initWithPrimaryKey:entity:)]) [obj initWithPrimaryKey:_key entity:self]; else [obj init]; return AUTORELEASE(obj); } - (void)setAttributesOfObjectToEONull:(id)_object { static EONull *null = nil; NSEnumerator *attrs; EOAttribute *attr; int pkeyCount; if (null == nil) null = [[NSNull null] retain]; attrs = [self->attributes objectEnumerator]; attr = nil; pkeyCount = [self->primaryKeyAttributeNames count]; NSAssert(NSClassFromString([self className]) == [_object class], @"object does not belong to entity"); while ((attr = [attrs nextObject])) { if (pkeyCount > 0) { if ([self isPrimaryKeyAttribute:attr]) { pkeyCount--; continue; } } [_object takeValue:null forKey:[attr name]]; } } @end /* EOEntity(ObjectFactory) */ SOPE/sope-gdl1/GDLAccess/EOEntity+Factory.h0000644000000000000000000000114612242733417017130 0ustar rootroot// $Id: EOEntity+Factory.h 1 2004-08-20 10:38:46Z znek $ #ifndef __GDLAccess_EOEntity_Factory_H__ #define __GDLAccess_EOEntity_Factory_H__ #import @class NSDictionary; @class EOAttribute; @interface EOEntity(AttributeNames) - (NSArray *)attributeNames; @end @interface EOEntity(PrimaryKeys) - (BOOL)isPrimaryKeyAttribute:(EOAttribute *)_attribute; - (unsigned)primaryKeyCount; @end @interface EOEntity(ObjectFactory) - (id)produceNewObjectWithPrimaryKey:(NSDictionary *)_key; - (void)setAttributesOfObjectToEONull:(id)_object; @end #endif /* __GDLAccess_EOEntity_Factory_H__ */ SOPE/sope-gdl1/GDLAccess/EOCustomValues.h0000644000000000000000000000476612242733417016716 0ustar rootroot/* EOCustomValues.h Copyright (C) 1996 Free Software Foundation, Inc. Author: Mircea Oancea Date: 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __EOCustomValues_h__ #define __EOCustomValues_h__ #import #import #import /* * Informal protocols to initialize value-instances (used as objects * in the dictionaries for the enterprise objects) and to convert * those values to string or data. * NOT implemented in NSObject */ @interface NSObject(EOCustomValues) - (id)initWithString:(NSString*)string type:(NSString*)type; - (NSString*)stringForType:(NSString*)type; @end @interface NSObject(EODatabaseCustomValues) - (id)initWithData:(NSData*)data type:(NSString*)type; - (NSData*)dataForType:(NSString*)type; @end /* * These categories are added to NSString, NSData and NSNumber classes. */ @interface NSString(EOCustomValues) + stringWithString:(NSString*)string type:(NSString*)type; - (id)initWithString:(NSString*)string type:(NSString*)type; - (NSString*)stringForType:(NSString*)type; - (id)initWithData:(NSData*)data type:(NSString*)type; - (NSData*)dataForType:(NSString*)type; @end @interface NSData(EOCustomValues) - initWithString:(NSString*)string type:(NSString*)type; - (NSString*)stringForType:(NSString*)type; - (id)initWithData:(NSData*)data type:(NSString*)type; - (NSData*)dataForType:(NSString*)type; @end @interface NSNumber(EOCustomValues) + (id)numberWithString:(NSString*)string type:(NSString*)type; - (id)initWithString:(NSString*)string type:(NSString*)type; - (NSString*)stringForType:(NSString*)type; @end #endif /* __EOCustomValues_h__ */ /* Local Variables: c-basic-offset: 4 tab-width: 8 End: */ SOPE/sope-gdl1/GDLAccess/EODatabaseContext.h0000644000000000000000000001223412242733417017322 0ustar rootroot/* EODatabaseContext.h Copyright (C) 1996 Free Software Foundation, Inc. Author: Mircea Oancea Date: 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __EODatabaseContext_h__ #define __EODatabaseContext_h__ #import #import @class NSArray, NSMutableArray, NSDictionary, NSMutableDictionary; @class NSString, NSMutableString; @class EOAdaptorContext; @class EOEntity; @class EOObjectUniquer, EODatabase, EODatabaseContext, EODatabaseChannel; typedef enum { EOUpdateWithOptimisticLocking, EOUpdateWithPessimisticLocking, EOUpdateWithNoLocking, EONoUpdate, } EOUpdateStrategy; struct _EOTransactionScope; extern NSString *EODatabaseContextWillBeginTransactionName; extern NSString *EODatabaseContextDidBeginTransactionName; extern NSString *EODatabaseContextWillRollbackTransactionName; extern NSString *EODatabaseContextDidRollbackTransactionName; extern NSString *EODatabaseContextWillCommitTransactionName; extern NSString *EODatabaseContextDidCommitTransactionName; struct EODatabaseContextModificationQueue; @interface EODatabaseContext : NSObject < EOObjectRegistry > //EOCooperatingObjectStore < EOObjectRegistry > { EOAdaptorContext *adaptorContext; EODatabase *database; NSMutableArray *channels; EOUpdateStrategy updateStrategy; id coordinator; id delegate; /* non-retained */ struct _EOTransactionScope *transactionStackTop; int transactionNestingLevel; // These fields should be in a bitfield but are ivars for debug purposes BOOL isKeepingSnapshots; BOOL isUniquingObjects; /* modified objects */ struct EODatabaseContextModificationQueue *ops; /* statistics */ unsigned int txBeginCount; unsigned int txCommitCount; unsigned int txRollbackCount; } // Initializing instances - (id)initWithDatabase:(EODatabase *)aDatabase; /* accessors */ - (void)setDelegate:(id)_delegate; - (id)delegate; - (EODatabase *)database; // Getting the adaptor context - (EOAdaptorContext*)adaptorContext; // Finding channels - (BOOL)hasBusyChannels; - (BOOL)hasOpenChannels; - (NSArray *)channels; - (id)createChannel; // Controlling transactions - (BOOL)beginTransaction; - (BOOL)commitTransaction; - (BOOL)rollbackTransaction; // Notifying of other transactions - (void)transactionDidBegin; - (void)transactionDidCommit; - (void)transactionDidRollback; // Nesting transactions - (BOOL)canNestTransactions; - (unsigned)transactionNestingLevel; // Setting the update strategy - (void)setUpdateStrategy:(EOUpdateStrategy)aStrategy; - (EOUpdateStrategy)updateStrategy; - (BOOL)keepsSnapshots; // Handle Objects - (void)recordLockedObject:(id)anObj; - (BOOL)isObjectLocked:(id)anObj; - (void)recordUpdatedObject:(id)anObj; - (BOOL)isObjectUpdated:(id)anObj; @end /* EODatabaseContext */ @interface EODatabaseContext(Statistics) - (unsigned int)transactionBeginCount; - (unsigned int)transactionCommitCount; - (unsigned int)transactionRollbackCount; @end /* * Methods used by database classess internally */ @interface EODatabaseContext(Private) - (void)channelDidInit:(id)aChannel; - (void)channelWillDealloc:(id)aChannel; - (void)privateBeginTransaction; - (void)privateCommitTransaction; - (void)privateRollbackTransaction; @end @class EOModel; @interface EODatabaseContext(NewInEOF2) + (void)setContextClassToRegister:(Class)_cclass; + (Class)contextClassToRegister; #if 0 + (EODatabaseContext *)registeredDatabaseContextForModel:(EOModel *)_model editingContext:(id)_ec; - (id)coordinator; #endif /* managing channels */ - (EODatabaseChannel *)availableChannel; - (NSArray *)registeredChannels; - (void)registerChannel:(EODatabaseChannel *)_channel; - (void)unregisterChannel:(EODatabaseChannel *)_channel; @end @class EOFetchSpecification; @interface NSObject(EOF2DelegateMethods) - (BOOL)databaseContext:(EODatabaseContext *)_ctx shouldSelectObjectsWithFetchSpecification:(EOFetchSpecification *)_fspec databaseChannel:(EODatabaseChannel *)_channel; - (void)databaseContext:(EODatabaseContext *)_ctx didSelectObjectsWithFetchSpecification:(EOFetchSpecification *)_fspec databaseChannel:(EODatabaseChannel *)_channel; - (BOOL)databaseContext:(EODatabaseContext *)_ctx shouldUsePessimisticLockWithFetchSpecification:(EOFetchSpecification *)_fspec databaseChannel:(EODatabaseChannel *)_channel; @end #endif /* __EODatabaseContext_h__ */ SOPE/sope-gdl1/GDLAccess/EOGenericRecord.h0000644000000000000000000000234512242733417016766 0ustar rootroot// $Id: EOGenericRecord.h 1 2004-08-20 10:38:46Z znek $ #ifndef __eoaccess_EOGenericRecord_H__ #define __eoaccess_EOGenericRecord_H__ #import @class NSDictionary; @class EOEntity; @interface EOGenericRecord(EOAccess) // Initializing new instances - (id)initWithPrimaryKey:(NSDictionary *)aKey entity:(EOEntity *)anEntity; // Getting the associated entity - (EOEntity *)entity; @end /* * Informal protocol. NOT implemented by NSObject. * Before sending one of this messages the caller must * check if the object responds to them. */ @interface NSObject(EOGenericRecord) /* * Initialize an new instance of an object. * If an enterprise object does not respond * to this method it will receive -init. */ - (id)initWithPrimaryKey:(NSDictionary *)key entity:(EOEntity *)entity; /* * Determines the entity of user defined objects, * when more than one entity uses the same class for its objects. */ - (EOEntity *)entity; /* * Determine the class for object based on its fetched row. * The returned class *must* be a subclass of the class that * receives this method. */ + (Class)classForEntity:(EOEntity *)entity values:(NSDictionary *)values; @end #endif /* __eoaccess_EOGenericRecord_H__ */ SOPE/sope-gdl1/GDLAccess/EOExpressionArray.m0000644000000000000000000002121712242733417017415 0ustar rootroot/* EOExpressionArray.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: September 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import "common.h" #import "EOExpressionArray.h" #import "EOAttribute.h" #import "EOEntity.h" #import "EORelationship.h" @implementation EOExpressionArray - (id)init { [super init]; self->array = [[NSMutableArray allocWithZone:[self zone]] init]; return self; } - (id)initWithPrefix:(NSString *)_prefix infix:(NSString *)_infix suffix:(NSString *)_suffix { [super init]; ASSIGN(self->prefix, _prefix); ASSIGN(self->infix, _infix); ASSIGN(self->suffix, _suffix); RELEASE(self->array); self->array = [[NSMutableArray allocWithZone:[self zone]] init]; return self; } - (void)dealloc { RELEASE(self->array); RELEASE(self->prefix); RELEASE(self->infix); RELEASE(self->suffix); [super dealloc]; } - (BOOL)referencesObject:(id)anObject { return [self indexOfObject:anObject] != NSNotFound; } - (NSString *)expressionValueForContext:(id)ctx { if(ctx && [self count] && [[self objectAtIndex:0] isKindOfClass:[EORelationship class]]) return [ctx expressionValueForAttributePath:self->array]; else { NSUInteger i, count; id result; SEL sel; IMP imp; count = [self count]; result = [NSMutableString stringWithCapacity:256]; sel = @selector(appendString:); imp = [result methodForSelector:sel]; if (self->prefix) [result appendString:self->prefix]; if (count) { id o; o = [self objectAtIndex:0]; (*imp)(result, sel, [o expressionValueForContext:ctx]); for (i = 1 ; i < count; i++) { if (self->infix) (*imp)(result, sel, self->infix); o = [self objectAtIndex:i]; (*imp)(result, sel, [o expressionValueForContext:ctx]); } } if (self->suffix) [result appendString:self->suffix]; return result; } } - (void)setPrefix:(NSString *)_prefix { ASSIGNCOPY(self->prefix, _prefix); } - (void)setInfix:(NSString *)_infix { ASSIGNCOPY(self->infix, _infix); } - (void)setSuffix:(NSString *)_suffix { ASSIGNCOPY(self->suffix, _suffix); } - (NSString *)prefix { return self->prefix; } - (NSString *)infix { return self->infix; } - (NSString *)suffix { return self->suffix; } + (EOExpressionArray *)parseExpression:(NSString *)expression entity:(EOEntity *)entity replacePropertyReferences:(BOOL)replacePropertyReferences { return [EOExpressionArray parseExpression:expression entity:entity replacePropertyReferences: replacePropertyReferences relationshipPaths:nil]; } + (EOExpressionArray *)parseExpression:(NSString *)expression entity:(EOEntity *)entity replacePropertyReferences:(BOOL)replacePropertyReferences relationshipPaths:(NSMutableArray *)relationshipPaths { EOExpressionArray *exprArray; unsigned char buf[[expression lengthOfBytesUsingEncoding:NSUTF8StringEncoding] + 4]; // TODO: not too good const unsigned char *s, *start; id objectToken; NSAutoreleasePool *pool; exprArray = [[EOExpressionArray new] autorelease]; pool = [[NSAutoreleasePool alloc] init]; [expression getCString:(char *)buf maxLength:[expression lengthOfBytesUsingEncoding:NSUTF8StringEncoding] + 4 encoding:NSUTF8StringEncoding]; s = buf; /* Divide the expression string in alternating substrings that obey the following simple grammar: I = [a-zA-Z0-9@_#]([a-zA-Z0-9@_.#$])+ O = \'.*\' | \".*\" | [^a-zA-Z0-9@_#]+ S -> I S | O S | nothing */ while(*s) { /* Determines an I token. */ if(isalnum((int)*s) || *s == '@' || *s == '_' || *s == '#') { start = s; for(++s; *s; s++) if(!isalnum((int)*s) && *s != '@' && *s != '_' && *s != '.' && *s != '#' && *s != '$') break; objectToken = [NSString stringWithCString:(char *)start length:(unsigned)(s - start)]; if (replacePropertyReferences) { id property = [entity propertyNamed:objectToken]; if(property) { if ([objectToken isNameOfARelationshipPath] && relationshipPaths) { [relationshipPaths addObject: [entity relationshipsNamed: objectToken]]; } objectToken = property; } } [exprArray addObject:objectToken]; } /* Determines an O token. */ start = s; for(; *s && !isalnum((int)*s) && *s != '@' && *s != '_' && *s != '#'; s++) { if(*s == '\'' || *s == '"') { unsigned char quote = *s; for(++s; *s; s++) if(*s == quote) break; else if(*s == '\\') s++; /* Skip the escaped characters */ if(!*s) { [NSException raise:@"SyntaxErrorException" format:@"unterminated character string"]; } } } if (s != start) { objectToken = [NSString stringWithCString:(char *)start length:(unsigned)(s - start)]; [exprArray addObject:objectToken]; } } [pool release]; return exprArray; } /* NSMutableCopying */ - (id)copyWithZone:(NSZone *)_zone { return [self mutableCopyWithZone:_zone]; } - (id)mutableCopyWithZone:(NSZone *)_zone { EOExpressionArray *new; new = [[EOExpressionArray allocWithZone:_zone] initWithPrefix:self->prefix infix:self->infix suffix:self->suffix]; RELEASE(new->array); new->array = nil; new->array = [self->array mutableCopyWithZone:_zone]; return new; } /* NSArray compatibility */ - (void)addObjectsFromExpressionArray:(EOExpressionArray *)_array { [self->array addObjectsFromArray:_array->array]; } - (void)insertObject:(id)_obj atIndex:(NSUInteger)_idx { [self->array insertObject:_obj atIndex:_idx]; } - (void)addObjectsFromArray:(NSArray *)_array { [self->array addObjectsFromArray:_array]; } - (void)addObject:(id)_object { [self->array addObject:_object]; } - (NSUInteger)indexOfObject:(id)_object { return [self->array indexOfObject:_object]; } - (id)objectAtIndex:(NSUInteger)_idx { return [self->array objectAtIndex:_idx]; } - (id)lastObject { return [self->array lastObject]; } - (NSUInteger)count { return [self->array count]; } - (BOOL)isNotEmpty { return [self->array count] > 0 ? YES : NO; } - (NSEnumerator *)objectEnumerator { return [self->array objectEnumerator]; } - (NSEnumerator *)reverseObjectEnumerator { return [self->array reverseObjectEnumerator]; } - (NSString *)description { NSMutableString *ms; ms = [NSMutableString stringWithCapacity:128]; [ms appendFormat:@"<0x%p[%@]:", self, NSStringFromClass([self class])]; if (self->array) [ms appendFormat:@" array=%@", self->array]; if (self->prefix) [ms appendFormat:@" prefix='%@'", self->prefix]; if (self->infix) [ms appendFormat:@" infix='%@'", self->infix]; if (self->suffix) [ms appendFormat:@" suffix='%@'", self->suffix]; [ms appendString:@">"]; return ms; } @end /* EOExpressionArray */ @implementation NSObject(EOExpression) - (NSString *)expressionValueForContext:(id)ctx { if([self respondsToSelector:@selector(stringValue)]) return [(id)self stringValue]; return [self description]; } @end /* NSObject(EOExpression) */ @implementation NSString(EOExpression) /* Avoid returning the description in case of NSString because if the string contains whitespaces it will be quoted. Particular adaptors have to override -formatValue:forAttribute: and they have to quote with the specific database character the returned string. */ - (NSString *)expressionValueForContext:(id)ctx { return self; } @end /* NSString(EOExpression) */ /* Local Variables: c-basic-offset: 4 tab-width: 8 End: */ SOPE/sope-gdl1/GDLAccess/EOFaultHandler.m0000644000000000000000000001432412242733417016631 0ustar rootroot/* EOAdaptorChannel.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: October 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // $Id: EOFaultHandler.m 1 2004-08-20 10:38:46Z znek $ #include "EOFaultHandler.h" #include "EOFault.h" #include "common.h" #if (defined(__GNU_LIBOBJC__) && (__GNU_LIBOBJC__ >= 20100911)) || defined(APPLE_RUNTIME) || defined(__GNUSTEP_RUNTIME__) # define METHOD_NULL NULL # define class_get_super_class class_getSuperclass # define object_is_instance(object) (object!=nil?YES:NO) # define class_get_instance_method class_getInstanceMethod typedef struct objc_method *Method_t; #endif #if NeXT_RUNTIME # if !defined(METHOD_NULL) # define METHOD_NULL NULL # endif #endif #if defined (__GNUSTEP_RUNTIME__) # define class_get_instance_method class_getInstanceMethod #endif #if !(__GNU_LIBOBJC__ >= 20100911) # define sel_getTypeEncoding(selector) ((selector)->sel_types) #endif @implementation EOFaultHandler - (void)setTargetClass:(Class)_class extraData:(void *)_extraData { self->targetClass = _class; self->extraData = _extraData; } - (Class)targetClass; { return self->targetClass; } - (void *)extraData { return self->extraData; } /* firing */ - (BOOL)shouldPerformInvocation:(NSInvocation *)_invocation { return YES; } - (void)faultWillFire:(EOFault *)_fault { } - (void)completeInitializationOfObject:(id)_object { [self doesNotRecognizeSelector:_cmd]; } /* fault reflection */ - (Class)classForFault:(EOFault *)_fault { #if GNU_RUNTIME && !defined(__GNUSTEP_RUNTIME__) return (object_is_instance(_fault)) ? [self targetClass] : (*(Class *)_fault); #else # warning TODO: add complete implementation for Apple/NeXT runtime! return [self targetClass]; #endif } - (BOOL)respondsToSelector:(SEL)_selector forFault:(EOFault *)_fault { Class class; /* first check whether fault itself responds to selector */ #if GNU_RUNTIME && !defined(__GNUSTEP_RUNTIME__) if (class_get_instance_method(*(Class *)_fault, _selector) != METHOD_NULL) return YES; #else # warning TODO: add implementation for NeXT/Apple runtime! #endif /* then check whether the target class does */ class = [self targetClass]; #if GNU_RUNTIME && !defined(__GNUSTEP_RUNTIME__) return (class_get_instance_method(class, _selector) != NULL) ? YES : NO; #else # warning TODO: use NeXT/Apple runtime function return [(NSObject *)class methodForSelector:_selector] ? YES : NO; #endif } - (BOOL)conformsToProtocol:(Protocol *)_protocol forFault:(EOFault *)_fault { Class class, sClass; #if GNU_RUNTIME && !defined(__GNUSTEP_RUNTIME__) && !(__GNU_LIBOBJC__ >= 20100911) struct objc_protocol_list* protos; int i; class = object_is_instance(_fault) ? [self targetClass] : (Class)_fault; for (protos = class->protocols; protos; protos = protos->next) { for (i = 0; i < protos->count; i++) { if ([protos->list[i] conformsToProtocol:_protocol]) return YES; } } #else # warning TODO: implement on NeXT/Apple runtime! class = [self targetClass]; #endif return ((sClass = [class superclass])) ? [sClass conformsToProtocol:_protocol] : NO; } - (BOOL)isKindOfClass:(Class)_class forFault:(EOFault *)_fault { Class class; #if GNU_RUNTIME && !defined(__GNUSTEP_RUNTIME__) class = object_is_instance(_fault) ? [self targetClass] : (Class)_fault; for (; class != Nil; class = class_get_super_class(class)) { if (class == _class) return YES; } #else # warning TODO: add implementation for NeXT/Apple runtime! class = [self targetClass]; #endif return NO; } - (BOOL)isMemberOfClass:(Class)_class forFault:(EOFault *)_fault { Class class; #if GNU_RUNTIME && !defined(__GNUSTEP_RUNTIME__) class = object_is_instance(_fault) ? [self targetClass] : (Class)_fault; #else # warning TODO: add implementation for NeXT/Apple runtime! class = [self targetClass]; #endif return class == _class ? YES : NO; } - (NSMethodSignature *)methodSignatureForSelector:(SEL)_selector forFault:(EOFault *)_fault { #if NeXT_Foundation_LIBRARY || defined(__GNUSTEP_RUNTIME__) // probably incorrect return [_fault methodSignatureForSelector:_selector]; #else register const char *types = NULL; if (_selector == NULL) // invalid selector return nil; #if GNU_RUNTIME && 0 // GNU runtime selectors may be typed, a lookup may not be necessary types = aSelector->sel_types; #endif /* first check for EOFault's own methods */ #if !(__GNU_LIBOBJC__ >= 20100911) if (types == NULL) { // lookup method for selector struct objc_method *mth; mth = class_get_instance_method(*(Class *)_fault, _selector); if (mth) types = mth->method_types; } /* then check in target class methods */ if (types == NULL) { // lookup method for selector struct objc_method *mth; mth = class_get_instance_method([self targetClass], _selector); if (mth) types = mth->method_types; } #endif #if GNU_RUNTIME // GNU runtime selectors may be typed, a lookup may not be necessary if (types == NULL) types = sel_getTypeEncoding(_selector); #endif if (types == NULL) return nil; return [NSMethodSignature signatureWithObjCTypes:types]; #endif } /* description */ - (NSString *)descriptionForObject:(id)_fault { return [NSString stringWithFormat:@"<%@[0x%p]: on=%@>", NSStringFromClass(*(Class *)_fault), _fault, NSStringFromClass([self targetClass])]; } @end /* EOFaultHandler */ SOPE/sope-gdl1/GDLAccess/EOSQLExpression.h0000644000000000000000000002016012242733417016765 0ustar rootroot/* EOSQLExpression.h Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: September 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __EOSQLExpression_h__ #define __EOSQLExpression_h__ #import #import #include #include /* EOSQLExpression TODO: document Apparently the only object which implements EOExpressionContext? */ @class EOAdaptor, EOAdaptorChannel, EOEntity, EOSQLQualifier; extern NSString *EOBindVariableNameKey; extern NSString *EOBindVariablePlaceHolderKey; extern NSString *EOBindVariableAttributeKey; extern NSString *EOBindVariableValueKey; @interface EOSQLExpression : NSObject { EOEntity *entity; EOAdaptor *adaptor; NSMutableDictionary *entitiesAndPropertiesAliases; NSMutableArray *fromListEntities; NSMutableString *content; /* new in EOF2 */ NSString *whereClauseString; NSMutableString *listString; NSMutableArray *bindings; } /* Building SQL expressions */ + (id)deleteExpressionWithQualifier:(EOSQLQualifier *)qualifier channel:(EOAdaptorChannel *)channel; + (id)insertExpressionForRow:(NSDictionary *)row entity:(EOEntity *)entity channel:(EOAdaptorChannel *)channel; + (id)selectExpressionForAttributes:(NSArray *)attributes lock:(BOOL)flag qualifier:(EOSQLQualifier *)qualifier fetchOrder:(NSArray *)fetchOrder channel:(EOAdaptorChannel *)channel; + (id)updateExpressionForRow:(NSDictionary *)row qualifier:(EOSQLQualifier *)qualifier channel:(EOAdaptorChannel *)channel; - (id)deleteExpressionWithQualifier:(EOSQLQualifier *)qualifier channel:(EOAdaptorChannel *)channel; - (id)insertExpressionForRow:(NSDictionary *)row entity:(EOEntity *)entity channel:(EOAdaptorChannel *)channel; - (id)selectExpressionForAttributes:(NSArray *)attributes lock:(BOOL)flag qualifier:(EOSQLQualifier *)qualifier fetchOrder:(NSArray *)fetchOrder channel:(EOAdaptorChannel *)channel; - (id)updateExpressionForRow:(NSDictionary *)row qualifier:(EOSQLQualifier *)qualifier channel:(EOAdaptorChannel *)channel; /* factory classes */ + (Class)selectExpressionClass; + (Class)insertExpressionClass; + (Class)deleteExpressionClass; + (Class)updateExpressionClass; /* Getting the adaptor */ - (EOAdaptor *)adaptor; // Private methods. /* Creating components for the SELECT operation */ - (NSString *)selectListWithAttributes:(NSArray *)attributes qualifier:(EOSQLQualifier *)qualifier; - (NSString *)fromClause; - (NSString *)whereClauseForQualifier:(EOSQLQualifier *)qualifier; - (NSString *)joinExpressionForRelationshipPaths:(NSArray *)relationshipPaths; - (NSString *)lockClause; - (NSString *)orderByClauseForFetchOrder:(NSArray *)fetchOrder; /* Creating components for the UPDATE operation */ - (id)updateListForRow:(NSDictionary *)row; /* Creating components for the INSERT operation */ - (id)columnListForRow:(NSDictionary *)row; - (id)valueListForRow:(NSDictionary *)row; /* Final initialization */ - (id)finishBuildingExpression; /* Caching aliases */ - (NSArray *)relationshipPathsForAttributes:(NSArray *)attributes qualifier:(EOSQLQualifier *)qualifier fetchOrder:(NSArray *)fetchOrder; /* Getting the entity */ - (EOEntity *)entity; /* Getting the expression value of an attribute in a given context. This method is used by the expressionValueForAttribute: method. */ - (NSString *)expressionValueForAttribute:(EOAttribute *)attribute context:context; @end @class NSArray; @class EOFetchSpecification, EOKeyComparisonQualifier, EOKeyValueQualifier; @class EOQualifier; @interface EOSQLExpression(NewInEOF2) + (EOSQLExpression *)selectStatementForAttributes:(NSArray *)_attributes lock:(BOOL)_flag fetchSpecification:(EOFetchSpecification *)_fspec entity:(EOEntity *)_entity; + (EOSQLExpression *)expressionForString:(NSString *)_sql; /* accessors */ - (void)setStatement:(NSString *)_stmt; - (NSString *)statement; - (NSString *)whereClauseString; /* tables */ - (NSString *)tableListWithRootEntity:(EOEntity *)_entity; /* assembly */ - (NSString *)assembleDeleteStatementWithQualifier:(EOQualifier *)_qualifier tableList:(NSString *)_tableList whereClause:(NSString *)_whereClause; - (NSString *)assembleInsertStatementWithRow:(NSDictionary *)_row tableList:(NSString *)_tables columnList:(NSString *)_columns valueList:(NSString *)_values; - (NSString *)assembleSelectStatementWithAttributes:(NSArray *)_attributes lock:(BOOL)_lock qualifier:(EOQualifier *)_qualifier fetchOrder:(NSArray *)_fetchOrder selectString:(NSString *)_selectString columnList:(NSString *)_columns tableList:(NSString *)_tables whereClause:(NSString *)_whereClause joinClause:(NSString *)_joinClause orderByClause:(NSString *)_orderByClause lockClause:(NSString *)_lockClause; - (NSString *)assembleUpdateStatementWithRow:(NSDictionary *)_row qualifier:(EOQualifier *)_qualifier tableList:(NSString *)_tables updateList:(NSString *)_updates whereClause:(NSString *)_whereClause; - (NSString *)assembleJoinClauseWithLeftName:(NSString *)_leftName rightName:(NSString *)_rightName joinSemantic:(EOJoinSemantic)_semantic; /* bind variables */ - (BOOL)mustUseBindVariableForAttribute:(EOAttribute *)_attr; - (BOOL)shouldUseBindVariableForAttribute:(EOAttribute *)_attr; + (BOOL)useBindVariables; - (NSMutableDictionary *)bindVariableDictionaryForAttribute:(EOAttribute *)_attr value:(id)_value; - (void)addBindVariableDictionary:(NSMutableDictionary *)_dictionary; - (NSArray *)bindVariableDictionaries; /* values */ + (NSString *)formatValue:(id)_value forAttribute:(EOAttribute *)_attribute; - (NSString *)sqlStringForValue:(id)_value attributeNamed:(NSString *)_attrName; + (NSString *)sqlPatternFromShellPattern:(NSString *)_pattern; /* attributes */ - (NSString *)sqlStringForAttribute:(EOAttribute *)_attribute; - (NSString *)sqlStringForAttributePath:(NSString *)_attrPath; - (NSString *)sqlStringForAttributeNamed:(NSString *)_attrName; /* SQL formats */ + (NSString *)formatSQLString:(NSString *)_sqlString format:(NSString *)_fmt; /* qualifier operators */ - (NSString *)sqlStringForSelector:(SEL)_selector value:(id)_value; /* qualifiers */ - (NSString *)sqlStringForKeyComparisonQualifier:(EOKeyComparisonQualifier *)_q; - (NSString *)sqlStringForKeyValueQualifier:(EOKeyValueQualifier *)_q; - (NSString *)sqlStringForNegatedQualifier:(EOQualifier *)_q; - (NSString *)sqlStringForConjoinedQualifiers:(NSArray *)_qs; - (NSString *)sqlStringForDisjoinedQualifiers:(NSArray *)_qs; /* list strings */ - (NSMutableString *)listString; - (void)appendItem:(NSString *)_itemString toListString:(NSMutableString *)_lstr; /* deletes */ - (void)prepareDeleteExpressionForQualifier:(EOQualifier *)_qualifier; /* updates */ - (void)addUpdateListAttribute:(EOAttribute *)_attr value:(NSString *)_value; - (void)prepareUpdateExpressionWithRow:(NSDictionary *)_row qualifier:(EOQualifier *)_qualifier; @end /* Private subclasses used by EOSQLExpression. */ @interface EOSelectSQLExpression : EOSQLExpression @end @interface EOUpdateSQLExpression : EOSQLExpression @end @interface EOInsertSQLExpression : EOSQLExpression @end @interface EODeleteSQLExpression : EOSQLExpression @end #endif /* __EOSQLExpression_h__ */ /* Local Variables: c-basic-offset: 4 tab-width: 8 End: */ SOPE/sope-gdl1/GDLAccess/EOSelectSQLExpression.m0000644000000000000000000000602112242733417020132 0ustar rootroot/* EOSQLExpression.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: September 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "EOSQLExpression.h" #include "EOAttribute.h" #include "EOAdaptor.h" #include "common.h" #if LIB_FOUNDATION_LIBRARY # include # include #else # include "DefaultScannerHandler.h" # include "PrintfFormatScanner.h" #endif @interface EOSelectScannerHandler : DefaultScannerHandler { EOAttribute *attribute; EOAdaptor *adaptor; NSString *alias; } - (void)setAttribute:(EOAttribute*)attribute adaptor:(EOAdaptor*)adaptor alias:(NSString*)alias; @end @implementation EOSelectSQLExpression - (NSString *)expressionValueForAttribute:(EOAttribute *)attribute context:(id)context { NSString *alias; NSString *columnName; alias = [entitiesAndPropertiesAliases objectForKey:context]; //NSLog(@"entitiesAndPropertiesAliases: %@", entitiesAndPropertiesAliases); columnName = adaptor ? (NSString *)[adaptor formatAttribute:attribute] : [attribute columnName]; if (alias) { return [([[NSString alloc] initWithFormat:@"%@.%@", alias, columnName]) autorelease]; } return columnName; } @end /* EOSelectSQLExpression */ @implementation EOSelectScannerHandler - (id)init { if ((self = [super init]) != nil) { specHandler['A'] = [self methodForSelector:@selector(convertAttribute:scanner:)]; } return self; } - (void)dealloc { [self->attribute release]; [self->adaptor release]; [self->alias release]; [super dealloc]; } - (void)setAttribute:(EOAttribute*)_attribute adaptor:(EOAdaptor*)_adaptor alias:(NSString*)_alias { ASSIGN(self->attribute, _attribute); ASSIGN(self->adaptor, _adaptor); ASSIGN(self->alias, _alias); } - (NSString *)convertAttribute:(va_list *)pString scanner:(FormatScanner *)scanner { NSString *columnName; columnName = (adaptor) ? (NSString *)[adaptor formatAttribute:self->attribute] : [self->attribute columnName]; if (alias) return [NSString stringWithFormat:@"%@.%@", alias, columnName]; return columnName; } @end /* EOSelectScannerHandler */ SOPE/sope-gdl1/GDLAccess/EOFaultHandler.h0000644000000000000000000000233612242733417016624 0ustar rootroot// $Id: EOFaultHandler.h 1 2004-08-20 10:38:46Z znek $ #ifndef __EOFaultHandler_h__ #define __EOFaultHandler_h__ #import @class NSInvocation, NSMethodSignature; @class EOFault; @interface EOFaultHandler : NSObject { @public int faultReferences; void *extraData; /* saved ivars overridden by 'faultHandler' ivar */ Class targetClass; NSZone *zone; } - (Class)targetClass; - (void *)extraData; - (void)setTargetClass:(Class)_class extraData:(void *)_extraData; /* firing */ - (BOOL)shouldPerformInvocation:(NSInvocation *)_invocation; - (void)faultWillFire:(EOFault *)_fault; - (void)completeInitializationOfObject:(id)_object; /* fault reflection */ - (Class)classForFault:(EOFault *)_fault; - (BOOL)respondsToSelector:(SEL)_selector forFault:(EOFault *)_fault; - (BOOL)conformsToProtocol:(Protocol *)_protocol forFault:(EOFault *)_fault; - (BOOL)isKindOfClass:(Class)_class forFault:(EOFault *)_fault; - (BOOL)isMemberOfClass:(Class)_class forFault:(EOFault *)_fault; - (NSMethodSignature *)methodSignatureForSelector:(SEL)_selector forFault:(EOFault *)_fault; /* description */ - (NSString *)descriptionForObject:(id)_fault; @end /* EOFaultHandler */ #endif /* __EOFaultHandler_h__ */ SOPE/sope-gdl1/GDLAccess/EOAttribute.m0000644000000000000000000003647512242733417016236 0ustar rootroot/* EOAttributeOrdering.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import "common.h" #import "EOAttribute.h" #import "EOModel.h" #import "EOEntity.h" #import "EORelationship.h" #import "EOExpressionArray.h" #import "EOCustomValues.h" #import #import "EOFExceptions.h" @interface NSString(BeautifyAttributeName) - (NSString *)_beautifyAttributeName; @end @implementation EOAttribute static NSString *defaultCalendarFormat = @"%b %d %Y %H:%M"; static EONull *null = nil; + (void)initialize { if (null == nil) null = [[EONull null] retain]; } - (id)initWithName:(NSString*)_name { if ((self = [super init])) { ASSIGN(self->name,_name); self->entity = nil; } return self; } - (id)init { return [self initWithName:nil]; } - (void)dealloc { [self->name release]; [self->calendarFormat release]; [self->clientTimeZone release]; [self->serverTimeZone release]; [self->columnName release]; [self->externalType release]; [self->valueClassName release]; [self->valueType release]; [self->userDictionary release]; self->entity = nil; /* non-retained */ [super dealloc]; } // These methods should be here to let the library work with NeXT foundation - (id)copy { return [self retain]; } - (id)copyWithZone:(NSZone *)_zone { return [self retain]; } // Is equal only if same name; used to make aliasing ordering stable - (unsigned)hash { return [self->name hash]; } - (BOOL)setName:(NSString*)_name { if([name isEqual:_name]) return YES; if([entity attributeNamed:_name]) return NO; ASSIGN(name, _name); return YES; } + (BOOL)isValidName:(NSString*)_name { return [EOEntity isValidName:_name]; } - (BOOL)referencesProperty:(id)property { // TODO: still used? return NO; } - (NSString *)expressionValueForContext:(id)context { return (context != nil) ? [context expressionValueForAttribute:self] : columnName; } - (void)setEntity:(EOEntity*)_entity { self->entity = _entity; /* non-retained */ } - (EOEntity *)entity { return self->entity; } - (void)resetEntity { self->entity = nil; } - (BOOL)hasEntity { return (self->entity != nil) ? YES : NO; } - (void)setCalendarFormat:(NSString*)format { ASSIGN(self->calendarFormat, format); } - (NSString *)calendarFormat { return self->calendarFormat; } - (void)setClientTimeZone:(NSTimeZone*)tz { ASSIGN(self->clientTimeZone, tz); } - (NSTimeZone *)clientTimeZone { return self->clientTimeZone; } - (void)setServerTimeZone:(NSTimeZone*)tz { ASSIGN(self->serverTimeZone, tz); } - (NSTimeZone *)serverTimeZone { return self->serverTimeZone; } - (void)setColumnName:(NSString *)_name { ASSIGNCOPY(self->columnName, _name); } - (NSString *)columnName { return self->columnName; } - (void)setExternalType:(NSString *)type { ASSIGNCOPY(self->externalType, type); } - (NSString *)externalType { return self->externalType; } - (void)setValueClassName:(NSString *)_name { ASSIGNCOPY(self->valueClassName, _name); } - (NSString *)valueClassName { return self->valueClassName; } - (void)setValueType:(NSString *)type { ASSIGN(self->valueType, type); } - (NSString *)valueType { return self->valueType; } - (void)setUserDictionary:(NSDictionary *)dict { ASSIGN(self->userDictionary, dict); } - (NSDictionary *)userDictionary { return self->userDictionary; } + (NSString *)defaultCalendarFormat { return defaultCalendarFormat; } - (NSString *)name { return self->name; } /* description */ - (NSString *)description { return [[self propertyList] description]; } /* EOAttributePrivate */ + (EOAttribute*)attributeFromPropertyList:(id)propertyList { NSDictionary *plist = propertyList; EOAttribute *attribute = nil; NSString *timeZoneName; id tmp; attribute = [[[EOAttribute alloc] init] autorelease]; [attribute setName:[plist objectForKey:@"name"]]; [attribute setCalendarFormat:[plist objectForKey:@"calendarFormat"]]; timeZoneName = [plist objectForKey:@"clientTimeZone"]; if (timeZoneName) [attribute setClientTimeZone:[NSTimeZone timeZoneWithName:timeZoneName]]; timeZoneName = [plist objectForKey:@"serverTimeZone"]; if (timeZoneName) [attribute setServerTimeZone:[NSTimeZone timeZoneWithName:timeZoneName]]; [attribute setColumnName: [plist objectForKey:@"columnName"]]; [attribute setExternalType: [plist objectForKey:@"externalType"]]; [attribute setValueClassName:[plist objectForKey:@"valueClassName"]]; [attribute setValueType: [plist objectForKey:@"valueType"]]; [attribute setUserDictionary:[plist objectForKey:@"userDictionary"]]; if ((tmp = [plist objectForKey:@"allowsNull"])) [attribute setAllowsNull:[tmp isEqual:@"Y"]]; else [attribute setAllowsNull:YES]; [attribute setWidth:[[plist objectForKey:@"width"] unsignedIntValue]]; return attribute; } /* WARNING: You should call this method from entity after the relationships were constructed and after the `attributes' array contains the real attributes. */ - (void)replaceStringsWithObjects { } - (id)propertyList { NSMutableDictionary *propertyList; propertyList = [NSMutableDictionary dictionaryWithCapacity:16]; [self encodeIntoPropertyList:propertyList]; return propertyList; } - (int)compareByName:(EOAttribute *)_other { return [[(EOAttribute *)self name] compare:[_other name]]; } /* ValuesConversion */ - (id)convertValue:(id)aValue toClass:(Class)aClass forType:(NSString*)_type { // Check nil/EONull if (aValue == nil) return nil; if (aValue == null) return aValue; // Check if we need conversion; we use is kind of because // a string is not a NSString but some concrete class, so is NSData, // NSNumber and may be other classes if ([aValue isKindOfClass:aClass]) return aValue; // We have to convert the aValue // Try EOCustomValues if ([aValue respondsToSelector:@selector(stringForType:)]) { // Special case if aClass is NSNumber if (aClass == [NSNumber class]) { return [NSNumber numberWithString:[aValue stringForType:_type] type:_type]; } // Even more Special case if aClass is NSCalendar date if (aClass == [NSCalendarDate class]) { /* we enter this section even if the value is a NSDate object, or NSCFDate on Cocoa */ NSCalendarDate *date; NSString *format; format = [self calendarFormat]; if (format == nil) format = [EOAttribute defaultCalendarFormat]; if ([aValue isKindOfClass:[NSDate class]]) { // TBD: this does not catch NSCFDate?! date = [NSCalendarDate dateWithTimeIntervalSince1970: [(NSDate *)aValue timeIntervalSince1970]]; } else { date = [NSCalendarDate dateWithString:[aValue stringForType:_type] calendarFormat:format]; if (date == nil) { NSLog(@"WARN: could not create NSCalendarDate using format %@ " @"from value: %@", format, aValue); } } [date setCalendarFormat:format]; return date; } // See if we can alloc a new aValue and initilize it if ([aClass instancesRespondToSelector: @selector(initWithString:type:)]) { // Note: this is still problematic! Eg NSString instances respond to // initWithString:type:, but NSTemporaryString doesn't. // EOCustomValues contains a lF specific for that situation. return AUTORELEASE([[aClass alloc] initWithString:[aValue stringForType:_type] type:_type]); } } // Try EODatabaseCustomValues if ([aValue respondsToSelector:@selector(dataForType:)]) { // See if we can alloc a new aValue and initilize it if ([aClass instancesRespondToSelector: @selector(initWithData:type:)]) { return AUTORELEASE([[aClass alloc] initWithData:[aValue dataForType:_type] type:_type]); } } // Could not convert if got here return nil; } - (id)convertValueToModel:(id)aValue { id aValueClassName; Class aValueClass; // Check value class from attribute aValueClassName = [self valueClassName]; aValueClass = NSClassFromString(aValueClassName); if (aValueClass == Nil) return aValue; return [self convertValue:aValue toClass:aValueClass forType:[self valueType]]; } @end /* EOAttribute */ @implementation NSString(EOAttributeTypeCheck) - (BOOL)isNameOfARelationshipPath { BOOL result = NO; char buf[[self cStringLength] + 1]; const char *s; s = buf; [self getCString:buf]; if(!isalnum((int)*s) && *s != '@' && *s != '_' && *s != '#') return NO; for(++s; *s; s++) { if(!isalnum((int)*s) && *s != '@' && *s != '_' && *s != '#' && *s != '$' && *s != '.') return NO; if(*s == '.') result = YES; } return result; } @end /* NSString(EOAttributeTypeCheck) */ @implementation EOAttribute(PropertyListCoding) static inline void _addToPropList(NSMutableDictionary *propertyList, id _value, NSString *key) { if (_value != nil) [propertyList setObject:_value forKey:key]; } - (void)encodeIntoPropertyList:(NSMutableDictionary *)_plist { _addToPropList(_plist, self->name, @"name"); _addToPropList(_plist, self->calendarFormat, @"calendarFormat"); _addToPropList(_plist, self->columnName, @"columnName"); _addToPropList(_plist, self->externalType, @"externalType"); _addToPropList(_plist, self->valueClassName, @"valueClassName"); _addToPropList(_plist, self->valueType, @"valueType"); _addToPropList(_plist, self->userDictionary, @"userDictionary"); if (self->clientTimeZone) { #if !LIB_FOUNDATION_LIBRARY [_plist setObject:[self->clientTimeZone name] forKey:@"clientTimeZone"]; #else [_plist setObject:[self->clientTimeZone timeZoneName] forKey:@"clientTimeZone"]; #endif } if (self->serverTimeZone) { #if !LIB_FOUNDATION_LIBRARY [_plist setObject:[self->serverTimeZone name] forKey:@"serverTimeZone"]; #else [_plist setObject:[self->serverTimeZone timeZoneName] forKey:@"serverTimeZone"]; #endif } if (self->width != 0) { [_plist setObject:[NSNumber numberWithUnsignedInt:self->width] forKey:@"width"]; } if (self->flags.allowsNull) { [_plist setObject:[NSString stringWithCString:"Y"] forKey:@"allowsNull"]; } } @end /* EOAttribute(PropertyListCoding) */ @implementation EOAttribute(EOF2Additions) - (void)beautifyName { [self setName:[[self name] _beautifyAttributeName]]; } /* constraints */ - (void)setAllowsNull:(BOOL)_flag { self->flags.allowsNull = _flag ? 1 : 0; } - (BOOL)allowsNull { return self->flags.allowsNull ? YES : NO; } - (void)setWidth:(unsigned)_width { self->width = _width; } - (unsigned)width { return self->width; } - (NSException *)validateValue:(id *)_value { if (_value == NULL) return nil; /* check NULL constraint */ if (!self->flags.allowsNull) { if ((*_value == nil) || (*_value == null)) { NSException *e; NSDictionary *ui; ui = [NSDictionary dictionaryWithObjectsAndKeys: *_value ? *_value : (id)null, @"value", self, @"attribute", nil]; e = [NSException exceptionWithName:@"EOValidationException" reason:@"violated not-null constraint" userInfo:ui]; return e; } } /* check width constraint */ if (self->width != 0) { static Class NSDataClass = Nil; static Class NSStringClass = Nil; if (NSDataClass == nil) NSDataClass = [NSData class]; if (NSStringClass == nil) NSStringClass = [NSString class]; if ([(NSObject *)[*_value class] isKindOfClass:NSDataClass]) { unsigned len; len = [*_value length]; if (len > self->width) { NSException *e; NSDictionary *ui; ui = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithUnsignedInt:self->width], @"maxWidth", [NSNumber numberWithUnsignedInt:len], @"width", *_value ? *_value : (id)null, @"value", self, @"attribute", nil]; e = [NSException exceptionWithName:@"EOValidationException" reason:@"data value exceeds allowed attribute width" userInfo:ui]; return e; } } else if ([(NSObject *)[*_value class] isKindOfClass:NSStringClass]) { unsigned len; len = [*_value cStringLength]; if (len > self->width) { NSException *e; NSDictionary *ui; ui = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithUnsignedInt:self->width], @"maxWidth", [NSNumber numberWithUnsignedInt:len], @"width", *_value ? *_value : (id)null, @"value", self, @"attribute", nil]; e = [NSException exceptionWithName:@"EOValidationException" reason:@"string value exceeds allowed attribute width" userInfo:ui]; return e; } } } return nil; } @end /* EOAttribute(EOF2Additions) */ @implementation NSString(BeautifyAttributeName) - (NSString *)_beautifyAttributeName { // DML Unicode unsigned clen = 0; char *s = NULL; unsigned cnt, cnt2; if ([self length] == 0) return @""; clen = [self cStringLength]; #if GNU_RUNTIME s = objc_atomic_malloc(clen + 4); #else s = malloc(clen + 4); #endif [self getCString:s maxLength:clen]; for (cnt = cnt2 = 0; cnt < clen; cnt++, cnt2++) { if ((s[cnt] == '_') && (s[cnt + 1] != '\0')) { s[cnt2] = toupper(s[cnt + 1]); cnt++; } else if ((s[cnt] == '2') && (s[cnt + 1] != '\0')) { s[cnt2] = s[cnt]; cnt++; cnt2++; s[cnt2] = toupper(s[cnt]); } else s[cnt2] = tolower(s[cnt]); } s[cnt2] = '\0'; #if !LIB_FOUNDATION_LIBRARY { NSString *os; os = [NSString stringWithCString:s]; free(s); return os; } #else return [NSString stringWithCStringNoCopy:s freeWhenDone:YES]; #endif } @end /* NSString(BeautifyAttributeName) */ SOPE/sope-gdl1/GDLAccess/EOObjectUniquer.h0000644000000000000000000000412212242733417017025 0ustar rootroot/* EOObjectUniquer.h Copyright (C) 1996 Free Software Foundation, Inc. Author: Mircea Oancea Date: 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __EOObjectUniquer_h__ #define __EOObjectUniquer_h__ #import #import @class EOEntity; @class NSDictionary; @class NSArray; typedef struct _EOUniquerRecord { int refCount; id pkey; id entity; id object; id snapshot; } EOUniquerRecord; @interface EOObjectUniquer : NSObject { @protected NSMapTable *primaryKeyToRec; NSMapTable *objectsToRec; struct _EOUniquerRecord *keyRecord; } // Initializing a uniquing dictionary - init; // Transfer self to parent - (void)transferTo:(EOObjectUniquer*)dest objects:(BOOL)isObj andSnapshots:(BOOL)isSnap; // Handling objects - (void)forgetObject:(id)anObj; - (void)forgetAllObjects; - (void)forgetAllSnapshots; - (id)objectForPrimaryKey:(NSDictionary *)aKey entity:(EOEntity *)anEntity; - (EOUniquerRecord *)recordForObject:(id)anObj; - (void)recordObject:(id)anObj primaryKey:(NSDictionary *)aKey entity:(EOEntity *)anEntity snapshot:(NSDictionary *)aSnapshot; @end /* EOObjectUniquer */ #endif /* __EOObjectUniquer_h__ */ /* Local Variables: c-basic-offset: 4 tab-width: 8 End: */ SOPE/sope-gdl1/GDLAccess/EOQuotedExpression.m0000644000000000000000000000442712242733417017604 0ustar rootroot/* EOQuotedExpression.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import #import #import "common.h" #import "EOQuotedExpression.h" @implementation EOQuotedExpression - (id)expressionValueForContext:(id)_context { NSMutableString *result; NSArray *components; id expr; expr = [(EOExpressionArray *)self->expression expressionValueForContext:_context]; components = [expr componentsSeparatedByString:quote]; result = [NSMutableString stringWithCapacity:[expr length] + 10]; [result appendString:quote]; [result appendString:[components componentsJoinedByString:escape]]; [result appendString:quote]; return result; } - (id)initWithExpression:(id)_expression quote:(NSString *)_quote escape:(NSString *)_escape { if ((self = [super init])) { ASSIGN(self->expression, _expression); ASSIGN(self->quote, _quote); ASSIGN(self->escape, _escape); } return self; } - (void)dealloc { RELEASE(self->expression); RELEASE(self->quote); RELEASE(self->escape); [super dealloc]; } // NSCopying - (id)copyWithZone:(NSZone*)zone { return [[[self class] allocWithZone:zone] initWithExpression:expression quote:quote escape:escape]; } - (id)copy { return [self copyWithZone:NSDefaultMallocZone()]; } @end /* EOQuotedExpression */ SOPE/sope-gdl1/GDLAccess/EOFault.h0000644000000000000000000000224012242733417015320 0ustar rootroot// $Id: EOFault.h 1 2004-08-20 10:38:46Z znek $ #ifndef __EOFault_h__ #define __EOFault_h__ #import @class NSArray, NSDictionary, NSString, NSMethodSignature; @class EOFaultHandler; @interface EOFault { Class isa; EOFaultHandler *faultResolver; } + (void)makeObjectIntoFault:(id)_object withHandler:(EOFaultHandler *)_handler; + (EOFaultHandler *)handlerForFault:(id)_fault; /* Inquire about a fault */ + (BOOL)isFault:(id)object; + (BOOL)isFault; - (BOOL)isFault; + (void)clearFault:(id)fault; + (Class)targetClassForFault:fault; /* Non-Faulting Instance methods */ - (Class)superclass; - (Class)class; + (Class)class; - (BOOL)isKindOfClass:(Class)aClass; - (BOOL)isMemberOfClass:(Class)aClass; - (BOOL)conformsToProtocol:(Protocol *)aProtocol; - (BOOL)respondsToSelector:(SEL)aSelector; + (id)self; - (void)dealloc; - retain; - (void)release; - autorelease; - (NSUInteger)retainCount; - (NSZone*)zone; - (BOOL)isProxy; - (BOOL)isGarbageCollectable; - (NSString *)description; - (NSMethodSignature *)methodSignatureForSelector:(SEL)_selector; @end /* EOFault */ #include #endif /* __EOFault_h__ */ SOPE/sope-gdl1/GDLAccess/EONull.h0000644000000000000000000000025612242733417015164 0ustar rootroot// $Id: EONull.h 1 2004-08-20 10:38:46Z znek $ #ifndef __eoaccess_EONull_H__ #define __eoaccess_EONull_H__ #import #endif /* __eoaccess_EONull_H__ */ SOPE/sope-gdl1/GDLAccess/EOQualifierScanner.m0000644000000000000000000001306412242733417017513 0ustar rootroot/* EOQualifierScanner.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Helge Hess Date: September 1996 November 1999 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // $Id: EOQualifierScanner.m 1 2004-08-20 10:38:46Z znek $ #import "common.h" #include "EOQualifierScanner.h" #include "EOFExceptions.h" #include "EOEntity.h" #include "EOSQLQualifier.h" #include #if LIB_FOUNDATION_LIBRARY # import # import #else # import "DefaultScannerHandler.h" # import "PrintfFormatScanner.h" #endif @implementation EOQualifierScannerHandler - (id)init { [super init]; specHandler['d'] = [self methodForSelector:@selector(convertInt:scanner:)]; specHandler['f'] = [self methodForSelector:@selector(convertFloat:scanner:)]; specHandler['s'] = [self methodForSelector:@selector(convertCString:scanner:)]; specHandler['A'] = [self methodForSelector:@selector(convertProperty:scanner:)]; specHandler['@'] = [self methodForSelector:@selector(convertObject:scanner:)]; return self; } - (void)setEntity:(EOEntity *)_entity { ASSIGN(self->entity, _entity); } - (void)dealloc { RELEASE(self->entity); [super dealloc]; } /* conversions */ - (NSString *)convertInt:(va_list *)pInt scanner:(FormatScanner*)scanner { char buffer[256]; sprintf(buffer, [scanner currentSpecifier], va_arg(*pInt, int)); return [NSString stringWithCString:buffer]; } - (NSString*)convertFloat:(va_list *)pFloat scanner:(FormatScanner*)scanner { char buffer[256]; sprintf(buffer, [scanner currentSpecifier], va_arg(*pFloat, double)); return [NSString stringWithCString:buffer]; } - (NSString*)convertCString:(va_list *)pString scanner:(FormatScanner*)scanner { char *string; string = va_arg(*pString, char*); return string ? [NSString stringWithCString:string] : (id)@""; } - (NSString*)convertProperty:(va_list*)pString scanner:(FormatScanner*)scanner { NSString *propertyName; id property; propertyName = va_arg(*pString, id); property = [entity propertyNamed:propertyName]; if(property == nil) { [[[InvalidPropertyException alloc] initWithName:propertyName entity:entity] raise]; } return propertyName; } - (NSString *)convertObject:(va_list *)pId scanner:scanner { id object = va_arg(*pId, id); if (object == nil) object = [NSNull null]; return [object expressionValueForContext:nil]; } @end /* EOQualifierScannerHandler */ @implementation EOQualifierEnumScannerHandler - (id)init { [super init]; specHandler['d'] = [self methodForSelector:@selector(convertInt:scanner:)]; specHandler['f'] = [self methodForSelector:@selector(convertFloat:scanner:)]; specHandler['s'] = [self methodForSelector:@selector(convertCString:scanner:)]; specHandler['A'] = [self methodForSelector:@selector(convertProperty:scanner:)]; specHandler['@'] = [self methodForSelector:@selector(convertObject:scanner:)]; return self; } - (void)setEntity:(EOEntity *)_entity { ASSIGN(self->entity, _entity); } - (void)dealloc { RELEASE(self->entity); [super dealloc]; } - (NSString *)convertInt:(NSEnumerator **)pInt scanner:(FormatScanner*)scanner { char buffer[256]; sprintf(buffer, [scanner currentSpecifier], [[*pInt nextObject] intValue]); return [NSString stringWithCString:buffer]; } - (NSString *)convertFloat:(NSEnumerator **)pFloat scanner:(FormatScanner *)scanner { char buffer[256]; sprintf(buffer, [scanner currentSpecifier], [[*pFloat nextObject] doubleValue]); return [NSString stringWithCString:buffer]; } - (NSString *)convertCString:(NSEnumerator **)pString scanner:(FormatScanner *)scanner { id str; if ((str = [*pString nextObject]) == nil) str = @""; else if ([str isKindOfClass:[NSString class]]) ; else if ([str respondsToSelector:@selector(stringValue)]) str = [str stringValue]; else str = [str description]; return (str == nil) ? (id)@"" : str; } - (NSString *)convertProperty:(NSEnumerator **)pString scanner:(FormatScanner *)scanner { NSString *propertyName; id property; propertyName = [*pString nextObject]; property = [entity propertyNamed:propertyName]; if(property == nil) { [[[InvalidPropertyException alloc] initWithName:propertyName entity:entity] raise]; } return propertyName; } - (NSString *)convertObject:(NSEnumerator **)pId scanner:(id)scanner { id object; object = [*pId nextObject]; return [object expressionValueForContext:nil]; } @end /* EOQualifierEnumScannerHandler */ SOPE/sope-gdl1/GDLAccess/ChangeLog0000644000000000000000000002356412242733417015436 0ustar rootroot2009-03-24 Wolfgang Sourdeau * EOAdaptor: invoke MySQL adaptor using the 'mysql' URL scheme (v4.7.63) 2007-08-29 Helge Hess * EOAdaptor.m: invoke new Oracle8 adaptor for the 'oracle' URL scheme (v4.7.62) 2007-06-10 Helge Hess * v4.7.61 * EOAttribute.m: minor code cleanups * EOExpressionArray.m: copy prefix/suffix/infix strings in accessor methods 2007-06-01 Helge Hess * EOEntity.m, EOAttribute.m: minor improvements/comments on value encoding (v4.7.60) 2007-04-17 Helge Hess * EOSQLExpression.m: fixed a gcc4 warning (v4.7.59) 2006-08-15 Helge Hess * EOCustomValues.m: added special support for lF NSTemporaryString to fix OGo bug #1701 (v4.5.58) 2006-07-05 Helge Hess * EOAdaptor.m: changed to find SAX drivers on 64bit systems in lib64, added FHS_INSTALL_ROOT to lookup path (v4.5.57) 2006-07-04 Helge Hess * use %p for pointer formats, fixed gcc 4.1 warnings (v4.5.56) 2005-10-13 Helge Hess * EOArrayProxy.m, EOPrimaryKeyDictionary.m, EOExpressionArray.m, EORecordDictionary.m: added -isNotEmpty methods (v4.5.55) 2005-08-16 Helge Hess * GNUmakefile, GNUmakefile.preamble: added OSX framework compilation (v4.5.54) 2005-08-05 Helge Hess * EOAdaptorContext.m, common.h: do not include NSUtilities.h on Cocoa (v4.5.53) 2005-06-02 Helge Hess * EOJoinTypes.h: properly protect header against multiple inclusion (fixes a compilation issue) (v4.5.52) 2005-05-05 Helge Hess * fixed gcc 4.0 warnings (v4.5.51) 2005-04-21 Helge Hess * EOAdaptorChannel.[hm]: added -describeResults: as a public method, implemented -describeResults based on that (adaptors now need to override -describeResults:) (v4.5.50) 2005-04-12 Helge Hess * v4.5.49 * fixed various gcc 3.4.3 warnings * removed support for unused EOAttribute features like flattened, derived, read-only, insert/update formats, definition 2005-03-15 Helge Hess * FoundationExt/GNUmakefile: properly include config.make (v4.5.48) 2005-02-20 Helge Hess * EOAdaptor.m: added +adaptorForURL: method to create EOAdaptor objects from JDBC style URLs (eg PostgreSQL://OGo:OGo@localhost/OGo") (v4.5.47) 2005-01-14 Helge Hess * EOAdaptorDataSource.m: fixed a bug in the sorting code, the "AS" was missing in the SQL rename statement (v4.5.46) 2005-01-13 Helge Hess * EOAdaptorDataSource.m: improved -description (v4.5.45) 2005-01-04 Helge Hess * EOAttribute.m, EOFaultHandler.m, EODatabaseFaultResolver.m: added casts to avoid compile warnings with Xcode (v4.5.44) 2004-12-14 Marcus Mueller * v4.5.43 * GDLAccess.xcode: minor fixes and updated * EOAttribute.m: changed usage of -timeZoneName (deprecated) to -name for Foundations different to libFoundation. 2004-11-13 Helge Hess * EOAdaptor.m: fixed a bug in the lookup of GDL adaptor bundles (v4.5.42) 2004-11-11 Marcus Mueller * GDLAccess.xcode: fixed Xcode build by providing all necessary major/minor numbers and bumped the framework revision 2004-11-09 Helge Hess * v4.5.41 * bumped version from 1.3 to 4.5 to be consistent with the remaining SOPE versions (the "super major version" is still gdl1) * EOAdaptor.m: fixed adaptor lookup path 2004-09-22 Marcus Mueller * GDLAccess.xcode: new Xcode project 2004-09-11 Marcus Mueller * GNUmakefile.preamble, FoundationExt/GNUmakefile: minor changes for inline compilation with GNUSTEP_BUILD_DIR set elsewhere (v1.1.40) 2004-09-06 Helge Hess * EOSQLQualifier.m: fixed a compile warning related to scanner handler and NSArray argument instead of va_list (v1.1.39) 2004-09-06 Helge Hess * EOAdaptorChannel.m: added -selectAttributesX:describedByQualifier:fetchOrder:lock: for selects which return, not raise, exceptions (v1.1.38) 2004-08-31 Helge Hess * GNUmakefile.preamble: added library search pathes for FHS install (v1.1.37) 2004-08-30 Helge Hess * v1.1.36 * EOAdaptor.m: also look for adaptors in /usr/lib/sope-4.3/dbadaptors and /usr/local/lib/sope-4.3/dbadaptors * added hack to install the project in FHS locations - the library, its headers, the tools and the resources will be installed in FHS_INSTALL_ROOT if specified (eg make FHS_INSTALL_ROOT=/usr/local) 2004-08-27 Helge Hess * EOAdaptor.m: look for adaptor bundles in Library/GDLAdaptors-1.1/ (v1.1.35) * increased version to v1.1 because it depends on libEOControl v4.3 (v1.1.34) 2004-08-21 Helge Hess * v1.0.33 * fixed for SOPE 3.3 directory layout * removed GDLExtensions * moved headers files from EOAccess subdirectory to main directory 2004-08-20 Helge Hess * moved from ThirdParty to SOPE/sope-gdl1 (v1.0.32) 2004-06-29 Helge Hess * v1.0.31 * EOAdaptorChannel.m: fixed a bug in the transaction check introduced in v1.0.29 - resulted in OGo bug #824, #825 * EODatabaseChannel.m: use new "X" adaptor methods * GNUmakefile.preamble: added include path to SOPE/skyrix-core for "inline" compilation (v1.0.30) 2004-06-28 Helge Hess * EOAdaptorChannel.[hm]: added more "X" methods which do not raise exceptions (v1.0.29) * EOAdaptorChannel.m: added new method -evaluateExpressionX: which returns the exception instead of raising it. It returns @"EOEvaluationError" if the -evaluateExpression: returned NO without raising an exception. It is recommended that adaptor classes implement -evaluateExpression: using -evaluateExpressionX:, not the other way around (v1.0.28) 2004-06-27 Helge Hess * EOModel.m: minor code cleanups (v1.0.27) 2004-06-21 Helge Hess * EOModel.m: some code cleanups, improved description (v1.0.26) 2004-06-06 Helge Hess * fixed Xcode compilation with embedded FoundationExt classes (v1.0.25) 2004-05-14 Helge Hess * EOAdaptorDataSource.m: removed some ==YES comparisons, minor cleanups (v1.0.24) 2004-03-14 Helge Hess * v1.0.23 * EOSQLQualifier.m: improved -description method * EOSQLExpression.m: moved EOSelectSQLExpression to separate file, added a -description method, various minor code cleanups * EOExpressionArray.m: added a -description method, minor cleanups * EOAdaptorChannel.m: minor code cleanups * EODatabaseContext.m: removed registration for EOCooperatingObjectStoreNeeded notification (solves an issue with gstep-base) 2004-03-09 Helge Hess * EOAdaptorChannel.m, EOAdaptorDataSource.m, EOAttribute.m, EODatabase.m, EOEntity.m, EOEntityClassDescription.m, EOQualifier+SQL.m, EOSQLExpression.m, common.h, EOQualifierScanner.h: various subminor fixes for compilation against gstep-base (v1.0.22) 2004-02-12 Helge Hess * EODatabaseChannel.m: only check for GC objects on libFoundation (v1.0.21) 2004-01-29 Helge Hess * EORecordDictionary.m: disabled a profiling log (v1.0.20) 2004-01-07 Helge Hess * some tweaks for Xcode compilation (v1.0.19) 2004-01-04 Helge Hess * v1.0.18 * more tweaks to makefiles and source, now seems to compile fine on MacOSX * added FoundationExt subproject containing the necessary classes from the extensions library, that is, the FormatScanner, PrintfFormatScanner and DefaultScannerHandler 2004-01-03 Helge Hess * v1.0.17 * EORecordDictionary.m: cache -hash and -isEqual selector in objectForKey: * various changes to make gnustep-db compile on MacOSX (eg do not use InvalidArgumentException class but rather NSInvalidArgumentException exception name, etc) 2003-12-29 Helge Hess * EORecordDictionary.m(dealloc): cache release method of dict key, which is basically always an NSString, also cache empty dictionary (v1.0.16) 2003-10-20 Helge Hess * v1.0.15 * common.h: do not use zones for memory allocation (read: speedup) * removed support for Boehm GC, makes code much more readable and shorter (and isn't used in OGo anyway ...) * removed some warnings, some FoundationExt cleanups * EOExpressionArray.h: does not inherit from GCObject and use GCMutableArray anymore (replaced with NSObject and NSMutableArray) * EODatabaseContext.m: removed some unused methods * removed some GCObject dependency * EODatabaseChannel.m: removed some unused methods Wed Oct 15 16:26:50 2003 Jan Reichmann * EOModel.m: initialize model name with the filename which contains the model (*.eomodel) (v1.0.14) Sun Sep 07 00:30:59 2003 Marcus Mueller * GNUmakefile: reordered autodoc target Mon Jul 14 14:07:22 2003 Jan Reichmann * fixed license entries (v1.0.13) Fri Jul 4 19:15:35 2003 Helge Hess * imported into OpenGroupware.org (v1.0.11) SOPE/sope-gdl1/GDLAccess/EOKeySortOrdering.m0000644000000000000000000000724212242733417017353 0ustar rootroot/* EOKeySortOrdering.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Mircea Oancea Date: 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import #import #import #import #import "common.h" #import "EOKeySortOrdering.h" #import @implementation EOKeySortOrdering + keyOrderingWithKey:(NSString*)aKey ordering:(NSComparisonResult)anOrdering { return AUTORELEASE([[EOKeySortOrdering alloc] initWithKey:aKey ordering:anOrdering]); } - initWithKey:(NSString*)aKey ordering:(NSComparisonResult)anOrdering { ASSIGN(key, aKey); ordering = anOrdering; return self; } - (NSString*)key {return key;} - (NSComparisonResult)ordering {return ordering;} @end // TODO : integrate this function in the two methods above and optimize // object creation and method calls for objects that provide quick // access to their values - do not use nested functions static NSComparisonResult _keySortCompare(id obj1, id obj2, NSArray* order) __attribute__((unused)); static NSComparisonResult _keySortCompare(id obj1, id obj2, NSArray* order) { int i, n; for (i = 0, n = [order count]; i < n; i++) { id val1, val2, key, kar; NSComparisonResult ord, vord; EOKeySortOrdering* kso = [order objectAtIndex:i]; key = [kso key]; ord = [kso ordering]; kar = [NSArray arrayWithObject:key]; val1 = [[obj1 valuesForKeys:kar] objectForKey:key]; val2 = [[obj2 valuesForKeys:kar] objectForKey:key]; if (!val1 && !val2) continue; if (!val1 && val2) return ord == NSOrderedAscending ? NSOrderedAscending : NSOrderedDescending; if (val1 && !val2) return ord == NSOrderedAscending ? NSOrderedDescending : NSOrderedAscending; vord = [(NSString *)val1 compare:val2]; if (vord == NSOrderedSame) continue; if (vord == NSOrderedAscending) return ord == NSOrderedAscending ? NSOrderedAscending : NSOrderedDescending; else return ord == NSOrderedAscending ? NSOrderedDescending : NSOrderedAscending; } return NSOrderedSame; } #if 0 @implementation NSArray(EOKeyBasedSorting) - (NSArray*)sortedArrayUsingKeyOrderArray:(NSArray*)orderArray { NSArray* arry; CREATE_AUTORELEASE_POOL(pool); arry = [self sortedArrayUsingFunction: (int(*)(id, id, void*))_keySortCompare context:orderArray]; RELEASE(pool); return arry; } @end @implementation NSMutableArray(EOKeyBasedSorting) - (void)sortUsingKeyOrderArray:(NSArray*)orderArray { CREATE_AUTORELEASE_POOL(pool); [self sortUsingFunction: (int(*)(id, id, void*))_keySortCompare context:orderArray]; RELEASE(pool); } @end #endif /* Local Variables: c-basic-offset: 4 tab-width: 8 End: */ SOPE/sope-gdl1/GDLAccess/EODelegateResponse.h0000644000000000000000000000025312242733417017500 0ustar rootroot// $Id: EODelegateResponse.h 1 2004-08-20 10:38:46Z znek $ typedef enum { EODelegateRejects, EODelegateApproves, EODelegateOverrides } EODelegateResponse; SOPE/sope-gdl1/GDLAccess/NSObject+EONullInit.m0000644000000000000000000000302112242733417017451 0ustar rootroot/* EOAdaptorChannel.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: October 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // $Id: NSObject+EONullInit.m 1 2004-08-20 10:38:46Z znek $ #include #include #include "common.h" @interface NSObject(Entity) - (EOEntity *)entity; @end @implementation NSObject(EONullInit) - (void)setAllAttributesToEONull:(EOEntity *)_entity { NSAssert(_entity != nil, @"invalid entity parameter"); [_entity setAttributesOfObjectToEONull:self]; } - (void)setAllAttributesToEONull { // assume the object respondsTo: entity [self setAllAttributesToEONull:[self entity]]; } @end /* NSObject(EONullInit) */ SOPE/sope-gdl1/GDLAccess/NSObject+EONullInit.h0000644000000000000000000000066312242733417017455 0ustar rootroot// $Id: NSObject+EONullInit.h 1 2004-08-20 10:38:46Z znek $ #ifndef __GDLAccess_NSObject_EONull_H__ #define __GDLAccess_NSObject_EONull_H__ #import #import @class EOEntity; @interface NSObject(EONullInit) - (void)setAllAttributesToEONull:(EOEntity *)_entity; - (void)setAllAttributesToEONull; // assume the object respondsTo: entity @end #endif /* __GDLAccess_NSObject_EONull_H__ */ SOPE/sope-gdl1/GDLAccess/EOArrayProxy.m0000644000000000000000000001230612242733417016376 0ustar rootroot/* EOArrayProxy.m Copyright (C) 1999 MDlink online service center GmbH, Helge Hess Author: Helge Hess (hh@mdlink.de) Date: 1999 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // $Id: EOArrayProxy.m 1 2004-08-20 10:38:46Z znek $ #import "common.h" #import "EOArrayProxy.h" #import "EODatabaseChannel.h" #import "EODatabaseContext.h" #import "EOEntity.h" #import "EOSQLQualifier.h" #import "EOGenericRecord.h" @implementation EOArrayProxy - (id)initWithQualifier:(EOSQLQualifier *)_qualifier fetchOrder:(NSArray *)_fetchOrder channel:(EODatabaseChannel *)_channel { self->qualifier = RETAIN(_qualifier); self->fetchOrder = RETAIN(_fetchOrder); self->channel = RETAIN(_channel); return self; } + (id)arrayProxyWithQualifier:(EOSQLQualifier *)_qualifier fetchOrder:(NSArray *)_fetchOrder channel:(EODatabaseChannel *)_channel { return AUTORELEASE([[self alloc] initWithQualifier:_qualifier fetchOrder:_fetchOrder channel:_channel]); } - (void)dealloc { AUTORELEASE(self->content); RELEASE(self->qualifier); RELEASE(self->fetchOrder); RELEASE(self->channel); [super dealloc]; } // accessors - (BOOL)isFetched { return self->content ? YES : NO; } - (EODatabaseChannel *)databaseChannel { return self->channel; } - (EOEntity *)entity { return [self->qualifier entity]; } - (NSArray *)fetchOrder { return self->fetchOrder; } - (EOSQLQualifier *)qualifier { return self->qualifier; } // operations - (void)clear { RELEASE(self->content); self->content = nil; } - (BOOL)fetch { BOOL inTransaction; BOOL didOpenChannel; NSMutableArray *result; [self clear]; result = [NSMutableArray arrayWithCapacity:16]; didOpenChannel = (![self->channel isOpen]) ? [self->channel openChannel] : NO; if ([self->channel isFetchInProgress]) { [NSException raise:NSInvalidArgumentException format:@"attempt to fetch with busy channel: %@", self]; } inTransaction = [[self->channel databaseContext] transactionNestingLevel] > 0; if (!inTransaction) { if (![[self->channel databaseContext] beginTransaction]) { NSLog(@"WARNING: could not begin transaction to fetch array proxy !"); if (didOpenChannel) [self->channel closeChannel]; return NO; } } if (![self->channel selectObjectsDescribedByQualifier:self->qualifier fetchOrder:self->fetchOrder]) { if (!inTransaction) [[self->channel databaseContext] rollbackTransaction]; if (didOpenChannel) [self->channel closeChannel]; NSLog(@"ERROR: select on array proxy failed .."); return NO; } { // fetch objects NSZone *z = [self zone]; id object; while ((object = [self->channel fetchWithZone:z])) [result addObject:object]; object = nil; } [self->channel cancelFetch]; if (!inTransaction) { if (![[self->channel databaseContext] commitTransaction]) { NSLog(@"WARNING: could not commit array proxy's transaction !"); if (didOpenChannel) [self->channel closeChannel]; return NO; } } if (didOpenChannel) [self->channel closeChannel]; self->content = [result copyWithZone:[self zone]]; return YES; } // turn fault to real array .. void _checkFetch(EOArrayProxy *self) { if (self->content) return; [self fetch]; } // NSArray operations - (id)objectAtIndex:(NSUInteger)_index { _checkFetch(self); return [self->content objectAtIndex:_index]; } - (NSUInteger) count { _checkFetch(self); return [self->content count]; } - (BOOL)isNotEmpty { _checkFetch(self); return [self->content count] > 0 ? YES : NO; } - (NSUInteger)indexOfObjectIdenticalTo:(id)_object { _checkFetch(self); return [self->content indexOfObjectIdenticalTo:_object]; } // NSCopying - (id)copyWithZone:(NSZone*)zone { if (NSShouldRetainWithZone(self, zone)) return RETAIN(self); else { _checkFetch(self); return [[NSArray allocWithZone:zone] initWithArray:self->content copyItems:NO]; } } - (id)mutableCopyWithZone:(NSZone*)zone { _checkFetch(self); return [[NSMutableArray alloc] initWithArray:self->content]; } #if 0 // forwarding - (void)forwardInvocation:(NSInvocation *)_invocation { _checkFetch(self); [_invocation invokeWithTarget:self->content]; } - (retval_t)forward:(SEL)_selector:(arglist_t)_frame { _checkFetch(self); return objc_msg_sendv(self->content, _selector, _frame); } #endif @end SOPE/sope-gdl1/GDLAccess/EOAttributeOrdering.h0000644000000000000000000000320712242733417017706 0ustar rootroot/* EOAttributeOrdering.h Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __EOAttributeOrdering_h__ #define __EOAttributeOrdering_h__ #import @class EOAttribute; typedef enum { EOAnyOrder, EOAscendingOrder, EODescendingOrder } EOOrdering; @interface EOAttributeOrdering : NSObject { EOAttribute* attribute; EOOrdering ordering; } /* Creating an attribute ordering */ + attributeOrderingWithAttribute:(EOAttribute*)attribute ordering:(EOOrdering)ordering; - initWithAttribute:(EOAttribute*)attribute ordering:(EOOrdering)ordering; /* Getting values */ - (EOAttribute*)attribute; - (EOOrdering)ordering; @end #endif /* __EOAttributeOrdering_h__ */ /* Local Variables: c-basic-offset: 4 tab-width: 8 End: */ SOPE/sope-gdl1/GDLAccess/EOEntity.h0000644000000000000000000001414512242733417015530 0ustar rootroot/* EOEntity.h Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: August 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __EOEntity_h__ #define __EOEntity_h__ #import @class EOModel, EOAttribute, EORelationship; @class EOSQLQualifier, EOExpressionArray; @class NSMutableDictionary; @interface EOEntity : NSObject { NSString *name; NSString *className; NSString *externalName; NSString *externalQuery; NSDictionary *userDictionary; NSArray *primaryKeyAttributeNames; /* sorted array of names */ NSArray *attributesNamesUsedForInsert; NSArray *classPropertyNames; /* Garbage collectable objects */ EOModel *model; /* non-retained */ EOSQLQualifier *qualifier; NSArray *attributes; NSMutableDictionary *attributesByName; NSArray *relationships; NSMutableDictionary *relationshipsByName; // name/EORelationship NSArray *primaryKeyAttributes; NSArray *classProperties; // EOAttribute/EORelationship NSArray *attributesUsedForLocking; /* Cached properties */ NSArray *attributesUsedForInsert; // cache from classProperties NSArray *attributesUsedForFetch; // cache from classProperties NSArray *relationsUsedForFetch; // cache from classProperties struct { BOOL isReadOnly:1; BOOL createsMutableObjects:1; BOOL isPropertiesCacheValid:1; } flags; } /* Initializing instances */ - (id)initWithName:(NSString *)name; /* Accessing the name */ - (NSString *)name; - (BOOL)setName:(NSString *)name; + (BOOL)isValidName:(NSString *)name; /* Accessing the model */ - (void)setModel:(EOModel *)model; - (EOModel *)model; - (void)resetModel; - (BOOL)hasModel; /* Getting the qualifier */ - (EOSQLQualifier *)qualifier; /* Accessing attributes */ - (BOOL)addAttribute:(EOAttribute *)attribute; - (void)removeAttributeNamed:(NSString *)name; - (EOAttribute *)attributeNamed:(NSString *)attributeName; - (NSArray *)attributes; /* Accessing relationships */ - (BOOL)addRelationship:(EORelationship *)relationship; - (void)removeRelationshipNamed:(NSString *)name; - (EORelationship *)relationshipNamed:(NSString *)relationshipName; - (NSArray *)relationships; /* Accessing primary key attributes */ - (BOOL)setPrimaryKeyAttributes:(NSArray *)keys; - (NSArray *)primaryKeyAttributes; - (NSArray *)primaryKeyAttributeNames; - (BOOL)isValidPrimaryKeyAttribute:(EOAttribute *)anAttribute; /* Getting primary keys and snapshot for row */ - (NSDictionary *)primaryKeyForRow:(NSDictionary *)row; - (NSDictionary *)snapshotForRow:(NSDictionary *)aRow; /* Getting attributes used for fetch/insert/update operations */ - (NSArray *)attributesUsedForInsert; - (NSArray *)attributesUsedForFetch; - (NSArray *)relationsUsedForFetch; - (NSArray *)attributesNamesUsedForInsert; /* Accessing class properties */ - (BOOL)setClassProperties:(NSArray *)properties; - (NSArray *)classProperties; - (NSArray *)classPropertyNames; - (BOOL)isValidClassProperty:(id)aProp; - (id)propertyNamed:(NSString *)name; - (NSArray *)relationshipsNamed:(NSString *)_relationshipPath; /* Accessing locking attributes */ - (BOOL)setAttributesUsedForLocking:(NSArray *)attributes; - (NSArray *)attributesUsedForLocking; - (BOOL)isValidAttributeUsedForLocking:(EOAttribute *)anAttribute; /* Accessing the enterprise object class */ - (void)setClassName:(NSString *)name; - (NSString *)className; /* Accessing external information */ - (void)setExternalName:(NSString *)name; - (NSString *)externalName; /* Accessing the external query */ - (void)setExternalQuery:(NSString *)query; - (NSString *)externalQuery; /* Accessing read-only status */ - (void)setReadOnly:(BOOL)flag; - (BOOL)isReadOnly; /* Accessing the user dictionary */ - (void)setUserDictionary:(NSDictionary *)dictionary; - (NSDictionary *)userDictionary; - (BOOL)referencesProperty:property; @end @interface EOEntity (EOEntityPrivate) + (EOEntity *)entityFromPropertyList:(id)propertyList model:(EOModel *)model; - (void)replaceStringsWithObjects; - (id)propertyList; - (void)setCreateMutableObjects:(BOOL)flag; - (BOOL)createsMutableObjects; - (void)validatePropertiesCache; - (void)invalidatePropertiesCache; @end @interface EOEntity(ValuesConversion) - (NSDictionary *)convertValuesToModel:(NSDictionary *)aRow; @end /* EOAttribute (ValuesConversion) */ @class EOGlobalID, EOFetchSpecification; @interface EOEntity(EOF2Additions) - (BOOL)isAbstractEntity; /* ids */ - (EOGlobalID *)globalIDForRow:(NSDictionary *)_row; - (BOOL)isPrimaryKeyValidInObject:(id)_object; /* refs to other models */ - (NSArray *)externalModelsReferenced; /* fetch specs */ - (EOFetchSpecification *)fetchSpecificationNamed:(NSString *)_name; - (NSArray *)fetchSpecificationNames; /* names */ - (void)beautifyName; @end @class NSMutableDictionary; @interface EOEntity(PropertyListCoding) - (void)encodeIntoPropertyList:(NSMutableDictionary *)_plist; @end #import @interface EOEntityClassDescription : EOClassDescription { EOEntity *entity; } - (id)initWithEntity:(EOEntity *)_entity; - (EOEntity *)entity; @end #endif /* __EOEntity_h__ */ SOPE/sope-gdl1/GDLAccess/English.lproj/0000755000000000000000000000000012242733417016370 5ustar rootrootSOPE/sope-gdl1/GDLAccess/English.lproj/InfoPlist.strings0000644000000000000000000000106012242733417021707 0ustar rootrootþÿ/* Localized versions of Info.plist keys */ CFBundleName = "GDLAccess"; CFBundleShortVersionString = "GDLAccess version 4.1"; CFBundleGetInfoString = "GDLAccess version 4.1, Copyright 2001, SKYRIX Software AG."; NSHumanReadableCopyright = "Copyright 2001, SKYRIX Software AG."; SOPE/sope-gdl1/GDLAccess/EOAdaptorChannel.m0000644000000000000000000004457212242733417017153 0ustar rootroot/* EOAdaptorChannel.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: October 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import "common.h" #import "EOAdaptorChannel.h" #import "EOAttribute.h" #import "EOAdaptor.h" #import "EOAdaptorContext.h" #import "EOSQLExpression.h" #import "EOFExceptions.h" @interface EOAdaptorChannel(Internals) - (NSArray *)_sortAttributesForSelectExpression:(NSArray *)_attrs; @end /* EOAdaptorChannel(Internals) */ @implementation EOAdaptorChannel + (NSCalendarDate*)dateForAttribute:(EOAttribute*)attr year:(int)year month:(unsigned)month day:(unsigned)day hour:(unsigned)hour minute:(unsigned)minute second:(unsigned)second zone:(NSZone*)zone { NSTimeZone *serverTimeZone = [attr serverTimeZone]; NSTimeZone *clientTimeZone = [attr clientTimeZone]; NSCalendarDate *date; NSString *fmt; if (serverTimeZone == nil) serverTimeZone = [NSTimeZone localTimeZone]; if (clientTimeZone == nil) clientTimeZone = [NSTimeZone localTimeZone]; date = AUTORELEASE([[NSCalendarDate allocWithZone:zone] initWithYear:year month:month day:day hour:hour minute:minute second:second timeZone:serverTimeZone]); [date setTimeZone:clientTimeZone]; fmt = [attr calendarFormat]; [date setCalendarFormat:fmt ? fmt : [EOAttribute defaultCalendarFormat]]; return date; } - (id)initWithAdaptorContext:(EOAdaptorContext*)_adaptorContext { ASSIGN(self->adaptorContext, _adaptorContext); NS_DURING [self->adaptorContext channelDidInit:self]; NS_HANDLER { AUTORELEASE(self); [localException raise]; } NS_ENDHANDLER; return self; } - (void)dealloc { [self->adaptorContext channelWillDealloc:self]; RELEASE(self->adaptorContext); [super dealloc]; } /* open/close channel */ - (BOOL)openChannel { if(self->isOpen) return NO; self->isOpen = YES; return YES; } - (void)closeChannel { if ([self isFetchInProgress]) [self cancelFetch]; self->isOpen = NO; } /* modifications */ - (Class)_adaptorExpressionClass { return [[self->adaptorContext adaptor] expressionClass]; } - (BOOL)_isNoRaiseOnModificationException:(NSException *)_exception { /* for compatibility with non-X methods, translate some errors to a bool */ NSString *n; n = [_exception name]; if ([n isEqualToString:@"EOEvaluationError"]) return YES; if ([n isEqualToString:@"EODelegateRejects"]) return YES; return NO; } - (NSException *)insertRowX:(NSDictionary *)row forEntity:(EOEntity *)entity { EOSQLExpression *sqlexpr; NSMutableDictionary *mrow = (id)row; NSException *ex; if (!isOpen) return [[ChannelIsNotOpenedException new] autorelease]; if ((row == nil) || (entity == nil)) { return [NSException exceptionWithName:NSInvalidArgumentException reason:@"row and entity arguments for " @"insertRow:forEntity: must not be the nil object" userInfo:nil]; } if ([self isFetchInProgress]) return [AdaptorIsFetchingException exceptionWithAdaptor:self]; if ([self->adaptorContext transactionNestingLevel] == 0) return [NoTransactionInProgressException exceptionWithAdaptor:self]; if (delegateRespondsTo.willInsertRow) { EODelegateResponse response; mrow = AUTORELEASE([row mutableCopyWithZone:[row zone]]); response = [delegate adaptorChannel:self willInsertRow:mrow forEntity:entity]; if (response == EODelegateRejects) { return [NSException exceptionWithName:@"EODelegateRejects" reason:@"delegate rejected insert" userInfo:nil]; } if (response == EODelegateOverrides) return nil; } sqlexpr = [[[self->adaptorContext adaptor] expressionClass] insertExpressionForRow:mrow entity:entity channel:self]; ex = [self evaluateExpressionX:[sqlexpr expressionValueForContext:nil]]; if (ex != nil) return ex; if(delegateRespondsTo.didInsertRow) [delegate adaptorChannel:self didInsertRow:mrow forEntity:entity]; return nil; } - (NSException *)updateRowX:(NSDictionary *)row describedByQualifier:(EOSQLQualifier *)qualifier { EOSQLExpression *sqlexpr = nil; NSMutableDictionary *mrow = (id)row; NSException *ex; if (!isOpen) return [[ChannelIsNotOpenedException new] autorelease]; if (row == nil) { return [NSException exceptionWithName:NSInvalidArgumentException reason: @"row argument for updateRow:describedByQualifier: " @"must not be the nil object" userInfo:nil]; } if ([self isFetchInProgress]) return [AdaptorIsFetchingException exceptionWithAdaptor:self]; if ([self->adaptorContext transactionNestingLevel] == 0) return [NoTransactionInProgressException exceptionWithAdaptor:self]; if (delegateRespondsTo.willUpdateRow) { EODelegateResponse response; mrow = AUTORELEASE([row mutableCopyWithZone:[row zone]]); response = [delegate adaptorChannel:self willUpdateRow:mrow describedByQualifier:qualifier]; if (response == EODelegateRejects) { return [NSException exceptionWithName:@"EODelegateRejects" reason:@"delegate rejected update" userInfo:nil]; } if (response == EODelegateOverrides) return nil; } sqlexpr = [[self _adaptorExpressionClass] updateExpressionForRow:mrow qualifier:qualifier channel:self]; ex = [self evaluateExpressionX:[sqlexpr expressionValueForContext:nil]]; if (ex != nil) return ex; if (delegateRespondsTo.didUpdateRow) { [delegate adaptorChannel:self didUpdateRow:mrow describedByQualifier:qualifier]; } return nil; } - (NSException *)deleteRowsDescribedByQualifierX:(EOSQLQualifier *)qualifier { EOSQLExpression *sqlexpr = nil; NSException *ex; if (!isOpen) return [[ChannelIsNotOpenedException new] autorelease]; if ([self isFetchInProgress]) return [AdaptorIsFetchingException exceptionWithAdaptor:self]; if ([self->adaptorContext transactionNestingLevel] == 0) return [NoTransactionInProgressException exceptionWithAdaptor:self]; if (delegateRespondsTo.willDeleteRows) { EODelegateResponse response; response = [delegate adaptorChannel:self willDeleteRowsDescribedByQualifier:qualifier]; if (response == EODelegateRejects) { return [NSException exceptionWithName:@"EODelegateRejects" reason:@"delegate rejected delete" userInfo:nil]; } if (response == EODelegateOverrides) return nil; } sqlexpr = [[self _adaptorExpressionClass] deleteExpressionWithQualifier:qualifier channel:self]; ex = [self evaluateExpressionX:[sqlexpr expressionValueForContext:nil]]; if (ex != nil) return ex; if (delegateRespondsTo.didDeleteRows) [delegate adaptorChannel:self didDeleteRowsDescribedByQualifier:qualifier]; return nil; } /* compatibility methods (DEPRECATED, use the ...X methods */ - (BOOL)selectAttributes:(NSArray *)attributes describedByQualifier:(EOSQLQualifier *)qualifier fetchOrder:(NSArray *)fetchOrder lock:(BOOL)lockFlag { NSException *ex; ex = [self selectAttributesX:attributes describedByQualifier:qualifier fetchOrder:fetchOrder lock:lockFlag]; if (ex == nil) return YES; if ([self _isNoRaiseOnModificationException:ex]) return NO; [ex raise]; return NO; } - (BOOL)insertRow:(NSDictionary *)_row forEntity:(EOEntity *)_entity { NSException *ex; ex = [self insertRowX:_row forEntity:_entity]; if (ex == nil) return YES; if ([self _isNoRaiseOnModificationException:ex]) return NO; [ex raise]; return NO; } - (BOOL)updateRow:(NSDictionary *)_row describedByQualifier:(EOSQLQualifier *)_q { NSException *ex; ex = [self updateRowX:_row describedByQualifier:_q]; if (ex == nil) return YES; if ([self _isNoRaiseOnModificationException:ex]) return NO; [ex raise]; return NO; } - (BOOL)deleteRowsDescribedByQualifier:(EOSQLQualifier *)_qualifier { NSException *ex; ex = [self deleteRowsDescribedByQualifierX:_qualifier]; if (ex == nil) return YES; if ([self _isNoRaiseOnModificationException:ex]) return NO; [ex raise]; return NO; } /* fetch operations */ - (NSException *)selectAttributesX:(NSArray *)attributes describedByQualifier:(EOSQLQualifier *)qualifier fetchOrder:(NSArray *)fetchOrder lock:(BOOL)lockFlag { NSException *ex; EOSQLExpression *sqlexpr = nil; NSMutableArray *mattrs = (NSMutableArray *)attributes; NSMutableArray *mfetch = (NSMutableArray *)fetchOrder; if (!isOpen) return [[ChannelIsNotOpenedException new] autorelease]; if (attributes == nil) { return [NSException exceptionWithName:NSInvalidArgumentException reason: @"attributes argument for selectAttributes:" @"describedByQualifier:fetchOrder:lock: " @"must not be the nil object" userInfo:nil]; } if ([self isFetchInProgress]) return [AdaptorIsFetchingException exceptionWithAdaptor:self]; if ([self->adaptorContext transactionNestingLevel] == 0) return [NoTransactionInProgressException exceptionWithAdaptor:self]; if (delegateRespondsTo.willSelectAttributes) { EODelegateResponse response; mattrs = [[attributes mutableCopy] autorelease]; mfetch = [[fetchOrder mutableCopy] autorelease]; response = [delegate adaptorChannel:self willSelectAttributes:mattrs describedByQualifier:qualifier fetchOrder:mfetch lock:lockFlag]; if (response == EODelegateRejects) { return [NSException exceptionWithName:@"EODelegateRejects" reason:@"delegate rejected select" userInfo:nil]; } if (response == EODelegateOverrides) return nil; } #if 0 #warning DEBUG LOG, REMOVE! [self logWithFormat:@"fetch qualifier: %@", qualifier]; #endif sqlexpr = [[[self->adaptorContext adaptor] expressionClass] selectExpressionForAttributes:attributes lock:lockFlag qualifier:qualifier fetchOrder:fetchOrder channel:self]; ex = [self evaluateExpressionX:[sqlexpr expressionValueForContext:nil]]; if (ex != nil) return ex; if (delegateRespondsTo.didSelectAttributes) { [delegate adaptorChannel:self didSelectAttributes:mattrs describedByQualifier:qualifier fetchOrder:mfetch lock:lockFlag]; } return nil; } - (NSArray *)describeResults:(BOOL)_beautifyNames { [self subclassResponsibility:_cmd]; return nil; } - (NSArray *)describeResults { return [self describeResults:YES]; } - (NSMutableDictionary *)fetchAttributes:(NSArray *)attributes withZone:(NSZone *)_zone { NSMutableDictionary *row = nil; if (!self->isOpen) [[ChannelIsNotOpenedException new] raise]; if (_zone == NULL) _zone = NSDefaultMallocZone(); if(![self isFetchInProgress]) [[AdaptorIsNotFetchingException exceptionWithAdaptor:self] raise]; if(delegateRespondsTo.willFetchAttributes) { row = [delegate adaptorChannel:self willFetchAttributes:attributes withZone:_zone]; } /* NOTE: primaryFetchAttributes:withZone: have to set the isFetchInProgress status */ if(row == nil) row = [self primaryFetchAttributes:attributes withZone:_zone]; if(row) { if(delegateRespondsTo.didFetchAttributes) row = [delegate adaptorChannel:self didFetchAttributes:row withZone:_zone]; if(delegateRespondsTo.didChangeResultSet) [delegate adaptorChannelDidChangeResultSet:self]; } else { /* Do not set here the isFetchInProgress status since only subclasses can know whether there are more SELECT commands to be executed. Setting the status here to NO will overwrite the adaptor subclass intention. */ if(delegateRespondsTo.didFinishFetching) [delegate adaptorChannelDidFinishFetching:self]; } return row; } - (BOOL)isFetchInProgress { return self->isFetchInProgress; } - (void)cancelFetch { if (!isOpen) [[ChannelIsNotOpenedException new] raise]; self->isFetchInProgress = NO; } - (NSMutableDictionary *)dictionaryWithObjects:(id *)objects forAttributes:(NSArray *)attributes zone:(NSZone *)zone { [self notImplemented:_cmd]; return nil; } - (NSMutableDictionary*)primaryFetchAttributes:(NSArray *)attributes withZone:(NSZone *)zone { [self subclassResponsibility:_cmd]; return nil; } - (BOOL)evaluateExpression:(NSString *)anExpression { [self subclassResponsibility:_cmd]; return NO; } - (NSException *)evaluateExpressionX:(NSString *)_sql { NSException *ex; BOOL ok; ex = nil; ok = NO; NS_DURING ok = [self evaluateExpression:_sql]; NS_HANDLER ex = [localException retain]; NS_ENDHANDLER; if (ex) return [ex autorelease]; if (ok) return nil; return [NSException exceptionWithName:@"EOEvaluationError" reason:@"could not evaluate SQL expression" userInfo:nil]; } - (EOAdaptorContext *)adaptorContext { return self->adaptorContext; } - (EOModel *)describeModelWithTableNames:(NSArray *)tableNames { [self subclassResponsibility:_cmd]; return nil; } - (NSArray *)describeTableNames { [self subclassResponsibility:_cmd]; return nil; } - (BOOL)readTypesForEntity:(EOEntity*)anEntity { [self subclassResponsibility:_cmd]; return NO; } - (BOOL)readTypeForAttribute:(EOAttribute*)anAttribute { [self subclassResponsibility:_cmd]; return NO; } // delegate - (id)delegate { return self->delegate; } - (void)setDelegate:(id)_delegate { self->delegate = _delegate; delegateRespondsTo.willInsertRow = [delegate respondsToSelector: @selector(adaptorChannel:willInsertRow:forEntity:)]; delegateRespondsTo.didInsertRow = [delegate respondsToSelector: @selector(adaptorChannel:didInsertRow:forEntity:)]; delegateRespondsTo.willUpdateRow = [delegate respondsToSelector: @selector(adaptorChannel:willUpdateRow:describedByQualifier:)]; delegateRespondsTo.didUpdateRow = [delegate respondsToSelector: @selector(adaptorChannel:didUpdateRow:describedByQualifier:)]; delegateRespondsTo.willDeleteRows = [delegate respondsToSelector: @selector(adaptorChannel:willDeleteRowsDescribedByQualifier:)]; delegateRespondsTo.didDeleteRows = [delegate respondsToSelector: @selector(adaptorChannel:didDeleteRowsDescribedByQualifier:)]; delegateRespondsTo.willSelectAttributes = [delegate respondsToSelector: @selector(adaptorChannel:willSelectAttributes: describedByQualifier:fetchOrder:lock:)]; delegateRespondsTo.didSelectAttributes = [delegate respondsToSelector: @selector(adaptorChannel:didSelectAttributes: describedByQualifier:fetchOrder:lock:)]; delegateRespondsTo.willFetchAttributes = [delegate respondsToSelector: @selector(adaptorChannel:willFetchAttributes:withZone:)]; delegateRespondsTo.didFetchAttributes = [delegate respondsToSelector: @selector(adaptorChannel:didFetchAttributes:withZone:)]; delegateRespondsTo.didChangeResultSet = [delegate respondsToSelector: @selector(adaptorChannelDidChangeResultSet:)]; delegateRespondsTo.didFinishFetching = [delegate respondsToSelector: @selector(adaptorChannelDidFinishFetching:)]; delegateRespondsTo.willEvaluateExpression = [delegate respondsToSelector: @selector(adaptorChannel:willEvaluateExpression:)]; delegateRespondsTo.didEvaluateExpression = [delegate respondsToSelector: @selector(adaptorChannel:didEvaluateExpression:)]; } - (void)setDebugEnabled:(BOOL)flag { self->debugEnabled = flag; } - (BOOL)isDebugEnabled { return self->debugEnabled; } - (BOOL)isOpen { return self->isOpen; } @end /* EOAdaptorChannel */ #import @implementation EOAdaptorChannel(PrimaryKeyGeneration) // new in EOF2 - (NSDictionary *)primaryKeyForNewRowWithEntity:(EOEntity *)_entity { return nil; } @end /* EOAdaptorChannel(PrimaryKeyGeneration) */ @implementation EOAdaptorChannel(EOF2Additions) - (void)selectAttributes:(NSArray *)_attributes fetchSpecification:(EOFetchSpecification *)_fspec lock:(BOOL)_flag entity:(EOEntity *)_entity { EOSQLQualifier *q; BOOL isOk; q = (EOSQLQualifier *)[_fspec qualifier]; isOk = [self selectAttributes:_attributes describedByQualifier:q fetchOrder:[_fspec sortOrderings] lock:_flag]; if (!isOk) { [NSException raise:@"Select failed" format:@"could not select attributes for fetch spec"]; } } - (void)setAttributesToFetch:(NSArray *)_attributes { [self notImplemented:_cmd]; } - (NSArray *)attributesToFetch { NSLog(@"ERROR(%s): subclasses must override this method!", __PRETTY_FUNCTION__); return nil; } - (NSMutableDictionary *)fetchRowWithZone:(NSZone *)_zone { return [self fetchAttributes:[self attributesToFetch] withZone:_zone]; } @end /* EOAdaptorChannel(EOF2Additions) */ @implementation EOAdaptorChannel(Internals) - (NSArray *)_sortAttributesForSelectExpression:(NSArray *)_attrs { return _attrs; } @end /* EOAdaptorChannel(Internals) */ SOPE/sope-gdl1/GDLAccess/EOAdaptorContext.h0000644000000000000000000000725112242733417017213 0ustar rootroot/* EOAdaptorContext.h Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: October 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __EOAdaptorContext_h__ #define __EOAdaptorContext_h__ #import @class NSArray, NSMutableArray; @class EOAdaptor; @class EOAdaptorChannel; /* The EOAdaptorContext class could be overriden for a concrete database adaptor. You have to override only those methods marked in this header with `override'. */ @interface EOAdaptorContext : NSObject { EOAdaptor *adaptor; NSMutableArray *channels; // values with channels id delegate; // not retained int transactionNestingLevel; /* Flags used to check if the delegate responds to several messages */ struct { BOOL willBegin:1; BOOL didBegin:1; BOOL willCommit:1; BOOL didCommit:1; BOOL willRollback:1; BOOL didRollback:1; } delegateRespondsTo; } /* Initializing an adaptor context */ - (id)initWithAdaptor:(EOAdaptor*)adaptor; /* Setting and getting the adaptor */ - (EOAdaptor*)adaptor; /* Creating a new channel */ - (EOAdaptorChannel*)createAdaptorChannel; // override - (NSArray *)channels; /* Checking connection status */ - (BOOL)hasOpenChannels; /* Finding open channels */ - (BOOL)hasBusyChannels; /* Controlling transactions */ - (BOOL)beginTransaction; - (BOOL)commitTransaction; - (BOOL)rollbackTransaction; /* Notifying of other transactions */ - (void)transactionDidBegin; - (void)transactionDidCommit; - (void)transactionDidRollback; /* Nesting transactions */ - (BOOL)canNestTransactions; // override, deprecated - (unsigned)transactionNestingLevel; // deprecated - (BOOL)hasOpenTransaction; // new in WO 4.5 /* Setting the delegate */ - (id)delegate; - (void)setDelegate:(id)aDelegate; /* Primary methods that control the transactions. This methods dont't call the delegate. You should implement these methods instead of the similar ones but without the `primary' prefix. */ - (BOOL)primaryBeginTransaction; // override - (BOOL)primaryCommitTransaction; // override - (BOOL)primaryRollbackTransaction; // override @end /* EOAdaptorContext*/ @interface EOAdaptorContext(Private) - (void)channelDidInit:(id)aChannel; - (void)channelWillDealloc:(id)aChannel; @end #import @interface NSObject(EOAdaptorContextDelegate) - (EODelegateResponse)adaptorContextWillBegin:(id)aContext; - (void)adaptorContextDidBegin:(id)aContext; - (EODelegateResponse)adaptorContextWillCommit:(id)aContext; - (void)adaptorContextDidCommit:(id)aContext; - (EODelegateResponse)adaptorContextWillRollback:(id)aContext; - (void)adaptorContextDidRollback:(id)aContext; @end /* NSObject(EOAdaptorContextDelegate) */ #endif /* __EOAdaptorContext_h__*/ SOPE/sope-gdl1/GDLAccess/EONotQualifier+SQL.m0000644000000000000000000000251012242733417017307 0ustar rootroot/* EOAdaptorChannel.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: October 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // $Id: EONotQualifier+SQL.m 1 2004-08-20 10:38:46Z znek $ #import "EOSQLQualifier.h" #include "common.h" @implementation EONotQualifier(SQLQualifier) /* SQL qualifier generation */ - (EOSQLQualifier *)sqlQualifierForEntity:(EOEntity *)_entity { EOSQLQualifier *q; q = [self->qualifier sqlQualifierForEntity:_entity]; [q negate]; return q; } @end /* EONotQualifier */ SOPE/sope-gdl1/GDLAccess/EODatabaseChannel.m0000644000000000000000000013051312242733417017254 0ustar rootroot/* EODatabaseChannel.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Mircea Oancea Date: 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import "common.h" #import "EODatabaseChannel.h" #import "EOAdaptor.h" #import "EOAdaptorChannel.h" #import "EOAdaptorContext.h" #import "EOAttribute.h" #import "EODatabase.h" #import "EODatabaseContext.h" #import "EOEntity.h" #import "EODatabaseFault.h" #import "EOGenericRecord.h" #import "EOModel.h" #import "EOObjectUniquer.h" #import "EOSQLQualifier.h" #import "EORelationship.h" #import #import #import @class EOGenericRecord; NSString *EODatabaseChannelWillOpenNotificationName = @"EODatabaseChannelWillOpenNotification"; NSString *EODatabaseChannelDidOpenNotificationName = @"EODatabaseChannelDidOpenNotification"; NSString *EODatabaseChannelWillCloseNotificationName = @"EODatabaseChannelWillCloseNotification"; NSString *EODatabaseChannelDidCloseNotificationName = @"EODatabaseChannelDidCloseNotification"; NSString *EODatabaseChannelCouldNotOpenNotificationName = @"EODatabaseChannelCouldNotOpenNotification"; NSString *EODatabaseChannelWillInsertObjectName = @"EODatabaseChannelWillInsertObjectName"; NSString *EODatabaseChannelDidInsertObjectName = @"EODatabaseChannelDidInsertObjectName"; NSString *EODatabaseChannelWillUpdateObjectName = @"EODatabaseChannelWillUpdateObjectName"; NSString *EODatabaseChannelDidUpdateObjectName = @"EODatabaseChannelDidUpdateObjectName"; NSString *EODatabaseChannelWillDeleteObjectName = @"EODatabaseChannelWillDeleteObjectName"; NSString *EODatabaseChannelDidDeleteObjectName = @"EODatabaseChannelDidDeleteObjectName"; NSString *EODatabaseChannelWillLockObjectName = @"EODatabaseChannelWillLockObjectName"; NSString *EODatabaseChannelDidLockObjectName = @"EODatabaseChannelDidLockObjectName"; /* * Private methods declaration */ @interface EODatabaseChannel(Private) - (id)privateFetchWithZone:(NSZone *)_zone; - (Class)privateClassForEntity:(EOEntity *)anEntity; - (void)privateUpdateCurrentEntityInfo; - (void)privateClearCurrentEntityInfo; - (void)privateReportError:(SEL)method:(NSString *)format, ...; @end /* * EODatabaseChannel implementation */ @implementation EODatabaseChannel /* * Initializing a new instance */ - (id)initWithDatabaseContext:(EODatabaseContext *)_dbContext { if (_dbContext == nil) { AUTORELEASE(self); return nil; } self->notificationCenter = RETAIN([NSNotificationCenter defaultCenter]); self->databaseContext = RETAIN(_dbContext); [self setDelegate:[self->databaseContext delegate]]; [self->databaseContext channelDidInit:self]; return self; } - (void)dealloc { [self->databaseContext channelWillDealloc:self]; RELEASE(self->currentEditingContext); RELEASE(self->databaseContext); RELEASE(self->adaptorChannel); RELEASE(self->notificationCenter); [super dealloc]; } // notifications - (void)postNotification:(NSString *)_name { [self->notificationCenter postNotificationName:_name object:self]; } - (void)postNotification:(NSString *)_name object:(id)_obj { [self->notificationCenter postNotificationName:_name object:self userInfo:[NSDictionary dictionaryWithObject:_obj forKey:@"object"]]; } // accessors - (EOAdaptorChannel *)adaptorChannel { if (self->adaptorChannel == nil) { static int reuseAdaptorCh = -1; if (reuseAdaptorCh == -1) { reuseAdaptorCh = [[[NSUserDefaults standardUserDefaults] objectForKey:@"EOReuseAdaptorChannel"] boolValue] ? 1 : 0; } if (reuseAdaptorCh) { NSEnumerator *channels; EOAdaptorChannel *channel; channels = [[[[self databaseContext] adaptorContext] channels] objectEnumerator]; while ((channel = [channels nextObject])) { if ([channel isFetchInProgress]) continue; #if DEBUG NSLog(@"reuse adaptor channel: %@", channel); #endif self->adaptorChannel = channel; break; } } if (self->adaptorChannel == nil) { self->adaptorChannel = [[[self databaseContext] adaptorContext] createAdaptorChannel]; } RETAIN(self->adaptorChannel); } return self->adaptorChannel; } - (EODatabaseContext *)databaseContext { return self->databaseContext; } // delegate - (void)setDelegate:(id)_delegate { self->delegate = _delegate; } - (id)delegate { return self->delegate; } // Opening and closing a channel - (BOOL)isOpen { return [[self adaptorChannel] isOpen]; } - (BOOL)openChannel { BOOL result; [self postNotification:EODatabaseChannelWillOpenNotificationName]; if ((result = [[self adaptorChannel] openChannel])) { self->successfulOpenCount++; [self postNotification:EODatabaseChannelDidOpenNotificationName]; } else { self->failedOpenCount++; [self postNotification:EODatabaseChannelCouldNotOpenNotificationName]; } return result; } - (void)closeChannel { [self postNotification:EODatabaseChannelWillCloseNotificationName]; [[self adaptorChannel] closeChannel]; self->closeCount++; [self postNotification:EODatabaseChannelDidCloseNotificationName]; } // Modifying objects - (BOOL)_isNoRaiseOnModificationException:(NSException *)_exception { /* for compatibility with non-X methods, translate some errors to a bool */ NSString *n; n = [_exception name]; if ([n isEqualToString:@"EOEvaluationError"]) return YES; if ([n isEqualToString:@"EODelegateRejects"]) return YES; return NO; } - (BOOL)insertObject:(id)anObj { // TODO: split up this method // TODO: write an insertObjectX: which returns an exception NSException *exception = nil; EOEntity *entity = nil; NSDictionary *pkey = nil; NSDictionary *values = nil; NSDictionary *snapshot = nil; NSArray *attributes = nil; int i; [self postNotification:EODatabaseChannelWillInsertObjectName object:anObj]; if (![anObj prepareForInsertInChannel:self context:self->databaseContext]) return NO; // Check the delegate if ([self->delegate respondsToSelector: @selector(databaseChannel:willInsertObject:)]) anObj = [delegate databaseChannel:self willInsertObject:anObj]; // Check nil (delegate disallowes or given object was nil) if (anObj == nil) return NO; // Check if fault if ([EOFault isFault:anObj]) { [NSException raise:NSInvalidArgumentException format:@"Attempt to insert a fault in a database channel"]; } // Check if we can insert if ([databaseContext updateStrategy] == EONoUpdate) { [self privateReportError:_cmd : @"cannot insert if context has 'NoUpdate' update strategy."]; return NO; } /* validate object for insert */ if ((exception = [anObj validateForInsert])) { /* validation failed */ [exception raise]; } // Check if in a transaction if (![databaseContext transactionNestingLevel]) { [self privateReportError:_cmd : @"cannot insert if contex has no transaction opened."]; return NO; } // Get entity entity = [anObj respondsToSelector:@selector(entity)] ? [anObj entity] : [[[[adaptorChannel adaptorContext] adaptor] model] entityForObject:anObj]; // Check entity if (entity == nil) { [self privateReportError:_cmd : @"cannot determine entity for object %p class %@.", anObj, NSStringFromClass([anObj class])]; return NO; } if ([entity isReadOnly]) { [self privateReportError:_cmd : @"cannot insert object %p for readonly entity %@.", anObj, [entity name]]; return NO; } // Get array of attributes to insert attributes = [entity attributesUsedForInsert]; // Get simple values and convert them to adaptor values values = [anObj valuesForKeys:[entity attributesNamesUsedForInsert]]; values = [entity convertValuesToModel:values]; // Get and check *must insert* attributes (primary key, lock, readonly) for (i = [attributes count]-1; i >= 0; i--) { EOAttribute *attribute = [attributes objectAtIndex:i]; NSAssert(attribute, @"invalid attribute object .."); if (![values objectForKey:[attribute name]]) { [self privateReportError:_cmd : @"null value for insert attribute %@ for object %@ entity %@", [attribute name], anObj, [entity name]]; return NO; } } // Make primary key and snapshot snapshot = [entity snapshotForRow:values]; if (snapshot == nil) { [self privateReportError:_cmd : @"cannot determine snapshot for %p from values %@ entity %@.", anObj, [values description], [entity name]]; return NO; } pkey = [entity primaryKeyForRow:values]; if (pkey == nil) { [self privateReportError:_cmd : @"cannot determine primary key for %p from values %@ entity %@.", anObj, [values description], [entity name]]; return NO; } // Insert adaptor row exception = [adaptorChannel insertRowX:values forEntity:entity]; if (exception) { if (![self _isNoRaiseOnModificationException:exception]) [exception raise]; return NO; } // Record object in database context [databaseContext recordObject:anObj primaryKey:pkey entity:entity snapshot:values]; self->insertCount++; [anObj wasInsertedInChannel:self context:self->databaseContext]; // Notify delegate if ([delegate respondsToSelector:@selector(databaseChannel:didInsertObject:)]) [delegate databaseChannel:self didInsertObject:anObj]; [self postNotification:EODatabaseChannelDidInsertObjectName object:anObj]; return YES; } - (BOOL)updateObject:(id)anObj { // TODO: split up this huge method // TODO: make an updateObjectX: method which returns an exception NSException *exception = nil; EOEntity *entity = nil; EOSQLQualifier *qualifier = nil; NSDictionary *old_pkey = nil; NSDictionary *old_snapshot = nil; NSDictionary *new_pkey = nil; NSDictionary *new_snapshot = nil; NSDictionary *values = nil; BOOL needsOptimisticLock; [self postNotification:EODatabaseChannelWillUpdateObjectName object:anObj]; if (![anObj prepareForUpdateInChannel:self context:self->databaseContext]) return NO; // Check the delegate if ([delegate respondsToSelector:@selector(databaseChannel:willUpdateObject:)]) anObj = [delegate databaseChannel:self willUpdateObject:anObj]; // Check nil (delegate disallowes or given object was nil) if (anObj == nil) return NO; // Check if fault if ([EOFault isFault:anObj]) { [NSException raise:NSInvalidArgumentException format:@"Attempt to update a fault in a database channel"]; } // Check if we can update if ([databaseContext updateStrategy] == EONoUpdate) { [self privateReportError:_cmd : @"cannot update if context has 'NoUpdate' update strategy."]; return NO; } /* validate object for update */ if ((exception = [anObj validateForUpdate])) { /* validation failed */ [exception raise]; } // Check if in a transaction if (![databaseContext transactionNestingLevel]) { [self privateReportError:_cmd : @"cannot update if contex has no transaction opened."]; return NO; } // Get entity entity = [anObj respondsToSelector:@selector(entity)] ? [anObj entity] : [[[[adaptorChannel adaptorContext] adaptor] model] entityForObject:anObj]; // Check entity { if (entity == nil) { [self privateReportError:_cmd : @"cannot determine entity for object %p class %@.", anObj, NSStringFromClass([anObj class])]; return NO; } if ([entity isReadOnly]) { [self privateReportError:_cmd : @"cannot update object %p for readonly entity %@.", anObj, [entity name]]; return NO; } } // Get and check old snapshot and primary key { [databaseContext primaryKey:&old_pkey andSnapshot:&old_snapshot forObject:anObj]; if (old_snapshot == nil) { [self privateReportError:_cmd : @"cannot update object %p because there is no snapshot for it."]; return NO; } if (old_pkey == nil) old_pkey = [entity primaryKeyForRow:old_snapshot]; if (old_pkey == nil) { [self privateReportError:_cmd : @"cannot determine primary key for %p from snapshot %@ entity %@.", anObj, [old_snapshot description], [entity name]]; return NO; } } // Get simple values and convert them to adaptor values values = [anObj valuesForKeys:[entity attributesNamesUsedForInsert]]; values = [entity convertValuesToModel:values]; // Get and check new primary key and snapshot { new_snapshot = [entity snapshotForRow:values]; if (new_snapshot == nil) { [self privateReportError:_cmd : @"cannot determine snapshot for %p from values %@ entity %@.", anObj, [values description], [entity name]]; return NO; } new_pkey = [entity primaryKeyForRow:new_snapshot]; if (new_pkey == nil) { [self privateReportError:_cmd : @"cannot determine primary key for %p from values %@ entity %@.", anObj, [values description], [entity name]]; return NO; } } // Check if we need to lock optimistic before update // that is compare locking attributes with the existing ones in database switch([databaseContext updateStrategy]) { case EOUpdateWithOptimisticLocking: case EOUpdateWithPessimisticLocking: needsOptimisticLock = ![databaseContext isObjectLocked:anObj]; break; case EOUpdateWithNoLocking: needsOptimisticLock = NO; break; default: return NO; } // If we need an "optimistic lock" then perform lock // else just make the qualifier based on the primary key only if (needsOptimisticLock) { int i; BOOL canUseQualifier = YES; NSArray *lockAttrs = [entity attributesUsedForLocking]; EOAdaptor *adaptor = [[adaptorChannel adaptorContext] adaptor]; NSDictionary *row; // Check if attributes used for locking can be used in a qualifier for (i = [lockAttrs count]-1; i >= 0; i--) { if (![adaptor isValidQualifierType: [[lockAttrs objectAtIndex:i] externalType]]) { canUseQualifier = NO; break; } } if (canUseQualifier) // If YES just build the qualifier qualifier = [EOSQLQualifier qualifierForRow:old_snapshot entity:entity]; else { // If NO then lock the row in the database server, fetch the // new snapshot and compare it with the old one qualifier = [EOSQLQualifier qualifierForPrimaryKey:old_pkey entity:entity]; #ifdef DEBUG NSAssert2([lockAttrs count] > 0, @"missing locking attributes: lock=%@ object=%@", lockAttrs, anObj); #endif if (![adaptorChannel selectAttributes:lockAttrs describedByQualifier:qualifier fetchOrder:nil lock:YES]) { [self privateReportError:_cmd : @"could not lock=%@ with qualifier=%@ entity=%@.", anObj, [qualifier description], [entity name]]; return NO; } row = [adaptorChannel fetchAttributes:lockAttrs withZone:NULL]; [adaptorChannel cancelFetch]; if (row == nil) { [self privateReportError:_cmd : @"could not get row to lock %p with qualifier %@.", anObj, [qualifier description]]; return NO; } [databaseContext recordLockedObject:anObj]; if (![row isEqual:old_snapshot]) { [self privateReportError:_cmd : @"could not lock %p. Snapshots: self %@ database %@.", anObj, [old_snapshot description], [row description]]; return NO; } } } else { qualifier = [EOSQLQualifier qualifierForPrimaryKey:old_pkey entity:entity]; } // Compute values as delta from values and old_snapshot { NSMutableDictionary *delta; NSString *attributeName; NSArray *allKeys; int i, count; allKeys = [values allKeys]; delta = [NSMutableDictionary dictionary]; for (i = 0, count = [allKeys count]; i < count; i++) { id new_v, old_v; attributeName = [allKeys objectAtIndex:i]; new_v = [values objectForKey:attributeName]; old_v = [old_snapshot objectForKey:attributeName]; if ((old_v == nil) || ![new_v isEqual:old_v]) [delta setObject:new_v forKey:attributeName]; } values = delta; } // no reason for update --> fetch to be sure, that no one has deleted it // HH: The object was not changed, so we refetch to determine whether it // was deleted if ([values count] == 0) { if (![self refetchObject:anObj]) return NO; } // Update in adaptor else { NSException *ex; ex = [adaptorChannel updateRowX:values describedByQualifier:qualifier]; if (ex != nil) { if (![self _isNoRaiseOnModificationException:ex]) [ex raise]; return NO; } } // Record object in database context if (![new_pkey isEqual:old_pkey]) { NSLog(@"WARNING: (%@) primary key changed from %@ to %@", __PRETTY_FUNCTION__, old_pkey, new_pkey); [databaseContext forgetObject:anObj]; } [databaseContext recordObject:anObj primaryKey:new_pkey entity:entity snapshot:new_snapshot]; [databaseContext recordUpdatedObject:anObj]; self->updateCount++; [anObj wasUpdatedInChannel:self context:self->databaseContext]; // Notify delegate if ([delegate respondsToSelector:@selector(databaseChannel:didUpdateObject:)]) [delegate databaseChannel:self didUpdateObject:anObj]; [self postNotification:EODatabaseChannelDidUpdateObjectName object:anObj]; return YES; } - (BOOL)deleteObject:(id)anObj { // TODO: split this method // TODO: add an deleteObjectX: method which returns an NSException NSException *exception = nil; EOEntity *entity = nil; NSDictionary *pkey = nil; NSDictionary *snapshot = nil; EOSQLQualifier *qualifier = nil; [self postNotification:EODatabaseChannelWillDeleteObjectName object:anObj]; if (![anObj prepareForDeleteInChannel:self context:self->databaseContext]) return NO; // Check the delegate if ([delegate respondsToSelector:@selector(databaseChannel:willDeleteObject:)]) anObj = [delegate databaseChannel:self willDeleteObject:anObj]; // Check nil (delegate disallowes or given object was nil) if (anObj == nil) return NO; // Check if fault if ([EOFault isFault:anObj]) { [NSException raise:NSInvalidArgumentException format:@"Attempt to delete a fault in a database channel"]; } // Check if we can delete if ([databaseContext updateStrategy] == EONoUpdate) { [self privateReportError:_cmd : @"cannot delete if context has 'NoUpdate' update strategy."]; return NO; } /* validate object for delete */ if ((exception = [anObj validateForDelete])) { /* validation failed */ [exception raise]; } // Check if in a transaction if (![databaseContext transactionNestingLevel]) { [self privateReportError:_cmd : @"cannot update if contex has no transaction opened."]; return NO; } // Get entity entity = [anObj respondsToSelector:@selector(entity)] ? [anObj entity] : [[[[adaptorChannel adaptorContext] adaptor] model] entityForObject:anObj]; // Check entity if (entity == nil) { [self privateReportError:_cmd : @"cannot determine entity for object %p class %s.", anObj, NSStringFromClass([anObj class])]; return NO; } if ([entity isReadOnly]) { [self privateReportError:_cmd : @"cannot delete object %p for readonly entity %@.", anObj, [entity name]]; return NO; } // Get snapshot and old primary key [databaseContext primaryKey:&pkey andSnapshot:&snapshot forObject:anObj]; if (pkey == nil) { if (snapshot == nil) [self privateReportError:_cmd : @"cannot delete object %p because there is no snapshot for it."]; pkey = [entity primaryKeyForRow:snapshot]; } if (pkey == nil) { [self privateReportError:_cmd : @"cannot determine primary key for %p from values %@ entity %@.", anObj, [snapshot description], [entity name]]; return NO; } // Get and check qualifier for object to delete qualifier = [EOSQLQualifier qualifierForPrimaryKey:pkey entity:entity]; if (qualifier == nil) { [self privateReportError:_cmd : @"cannot make qualifier to delete %p primary key %@ entity %@.", anObj, [pkey description], [entity name]]; return NO; } // Delete adaptor row exception = [adaptorChannel deleteRowsDescribedByQualifierX:qualifier]; if (exception != nil) { if (![self _isNoRaiseOnModificationException:exception]) [exception raise]; return NO; } AUTORELEASE(RETAIN(anObj)); // Forget object in database context [databaseContext forgetObject:anObj]; self->deleteCount++; [anObj wasDeletedInChannel:self context:self->databaseContext]; // Notify delegate if ([delegate respondsToSelector: @selector(databaseChannel:didDeleteObject:)]) [delegate databaseChannel:self didDeleteObject:anObj]; [self postNotification:EODatabaseChannelDidDeleteObjectName object:anObj]; return YES; } - (BOOL)lockObject:(id)anObj { EOEntity *entity = nil; NSDictionary *pkey = nil; NSDictionary *snapshot = nil; EOSQLQualifier *qualifier = nil; [self postNotification:EODatabaseChannelWillLockObjectName object:anObj]; if (![anObj prepareForLockInChannel:self context:self->databaseContext]) return NO; // Check the delegate if ([delegate respondsToSelector:@selector(databaseChannel:willLockObject:)]) anObj = [delegate databaseChannel:self willLockObject:anObj]; // Check nil (delegate disallowes or given object was nil) if (anObj == nil) return NO; // Check if fault if ([EOFault isFault:anObj]) { [NSException raise:NSInvalidArgumentException format:@"Attempt to lock a fault in a database channel"]; } // Check if we can lock if ([databaseContext updateStrategy] == EONoUpdate) { [self privateReportError:_cmd : @"cannot lock if context has 'NoUpdate' update strategy."]; return NO; } // Check if in a transaction if (![databaseContext transactionNestingLevel]) { [self privateReportError:_cmd : @"cannot lock if contex has no transaction opened."]; return NO; } // Check if fetch is in progress if ([self isFetchInProgress]) { [self privateReportError:_cmd : @"cannot lock if contex has a fetch in progress."]; return NO; } // Get entity entity = [anObj respondsToSelector:@selector(entity)] ? [anObj entity] : [[[[adaptorChannel adaptorContext] adaptor] model] entityForObject:anObj]; // Check entity if (entity == nil) { [self privateReportError:_cmd : @"cannot determine entity for object %p class %s.", anObj, NSStringFromClass([anObj class])]; return NO; } if ([entity isReadOnly]) { [self privateReportError:_cmd : @"cannot lock object %p for readonly entity %@.", anObj, [entity name]]; return NO; } // Get snapshot and old primary key [databaseContext primaryKey:&pkey andSnapshot:&snapshot forObject:anObj]; if (snapshot == nil) { [self privateReportError:_cmd : @"cannot lock object %p because there is no snapshot for it."]; return NO; } if (pkey == nil) pkey = [entity primaryKeyForRow:snapshot]; if (pkey == nil) { [self privateReportError:_cmd : @"cannot determine primary key for %p from values %@ entity %@.", anObj, [snapshot description], [entity name]]; return NO; } { NSArray *lockAttrs = [entity attributesUsedForLocking]; NSDictionary *row = nil; qualifier = [EOSQLQualifier qualifierForPrimaryKey:pkey entity:entity]; #ifdef DEBUG NSAssert2([lockAttrs count] > 0, @"missing locking attributes: lock=%@ object=%@", lockAttrs, anObj); #endif if (![adaptorChannel selectAttributes:lockAttrs describedByQualifier:qualifier fetchOrder:nil lock:YES]) { [self privateReportError:_cmd : @"could not lock %p with qualifier %@.", anObj, [qualifier description]]; return NO; } row = [adaptorChannel fetchAttributes:lockAttrs withZone:NULL]; [adaptorChannel cancelFetch]; if (row == nil) { [self privateReportError:_cmd : @"could not lock %p with qualifier %@.", anObj, [qualifier description]]; return NO; } if (![row isEqual:snapshot]) { [self privateReportError:_cmd : @"could not lock %p. Snapshots: self %@ database %@.", anObj, [snapshot description], [row description]]; return NO; } } // Register lock object in database context [databaseContext recordLockedObject:anObj]; self->lockCount++; [anObj wasLockedInChannel:self context:self->databaseContext]; // Notify delegate if ([delegate respondsToSelector:@selector(databaseChannel:didLockObject:)]) [delegate databaseChannel:self didLockObject:anObj]; [self postNotification:EODatabaseChannelDidLockObjectName object:anObj]; return YES; } - (BOOL)refetchObject:(id)anObj { EOEntity *entity = nil; NSDictionary *pkey = nil; NSDictionary *snapshot = nil; EOSQLQualifier *qualifier = nil; // Check the delegate if ([delegate respondsToSelector: @selector(databaseChannel:willRefetchObject:)]) anObj = [delegate databaseChannel:self willRefetchObject:anObj]; // Check nil (delegate disallowes or given object was nil) if (anObj == nil) return NO; // Check if fault if ([EOFault isFault:anObj]) { [NSException raise:NSInvalidArgumentException format:@"Attempt to refetch a fault in a database channel"]; } // Check if in a transaction if (![databaseContext transactionNestingLevel]) { [self privateReportError:_cmd : @"cannot refetch if context has no transaction opened."]; return NO; } // Check if fetch is in progress if ([self isFetchInProgress]) { [self privateReportError:_cmd : @"cannot refetch if context has a fetch in progress."]; return NO; } // Get entity entity = [anObj respondsToSelector:@selector(entity)] ? [anObj entity] : [[[[adaptorChannel adaptorContext] adaptor] model] entityForObject:anObj]; // Check entity if (entity == nil) { [self privateReportError:_cmd : @"cannot determine entity for object %p class %s.", anObj, NSStringFromClass([anObj class])]; return NO; } // Get snapshot and old primary key [databaseContext primaryKey:&pkey andSnapshot:&snapshot forObject:anObj]; if (pkey == nil) { if (snapshot == nil) [self privateReportError:_cmd : @"cannot refetch object %p because there is no snapshot for it."]; pkey = [entity primaryKeyForRow:snapshot]; } if (pkey == nil) { [self privateReportError:_cmd : @"cannot determine primary key for %p from values %@ entity %@.", anObj, [snapshot description], [entity name]]; return NO; } // Get and check qualifier for object to refetch qualifier = [EOSQLQualifier qualifierForPrimaryKey:pkey entity:entity]; if (qualifier == nil) { [self privateReportError:_cmd : @"cannot make qualifier to refetch %p primary key %@ entity %@.", anObj, [pkey description], [entity name]]; return NO; } // Request object from adaptor [self setCurrentEntity:entity]; [self privateUpdateCurrentEntityInfo]; if (currentAttributes == nil) { [self privateReportError:_cmd : @"internal inconsitency while refetching %p.", anObj]; return NO; } #ifdef DEBUG NSAssert3([currentAttributes count] > 0, @"missing attributes for select: lock=%@ object=%@ entity=%@", currentAttributes, anObj, entity); #endif if (![adaptorChannel selectAttributes:currentAttributes describedByQualifier:qualifier fetchOrder:nil lock:([databaseContext updateStrategy] == EOUpdateWithPessimisticLocking)]) { [self privateClearCurrentEntityInfo]; return NO; } // Get object from adaptor, re-build its faults and record new snapshot anObj = [self privateFetchWithZone:NULL]; [self cancelFetch]; if (anObj == nil) { [self privateReportError:_cmd : @"could not refetch %p with qualifier %@.", anObj, [qualifier description]]; return NO; } // Notify delegate if ([delegate respondsToSelector:@selector(databaseChannel:didRefetchObject:)]) [delegate databaseChannel:self didRefetchObject:anObj]; return YES; } - (id)_createObjectForRow:(NSDictionary*)aRow entity:(EOEntity*)anEntity isPrimaryKey:(BOOL)yn zone:(NSZone*)zone { Class class = Nil; id anObj = nil; if (anEntity == nil) return nil; class = [self privateClassForEntity:anEntity]; // Create new instance if ([class respondsToSelector:@selector(classForEntity:values:)]) class = [class classForEntity:anEntity values:aRow]; anObj = [class allocWithZone:zone]; return anObj; } - (id)allocateObjectForRow:(NSDictionary *)row entity:(EOEntity *)anEntity zone:(NSZone *)zone { Class class = Nil; id anObj = nil; if (anEntity == nil) return nil; class = [self privateClassForEntity:anEntity]; // Create new instance if ([class respondsToSelector:@selector(classForEntity:values:)]) class = [class classForEntity:anEntity values:row]; anObj = [class allocWithZone:zone]; return anObj; } - (id)initializedObjectForRow:(NSDictionary *)row entity:(EOEntity *)anEntity zone:(NSZone *)zone { id anObj; anObj = [self allocateObjectForRow:row entity:anEntity zone:zone]; anObj = [anObj respondsToSelector:@selector(initWithPrimaryKey:entity:)] ? [anObj initWithPrimaryKey:row entity:anEntity] : [anObj init]; return AUTORELEASE(anObj); } /* * Fetching objects */ - (id)_fetchObject:(id)anObj qualifier:(EOSQLQualifier *)qualifier { id obj; [self selectObjectsDescribedByQualifier:qualifier fetchOrder:nil]; obj = [self fetchWithZone:NULL]; [self cancelFetch]; return obj; } - (BOOL)selectObjectsDescribedByQualifier:(EOSQLQualifier *)qualifier fetchOrder:(NSArray *)fetchOrder { if ([delegate respondsToSelector: @selector(databaseChannel:willSelectObjectsDescribedByQualifier:fetchOrder:)]) if (![delegate databaseChannel:self willSelectObjectsDescribedByQualifier:qualifier fetchOrder:fetchOrder]) return NO; [self setCurrentEntity:[qualifier entity]]; [self privateUpdateCurrentEntityInfo]; if (self->currentAttributes == nil) { [self privateReportError:_cmd : @"internal inconsitency while selecting."]; } #ifdef DEBUG NSAssert3([self->currentAttributes count] > 0, @"missing select attributes: attrs=%@, qualifier=%@, entity=%@", self->currentAttributes, qualifier, self->currentEntity); #endif if (![adaptorChannel selectAttributes:self->currentAttributes describedByQualifier:qualifier fetchOrder:fetchOrder lock:([databaseContext updateStrategy] == EOUpdateWithPessimisticLocking)]) { [self privateClearCurrentEntityInfo]; [self privateReportError:_cmd : @"could not select attributes with qualifier %@.", [qualifier description]]; return NO; } if ([delegate respondsToSelector: @selector(databaseChannel:didSelectObjectsDescribedByQualifier:fetchOrder:)]) [delegate databaseChannel:self didSelectObjectsDescribedByQualifier:qualifier fetchOrder:fetchOrder]; return YES; } - (id)fetchWithZone:(NSZone *)zone { id object = nil; if ([delegate respondsToSelector: @selector(databaseChannel:willFetchObjectOfClass:withZone:)]) { Class class; class = currentClass ? currentClass : [self privateClassForEntity:currentEntity]; [delegate databaseChannel:self willFetchObjectOfClass:class withZone:zone]; } object = [self privateFetchWithZone:zone]; if (object == nil) return nil; if ([delegate respondsToSelector:@selector(databaseChannel:didFetchObject:)]) [delegate databaseChannel:self didFetchObject:object]; return object; } - (BOOL)isFetchInProgress { return [[self adaptorChannel] isFetchInProgress]; } - (void)cancelFetch { if ([[self adaptorChannel] isFetchInProgress]) { [self privateClearCurrentEntityInfo]; [[self adaptorChannel] cancelFetch]; } } - (void)setCurrentEntity:(EOEntity *)_entity { // Clear entity info [self privateClearCurrentEntityInfo]; // Set new entity NSAssert(self->currentEntity == nil, @"entity not cleared correctly .."); self->currentEntity = RETAIN(_entity); } - (void)privateClearCurrentEntityInfo { RELEASE(self->currentEntity); self->currentEntity = nil; RELEASE(self->currentAttributes); self->currentAttributes = nil; RELEASE(self->currentRelations); self->currentRelations = nil; self->currentClass = Nil; self->currentReady = NO; } - (void)privateUpdateCurrentEntityInfo { if (self->currentEntity == nil) { [NSException raise:NSInvalidArgumentException format:@"Must use setCurrentEntity if select is not done " @"through database"]; } if (self->currentAttributes == nil) self->currentAttributes = RETAIN([self->currentEntity attributesUsedForFetch]); if (self->currentRelations == nil) self->currentRelations = RETAIN([self->currentEntity relationsUsedForFetch]); self->currentReady = YES; } /* * Private methods */ - (Class)privateClassForEntity:(EOEntity *)anEntity { Class class; if (anEntity == currentEntity && currentClass) return currentClass; // Get class for new object class = NSClassFromString([anEntity className]); if (!class && [delegate respondsToSelector: @selector(databaseChannel:failedToLookupClassNamed:)]) class = [delegate databaseChannel:self failedToLookupClassNamed:[[anEntity className] cString]]; if (class == Nil) class = [EOGenericRecord class]; if (anEntity == currentEntity) currentClass = class; return class; } - (id)privateFetchWithZone:(NSZone *)_zone { NSMutableDictionary *values = nil; id object = nil; NSDictionary *pkey = nil; NSDictionary *snapshot = nil; NSDictionary *row = nil; NSDictionary *dict = nil;; // Be sure we have entity info (raises if no entity is set) if (!self->currentReady) [self privateUpdateCurrentEntityInfo]; // fetch row from adaptor row = [[self adaptorChannel] fetchAttributes:self->currentAttributes withZone:_zone]; if (row == nil) // Results set finished or no more result sets return nil; #if 0 row = [row copyWithZone:_zone]; AUTORELEASE(row); #endif // determine primary key and snapshot snapshot = [self->currentEntity snapshotForRow:row]; pkey = [self->currentEntity primaryKeyForRow:row]; if ((pkey == nil) || (snapshot == nil)) { // TODO - should we have a delegate method here ? [NSException raise:NSInvalidArgumentException format:@"Cannot determine primary key and snapshot for row"]; } // lookup object in context/database object = [self->databaseContext objectForPrimaryKey:pkey entity:currentEntity]; // use old, make new, clear fault if (object == nil) { //NSLog(@"new anObj\n"); object = [self initializedObjectForRow:row entity:currentEntity zone:_zone]; } if ([EOFault isFault:object]) { [EODatabaseFault clearFault:object]; object = [object respondsToSelector:@selector(initWithPrimaryKey:entity:)] ? [object initWithPrimaryKey:row entity:currentEntity] : [object init]; if (object == nil) { [NSException raise:NSInvalidArgumentException format:@"could not initialize cleared fault with " @"row `%@' and entity %@", [row description], [currentEntity name]]; } } // make values // TODO - handle only class properties to object values = [NSMutableDictionary dictionaryWithCapacity: ([row count] + [currentRelations count])]; [values addEntriesFromDictionary:row]; // resolve relationships (to-one and to-many) { EORelationship *rel = nil; int i, n = [self->currentRelations count]; id fault = nil; for (i = 0; i < n; i++) { rel = [self->currentRelations objectAtIndex:i]; // Check if the delegate can provide a different relationship if ([delegate respondsToSelector: @selector(databaseChannel:relationshipForRow:relationship:)]) { id nrel = [delegate databaseChannel:self relationshipForRow:row relationship:rel]; rel = nrel ? nrel : (id)rel; } if ([rel isToMany]) { // Build to-many fault EOSQLQualifier* qualifier = [EOSQLQualifier qualifierForRow:row relationship:rel]; if (qualifier == nil) { // HH: THROW was uncommented .. [NSException raise:NSInvalidArgumentException format: @"Cannot build fault qualifier for relationship"]; // TODO continue; } #if LIB_FOUNDATION_LIBRARY if ([NSClassFromString([[rel destinationEntity] className]) isGarbageCollectable]) fault = [EODatabaseFault gcArrayFaultWithQualifier:qualifier fetchOrder:nil databaseChannel:self zone:_zone]; else #endif fault = [EODatabaseFault arrayFaultWithQualifier:qualifier fetchOrder:nil databaseChannel:self zone:_zone]; } else { // Build to-one fault EOEntity *faultEntity; NSDictionary *faultKey; faultEntity = [rel destinationEntity]; faultKey = [rel foreignKeyForRow:row]; faultKey = [faultEntity primaryKeyForRow:faultKey]; if (faultEntity == nil) { [NSException raise:NSInvalidArgumentException format:@"Cannot get entity for relationship"]; } if (faultKey) { fault = [self->databaseContext objectForPrimaryKey:faultKey entity:faultEntity]; if (fault == nil) { fault = [EODatabaseFault objectFaultWithPrimaryKey:faultKey entity:faultEntity databaseChannel:self zone:_zone]; [databaseContext recordObject:fault primaryKey:faultKey entity:faultEntity snapshot:nil]; } } else fault = [EONull null]; } if (fault) [values setObject:fault forKey:[rel name]]; } } // check if is updated in another context or just updated or new (delegate) dict = values; if ([[databaseContext database] isObject:object updatedOutsideContext:databaseContext]) { if ([delegate respondsToSelector: @selector(databaseChannel:willRefetchConflictingObject:withSnapshot:)]) { dict = [delegate databaseChannel:self willRefetchConflictingObject:object withSnapshot:values]; } else { [NSException raise:NSInvalidArgumentException format:@"object updated in an uncommitted transaction " @"was fetched"]; } } else { if ([delegate respondsToSelector: @selector(databaseChannel:willRefetchObject:fromSnapshot:)]) { dict = [delegate databaseChannel:self willRefetchObject:object fromSnapshot:values]; } } // does delegate disallow setting the new values and recording the fetch ? if (dict == nil) return object; // put values [object takeValuesFromDictionary:dict]; // register lock if locked if ([databaseContext updateStrategy] == EOUpdateWithPessimisticLocking) [databaseContext recordLockedObject:object]; // register object in context [databaseContext recordObject:object primaryKey:pkey entity:currentEntity snapshot:snapshot]; // awake object from database channel if ([object respondsToSelector:@selector(awakeForDatabaseChannel:)]) [object awakeForDatabaseChannel:self]; // Done. return object; } // ******************** Reporting errors ******************** - (void)privateReportError:(SEL)method :(NSString*)format,... { NSString* message; va_list va; if (![[databaseContext database] logsErrorMessages]) return; va_start(va, format); message = AUTORELEASE([[NSString alloc] initWithFormat:format arguments:va]); va_end(va); [[databaseContext database] reportErrorFormat: @"EODatabaseChannel:error in [EODatabaseChannel %@]: %@", NSStringFromSelector(method), message]; } @end /* EODatabaseChannel */ @implementation NSObject(EODatabaseChannelEONotifications) - (BOOL)prepareForDeleteInChannel:(EODatabaseChannel *)_channel context:(EODatabaseContext *)_ctx { return YES; } - (void)wasDeletedInChannel:(EODatabaseChannel *)_channel context:(EODatabaseContext *)_ctx { } - (BOOL)prepareForInsertInChannel:(EODatabaseChannel *)_channel context:(EODatabaseContext *)_ctx { return YES; } - (void)wasInsertedInChannel:(EODatabaseChannel *)_channel context:(EODatabaseContext *)_ctx { } - (BOOL)prepareForUpdateInChannel:(EODatabaseChannel *)_channel context:(EODatabaseContext *)_ctx { return YES; } - (void)wasUpdatedInChannel:(EODatabaseChannel *)_channel context:(EODatabaseContext *)_ctx { } - (BOOL)prepareForLockInChannel:(EODatabaseChannel *)_channel context:(EODatabaseContext *)_ctx { return YES; } - (void)wasLockedInChannel:(EODatabaseChannel *)_channel context:(EODatabaseContext *)_ctx { } @end /* NSObject(EODatabaseChannelNotifications) */ @implementation EODatabaseChannel(Statistics) - (unsigned int)successfulOpenCount { return self->successfulOpenCount; } - (unsigned int)failedOpenCount { return self->failedOpenCount; } - (unsigned int)closeCount { return self->closeCount; } - (unsigned int)insertCount { return self->insertCount; } - (unsigned int)updateCount { return self->updateCount; } - (unsigned int)deleteCount { return self->deleteCount; } - (unsigned int)lockCount { return self->lockCount; } @end SOPE/sope-gdl1/GDLAccess/EOObjectUniquer.m0000644000000000000000000002517712242733417017047 0ustar rootroot/* EOObjectUniquer.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Mircea Oancea Date: 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import "common.h" #import "EOEntity.h" #import "EOObjectUniquer.h" #import "EOPrimaryKeyDictionary.h" #import "EODatabaseFault.h" #import "EOGenericRecord.h" static unsigned uniquerHash(NSMapTable* table, EOUniquerRecord* rec) { // efficient hash for dictionaries is done in the concrete // dictionaries implementation; dictionaries are allocated // from EOPrimaryKeyDictionary concrete subclasses return ((unsigned long)(rec->entity) >> 4L) + ((EOPrimaryKeyDictionary*)(rec->pkey))->fastHash; } static BOOL uniquerCompare(NSMapTable *table, EOUniquerRecord *rec1, EOUniquerRecord *rec2) { // efficient compare between dictionaries is done in the concrete // dictionaries implementation; dictionaries are allocated // from EOPrimaryKeyDictionary concrete subclasses return (rec1->entity == rec2->entity) && [rec1->pkey fastIsEqual:rec2->pkey]; } static NSString* uniqDescription(NSMapTable *t, EOUniquerRecord* rec) { return [NSString stringWithFormat: @"<>", rec->pkey, rec->entity, rec->object, rec->snapshot]; } static void uniquerRetain(NSMapTable *table, EOUniquerRecord* rec) { rec->refCount++; } static void uniquerRelease(NSMapTable *table, EOUniquerRecord *rec) { rec->refCount--; if (rec->refCount <= 0) { RELEASE(rec->pkey); rec->pkey = NULL; RELEASE(rec->entity); rec->entity = NULL; RELEASE(rec->snapshot); rec->snapshot = NULL; Free(rec); rec = NULL; } } static inline EOUniquerRecord *uniquerCreate(id pkey, id entity, id object, id snapshot) { EOUniquerRecord *rec = NULL; rec = (EOUniquerRecord *)Malloc(sizeof(EOUniquerRecord)); rec->refCount = 0; rec->pkey = RETAIN(pkey); rec->entity = RETAIN(entity); rec->object = object; rec->snapshot = RETAIN(snapshot); return rec; } static void uniquerNoAction(NSMapTable * t, const void *_object) { } static NSMapTableKeyCallBacks uniquerKeyMapCallbacks = { (NSUInteger(*)(NSMapTable *, const void *))uniquerHash, (BOOL(*)(NSMapTable *, const void *, const void *))uniquerCompare, (void (*)(NSMapTable *, const void *))uniquerNoAction, (void (*)(NSMapTable *, void *))uniquerNoAction, (NSString *(*)(NSMapTable *, const void *))uniqDescription, (const void *)NULL }; static NSMapTableValueCallBacks uniquerValueMapCallbacks = { (void (*)(NSMapTable *, const void *))uniquerRetain, (void (*)(NSMapTable *, void *))uniquerRelease, (NSString *(*)(NSMapTable *, const void *))uniqDescription }; static int initialHashSize = 1021; @implementation EOObjectUniquer static NSMutableArray *uniquerExtent = nil; static NSRecursiveLock *lock = nil; + (void)initialize { static BOOL isInitialized = NO; if (!isInitialized) { isInitialized = YES; uniquerExtent = [[NSMutableArray alloc] initWithCapacity:16]; // THREAD: lock = [[NSRecursiveLock alloc] init]; } } static inline void _addUniquerInstance(EOObjectUniquer *_uniquer) { [lock lock]; [uniquerExtent addObject:[NSValue valueWithNonretainedObject:_uniquer]]; [lock unlock]; } static inline void _removeUniquerInstance(EOObjectUniquer *_uniquer) { [lock lock]; { int i; for (i = [uniquerExtent count] - 1; i >= 0; i--) { EOObjectUniquer *uniquer; uniquer = [[uniquerExtent objectAtIndex:i] nonretainedObjectValue]; if (uniquer == _uniquer) { [uniquerExtent removeObjectAtIndex:i]; break; } } } [lock unlock]; } // Initializing a uniquing dictionary - (id)init { self->primaryKeyToRec = NSCreateMapTable(uniquerKeyMapCallbacks, uniquerValueMapCallbacks, initialHashSize); #if LIB_FOUNDATION_LIBRARY self->objectsToRec = NSCreateMapTableInvisibleKeysOrValues (NSNonOwnedPointerMapKeyCallBacks, uniquerValueMapCallbacks, initialHashSize, YES, NO); #else self->objectsToRec = NSCreateMapTable (NSNonOwnedPointerMapKeyCallBacks, uniquerValueMapCallbacks, initialHashSize); #endif self->keyRecord = uniquerCreate(nil, nil, nil, nil); _addUniquerInstance(self); return self; } - (void)dealloc { [self forgetAllObjects]; _removeUniquerInstance(self); NSFreeMapTable(self->objectsToRec); NSFreeMapTable(self->primaryKeyToRec); if (self->keyRecord) { Free(self->keyRecord); self->keyRecord = NULL; } [super dealloc]; } // Transfer self to parent - (void)transferTo:(EOObjectUniquer *)_dest objects:(BOOL)isKey andSnapshots:(BOOL)isSnap { EOUniquerRecord *key = NULL; EOUniquerRecord *rec = NULL; NSMapEnumerator enumerator = NSEnumerateMapTable(primaryKeyToRec); while(NSNextMapEnumeratorPair(&enumerator, (void**)(&key), (void**)(&rec))) { [_dest recordObject:rec->object primaryKey: isKey ? rec->pkey : nil entity: isKey ? rec->entity : nil snapshot: isSnap ? rec->snapshot : nil]; } [self forgetAllObjects]; } // Handling objects - (void)forgetObject:(id)_object { EOUniquerRecord *rec = NULL; if (_object == nil) return; rec = (EOUniquerRecord *)NSMapGet(self->objectsToRec, _object); if (rec == NULL) return; /* NSLog(@"Uniquer[0x%p]: forget object 0x%p<%s> entity=%@", self, _object, class_get_class_name(*(Class *)_object), [[_object entity] name]); */ if (rec->pkey) NSMapRemove(self->primaryKeyToRec, rec); NSMapRemove(self->objectsToRec, _object); } - (void)forgetAllObjects { NSResetMapTable(self->primaryKeyToRec); NSResetMapTable(self->objectsToRec); } - (void)forgetAllSnapshots { NSMapEnumerator enumerator; EOUniquerRecord *rec = NULL; id key = nil; NSLog(@"uniquer 0x%p forgetAllSnapshots ..", self); enumerator = NSEnumerateMapTable(self->objectsToRec); while (NSNextMapEnumeratorPair(&enumerator, (void**)(&key), (void**)(&rec))) { RELEASE(rec->snapshot); rec->snapshot = nil; } } - (id)objectForPrimaryKey:(NSDictionary *)_key entity:(EOEntity *)_entity { EOUniquerRecord *rec; if (_key == nil || _entity == nil) return nil; if (![_key isKindOfClass:[EOPrimaryKeyDictionary class]]) { [NSException raise:NSInvalidArgumentException format: @"attempt to record object with non " @" EOPrimaryKeyDictionary class in EOObjectUniquer." @"This is a bug in EODatabase/Context/Channel."]; } keyRecord->pkey = _key; keyRecord->entity = _entity; rec = (EOUniquerRecord*)NSMapGet(primaryKeyToRec, keyRecord); return rec ? rec->object : nil; } - (EOUniquerRecord *)recordForObject:(id)_object { return (_object == nil) ? (EOUniquerRecord *)NULL : (EOUniquerRecord *)NSMapGet(self->objectsToRec, _object); } - (void)recordObject:(id)_object primaryKey:(NSDictionary *)_key entity:(EOEntity *)_entity snapshot:(NSDictionary *)_snapshot { EOUniquerRecord *rec = NULL; EOUniquerRecord *orc = NULL; if (_object == nil) return; if ((_key == nil) || (_entity == nil)) { _key = nil; _entity = nil; } if ((_key == nil) && (_snapshot == nil)) return; if (_key && ![_key isKindOfClass:[EOPrimaryKeyDictionary class]]) { [NSException raise:NSInvalidArgumentException format: @"attempt to record object with non " @" EOPrimaryKeyDictionary class in EOObjectUniquer." @"This is a bug in EODatabase/Context/Channel."]; } keyRecord->pkey = _key; keyRecord->entity = _entity; rec = (EOUniquerRecord*)NSMapGet(objectsToRec, _object); if (rec) { if (_key && uniquerCompare(NULL, rec, keyRecord)) { ASSIGN(rec->snapshot, _snapshot); return; } if (_key) { orc = (EOUniquerRecord*)NSMapGet(primaryKeyToRec, keyRecord); if (orc && orc != rec) { if (orc->pkey) NSMapRemove(primaryKeyToRec, orc); NSMapRemove(objectsToRec, orc->object); } NSMapRemove(primaryKeyToRec, rec); } ASSIGN(rec->pkey, _key); ASSIGN(rec->entity, _entity); ASSIGN(rec->snapshot, _snapshot); if (_key) NSMapInsertKnownAbsent(primaryKeyToRec, rec, rec); return; } if (_key) rec = (EOUniquerRecord*)NSMapGet(primaryKeyToRec, keyRecord); if (rec) { if (rec->object == _object) { ASSIGN(rec->snapshot, _snapshot); return; } NSMapRemove(objectsToRec, rec->object); ASSIGN(rec->snapshot, _snapshot); rec->object = _object; NSMapInsertKnownAbsent(objectsToRec, _object, rec); return; } rec = uniquerCreate(_key, _entity, _object, _snapshot); if (_key) NSMapInsertKnownAbsent(primaryKeyToRec, rec, rec); NSMapInsertKnownAbsent(objectsToRec, _object, rec); } /* This method is called by the Boehm's garbage collector when an object is finalized */ - (void)_objectWillFinalize:(id)_object { // printf ("_objectWillFinalize: %p (%s)\n", // _object, class_get_class_name ([_object class])); [self forgetObject:_object]; } + (void)forgetObject:(id)_object { [lock lock]; { int i; for (i = [uniquerExtent count] - 1; i >= 0; i--) { EOObjectUniquer *uniquer; uniquer = [[uniquerExtent objectAtIndex:i] nonretainedObjectValue]; [uniquer forgetObject:_object]; } } [lock unlock]; } @end /* EOObjectUniquer */ SOPE/sope-gdl1/GDLAccess/GDLAccess.h0000644000000000000000000000241412242733417015554 0ustar rootroot// $Id: EOAccess.h 1 2004-08-20 10:38:46Z znek $ #ifndef __GDLAccess_H__ #define __GDLAccess_H__ #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import // Kit class @interface GDLAccess : NSObject @end #endif /* __GDLAccess_H__ */ SOPE/sope-gdl1/GDLAccess/GNUmakefile.preamble0000644000000000000000000000303712242733417017515 0ustar rootroot# compilation settings SOPE_ROOT=../.. ADDITIONAL_CPPFLAGS += -Wall ADDITIONAL_CPPFLAGS += \ -DGDL_MAJOR_VERSION=$(MAJOR_VERSION) \ -DGDL_MINOR_VERSION=$(MINOR_VERSION) \ -DGDL_SUBMINOR_VERSION=$(SUBMINOR_VERSION) ADDITIONAL_CPPFLAGS += \ -DSOPE_MAJOR_VERSION=$(SOPE_MAJOR_VERSION) \ -DSOPE_MINOR_VERSION=$(SOPE_MINOR_VERSION) \ -DSOPE_SUBMINOR_VERSION=$(SOPE_SUBMINOR_VERSION) ADDITIONAL_INCLUDE_DIRS += \ -I. -I.. \ -I./FoundationExt \ -I$(SOPE_ROOT)/sope-core/ \ -I$(SOPE_ROOT)/sope-core/NGExtensions/ ifneq ($(CGS_LIBDIR_NAME),) ADDITIONAL_CPPFLAGS += -DCGS_LIBDIR_NAME=\@\"$(CGS_LIBDIR_NAME)\" endif # dependencies libGDLAccess_LIBRARIES_DEPEND_UPON += -lEOControl $(BASE_LIBS) GDLAccess_LIBRARIES_DEPEND_UPON += -framework EOControl ifneq ($(frameworks),yes) ADDITIONAL_TOOL_LIBS += -lGDLAccess -lEOControl else ADDITIONAL_TOOL_LIBS += -framework GDLAccess -framework EOControl endif # library/framework search pathes DEP_DIRS = . $(SOPE_ROOT)/sope-core/EOControl ifneq ($(frameworks),yes) ADDITIONAL_LIB_DIRS += \ $(foreach dir,$(DEP_DIRS),\ -L$(GNUSTEP_BUILD_DIR)/$(dir)/$(GNUSTEP_OBJ_DIR_NAME)) else ADDITIONAL_LIB_DIRS += \ $(foreach dir,$(DEP_DIRS),-F$(GNUSTEP_BUILD_DIR)/$(dir)) endif SYSTEM_LIB_DIR += $(CONFIGURE_SYSTEM_LIB_DIR) # TODO: add prebinding address ifeq ($(FOUNDATION_LIB),apple) #libGDLAccess_PREBIND_ADDR="0x??" #libGDLAccess_LDFLAGS += -seg1addr $(libGDLAccess_PREBIND_ADDR) #GDLAccess_LDFLAGS += -seg1addr $(libGDLAccess_PREBIND_ADDR) endif SOPE/sope-gdl1/GDLAccess/EOModelGroup.h0000644000000000000000000000417412242733417016332 0ustar rootroot// $Id: EOModelGroup.h 1 2004-08-20 10:38:46Z znek $ #ifndef __EOAccess_EOModelGroup_H__ #define __EOAccess_EOModelGroup_H__ #import @class NSDictionary; @class EOGlobalID, EOFetchSpecification; @class EOModelGroup, EOModel, EOEntity, EORelationship; @protocol EOModelGroupClassDelegation < NSObject > - (EOModelGroup *)defaultModelGroup; @end @protocol EOModelGroupDelegation < NSObject > - (Class)entity:(EOEntity *)_entity classForObjectWithGlobalID:(EOGlobalID *)_oid; - (Class)entity:(EOEntity *)_entity failedToLookupClassNamed:(NSString *)_className; - (EOEntity *)relationship:(EORelationship *)_relship failedToLookupDestinationNamed:(NSString *)_entityName; - (EOEntity *)subEntityForEntity:(EOEntity *)_entity primaryKey:(NSDictionary *)_pkey isFinal:(BOOL *)_flag; - (EOModel *)modelGroup:(EOModelGroup *)_group entityNamed:(NSString *)_name; - (EORelationship *)entity:(EOEntity *)_entity relationshipForRow:(NSDictionary *)_row relationship:(EORelationship *)_relship; @end @class NSArray, NSMutableDictionary; @interface EOModelGroup : NSObject { NSMutableDictionary *nameToModel; id delegate; /* non-retained */ } + (void)setDefaultGroup:(EOModelGroup *)_group; + (EOModelGroup *)defaultGroup; + (EOModelGroup *)globalModelGroup; /* class delegate */ + (void)setClassDelegate:(id)_delegate; + (id)classDelegate; /* instance delegate */ - (void)setDelegate:(id)_delegate; - (id)delegate; /* models */ - (void)addModel:(EOModel *)_model; - (void)removeModel:(EOModel *)_model; - (EOModel *)modelNamed:(NSString *)_name; - (NSArray *)modelNames; - (NSArray *)models; - (EOModel *)modelWithPath:(NSString *)_path; - (EOModel *)addModelWithFile:(NSString *)_path; - (void)loadAllModelObjects; /* entities */ - (EOEntity *)entityForObject:(id)_object; - (EOEntity *)entityNamed:(NSString *)_name; - (EOFetchSpecification *)fetchSpecificationNamed:(NSString *)_name entityNamed:(NSString *)_entityName; @end #endif /* __EOAccess_EOModelGroup_H__ */ SOPE/sope-gdl1/GDLAccess/EOSQLQualifier.h0000644000000000000000000000761312242733417016557 0ustar rootroot/* EOSQLQualifier.h Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Helge Hess Date: September 1996 November 1999 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __EOSQLQualifier_h__ #define __EOSQLQualifier_h__ #import #import /* EOSQLQualifier TODO: document Note: the expression context is the EOSQLExpression. */ @class NSDictionary, NSString, NSMutableSet; @class EOEntity, EORelationship, EOExpressionArray, EOSQLQualifier; @class EOSQLExpression; @protocol EOQualifierSQLGeneration - (NSString *)sqlStringForSQLExpression:(EOSQLExpression *)_sqlExpr; - (EOQualifier *)schemaBasedQualifierWithRootEntity:(EOEntity *)_entity; @end @interface EOSQLQualifier : EOQualifier < NSCopying > { /* TODO: these should be GCMutableSet */ NSMutableSet *relationshipPaths; NSMutableSet *additionalEntities; /* Garbage collectable objects */ EOEntity *entity; EOExpressionArray *content; BOOL usesDistinct; } /* Combining qualifiers */ - (void)negate; - (void)conjoinWithQualifier:(EOSQLQualifier*)qualifier; - (void)disjoinWithQualifier:(EOSQLQualifier*)qualifier; /* Getting the entity */ - (EOEntity *)entity; /* Checking the definition */ - (BOOL)isEmpty; /* Accessing the distinct selection */ - (void)setUsesDistinct:(BOOL)flag; - (BOOL)usesDistinct; /* Accessing the relationships referred within qualifier */ - (NSMutableSet*)relationshipPaths; - (NSMutableSet*)additionalEntities; /* Getting the expression value */ - (NSString*)expressionValueForContext:(id)ctx; /* Private methods */ - (void)_computeRelationshipPaths:(NSArray *)_relationshipPaths; - (void)_computeRelationshipPaths; - (EOSQLQualifier *)sqlQualifierForEntity:(EOEntity *)_entity; @end @interface EOSQLQualifier(QualifierCreation) - (id)initWithEntity:(EOEntity *)_entity qualifierFormat:(NSString *)_qualifierFormat, ...; - (id)initWithEntity:(EOEntity *)_entity qualifierFormat:(NSString *)_qualifierFormat argumentsArray:(NSArray *)_args; /* Creating instances */ + (EOSQLQualifier *)qualifierForRow:(NSDictionary *)row entity:(EOEntity *)entity; + (EOSQLQualifier *)qualifierForPrimaryKey:(NSDictionary *)key entity:(EOEntity *)entity; + (EOSQLQualifier *)qualifierForRow:(NSDictionary *)row relationship:(EORelationship *)relationship; + (EOSQLQualifier *)qualifierForObject:(id)sourceObject relationship:(EORelationship *)relationship; @end @interface EOQualifier(SQLQualifier) - (EOSQLQualifier *)sqlQualifierForEntity:(EOEntity *)_entity; @end @interface EOAndQualifier(SQLGeneration) < EOQualifierSQLGeneration > @end @interface EOOrQualifier(SQLGeneration) < EOQualifierSQLGeneration > @end @interface EONotQualifier(SQLGeneration) < EOQualifierSQLGeneration > @end @interface EOKeyValueQualifier(SQLGeneration) < EOQualifierSQLGeneration > @end @interface EOKeyComparisonQualifier(SQLGeneration) < EOQualifierSQLGeneration > @end #endif /* __EOSQLQualifier_h__ */ /* Local Variables: c-basic-offset: 4 tab-width: 8 End: */ SOPE/sope-gdl1/GDLAccess/FoundationExt/0000755000000000000000000000000012242733417016441 5ustar rootrootSOPE/sope-gdl1/GDLAccess/FoundationExt/GNUmakefile0000644000000000000000000000057712242733417020524 0ustar rootroot# GNUstep makefile include ../../../config.make include $(GNUSTEP_MAKEFILES)/common.make include ../../Version include ../Version SUBPROJECT_NAME = FoundationExt FoundationExt_OBJC_FILES = \ DefaultScannerHandler.m \ PrintfFormatScanner.m \ FormatScanner.m \ ADDITIONAL_INCLUDE_DIRS += -I. -I.. -I../../../sope-core/NGExtensions include $(GNUSTEP_MAKEFILES)/subproject.make SOPE/sope-gdl1/GDLAccess/FoundationExt/COPYING0000644000000000000000000000171612242733417017501 0ustar rootroot Copyright (C) 1995, 1996, 1997, 1998 Ovidiu Predescu and Mircea Oancea. All rights reserved. Permission to use, copy, modify, and distribute this software and its documentation for ANY purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. This software may be included in any commercial product provided that its distribution contain the libFoundation copyright notice and this permission notice. We disclaim all warranties with regard to this software, including all implied warranties of merchantability and fitness, in no event shall we be liable for any special, indirect or consequential damages or any damages whatsoever resulting from loss of use, data or profits, whether in an action of contract, negligence or other tortious action, arising out of or in connection with the use or performance of this software. SOPE/sope-gdl1/GDLAccess/FoundationExt/PrintfFormatScanner.m0000644000000000000000000000435312242733417022551 0ustar rootroot/* PrintfFormatScanner.m Copyright (C) 1995, 1996 Ovidiu Predescu and Mircea Oancea. All rights reserved. Author: Ovidiu Predescu This file is part of libFoundation. Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. We disclaim all warranties with regard to this software, including all implied warranties of merchantability and fitness, in no event shall we be liable for any special, indirect or consequential damages or any damages whatsoever resulting from loss of use, data or profits, whether in an action of contract, negligence or other tortious action, arising out of or in connection with the use or performance of this software. */ #import #include "PrintfFormatScanner.h" #include "DefaultScannerHandler.h" @implementation PrintfFormatScanner - (NSString *)stringWithFormat:(NSString *)format arguments:(va_list)args { va_list va; #ifdef __va_copy // args being NULL breaks heavily on amd64. It shouldn't be // possible to be NULL at all, but we're called with an array as // argument instead of a va_list in EOSQLQualifier and are thus // calling __va_copy on an array, which is something that really // shouldn't be done. Checking whether args is NULL breaks on arm // and alpha however, because a va_list isn't a pointer, so we // don't do the check on arm and alpha. #if !defined(__arm__) && !defined(__alpha__) if (!args) return format; #endif __va_copy(va, args); #else va = args; #endif self->result = [NSMutableString stringWithCapacity:[format cStringLength]]; [self parseFormatString:format context:&va]; return [[self->result copy] autorelease]; } - (BOOL)handleOrdinaryString:(NSString *)string { [self->result appendString:string]; return YES; } - (BOOL)handleFormatSpecifierWithContext:(void *)context { [self->result appendString:[handler stringForArgument:context scanner:self]]; return YES; } @end /* PrintfFormatScanner */ SOPE/sope-gdl1/GDLAccess/FoundationExt/PrintfFormatScanner.h0000644000000000000000000000264112242733417022542 0ustar rootroot/* PrintfFormatScanner.h Copyright (C) 1995, 1996 Ovidiu Predescu and Mircea Oancea. All rights reserved. Author: Ovidiu Predescu This file is part of libFoundation. Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. We disclaim all warranties with regard to this software, including all implied warranties of merchantability and fitness, in no event shall we be liable for any special, indirect or consequential damages or any damages whatsoever resulting from loss of use, data or profits, whether in an action of contract, negligence or other tortious action, arising out of or in connection with the use or performance of this software. */ #ifndef __PrintfFormatScanner_h__ #define __PrintfFormatScanner_h__ #if XCODE_SELF_COMPILE # include "FormatScanner.h" #else # include #endif @class NSMutableString; @interface PrintfFormatScanner : FormatScanner { NSMutableString *result; } - (NSString *)stringWithFormat:(NSString *)format arguments:(va_list)args; @end #endif /* __PrintfFormatScanner_h__ */ /* Local Variables: c-basic-offset: 4 tab-width: 8 End: */ SOPE/sope-gdl1/GDLAccess/FoundationExt/COPYRIGHT0000644000000000000000000000027412242733417017737 0ustar rootroot Copyright (C) 1995, 1996 Ovidiu Predescu and Mircea Oancea. All rights reserved. Author: Ovidiu Predescu Helge Hess SOPE/sope-gdl1/GDLAccess/FoundationExt/DefaultScannerHandler.h0000644000000000000000000000323012242733417023004 0ustar rootroot/* DefaultScannerHandler.h Copyright (C) 1995, 1996 Ovidiu Predescu and Mircea Oancea. All rights reserved. Author: Ovidiu Predescu This file is part of libFoundation. Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. We disclaim all warranties with regard to this software, including all implied warranties of merchantability and fitness, in no event shall we be liable for any special, indirect or consequential damages or any damages whatsoever resulting from loss of use, data or profits, whether in an action of contract, negligence or other tortious action, arising out of or in connection with the use or performance of this software. */ #ifndef __DefaultScannerHandler_h__ #define __DefaultScannerHandler_h__ #include @class NSString; @class FormatScanner; @interface DefaultScannerHandler : NSObject { IMP specHandler[256]; } - (NSString *)stringForArgument:(void *)arg scanner:(id)aFormatScanner; - (NSString *)unknownSpecifier:(void *)arg scanner:(id)scanner; @end @class NSEnumerator; @interface DefaultEnumScannerHandler : NSObject { IMP specHandler[256]; } - (NSString *)stringForArgument:(void *)arg scanner:(id)aFormatScanner; - (NSString *)unknownSpecifier:(void *)arg scanner:(id)scanner; @end #endif /* __DefaultScannerHandler_h__ */ /* Local Variables: c-basic-offset: 4 tab-width: 8 End: */ SOPE/sope-gdl1/GDLAccess/FoundationExt/LICENSE0000644000000000000000000000136212242733417017450 0ustar rootroot Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. We disclaim all warranties with regard to this software, including all implied warranties of merchantability and fitness, in no event shall we be liable for any special, indirect or consequential damages or any damages whatsoever resulting from loss of use, data or profits, whether in an action of contract, negligence or other tortious action, arising out of or in connection with the use or performance of this software. SOPE/sope-gdl1/GDLAccess/FoundationExt/FormatScanner.m0000644000000000000000000002167712242733417021376 0ustar rootroot/* FormatScanner.m Copyright (C) 1995, 1996 Ovidiu Predescu and Mircea Oancea. All rights reserved. Author: Ovidiu Predescu This file is part of libFoundation. Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. We disclaim all warranties with regard to this software, including all implied warranties of merchantability and fitness, in no event shall we be liable for any special, indirect or consequential damages or any damages whatsoever resulting from loss of use, data or profits, whether in an action of contract, negligence or other tortious action, arising out of or in connection with the use or performance of this software. */ #include #include "common.h" #import #import #import #import //#include #include "FormatScanner.h" @implementation FormatScanner enum { SPECIFIER_SIZE = 1000 }; /* This value should be sufficient */ - (id)init { specifierSize = SPECIFIER_SIZE; currentSpecifier = MallocAtomic(specifierSize); allowFlags = YES; allowWidth = YES; allowPeriod = YES; allowPrecision = YES; allowModifier = YES; return self; } - (void)dealloc { if (self->currentSpecifier) free(currentSpecifier); RELEASE(self->handler); [super dealloc]; } - (void)setFormatScannerHandler:(id)anObject { ASSIGN(self->handler, anObject); } - (id)setAllowOnlySpecifier:(BOOL)flag { allowFlags = !flag; allowWidth = !flag; allowPeriod = !flag; allowPrecision = !flag; allowModifier = !flag; return self; } - (id)setAllowFlags:(BOOL)flag { allowFlags = flag; return self; } - (BOOL)allowFlags { return allowFlags; } - (id)setAllowWidth:(BOOL)flag { allowWidth = flag; return self; } - (BOOL)allowWidth { return allowWidth; } - (id)setAllowPeriod:(BOOL)flag { allowPeriod = flag; return self; } - (BOOL)allowPeriod { return allowPeriod; } - (id)setAllowPrecision:(BOOL)flag { allowPrecision = flag; return self; } - (BOOL)allowPrecision { return allowPrecision; } - (id)setAllowModifier:(BOOL)flag { allowModifier = flag; return self; } - (BOOL)allowModifier { return allowModifier; } - (id)formatScannerHandler { return handler; } - (unsigned int)flags { return self->flags; } - (int)width { return self->width; } - (int)precision { return self->precision; } - (char)modifier { return self->modifier; } - (char)characterSpecifier { return self->characterSpecifier; } - (const char *)currentSpecifier { return self->currentSpecifier; } #define CHECK_END \ if(i >= length) { \ /* An unterminated specifier. Break the loop. */ \ [self handleOrdinaryString: \ [NSString stringWithCString:currentSpecifier]]; \ goto _return; \ } /* Scans the format string looking after specifiers. Doesn't handle '*' as a valid width or precision. */ - (BOOL)parseFormatString:(NSString*)format context:(void *)context { NSRange searchRange, foundRange; int i, length; unichar ch; NSCharacterSet *decimals; i = 0; length = [format length]; decimals = [NSCharacterSet decimalDigitCharacterSet]; *currentSpecifier = 0; specifierLen = 0; while (i < length) { searchRange.location = i; searchRange.length = length - i; foundRange = [format rangeOfString:@"%" options:0 range:searchRange]; if (foundRange.length == 0) foundRange.location = length; searchRange.length = foundRange.location - searchRange.location; if (searchRange.length) { if (![self handleOrdinaryString: [format substringWithRange:searchRange]]) return NO; } i = foundRange.location; CHECK_END i++; strcpy(currentSpecifier, "%"); specifierLen = 1; CHECK_END flags = width = precision = modifier = characterSpecifier = 0; /* Check for flags. */ if (self->allowFlags) { for (; i < length; i++) { ch = [format characterAtIndex:i]; switch(ch) { case '#': strcat(currentSpecifier, "#"); flags |= FS_ALTERNATE_FORM; break; case '0': strcat(currentSpecifier, "0"); flags |= FS_ZERO; break; case '-': strcat(currentSpecifier, "-"); flags |= FS_MINUS_SIGN; break; case '+': strcat(currentSpecifier, "+"); flags |= FS_PLUS_SIGN; break; case ' ': strcat(currentSpecifier, " "); flags |= FS_BLANK; break; default: goto quit; } if (++specifierLen == specifierSize) { currentSpecifier = Realloc(currentSpecifier, specifierSize += SPECIFIER_SIZE); } } quit: CHECK_END } /* Check for width. */ if (self->allowWidth) { for(; i < length; i++) { char str[2] = { 0, 0 }; ch = [format characterAtIndex:i]; if (![decimals characterIsMember:ch]) break; str[0] = ch; strcat(currentSpecifier, str); if(++specifierLen == specifierSize) { currentSpecifier = Realloc(currentSpecifier, specifierSize += SPECIFIER_SIZE); } width = 10 * width + (ch - '0'); } CHECK_END } /* Check for period. */ if (self->allowPeriod) { ch = [format characterAtIndex:i]; if(ch == '.') { char str[2] = { ch, 0 }; strcat(currentSpecifier, str); if(++specifierLen == specifierSize) { currentSpecifier = Realloc(currentSpecifier, specifierSize += SPECIFIER_SIZE); } i++; CHECK_END } } /* Check for precision. */ if (self->allowPrecision) { for(; i < length; i++) { char str[2] = { 0, 0 }; ch = [format characterAtIndex:i]; if (![decimals characterIsMember:ch]) break; str[0] = ch; strcat(currentSpecifier, str); if(++specifierLen == specifierSize) { currentSpecifier = Realloc(currentSpecifier, specifierSize += SPECIFIER_SIZE); } precision = 10 * precision + (ch - '0'); } CHECK_END } /* Check for data-width modifier. */ if (allowModifier) { ch = [format characterAtIndex:i]; if (ch == 'h' || ch == 'l') { char str[2] = { ch, 0 }; strcat(currentSpecifier, str); if (++specifierLen == specifierSize) { currentSpecifier = Realloc(currentSpecifier, specifierSize += SPECIFIER_SIZE); } modifier = ch; i++; CHECK_END } } /* Finally, the conversion character. */ { char str[2] = { 0, 0 }; ch = [format characterAtIndex:i]; str[0] = ch; strcat(currentSpecifier, str); if(++specifierLen == specifierSize) { currentSpecifier = Realloc(currentSpecifier, specifierSize += SPECIFIER_SIZE); } characterSpecifier = ch; } if (![self handleFormatSpecifierWithContext:context]) return NO; i++; *currentSpecifier = 0; specifierLen = 0; CHECK_END } _return: return YES; } - (BOOL)handleOrdinaryString:(NSString*)string { return YES; } - (BOOL)handleFormatSpecifierWithContext:(void*)context { return YES; } @end /* FormatScanner */ /* Local Variables: c-basic-offset: 4 tab-width: 8 End: */ SOPE/sope-gdl1/GDLAccess/FoundationExt/FormatScanner.h0000644000000000000000000001022212242733417021351 0ustar rootroot/* FormatScanner.h Copyright (C) 1995, 1996 Ovidiu Predescu and Mircea Oancea. All rights reserved. Author: Ovidiu Predescu This file is part of libFoundation. Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. We disclaim all warranties with regard to this software, including all implied warranties of merchantability and fitness, in no event shall we be liable for any special, indirect or consequential damages or any damages whatsoever resulting from loss of use, data or profits, whether in an action of contract, negligence or other tortious action, arising out of or in connection with the use or performance of this software. */ #ifndef __FormatScanner_h__ #define __FormatScanner_h__ #include #include @class NSString; /* * A FormatScanner scans a NSString format. When it reaches a specifier * similar to printf(3S), it calls a handler object previously registered to * it. The handler object is usually inherited from the DefaultScannerHandler * class. The handler object maintains a mapping between format characters and * selectors that have to be called when a specifier is found in the format * string. The selector must have exactly two arguments: the first one is a * pointer to a va_list and the second one is the format scanner. It is the * responsability of handler to increase the pointer to the va_list with the * size of the object it handles. During the execution of the method the * scanner calls, the handler can ask the scanner about the flags, width, * precision, modifiers and the specifier character. The method should return a * NSString object that represents the converted object. * * FormatScanner is an abstract class. Use the PrintfFormatScanner class that * is used to write printf-like functions. Additional classes can be inherited * to write scanf-like functions. */ typedef enum { FS_ALTERNATE_FORM = 1, FS_ZERO = 2, FS_MINUS_SIGN = 4, FS_PLUS_SIGN = 8, FS_BLANK = 16 } FormatScannerFlags; @interface FormatScanner : NSObject { int specifierLen, specifierSize; char *currentSpecifier; id handler; unsigned flags; int width; int precision; char modifier; char characterSpecifier; BOOL allowFlags:1; BOOL allowWidth:1; BOOL allowPeriod:1; BOOL allowPrecision:1; BOOL allowModifier:1; } /* This method start the searching of specifiers in `format'. `context' is passed in handleFormatSpecifierWithContext: unmodified. */ - (BOOL)parseFormatString:(NSString*)format context:(void*)context; /* This method is called whenever a string between two specifiers is found. Rewrite it in subclasses to perform whatever action you want (for example to collect them in a result string if you're doing printf). The method should return NO if the scanning of format should stop. */ - (BOOL)handleOrdinaryString:(NSString*)string; /* This method is called whenever a format specifier is found in `format'. Again, rewrite this method in subclasses to perform whatever action you want. The method should return NO if the scanning of the format should stop. */ - (BOOL)handleFormatSpecifierWithContext:(void*)context; - (void)setFormatScannerHandler:(id)anObject; - (id)formatScannerHandler; - (unsigned int)flags; - (int)width; - (int)precision; - (char)modifier; - (char)characterSpecifier; - (const char*)currentSpecifier; - (id)setAllowFlags:(BOOL)flag; - (id)setAllowWidth:(BOOL)flag; - (id)setAllowPeriod:(BOOL)flag; - (id)setAllowPrecision:(BOOL)flag; - (id)setAllowModifier:(BOOL)flag; /* A shorthand for sending all -setAllow* messages with !flag as argument */ - (id)setAllowOnlySpecifier:(BOOL)flag; - (BOOL)allowFlags; - (BOOL)allowWidth; - (BOOL)allowPeriod; - (BOOL)allowPrecision; - (BOOL)allowModifier; @end #endif /* __FormatScanner_h__ */ /* Local Variables: c-basic-offset: 4 tab-width: 8 End: */ SOPE/sope-gdl1/GDLAccess/FoundationExt/DefaultScannerHandler.m0000644000000000000000000000460212242733417023015 0ustar rootroot/* DefaultScannerHandler.m Copyright (C) 1995, 1996 Ovidiu Predescu and Mircea Oancea. All rights reserved. Author: Ovidiu Predescu Helge Hess This file is part of libFoundation. Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. We disclaim all warranties with regard to this software, including all implied warranties of merchantability and fitness, in no event shall we be liable for any special, indirect or consequential damages or any damages whatsoever resulting from loss of use, data or profits, whether in an action of contract, negligence or other tortious action, arising out of or in connection with the use or performance of this software. */ #import #include "FormatScanner.h" #include "DefaultScannerHandler.h" @implementation DefaultScannerHandler - (id)init { int i; IMP unknownSpecifierIMP = [self methodForSelector:@selector(unknownSpecifier:scanner:)]; for(i = 0; i < 256; i++) specHandler[i] = unknownSpecifierIMP; return self; } - (NSString *)unknownSpecifier:(void *)arg scanner:scanner { char str[] = { [scanner characterSpecifier], 0 }; return [NSString stringWithCString:str]; } - (NSString *)stringForArgument:(void *)arg scanner:scanner { return (*specHandler[(int)[scanner characterSpecifier]]) (self, _cmd, arg, scanner); } @end /* DefaultScannerHandler */ @implementation DefaultEnumScannerHandler - (id)init { int i; IMP unknownSpecifierIMP; unknownSpecifierIMP = [self methodForSelector:@selector(unknownSpecifier:scanner:)]; for(i = 0; i < 256; i++) self->specHandler[i] = unknownSpecifierIMP; return self; } - (NSString *)unknownSpecifier:(void *)arg scanner:scanner { char str[] = { [scanner characterSpecifier], 0 }; return [NSString stringWithCString:str]; } - (NSString *)stringForArgument:(void *)arg scanner:scanner { return (*specHandler[(int)[scanner characterSpecifier]]) (self, _cmd, arg, scanner); } @end /* DefaultEnumScannerHandler */ /* Local Variables: c-basic-offset: 4 tab-width: 8 End: */ SOPE/sope-gdl1/GDLAccess/EOAdaptor.m0000644000000000000000000003162212242733417015652 0ustar rootroot/* EOAttributeOrdering.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "EOAdaptor.h" #include "EOAdaptorChannel.h" #include "EOAdaptorContext.h" #include "EOAttribute.h" #include "EOFExceptions.h" #include "EOModel.h" #include "EOSQLExpression.h" #include "common.h" @implementation EOAdaptor + (id)adaptorWithModel:(EOModel*)_model { /* Check first to see if the adaptor class exists in the running program by testing the existence of [_model adaptorClassName]. */ NSString *adaptorName = [_model adaptorName]; Class adaptorClass = NSClassFromString([_model adaptorClassName]); id adaptor; adaptor = adaptorClass ? AUTORELEASE([[adaptorClass alloc] initWithName:adaptorName]) : [self adaptorWithName:adaptorName]; [adaptor setModel:_model]; return adaptor; } + (NSArray *)adaptorSearchPathes { // TODO: add support for Cocoa static NSArray *searchPathes = nil; NSMutableArray *ma; id tmp; if (searchPathes != nil) return searchPathes; ma = [NSMutableArray arrayWithCapacity:8]; #if GNUSTEP_BASE_LIBRARY NSEnumerator *libraryPaths; NSString *directory, *suffix; suffix = [self libraryDriversSubDir]; libraryPaths = [NSStandardLibraryPaths() objectEnumerator]; while ((directory = [libraryPaths nextObject])) [ma addObject: [directory stringByAppendingPathComponent: suffix]]; #else NSDictionary *env; env = [[NSProcessInfo processInfo] environment]; if ((tmp = [env objectForKey:@"GNUSTEP_PATHPREFIX_LIST"]) == nil) tmp = [env objectForKey:@"GNUSTEP_PATHLIST"]; tmp = [tmp componentsSeparatedByString:@":"]; if ([tmp count] > 0) { NSEnumerator *e; e = [tmp objectEnumerator]; while ((tmp = [e nextObject])) { if (![tmp hasSuffix:@"/"]) tmp = [tmp stringByAppendingString:@"/"]; tmp = [tmp stringByAppendingFormat:@"Library/GDLAdaptors-%i.%i", GDL_MAJOR_VERSION, GDL_MINOR_VERSION]; if ([ma containsObject:tmp] || tmp == nil) continue; [ma addObject:tmp]; } } #endif tmp = [NSString stringWithFormat: #ifdef CGS_LIBDIR_NAME [CGS_LIBDIR_NAME stringByAppendingString:@"/sope-%i.%i/dbadaptors"], #else @"/lib/sope-%i.%i/dbadaptors", #endif SOPE_MAJOR_VERSION, SOPE_MINOR_VERSION]; #ifdef FHS_INSTALL_ROOT [ma addObject:[FHS_INSTALL_ROOT stringByAppendingPathComponent:tmp]]; #endif [ma addObject:[@"/usr/local/" stringByAppendingString:tmp]]; [ma addObject:[@"/usr/" stringByAppendingString:tmp]]; searchPathes = [ma copy]; if ([searchPathes count] == 0) NSLog(@"%s: empty library search path !", __PRETTY_FUNCTION__); return searchPathes; } + (id)adaptorWithName:(NSString *)adaptorName { int i, count; NSBundle *bundle; NSString *adaptorBundlePath = nil; Class adaptorClass = Nil; bundle = [NSBundle mainBundle]; /* Check error */ if ((adaptorName == nil) || [adaptorName isEqual:@""]) return nil; /* Look in application bundle */ bundle = [NSBundle mainBundle]; adaptorBundlePath = [bundle pathForResource:adaptorName ofType:@"gdladaptor"]; /* Look in standard paths */ if (adaptorBundlePath == nil) { NSFileManager *fm; NSString *dirname; NSArray *paths; fm = [NSFileManager defaultManager]; paths = [self adaptorSearchPathes]; dirname = [adaptorName stringByAppendingPathExtension:@"gdladaptor"]; /* Loop through the paths and check each one */ for (i = 0, count = [paths count]; i < count; i++) { NSString *p; BOOL isDir; p = [[paths objectAtIndex:i] stringByAppendingPathComponent:dirname]; if (![fm fileExistsAtPath:p isDirectory:&isDir]) continue; if (!isDir) continue; adaptorBundlePath = p; break; } } /* Make adaptor bundle */ bundle = adaptorBundlePath ? [NSBundle bundleWithPath:adaptorBundlePath] : (NSBundle *)nil; /* Check bundle */ if (bundle == nil) { NSLog(@"EOAdaptor: cannot find adaptor bundle: '%@'", adaptorName); #if 0 [[[[CannotFindAdaptorBundleException alloc] initWithFormat:@"Cannot find adaptor bundle '%@'", adaptorName] autorelease] raise]; #endif return nil; } /* load bundle */ if (![bundle load]) { NSLog(@"Cannot load adaptor bundle '%@'", adaptorName); #if 1 [[[[InvalidAdaptorBundleException alloc] initWithFormat:@"Cannot load adaptor bundle '%@'", adaptorName] autorelease] raise]; #endif return nil; } /* Get the adaptor bundle "infoDictionary", and pricipal class, ie. the adaptor class. Other info about the adaptor should be put in the bundle's "Info.plist" file (property list format - see NSBundle class documentation for details about reserved keys in this dictionary property list containing one entry whose key is adaptorClassName. It identifies the actual adaptor class from the bundle. */ adaptorClass = [bundle principalClass]; if (adaptorClass == Nil) { NSLog(@"The adaptor bundle '%@' at '%@' doesn't contain " @"a principal class (infoDict=%@)", adaptorName, [bundle bundlePath], [bundle infoDictionary]); [[[InvalidAdaptorBundleException alloc] initWithFormat:@"The adaptor bundle '%@' doesn't contain " @"a principal class (infoDict=%@)", adaptorName, [bundle infoDictionary]] raise]; } return AUTORELEASE([[adaptorClass alloc] initWithName:adaptorName]); } + (NSString *)adaptorNameForURLScheme:(NSString *)_scheme { // TODO: map scheme to adaptors (eg 'postgresql://' to PostgreSQL // TODO: hack in some known names if ([_scheme isEqualToString:@"postgresql"]) return @"PostgreSQL"; if ([_scheme isEqualToString:@"sybase"]) return @"Sybase10"; if ([_scheme isEqualToString:@"sqlite"]) return @"SQLite3"; if ([_scheme isEqualToString:@"oracle"]) return @"Oracle8"; if ([_scheme isEqualToString:@"mysql"]) return @"MySQL"; if ([_scheme isEqualToString:@"http"]) { NSLog(@"WARNING(%s): asked for 'http' URL, " @"please fix the URLs to 'postgresql'!", __PRETTY_FUNCTION__); return @"PostgreSQL"; } return _scheme; } + (NSString *)libraryDriversSubDir { return [NSString stringWithFormat:@"GDLAdaptors-%i.%i", GDL_MAJOR_VERSION, GDL_MINOR_VERSION]; } - (NSDictionary *)connectionDictionaryForNSURL:(NSURL *)_url { /* "Database URLs" We use the schema: postgresql://[user]:[password]@[host]:[port]/[dbname]/[tablename] */ NSMutableDictionary *md; id tmp; md = [NSMutableDictionary dictionaryWithCapacity:8]; if ((tmp = [_url host]) != nil) [md setObject:tmp forKey:@"hostName"]; if ((tmp = [_url port]) != nil) [md setObject:tmp forKey:@"port"]; if ((tmp = [_url user]) != nil) [md setObject:tmp forKey:@"userName"]; if ((tmp = [_url password]) != nil) [md setObject:tmp forKey:@"password"]; /* extract dbname */ tmp = [_url path]; if ([tmp hasPrefix:@"/"]) tmp = [tmp substringFromIndex:1]; if ([tmp length] > 0) { NSRange r; r = [tmp rangeOfString:@"/"]; if (r.length > 0) tmp = [tmp substringToIndex:r.location]; if ([tmp length] > 0) [md setObject:tmp forKey:@"databaseName"]; } return md; } + (id)adaptorForNSURL:(NSURL *)_url { EOAdaptor *adaptor; NSString *adaptorName; NSDictionary *condict; if (_url == nil) return nil; adaptorName = [self adaptorNameForURLScheme:[_url scheme]]; adaptor = [self adaptorWithName:adaptorName]; if ((condict = [adaptor connectionDictionaryForNSURL:_url]) != nil) [adaptor setConnectionDictionary:condict]; return adaptor; } + (id)adaptorForURL:(id)_url { NSURL *url; if (_url == nil) return nil; if ([_url isKindOfClass:[NSURL class]]) url = _url; else if ((url = [NSURL URLWithString:[_url stringValue]]) == nil) { NSLog(@"ERROR(%s): could not parse URL: '%@'", __PRETTY_FUNCTION__, _url); return nil; } return [self adaptorForNSURL:url]; } - (id)initWithName:(NSString*)_name { ASSIGN(self->name, _name); self->contexts = [[NSMutableArray allocWithZone:[self zone]] init]; return self; } - (void)dealloc { RELEASE(self->model); RELEASE(self->name); RELEASE(self->connectionDictionary); RELEASE(self->pkeyGeneratorDictionary); RELEASE(self->contexts); [super dealloc]; } /* accessors */ - (void)setConnectionDictionary:(NSDictionary*)_dictionary { if([self hasOpenChannels]) { [NSException raise:NSInvalidArgumentException format:@"Cannot set the connection dictionary " @"while the adaptor is connected!"]; } ASSIGN(self->connectionDictionary, _dictionary); [self->model setConnectionDictionary:_dictionary]; } - (NSDictionary *)connectionDictionary { return self->connectionDictionary; } - (BOOL)hasValidConnectionDictionary { return NO; } - (EOAdaptorContext*)createAdaptorContext { return AUTORELEASE([[[self adaptorContextClass] alloc] initWithAdaptor:self]); } - (NSArray *)contexts { NSMutableArray *ma; unsigned i, count; if ((count = [self->contexts count]) == 0) return nil; ma = [NSMutableArray arrayWithCapacity:count]; for (i = 0; i < count; i++) [ma addObject:[[self->contexts objectAtIndex:i] nonretainedObjectValue]]; return ma; } /* Setting pkey generation info */ - (void)setPkeyGeneratorDictionary:(NSDictionary*)aDictionary { ASSIGN(self->pkeyGeneratorDictionary, aDictionary); [self->model setPkeyGeneratorDictionary:aDictionary]; } - (NSDictionary*)pkeyGeneratorDictionary { return self->pkeyGeneratorDictionary; } // notifications - (void)contextDidInit:aContext { [self->contexts addObject:[NSValue valueWithNonretainedObject:aContext]]; } - (void)contextWillDealloc:aContext { int i; for (i = [contexts count]-1; i >= 0; i--) { if ([[contexts objectAtIndex:i] nonretainedObjectValue] == aContext) { [contexts removeObjectAtIndex:i]; break; } } } - (BOOL)hasOpenChannels { int i; for (i = [contexts count] - 1; i >= 0; i--) { EOAdaptorContext* ctx = [[contexts objectAtIndex:i] nonretainedObjectValue]; if ([ctx hasOpenChannels]) return YES; } return NO; } - (id)formatAttribute:(EOAttribute *)_attribute { return [_attribute expressionValueForContext:nil]; } - (id)formatValue:(id)_value forAttribute:(EOAttribute *)attribute { if (_value == nil) _value = [NSNull null]; return [_value expressionValueForContext:nil]; } - (void)reportError:(NSString*)error { if(delegateWillReportError) { if([delegate adaptor:self willReportError:error] == NO) return; } NSLog(@"%@ adaptor error: %@", name, error); } - (void)setDelegate:(id)_delegate { self->delegate = _delegate; self->delegateWillReportError = [self->delegate respondsToSelector: @selector(adaptor:willReportError:)]; } - (void)setModel:(EOModel *)_model { ASSIGN(self->model, _model); [self setConnectionDictionary:[_model connectionDictionary]]; [self setPkeyGeneratorDictionary:[_model pkeyGeneratorDictionary]]; } - (EOModel *)model { return self->model; } - (NSString *)name { return self->name; } - (Class)expressionClass { return [EOSQLExpression class]; } - (Class)adaptorContextClass { return [EOAdaptorContext class]; } - (Class)adaptorChannelClass { return [EOAdaptorChannel class]; } - (BOOL)attributeAllowedInDistinctSelects:(EOAttribute *)_attr { return YES; } - (BOOL)isValidQualifierType:(NSString*)typeName { return NO; } - (id)delegate { return self->delegate; } // description - (NSString *)description { return [NSString stringWithFormat: @"<%@[0x%p]: name=%@ " @"model=%s connection-dict=%s>", NSStringFromClass([self class]), self, [self name], [self model] ? "yes" : "no", [self connectionDictionary] ? "yes" : "no"]; } @end /* EOAdaptor */ @implementation EOAdaptor(EOF2Additions) - (BOOL)canServiceModel:(EOModel *)_model { return YES; } @end SOPE/sope-gdl1/GDLAccess/EOSQLQualifier.m0000644000000000000000000004441012242733417016560 0ustar rootroot/* EOSQLQualifier.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Helge Hess Date: September 1996 November 1999 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #import "common.h" #import "EOSQLQualifier.h" #import "EOAdaptor.h" #import "EOAttribute.h" #import "EOEntity.h" #import "EOExpressionArray.h" #import "EOFExceptions.h" #import "EORelationship.h" #import "EOSQLExpression.h" #include #include #import "EOQualifierScanner.h" #if LIB_FOUNDATION_LIBRARY # include # include #else # include "DefaultScannerHandler.h" # include "PrintfFormatScanner.h" #endif @interface EOQualifierJoinHolder : NSObject { id source; id destination; } + (id)valueForSource:(id)source destination:(id)destination; - (NSString*)expressionValueForContext:(EOSQLExpression*)context; - (id)source; - (id)destination; @end @implementation EOQualifierJoinHolder static Class AttributeClass = Nil; static EONull *null = nil; + (void)initialize { AttributeClass = [EOAttribute class]; null = [[NSNull null] retain]; } + (id)valueForSource:(id)_source destination:(id)_destination { EOQualifierJoinHolder *value; value = [[[self alloc] init] autorelease]; value->source = [_source retain]; value->destination = [_destination retain]; return value; } - (NSString *)expressionValueForContext:(EOSQLExpression *)context { NSMutableString *result = nil; EOAdaptor *adaptor = nil; NSString *formattedLeft = nil; NSString *formattedRight = nil; BOOL checkNull = NO; adaptor = [context adaptor]; if ([source isKindOfClass:AttributeClass]) { formattedLeft = [(EOAttribute *)source expressionValueForContext:context]; } else { NSAssert([destination isKindOfClass:AttributeClass], @"either one of source or destination should be EOAttribute"); if ([source isEqual:null] || (source == nil)) checkNull = YES; formattedLeft = [adaptor formatValue:(source ? source : (id)null) forAttribute:destination]; } if ([destination isKindOfClass:AttributeClass]) { NSString *tmp = formattedLeft; formattedLeft = [(EOAttribute *)destination expressionValueForContext:context]; formattedRight = tmp; } else { NSAssert([source isKindOfClass:AttributeClass], @"either one of source or destination should be EOAttribute"); if ([destination isEqual:null] || (destination == nil)) checkNull = YES; formattedRight = [adaptor formatValue:(destination ? destination :(id)null) forAttribute:source]; } result = [NSMutableString stringWithCapacity:64]; [result appendString:formattedLeft]; [result appendString:checkNull ? @" IS " : @"="]; [result appendString:formattedRight]; return result; } - (id)source { return self->source; } - (id)destination { return self->destination; } @end /* EOQualifierJoinHolder */ @implementation EOSQLQualifier + (EOSQLQualifier*)qualifierForRow:(NSDictionary*)row entity:(EOEntity*)_entity { EOSQLQualifier *qualifier = nil; NSEnumerator *enumerator = nil; NSString *attributeName = nil; EOAttribute *attribute = nil; id value = nil; BOOL first = YES; enumerator = [row keyEnumerator]; qualifier = [[[EOSQLQualifier alloc] init] autorelease]; while ((attributeName = [enumerator nextObject])) { attribute = [_entity attributeNamed:attributeName]; value = [row objectForKey:attributeName]; if ((value == nil) || (attribute == nil)) /* return nil when is unable to build a qualifier for all keys in the given row */ return nil; if (first) first = NO; else [qualifier->content addObject:@" AND "]; [qualifier->content addObject: [EOQualifierJoinHolder valueForSource:attribute destination:value]]; } qualifier->entity = RETAIN(_entity); [qualifier _computeRelationshipPaths]; return qualifier; } + (EOSQLQualifier*)qualifierForPrimaryKey:(NSDictionary*)dictionary entity:(EOEntity*)_entity { NSDictionary *pkey = nil; pkey = [_entity primaryKeyForRow:dictionary]; /* return nil when is unable to build a complete qualifier for all primary key attributes */ return pkey != nil ? [self qualifierForRow:pkey entity:_entity] : (EOSQLQualifier *)nil; } + (EOSQLQualifier*)qualifierForRow:(NSDictionary*)row relationship:(EORelationship*)relationship { NSArray *componentRelationships = nil; EOSQLQualifier *qualifier = nil; id tmpRelationship = nil; EOAttribute *sourceAttribute = nil; EOAttribute *destinationAttribute = nil; id value = nil; int j = 0; int count2 = 0; componentRelationships = [relationship componentRelationships]; tmpRelationship = relationship; qualifier = [[[EOSQLQualifier alloc] init] autorelease]; /* Make a qualifier string in the following manner. If the relationship is not flattened we must join using the join operator the values from `row' and the foreign keys taken from the destination entity of relatioship. If the relationship is flattend we must append then joins between the components of relationship. */ if (componentRelationships) { tmpRelationship = [componentRelationships objectAtIndex:0]; } sourceAttribute = [tmpRelationship sourceAttribute]; value = [row objectForKey:[sourceAttribute name]]; if (value == nil) /* Returns nil if `row' does not contain all the values needed to create a complete qualifier */ return nil; destinationAttribute = [tmpRelationship destinationAttribute]; [qualifier->content addObject: [EOQualifierJoinHolder valueForSource:destinationAttribute destination:value]]; if (componentRelationships) { EOEntity *tempEntity = [tmpRelationship destinationEntity]; /* The relationship is flattened. Iterate over the components and add joins that `link' the components between them. */ count2 = [componentRelationships count]; for (j = 1; j < count2; j++) { relationship = [componentRelationships objectAtIndex:j]; if ([relationship sourceAttribute]) { [qualifier->content addObject:@" AND "]; [qualifier->content addObject: [EOQualifierJoinHolder valueForSource: [relationship sourceAttribute] destination: [relationship destinationAttribute]]]; } } /* Here we make a hack because later we need to use this qualifier in a SELECT expression in which the qualifier's entity should be the final destination entity of the flattened relationship. In addition we need in the FROM clause all the entities corresponding to the components of the relationship to be able to insert the joins between the values given in row and the final attributes from the destination entity of the last component of relationship. */ ASSIGN(qualifier->entity, tempEntity); [qualifier _computeRelationshipPaths]; ASSIGN(qualifier->entity, [relationship destinationEntity]); return qualifier; } else { ASSIGN(qualifier->entity, [relationship destinationEntity]); return qualifier; } } + (EOSQLQualifier *)qualifierForObject:sourceObject relationship:(EORelationship *)relationship { return [self qualifierForRow: [sourceObject valueForKey:[[relationship sourceAttribute] name]] relationship:relationship]; } - (id)init { NSZone *z = [self zone]; RELEASE(self->content); self->content = nil; RELEASE(self->relationshipPaths); self->relationshipPaths = nil; RELEASE(self->additionalEntities); self->additionalEntities = nil; self->content = [[EOExpressionArray allocWithZone:z] init]; self->relationshipPaths = [[NSMutableSet allocWithZone:z] init]; self->additionalEntities = [[NSMutableSet allocWithZone:z] init]; return self; } - (id)initWithEntity:(EOEntity *)_entity qualifierFormat:(NSString *)_qualifierFormat argumentsArray:(NSArray *)_args { PrintfFormatScanner *formatScanner = nil; EOQualifierEnumScannerHandler *scannerHandler = nil; NSString *qualifierString = nil; NSMutableArray *myRelationshipPaths = nil; NSEnumerator *args = nil; myRelationshipPaths = [[NSMutableArray allocWithZone:[self zone]] init]; [self init]; ASSIGN(self->entity, _entity); if (_qualifierFormat == nil) return self; formatScanner = [[PrintfFormatScanner alloc] init]; scannerHandler = [[EOQualifierEnumScannerHandler alloc] init]; [formatScanner setAllowOnlySpecifier:YES]; args = [_args objectEnumerator]; [scannerHandler setEntity:_entity]; [formatScanner setFormatScannerHandler:scannerHandler]; /* Note: This is an ugly hack. Arguments is supposed to be a va_args structure, but an NSArray is passed in. It works because the value is casted to -parseFormatString:context: which gives control to the scannerHandler which casts the va_args back to an array (the EOQualifierEnumScannerHandler does that). Works on ix86, but *NOT* on iSeries or zServer !! */ #if defined(__s390__) || defined(__arm__) || defined(__alpha__) qualifierString = [formatScanner performSelector:@selector(stringWithFormat:arguments:) withObject:_qualifierFormat withObject:args]; #else // TODO: args is an NSArray, PrintfFormatScanner expects a va_list? // I think that this is OK because we use EOQualifierEnumScannerHandler qualifierString = [formatScanner stringWithFormat:_qualifierFormat arguments:(void *)args]; #endif [formatScanner release]; formatScanner = nil; [scannerHandler release]; scannerHandler = nil; [self->content release]; self->content = nil; self->content = [[EOExpressionArray parseExpression:qualifierString entity:entity replacePropertyReferences:YES relationshipPaths:myRelationshipPaths] retain]; [self _computeRelationshipPaths:myRelationshipPaths]; [myRelationshipPaths release]; myRelationshipPaths = nil; return self; } - (id)initWithEntity:(EOEntity*)_entity qualifierFormat:(NSString *)qualifierFormat, ... { va_list ap; id formatScanner = nil; id scannerHandler = nil; NSString *qualifierString = nil; NSMutableArray *myRelationshipPaths = nil; if ((self = [self init]) == nil) return nil; myRelationshipPaths = [[NSMutableArray alloc] init]; ASSIGN(self->entity, _entity); if (qualifierFormat == nil) { return self; } formatScanner = [[PrintfFormatScanner alloc] init]; scannerHandler = [[EOQualifierScannerHandler alloc] init]; [formatScanner setAllowOnlySpecifier:YES]; va_start(ap, qualifierFormat); [scannerHandler setEntity:_entity]; [formatScanner setFormatScannerHandler:scannerHandler]; qualifierString = [formatScanner stringWithFormat:qualifierFormat arguments:ap]; va_end(ap); [formatScanner release]; [scannerHandler release]; [self->content release]; self->content = nil; self->content = [[EOExpressionArray parseExpression:qualifierString entity:entity replacePropertyReferences:YES relationshipPaths:myRelationshipPaths] retain]; [self _computeRelationshipPaths:myRelationshipPaths]; [myRelationshipPaths release]; myRelationshipPaths = nil; return self; } - (void)_computeRelationshipPaths { [self _computeRelationshipPaths:nil]; } static void handle_attribute(EOSQLQualifier *self, id object, id _relationshipPaths) { [self->additionalEntities addObject:[object entity]]; } - (void)_computeRelationshipPaths:(NSArray *)_relationshipPaths { int i, count; [relationshipPaths removeAllObjects]; if (_relationshipPaths) { NSEnumerator *pathEnum = [_relationshipPaths objectEnumerator]; NSArray *relPath = nil; while ((relPath = [pathEnum nextObject])) { NSEnumerator *relEnum = nil; EORelationship *rel = nil; relEnum = [relPath objectEnumerator]; while ((rel = [relEnum nextObject])) { [additionalEntities addObject:[rel destinationEntity]]; } } [relationshipPaths addObjectsFromArray:_relationshipPaths]; } for (i = 0, count = [content count]; i < count; i++) { id object = [content objectAtIndex:i]; /* The objects from content can only be NSString, values or EOAttribute. */ if ([object isKindOfClass:[EOAttribute class]]) { handle_attribute (self, object, _relationshipPaths); } else if ([object isKindOfClass:[EOQualifierJoinHolder class]]) { id source = nil; id destination = nil; source = [object source]; destination = [object destination]; if ([source isKindOfClass:[EOAttribute class]]) handle_attribute (self, source, _relationshipPaths); if ([destination isKindOfClass:[EOAttribute class]]) handle_attribute (self, destination, _relationshipPaths); } else if ([object isKindOfClass:[EORelationship class]]) { [[[InvalidPropertyException alloc] initWithFormat:@"cannot refer a EORelat" @"ionship in a EOSQLQualifier: '%@'", [(EORelationship*)object name]] raise]; } } } - (void)dealloc { RELEASE(self->relationshipPaths); RELEASE(self->additionalEntities); RELEASE(self->entity); RELEASE(self->content); [super dealloc]; } - (id)copy { return [self copyWithZone:NSDefaultMallocZone()]; } - (id)copyWithZone:(NSZone*)zone { EOSQLQualifier* copy = nil; copy = [[self->isa allocWithZone:zone] init]; copy->entity = RETAIN(self->entity); copy->content = [self->content mutableCopyWithZone:zone]; copy->relationshipPaths = [self->relationshipPaths mutableCopyWithZone:zone]; copy->usesDistinct = self->usesDistinct; return copy; } - (void)negate { [self->content insertObject:@"NOT (" atIndex:0]; [self->content addObject:@")"]; } - (void)conjoinWithQualifier:(EOSQLQualifier*)qualifier { if (![qualifier isKindOfClass:[EOSQLQualifier class]]) { [NSException raise:NSInvalidArgumentException format:@"argument of conjoinWithQualifier: method must " @"be EOSQLQualifier"]; } if (self->entity != qualifier->entity) { [NSException raise:NSInvalidArgumentException format:@"qualifier argument of conjoinWithQualifier: " @"must have the same entity as receiver"]; } [self->content insertObject:@"(" atIndex:0]; [self->content addObject:@") AND ("]; [self->content addObjectsFromExpressionArray:qualifier->content]; [self->content addObject:@")"]; [self->relationshipPaths unionSet:qualifier->relationshipPaths]; } - (void)disjoinWithQualifier:(EOSQLQualifier*)qualifier { if (![qualifier isKindOfClass:[EOSQLQualifier class]]) { [NSException raise:NSInvalidArgumentException format:@"argument of disjoinWithQualifier: method must " @"be EOSQLQualifier"]; } if (self->entity != qualifier->entity) { [NSException raise:NSInvalidArgumentException format:@"qualifier argument of disjoinWithQualifier: " @"must have the same entity as receiver"]; } [self->content insertObject:@"(" atIndex:0]; [self->content addObject:@") OR ("]; [self->content addObjectsFromExpressionArray:qualifier->content]; [self->content addObject:@")"]; [self->relationshipPaths unionSet:qualifier->relationshipPaths]; } - (EOEntity*)entity { return self->entity; } - (BOOL)isEmpty { return (self->entity == nil) ? YES : NO; } - (void)setUsesDistinct:(BOOL)flag { self->usesDistinct = flag; } - (BOOL)usesDistinct { return self->usesDistinct; } - (NSMutableSet*)relationshipPaths { return self->relationshipPaths; } - (NSMutableSet*)additionalEntities { return self->additionalEntities; } - (NSString*)expressionValueForContext:(id)ctx { return [self->content expressionValueForContext:ctx]; } - (EOSQLQualifier *)sqlQualifierForEntity:(EOEntity *)_entity { NSAssert3(self->entity == _entity, @"passed invalid entity to %@ (contains %@, got %@)", self, self->entity, _entity); return (EOSQLQualifier *)self; } /* description */ - (NSString *)description { NSMutableString *ms; ms = [NSMutableString stringWithCapacity:128]; [ms appendFormat:@"<0x%p[%@]:\n", self, NSStringFromClass([self class])]; [ms appendFormat:@" entity=%@", [self->entity name]]; if (self->content) [ms appendFormat:@" content=%@", self->content]; if (self->usesDistinct) [ms appendString:@" distinct"]; [ms appendString:@">"]; return ms; } @end /* EOSQLQualifier */ SOPE/sope-gdl1/GDLAccess/EOAdaptorGlobalID.h0000644000000000000000000000113512242733417017177 0ustar rootroot// $Id: EOAdaptorGlobalID.h 1 2004-08-20 10:38:46Z znek $ #ifndef __EOAdaptorGlobalID_H__ #define __EOAdaptorGlobalID_H__ #include @class EOKeyGlobalID, NSDictionary; @interface EOAdaptorGlobalID : EOGlobalID < NSCopying > { @protected EOGlobalID *gid; NSDictionary *conDict; } - (id)initWithGlobalID:(EOGlobalID *)_gid connectionDictionary:(NSDictionary *)_conDict; - (EOGlobalID *)globalID; - (NSDictionary *)connectionDictionary; - (BOOL)isEqual:(id)_obj; - (BOOL)isEqualToEOAdaptorGlobalID:(EOAdaptorGlobalID *)_gid; @end #endif /* __EOAdaptorGlobalID_H__ */ SOPE/sope-gdl1/GDLAccess/EOArrayProxy.h0000644000000000000000000000335112242733417016371 0ustar rootroot/* EOArrayProxy.h Copyright (C) 1999 MDlink online service center GmbH, Helge Hess Author: Helge Hess (hh@mdlink.de) Date: 1999 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // $Id: EOArrayProxy.h 1 2004-08-20 10:38:46Z znek $ #ifndef __eoaccess_EOArrayProxy_H__ #define __eoaccess_EOArrayProxy_H__ #import /* * EOArrayProxy class */ @class NSArray, NSString; @class EODatabaseChannel, EOSQLQualifier, EOEntity; @interface EOArrayProxy : NSArray { @private EODatabaseChannel *channel; EOSQLQualifier *qualifier; NSArray *fetchOrder; NSArray *content; } + (id)arrayProxyWithQualifier:(EOSQLQualifier *)_qualifier fetchOrder:(NSArray *)_fetchOrder channel:(EODatabaseChannel *)_channel; // accessors - (BOOL)isFetched; - (EODatabaseChannel *)databaseChannel; - (EOEntity *)entity; - (NSArray *)fetchOrder; - (EOSQLQualifier *)qualifier; // operations - (BOOL)fetch; @end #endif /* __eoaccess_EOArrayProxy_H__ */ SOPE/sope-gdl1/GDLAccess/EORecordDictionary.m0000644000000000000000000001371112242733417017523 0ustar rootroot/* EOAdaptorChannel.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: October 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #import #import #import #import #import #if LIB_FOUNDATION_LIBRARY # include #else # include #endif #if (defined(__GNU_LIBOBJC__) && (__GNU_LIBOBJC__ >= 20100911)) || defined(APPLE_RUNTIME) || defined(__GNUSTEP_RUNTIME__) # include # define method_get_imp method_getImplementation # define class_get_instance_method class_getInstanceMethod #endif #include "EORecordDictionary.h" @implementation EORecordDictionary static NSDictionary *emptyDict = nil; - (id)init { RELEASE(self); if (emptyDict == nil) emptyDict = [[NSDictionary alloc] init]; return [emptyDict retain]; } - (id)initWithObjects:(id *)_objects forKeys:(id *)_keys count:(NSUInteger)_count { if (_count == 0) { RELEASE(self); if (emptyDict == nil) emptyDict = [[NSDictionary alloc] init]; return [emptyDict retain]; } if (_count == 1) { RELEASE(self); return [[NSDictionary alloc] initWithObjects:_objects forKeys:_keys count:_count]; } self->count = _count; while(_count--) { if ((_keys[_count] == nil) || (_objects[_count] == nil)) { [NSException raise:NSInvalidArgumentException format:@"Nil object to be added in dictionary"]; } self->entries[_count].key = RETAIN(_keys[_count]); self->entries[_count].hash = [_keys[_count] hash]; self->entries[_count].value = RETAIN(_objects[_count]); } return self; } - (id)initWithDictionary:(NSDictionary *)dictionary { // TODO: who calls this method? NSEnumerator *keys; unsigned char i; keys = [dictionary keyEnumerator]; self->count = [dictionary count]; for (i = 0; i < self->count; i++) { id key = [keys nextObject]; self->entries[i].key = RETAIN(key); self->entries[i].hash = [key hash]; self->entries[i].value = RETAIN([dictionary objectForKey:key]); } return self; } - (void)dealloc { /* keys are always NSString keys?! */ #if GNU_RUNTIME static Class LastKeyClass = Nil; static IMP keyRelease = 0; static unsigned misses = 0, hits = 0; #endif register unsigned char i; for (i = 0; i < self->count; i++) { register NSString *key = self->entries[i].key; #if GNU_RUNTIME if (*(id *)key != LastKeyClass) { LastKeyClass = *(id *)key; keyRelease = method_get_imp(class_get_instance_method(LastKeyClass, @selector(release))); misses++; } else hits++; keyRelease(key, NULL /* dangerous? */); #if PROF_METHOD_CACHE if (hits % 1000 == 0 && hits != 0) NSLog(@"%s: DB HITS: %d MISSES: %d", __PRETTY_FUNCTION__,hits, misses); #endif #else [key release]; #endif RELEASE(self->entries[i].value); } [super dealloc]; } /* operations */ - (id)objectForKey:(id)aKey { register EORecordDictionaryEntry *e = self->entries; register signed char i; register unsigned hash; #if GNU_RUNTIME static Class LastKeyClass = Nil; static unsigned (*keyHash)(id,SEL) = 0; static BOOL (*keyEq)(id,SEL,id) = 0; #if PROF_METHOD_CACHE static unsigned misses = 0, hits = 0; #endif #endif #if GNU_RUNTIME if (aKey == nil) return nil; if (*(id *)aKey != LastKeyClass) { LastKeyClass = *(id *)aKey; keyHash = (void *) method_get_imp(class_get_instance_method(LastKeyClass, @selector(hash))); keyEq = (void *) method_get_imp(class_get_instance_method(LastKeyClass, @selector(isEqual:))); } hash = keyHash(aKey, NULL /* dangerous? */); #else hash = [aKey hash]; #endif for (i = (self->count - 1); i >= 0; i--, e++) { if (e->hash != hash) continue; if (e->key == aKey) return e->value; #if GNU_RUNTIME if (keyEq(e->key, NULL /* dangerous? */, aKey)) return e->value; #else if ([e->key isEqual:aKey]) return e->value; #endif } return nil; } - (NSUInteger)count { return self->count; } - (BOOL)isNotEmpty { return self->count > 0 ? YES : NO; } - (NSEnumerator *)keyEnumerator { return [[[_EORecordDictionaryKeyEnumerator alloc] initWithDictionary:self firstEntry:self->entries count:self->count] autorelease]; } @end /* NSConcreteSmallDictionary */ @implementation _EORecordDictionaryKeyEnumerator - (id)initWithDictionary:(EORecordDictionary *)_dict firstEntry:(EORecordDictionaryEntry *)_firstEntry count:(unsigned char)_count { self->dict = RETAIN(_dict); self->currentEntry = _firstEntry; self->count = _count; return self; } - (void)dealloc { RELEASE(self->dict); [super dealloc]; } - (id)nextObject { if (self->count > 0) { id obj; obj = self->currentEntry->key; self->currentEntry++; self->count--; return obj; } return nil; } @end /* _NSConcreteSmallDictionaryKeyEnumerator */ SOPE/sope-gdl1/GDLAccess/EODatabaseFault.m0000644000000000000000000001721712242733417016764 0ustar rootroot/* EODatabaseFault.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Mircea Oancea Date: 1996 Author: Helge Hess Date: 1999 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import "EODatabaseFault.h" #import "EODatabase.h" #import "EODatabaseChannel.h" #import "EOEntity.h" #import "EOFExceptions.h" #import "EODatabaseFaultResolver.h" #import "EOArrayProxy.h" #import "common.h" #if NeXT_RUNTIME || APPLE_RUNTIME # include #endif typedef struct { Class isa; } *my_objc_object; #define object_is_instance(object) \ ((object!=nil)&&CLS_ISCLASS(((my_objc_object)object)->isa)) /* * EODatabaseFault class */ @implementation EODatabaseFault // Fault class methods + (id)objectFaultWithPrimaryKey:(NSDictionary *)key entity:(EOEntity *)entity databaseChannel:(EODatabaseChannel *)channel zone:(NSZone *)zone { EODatabaseFault *fault = nil; fault = [channel allocateObjectForRow:key entity:entity zone:zone]; if (fault == nil) return nil; #if defined(APPLE_RUNTIME) || defined(__GNUSTEP_RUNTIME__) || (__GNU_LIBOBJC__ >= 20100911) if (class_getInstanceSize([fault class]) < class_getInstanceSize([self class])) { #else if ([fault class]->instance_size < ((Class)self)->instance_size) { #endif [fault autorelease]; [NSException raise:NSInvalidArgumentException format: @"Instances from class %@ must be at least %d in size " @"to fault", NSStringFromClass([fault class]), #if defined(APPLE_RUNTIME) || defined(__GNUSTEP_RUNTIME__) || (__GNU_LIBOBJC__ >= 20100911) class_getInstanceSize([self class])]; #else ((Class)self)->instance_size]; #endif } fault->faultResolver = [[EOObjectFault alloc] initWithPrimaryKey:key entity:entity databaseChannel:channel zone:zone targetClass:fault->isa]; fault->isa = self; return (EODatabaseFault *)AUTORELEASE(fault); } + (NSArray*)arrayFaultWithQualifier:(EOSQLQualifier*)qualifier fetchOrder:(NSArray*)fetchOrder databaseChannel:(EODatabaseChannel*)channel zone:(NSZone*)zone { return [EOArrayProxy arrayProxyWithQualifier:qualifier fetchOrder:fetchOrder channel:channel]; #if 0 EODatabaseFault* fault; fault = [NSMutableArray allocWithZone:zone]; if ([fault class]->instance_size < ((Class)(self))->instance_size) { (void)AUTORELEASE(fault); THROW([[InvalidArgumentException alloc] initWithFormat: @"Instances from class %s must be at least %d " @"in size to fault", NSStringFromClass([fault class]), ((Class)self)->instance_size]); } fault->faultResolver = [[EOArrayFault alloc] initWithQualifier:qualifier fetchOrder:fetchOrder databaseChannel:channel zone:zone targetClass:fault->isa fault:fault]; fault->isa = self; return (NSArray*)AUTORELEASE(fault); #endif } // no more garbage collecting + (NSArray *)gcArrayFaultWithQualifier:(EOSQLQualifier *)qualifier fetchOrder:(NSArray *)fetchOrder databaseChannel:(EODatabaseChannel *)channel zone:(NSZone *)zone { EODatabaseFault *fault; fault = [NSMutableArray allocWithZone:zone]; #if defined(APPLE_RUNTIME) || defined(__GNUSTEP_RUNTIME__) || (__GNU_LIBOBJC__ >= 20100911) if (class_getInstanceSize([fault class]) < class_getInstanceSize([self class])) { #else if ([fault class]->instance_size < ((Class)(self))->instance_size) { #endif (void)[fault autorelease]; [NSException raise:NSInvalidArgumentException format: @"Instances from class %s must be at least %d " @"in size to fault", NSStringFromClass([fault class]), #if defined(APPLE_RUNTIME) || defined(__GNUSTEP_RUNTIME__) || (__GNU_LIBOBJC__ >= 20100911) class_getInstanceSize([self class])]; #else ((Class)self)->instance_size]; #endif } fault->faultResolver = [[EOArrayFault alloc] initWithQualifier:qualifier fetchOrder:fetchOrder databaseChannel:channel zone:zone targetClass:fault->isa]; fault->isa = self; return (NSArray *)AUTORELEASE(fault); } + (NSDictionary *)primaryKeyForFault:(id)fault { EODatabaseFault *aFault = (EODatabaseFault *)fault; // Check that argument is fault if (aFault->isa != self) return nil; return [(EODatabaseFaultResolver *)aFault->faultResolver primaryKey]; } + (EOEntity *)entityForFault:(id)fault { EODatabaseFault *aFault = (EODatabaseFault *)fault; // Check that argument is fault if (aFault->isa != self) return nil; return [(EODatabaseFaultResolver *)aFault->faultResolver entity]; } + (EOSQLQualifier *)qualifierForFault:(id)fault { EODatabaseFault *aFault = (EODatabaseFault *)fault; // Check that argument is fault if (aFault->isa != self) return nil; return [(EODatabaseFaultResolver *)aFault->faultResolver qualifier]; } + (NSArray *)fetchOrderForFault:(id)fault { EODatabaseFault *aFault = (EODatabaseFault *)fault; // Check that argument is fault if (aFault->isa != self) return nil; return [(EODatabaseFaultResolver *)aFault->faultResolver fetchOrder]; } + (EODatabaseChannel *)databaseChannelForFault:fault { EODatabaseFault *aFault = (EODatabaseFault *)fault; // Check that argument is fault if (aFault->isa != self) return nil; return [(EODatabaseFaultResolver *)aFault->faultResolver databaseChannel]; } - (void)dealloc { [EODatabase forgetObject:self]; [super dealloc]; } // Forwarding stuff + (void)initialize { // Must be here as initialize is called for each root class // without asking if it responds to it ! } - (EOEntity *)entity { return [EODatabaseFault entityForFault:self]; } @end /* EODatabaseFault */ /* * Informal protocol that informs an instance that a to-one * relationship could not be resoved to get data for self. * Its implementation in NSObject raises NSObjectNotAvailableException. */ @implementation NSObject(EOUnableToFaultToOne) - (void)unableToFaultWithPrimaryKey:(NSDictionary*)key entity:(EOEntity*)entity databaseChannel:(EODatabaseChannel*)channel { // TODO - throw exception form derived class [[[ObjectNotAvailableException alloc] initWithFormat:@"cannot fault to-one for primary key %@ entity %@", [key description], [entity name]] raise]; } @end /* NSObject(EOUnableToFaultToOne) */ @implementation EOFault(EOUnableToFaultToOne) - (void)unableToFaultWithPrimaryKey:(NSDictionary*)key entity:(EOEntity *)entity databaseChannel:(EODatabaseChannel*)channel { // TODO - throw exception from derived class [[[ObjectNotAvailableException alloc] initWithFormat:@"cannot fault to-one for primary key %@ entity %@", [key description], [entity name]] raise]; } @end /* EOFault(EOUnableToFaultToOne) */ SOPE/sope-gdl1/GDLAccess/EOPrimaryKeyDictionary.h0000644000000000000000000000274312242733417020377 0ustar rootroot/* EOPrimaryKeyDictionary.h Copyright (C) 1996 Free Software Foundation, Inc. Author: Mircea Oancea Date: 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __EOPrimaryKeyDictionary_h__ #define __EOPrimaryKeyDictionary_h__ #import @interface EOPrimaryKeyDictionary : NSDictionary { @public NSUInteger fastHash; @protected } + dictionaryWithKeys:(NSArray*)keys fromDictionary:(NSDictionary*)dict; + dictionaryWithObject:(id)object forKey:(id)key; - (unsigned)fastHash; - (BOOL)fastIsEqual:aDict; @end /* EOPrimaryKeyDictionary */ #endif /* __EOPrimaryKeyDictionary_h__ */ /* Local Variables: c-basic-offset: 4 tab-width: 8 End: */ SOPE/sope-gdl1/GDLAccess/EOAdaptorContext.m0000644000000000000000000001447012242733417017221 0ustar rootroot/* EOAdaptorContext.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: October 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import #import #import "common.h" #import "EOAdaptor.h" #import "EOAdaptorContext.h" #import "EOAdaptorChannel.h" @implementation EOAdaptorContext - (id)initWithAdaptor:(EOAdaptor *)_adaptor { ASSIGN(self->adaptor, _adaptor); self->channels = [[NSMutableArray alloc] initWithCapacity:2]; [self->adaptor contextDidInit:self]; return self; } - (void)dealloc { [self->adaptor contextWillDealloc:self]; [self->adaptor release]; [self->channels release]; [super dealloc]; } /* channels */ - (EOAdaptorChannel *)createAdaptorChannel { return [[[[adaptor adaptorChannelClass] alloc] initWithAdaptorContext:self] autorelease]; } - (NSArray *)channels { NSMutableArray *ma; unsigned i, count; if ((count = [self->channels count]) == 0) return nil; ma = [NSMutableArray arrayWithCapacity:count]; for (i = 0; i < count; i++) [ma addObject:[[self->channels objectAtIndex:i] nonretainedObjectValue]]; return ma; } - (void)channelDidInit:aChannel { [self->channels addObject:[NSValue valueWithNonretainedObject:aChannel]]; } - (void)channelWillDealloc:(id)aChannel { int i; for (i = [self->channels count] - 1; i >= 0; i--) if ([[channels objectAtIndex:i] nonretainedObjectValue] == aChannel) { [channels removeObjectAtIndex:i]; break; } } - (BOOL)hasOpenChannels { int i, count = [channels count]; for (i = 0; i < count; i++) if ([[[channels objectAtIndex:i] nonretainedObjectValue] isOpen]) return YES; return NO; } - (BOOL)hasBusyChannels { int i, count = [channels count]; for (i = 0; i < count; i++) if ([[[channels objectAtIndex:i] nonretainedObjectValue] isFetchInProgress]) return YES; return NO; } /* transactions */ - (BOOL)beginTransaction { if (transactionNestingLevel && ![self canNestTransactions]) return NO; if ([self->channels count] == 0) return NO; if (delegateRespondsTo.willBegin) { EODelegateResponse response = [delegate adaptorContextWillBegin:self]; if (response == EODelegateRejects) return NO; else if (response == EODelegateOverrides) return YES; } if ([self primaryBeginTransaction] == NO) return NO; [self transactionDidBegin]; if (delegateRespondsTo.didBegin) [delegate adaptorContextDidBegin:self]; return YES; } - (BOOL)commitTransaction { if (!transactionNestingLevel || [self hasBusyChannels]) return NO; if (![channels count]) return NO; if (delegateRespondsTo.willCommit) { EODelegateResponse response = [delegate adaptorContextWillCommit:self]; if (response == EODelegateRejects) return NO; else if (response == EODelegateOverrides) return YES; } if ([self primaryCommitTransaction] == NO) return NO; [self transactionDidCommit]; if (delegateRespondsTo.didCommit) [delegate adaptorContextDidCommit:self]; return YES; } - (BOOL)rollbackTransaction { if (!transactionNestingLevel || [self hasBusyChannels]) return NO; if (![channels count]) return NO; if (delegateRespondsTo.willRollback) { EODelegateResponse response = [delegate adaptorContextWillRollback:self]; if (response == EODelegateRejects) return NO; else if (response == EODelegateOverrides) return YES; } if ([self primaryRollbackTransaction] == NO) return NO; [self transactionDidRollback]; if (delegateRespondsTo.didRollback) [delegate adaptorContextDidRollback:self]; return YES; } - (void)transactionDidBegin { /* Increment the transaction scope */ transactionNestingLevel++; } - (void)transactionDidCommit { /* Decrement the transaction scope */ transactionNestingLevel--; } - (void)transactionDidRollback { /* Decrement the transaction scope */ transactionNestingLevel--; } /* delegate */ - (void)setDelegate:(id)_delegate { self->delegate = _delegate; delegateRespondsTo.willBegin = [delegate respondsToSelector:@selector(adaptorContextWillBegin:)]; delegateRespondsTo.didBegin = [delegate respondsToSelector:@selector(adaptorContextDidBegin:)]; delegateRespondsTo.willCommit = [delegate respondsToSelector:@selector(adaptorContextWillCommit:)]; delegateRespondsTo.didCommit = [delegate respondsToSelector:@selector(adaptorContextDidCommit:)]; delegateRespondsTo.willRollback = [delegate respondsToSelector:@selector(adaptorContextWillRollback:)]; delegateRespondsTo.didRollback = [delegate respondsToSelector:@selector(adaptorContextDidRollback:)]; } - (id)delegate { return self->delegate; } /* adaptor */ - (EOAdaptor *)adaptor { return self->adaptor; } /* transactions */ - (BOOL)canNestTransactions { /* deprecated in WO 4.5 */ return NO; } - (unsigned)transactionNestingLevel { /* deprecated in WO 4.5 */ return self->transactionNestingLevel; } - (BOOL)hasOpenTransaction { /* new in WO 4.5 */ return self->transactionNestingLevel > 0 ? YES : NO; } - (BOOL)primaryBeginTransaction { return NO; } - (BOOL)primaryCommitTransaction { return NO; } - (BOOL)primaryRollbackTransaction { return NO; } @end /* EOAdaptorContext */ SOPE/sope-gdl1/GDLAccess/EOFExceptions.m0000644000000000000000000001160212242733417016503 0ustar rootroot/* EOFExceptions.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: August 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import "common.h" #import "EOFExceptions.h" #import "EOEntity.h" #import "EORelationship.h" @implementation EOFException @end /* EOFException */ @implementation ObjectNotAvailableException - initWithEntity:entity andPrimaryKey:key { id _reason = [NSString stringWithFormat:@"A to-one relation could not be " @"resolved for entity %@ and primary key %@", [(EOEntity*)entity name], [key description]]; [self initWithName:@"NSObjectNotAvailableException" reason:_reason userInfo:nil]; return self; } @end /* ObjectNotAvailableException */ @implementation PropertyDefinitionException @end /* PropertyDefinitionException */ @implementation DestinationEntityDoesntMatchDefinitionException - initForDestination:(EOEntity*)destinationEntity andDefinition:(NSString*)definition relationship:(EORelationship*)relationship { id _reason = [NSString stringWithFormat:@"destination entity '%@' does not" @" match definition '%@' in relationship '%@'", [destinationEntity name], definition, [relationship name]]; [self initWithName:NSStringFromClass(isa) reason:_reason userInfo:nil]; return self; } @end /* DestinationEntityDoesntMatchDefinitionException */ @implementation InvalidNameException - initWithName:(NSString*)_name { id _reason = [NSString stringWithFormat:@"invalid name: '%@'", _name]; [self initWithName:NSStringFromClass(isa) reason:_reason userInfo:nil]; return self; } @end /* InvalidNameException */ @implementation InvalidPropertyException - initWithName:propertyName entity:currentEntity { id _reason = [NSString stringWithFormat:@"property '%@' does not exist in " @"entity '%@'", propertyName, [(EOEntity*)currentEntity name]]; [self initWithName:NSStringFromClass(isa) reason:_reason userInfo:nil]; return self; } @end /* InvalidPropertyException */ @implementation RelationshipMustBeToOneException - initWithName:propertyName entity:currentEntity { id _reason = [NSString stringWithFormat:@"property '%@' must be to one in " @"entity '%@' to allow flattened attribute", propertyName, [(EOEntity*)currentEntity name]]; [self initWithName:NSStringFromClass(isa) reason:_reason userInfo:nil]; return self; } @end /* RelationshipMustBeToOneException */ @implementation InvalidValueTypeException - initWithType:type { id _reason = [NSString stringWithFormat:@"unknow value type '%@'", type]; [self initWithName:@"InvalidValueTypeException" reason:_reason userInfo:nil]; return self; } @end @implementation InvalidAttributeException @end /* InvalidAttributeException */ @implementation InvalidQualifierException @end /* InvalidQualifierException */ @implementation EOAdaptorException @end /* EOAdaptorException */ @implementation CannotFindAdaptorBundleException @end /* CannotFindAdaptorBundleException */ @implementation InvalidAdaptorBundleException @end /* InvalidAdaptorBundleException */ @implementation InvalidAdaptorStateException + exceptionWithAdaptor:(id)_adaptor { InvalidAdaptorStateException* exception = [self alloc]; exception->adaptor = _adaptor; return exception; } @end /* InvalidAdaptorStateException */ @implementation DataTypeMappingNotSupportedException @end /* DataTypeMappingNotSupportedException */ @implementation ChannelIsNotOpenedException @end /* ChannelIsNotOpenedException */ @implementation AdaptorIsFetchingException @end /* AdaptorIsFetchingException */ @implementation AdaptorIsNotFetchingException @end /* AdaptorIsNotFetchingException */ @implementation NoTransactionInProgressException @end /* NoTransactionInProgressException */ @implementation TooManyOpenedChannelsException @end /* TooManyOpenedChannelsException */ SOPE/sope-gdl1/GDLAccess/connect-EOAdaptor.m0000644000000000000000000000650412242733417017302 0ustar rootroot/* EOAdaptorChannel.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: October 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // $Id: connect-EOAdaptor.m 1 2004-08-20 10:38:46Z znek $ #import #include #include #include #include int main(int argc, char **argv, char **env) { NSAutoreleasePool *pool; NSArray *args; NSString *adaptorName; NSString *condictstr; NSDictionary *condict; EOAdaptor *adaptor; EOAdaptorContext *adctx; EOAdaptorChannel *adch; BOOL ok; pool = [[NSAutoreleasePool alloc] init]; #if LIB_FOUNDATION_LIBRARY [NSProcessInfo initializeWithArguments:argv count:argc environment:env]; #endif args = [[NSProcessInfo processInfo] arguments]; if ([args count] < 3) { fprintf(stderr, "usage: %s adaptorname condict\n", argv[0]); exit(10); } adaptorName = [args objectAtIndex:1]; condictstr = [args objectAtIndex:2]; /* load adaptor */ NS_DURING { adaptor = [EOAdaptor adaptorWithName:adaptorName]; } NS_HANDLER { fprintf(stderr, "ERROR: %s: %s\n", [[localException name] cString], [[localException reason] cString]); adaptor = nil; } NS_ENDHANDLER; if (adaptor == nil) { fprintf(stderr, "ERROR: failed to load adaptor '%s'.\n", [adaptorName cString]); exit(1); } printf("did load adaptor: %s\n", [[adaptor name] cString]); /* setup connection dictionary */ if ((condict = [condictstr propertyList]) == nil) { fprintf(stderr, "ERROR: invalid connection dictionary '%s'.\n", [condictstr cString]); exit(2); } [adaptor setConnectionDictionary:condict]; /* setup connection */ if ((adctx = [adaptor createAdaptorContext]) == nil) { fprintf(stderr, "ERROR: could not create adaptor context."); exit(3); } if ((adch = [adctx createAdaptorChannel]) == nil) { fprintf(stderr, "ERROR: could not create adaptor channel."); exit(4); } /* connect */ ok = NO; NS_DURING { ok = [adch openChannel]; } NS_HANDLER { fprintf(stderr, "ERROR: could not connect to database %s: %s\n", [[localException name] cString], [[localException reason] cString]); exit(5); } NS_ENDHANDLER; if (!ok) { fprintf(stderr, "ERROR: could not connect to database.\n"); exit(6); } else printf("connection could be established.\n"); [adch closeChannel]; [pool release]; exit(0); return 0; } SOPE/sope-gdl1/GDLAccess/TODO0000644000000000000000000000051012242733417014336 0ustar rootroot# $Id: TODO 1 2004-08-20 10:38:46Z znek $ TODO ==== - remove all things not required for OGo MacOSX ====== - replace all InvalidArgumentExceptions with proper Foundation replacements - remove dependency on FoundationExt - currently the dependency is formed by the libFoundation scanner handlers and format processors SOPE/sope-gdl1/GDLAccess/EODatabaseFaultResolver.m0000644000000000000000000002100112242733417020470 0ustar rootroot/* EODatabaseFaultResolver.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Mircea Oancea Date: 1996 Author: Helge Hess Date: 1999 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import "common.h" #import "EODatabaseFaultResolver.h" #import "EODatabaseChannel.h" #import "EODatabaseContext.h" #import "EOEntity.h" #import "EODatabaseFault.h" #import "EOSQLQualifier.h" #import "EOGenericRecord.h" @implementation EODatabaseFaultResolver - (id)initWithDatabaseChannel:(EODatabaseChannel *)aChannel zone:(NSZone *)aZone targetClass:(Class)_targetClass { if ((self = [super init])) { self->channel = aChannel; self->targetClass = _targetClass; self->zone = aZone; self->faultReferences = 0; } return self; } - (BOOL)fault { return NO; } - (EODatabaseChannel *)databaseChannel { return self->channel; } - (Class)targetClass; { return self->targetClass; } - (NSDictionary *)primaryKey { return nil; } - (EOEntity *)entity { return nil; } - (EOSQLQualifier *)qualifier { return nil; } - (NSArray *)fetchOrder { return nil; } @end /* EODatabaseFaultResolver */ @implementation EOArrayFault - (id)initWithQualifier:(EOSQLQualifier *)aQualifier fetchOrder:(NSArray *)aFetchOrder databaseChannel:(EODatabaseChannel *)aChannel zone:(NSZone *)aZone targetClass:(Class)_targetClass { if ((self = [super initWithDatabaseChannel:aChannel zone:aZone targetClass:_targetClass])) { self->qualifier = RETAIN(aQualifier); self->fetchOrder = RETAIN(aFetchOrder); NSAssert([(NSObject *)self->targetClass isKindOfClass:[NSArray class]], @"target class of an array fault is not an array class"); } return self; } - (void)dealloc { RELEASE(self->qualifier); RELEASE(self->fetchOrder); [super dealloc]; } - (EOEntity *)entity { return [self->qualifier entity]; } - (EOSQLQualifier *)qualifier { return self->qualifier; } - (NSArray *)fetchOrder { return self->fetchOrder; } - (void)completeInitializationOfObject:(id)_fault { unsigned int oldRetainCount; BOOL inTransaction; NSAssert([(NSObject *)self->targetClass isKindOfClass:[NSArray class]], @"target class of an array fault is not an array class"); oldRetainCount = [_fault retainCount]; [EOFault clearFault:_fault]; NSAssert([(id)_fault init] == _fault, @"init modified fault reference .."); NSAssert([_fault isKindOfClass:[NSArray class]], @"resolved-object of an array fault is not of an array class"); if ([self->channel isFetchInProgress]) { [NSException raise:NSInvalidArgumentException format:@"attempt to fault with busy channel: %@", self]; } inTransaction = [[self->channel databaseContext] transactionNestingLevel] > 0; if (!inTransaction) { if (![[self->channel databaseContext] beginTransaction]) { [NSException raise:@"DBFaultResolutionException" format:@"could not begin transaction to resolve fault !"]; } } if (![self->channel selectObjectsDescribedByQualifier:self->qualifier fetchOrder:self->fetchOrder]) { if (!inTransaction) [[self->channel databaseContext] rollbackTransaction]; [NSException raise:@"DBFaultResolutionException" format:@"select for fault failed !"]; } { // fetch objects id object; while ((object = [self->channel fetchWithZone:zone])) { if (![object isKindOfClass:[EOGenericRecord class]]) { NSLog(@"Object is of class %@", NSStringFromClass([object class])); abort(); } NSAssert([object isKindOfClass:[EOGenericRecord class]], @"fetched object is not a EOGenericRecord .."); [(id)_fault addObject:object]; } object = nil; } [self->channel cancelFetch]; if (!inTransaction) { if (![[self->channel databaseContext] commitTransaction]) { NSLog(@"WARNING: could not commit fault's transaction !"); [NSException raise:@"DBFaultResolutionException" format:@"could not commit fault's transaction !"]; } } #if MOF2_DEBUG if ([fault retainCount] != oldRetainCount) { NSLog(@"fault retain count does not match replacement (old=%d, new=%d)", oldRetainCount, [fault retainCount]); } #endif NSAssert([_fault retainCount] == oldRetainCount, @"fault retain count does not match replacement's retain count"); } - (NSString *)descriptionForObject:(id)_fault { return [NSString stringWithFormat: @"", _fault, qualifier, fetchOrder, channel]; } @end /* EOArrayFault */ @implementation EOObjectFault - (id)initWithPrimaryKey:(NSDictionary *)_key entity:(EOEntity *)anEntity databaseChannel:(EODatabaseChannel *)aChannel zone:(NSZone *)aZone targetClass:(Class)_targetClass { [super initWithDatabaseChannel:aChannel zone:aZone targetClass:_targetClass]; self->entity = RETAIN(anEntity); self->primaryKey = RETAIN(_key); return self; } - (void)dealloc { RELEASE(self->entity); RELEASE(self->primaryKey); [super dealloc]; } - (NSDictionary*)primaryKey { return self->primaryKey; } - (EOEntity *)entity { return self->entity; } - (void)completeInitializationOfObject:(id)_fault { EOSQLQualifier *qualifier = nil; BOOL channelIsOpen = YES; BOOL inTransaction = YES; id object = nil; if ([self->channel isFetchInProgress]) { [NSException raise:NSInvalidArgumentException format:@"attempt to fault with busy channel: %@", self]; } qualifier = [EOSQLQualifier qualifierForPrimaryKey:primaryKey entity:self->entity]; if (qualifier == nil) { [NSException raise:NSInvalidArgumentException format:@"could not build qualifier for fault: %@", self]; } channelIsOpen = [self->channel isOpen]; if (!channelIsOpen) { if (![self->channel openChannel]) goto done; } inTransaction = [[self->channel databaseContext] transactionNestingLevel] != 0; if (!inTransaction) { if (![[self->channel databaseContext] beginTransaction]) { if (!channelIsOpen) [self->channel closeChannel]; goto done; } } if (![self->channel selectObjectsDescribedByQualifier:qualifier fetchOrder:nil]) { if (!inTransaction) { [[self->channel databaseContext] rollbackTransaction]; if (!channelIsOpen) [self->channel closeChannel]; } goto done; } // Fetch the object object = [self->channel fetchWithZone:zone]; // The fetch failed! if (object == nil) { [self->channel cancelFetch]; if (!inTransaction) [[self->channel databaseContext] rollbackTransaction]; if (!channelIsOpen) [self->channel closeChannel]; goto done; } // Make sure we only fetched one object if ([self->channel fetchWithZone:zone]) object = nil; [self->channel cancelFetch]; if (!inTransaction) { if (![[self->channel databaseContext] commitTransaction]) object = nil; if (!channelIsOpen) [self->channel closeChannel]; } done: if (object != _fault) { if ([EOFault isFault:_fault]) [EOFault clearFault:_fault]; [(id)_fault unableToFaultWithPrimaryKey:primaryKey entity:self->entity databaseChannel:self->channel]; } } - (NSString *)descriptionForObject:(id)_fault { return [NSString stringWithFormat: @"", _fault, NSStringFromClass(targetClass), [entity name], [primaryKey description], [channel description]]; } @end /* EOObjectFault */ SOPE/sope-gdl1/GDLAccess/GDLAccess-Info.plist0000644000000000000000000000133212242733417017347 0ustar rootroot CFBundleDevelopmentRegion English CFBundleExecutable GDLAccess CFBundleGetInfoString CFBundleIdentifier org.opengroupware.SOPE.gdl1 CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType FMWK CFBundleShortVersionString CFBundleSignature ???? CFBundleVersion 4.5 SOPE/sope-gdl1/GDLAccess/EODatabaseContext.m0000644000000000000000000006063712242733417017341 0ustar rootroot/* EODatabaseContext.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Mircea Oancea Date: 1996 Author: Helge Hess Date: 1999 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import "common.h" #import "EODatabaseContext.h" #import "EOAdaptor.h" #import "EOAdaptorContext.h" #import "EODatabase.h" #import "EODatabaseChannel.h" #import "EOEntity.h" #import "EODatabaseFault.h" #import "EOGenericRecord.h" #import "EOModel.h" #import "EOObjectUniquer.h" #include "EOModelGroup.h" #include #include NSString *EODatabaseContextWillBeginTransactionName = @"EODatabaseContextWillBeginTransaction"; NSString *EODatabaseContextDidBeginTransactionName = @"EODatabaseContextDidBeginTransaction"; NSString *EODatabaseContextWillRollbackTransactionName = @"EODatabaseContextWillRollbackTransaction"; NSString *EODatabaseContextDidRollbackTransactionName = @"EODatabaseContextDidRollbackTransaction"; NSString *EODatabaseContextWillCommitTransactionName = @"EODatabaseContextWillCommitTransaction"; NSString *EODatabaseContextDidCommitTransactionName = @"EODatabaseContextDidCommitTransaction"; struct EODatabaseContextModificationQueue { struct EODatabaseContextModificationQueue *next; enum { update, delete, insert } op; id object; }; /* * Transaction scope */ typedef struct _EOTransactionScope { struct _EOTransactionScope *previous; EOObjectUniquer *objectsDictionary; NSMutableArray *objectsUpdated; NSMutableArray *objectsDeleted; NSMutableArray *objectsLocked; } EOTransactionScope; static inline EOTransactionScope *_newTxScope(NSZone *_zone) { EOTransactionScope *newScope; newScope = NSZoneMalloc(_zone, sizeof(EOTransactionScope)); newScope->objectsDictionary = [[EOObjectUniquer allocWithZone:_zone] init]; newScope->objectsUpdated = [[NSMutableArray allocWithZone:_zone] init]; newScope->objectsDeleted = [[NSMutableArray allocWithZone:_zone] init]; newScope->objectsLocked = [[NSMutableArray allocWithZone:_zone] init]; return newScope; } static inline void _freeTxScope(NSZone *_zone, EOTransactionScope *_txScope) { RELEASE(_txScope->objectsDictionary); _txScope->objectsDictionary = nil; RELEASE(_txScope->objectsUpdated); _txScope->objectsUpdated = nil; RELEASE(_txScope->objectsDeleted); _txScope->objectsDeleted = nil; RELEASE(_txScope->objectsLocked); _txScope->objectsLocked = nil; NSZoneFree(_zone, _txScope); _txScope = NULL; } @implementation EODatabaseContext #if 0 // no such callback! + (void)initialize { static BOOL isInitialized = NO; if (!isInitialized) { isInitialized = YES; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_objectStoreNeeded:) name:@"EOCooperatingObjectStoreNeeded" object:nil]; } } #endif static inline void _checkTxInProgress(EODatabaseContext *self, const char *_function) { if (self->transactionNestingLevel == 0) { [NSException raise:NSInternalInconsistencyException format: @"EODatabaseContext:%x: No transaction in progress " @"in %s", self, _function]; } } // init - (id)initWithDatabase:(EODatabase *)aDatabase { static int reuseAdaptorCtx = -1; if (reuseAdaptorCtx == -1) { reuseAdaptorCtx = [[[NSUserDefaults standardUserDefaults] objectForKey:@"EOReuseAdaptorContext"] boolValue] ? 1 : 0; } if (reuseAdaptorCtx) { NSEnumerator *contexts; EOAdaptorContext *actx; contexts = [[[aDatabase adaptor] contexts] objectEnumerator]; while ((actx = [contexts nextObject])) { if (![actx hasOpenTransaction]) { #if DEBUG NSLog(@"reuse adaptor context: %@", actx); #endif self->adaptorContext = actx; break; } } if (self->adaptorContext == nil) self->adaptorContext = [[aDatabase adaptor] createAdaptorContext]; } else self->adaptorContext = [[aDatabase adaptor] createAdaptorContext]; if ((aDatabase == nil) || (adaptorContext == nil)) { NSLog(@"EODatabaseContext could not create adaptor context"); AUTORELEASE(self); return nil; } RETAIN(self->adaptorContext); self->database = RETAIN(aDatabase); self->channels = [[NSMutableArray allocWithZone:[self zone]] init]; self->transactionStackTop = NULL; self->transactionNestingLevel = 0; self->updateStrategy = EOUpdateWithOptimisticLocking; self->isKeepingSnapshots = YES; self->isUniquingObjects = [self->database uniquesObjects]; [database contextDidInit:self]; return self; } - (void)dealloc { [database contextWillDealloc:self]; if (self->ops) { struct EODatabaseContextModificationQueue *q; while ((q = self->ops)) { self->ops = q->next; RELEASE(q->object); free(q); } } while (self->transactionNestingLevel) { if (![self rollbackTransaction]) break; } while (self->transactionStackTop) [self privateRollbackTransaction]; RELEASE(self->adaptorContext); self->adaptorContext = nil; RELEASE(self->database); self->database = nil; RELEASE(self->channels); self->channels = nil; [super dealloc]; } /* accessors */ - (void)setDelegate:(id)_delegate { self->delegate = _delegate; } - (id)delegate { return self->delegate; } - (EODatabase *)database { return self->database; } - (EOAdaptorContext *)adaptorContext { return self->adaptorContext; } // channels - (BOOL)hasBusyChannels { int i; for (i = [channels count]-1; i >= 0; i--) { if ([[[channels objectAtIndex:i] nonretainedObjectValue] isFetchInProgress]) return YES; } return NO; } - (BOOL)hasOpenChannels { int i; for (i = [channels count]-1; i >= 0; i--) { if ([[[channels objectAtIndex:i] nonretainedObjectValue] isOpen]) return YES; } return NO; } - (NSArray *)channels { return [self registeredChannels]; } - (id)createChannel { return AUTORELEASE([[EODatabaseChannel alloc] initWithDatabaseContext:self]); } - (void)channelDidInit:(id)aChannel { [self registerChannel:aChannel]; } - (void)channelWillDealloc:(id)aChannel { [self unregisterChannel:aChannel]; } /* * Controlling transactions */ - (BOOL)beginTransaction { NSNotificationCenter *nc; if ([adaptorContext transactionNestingLevel] != (unsigned)transactionNestingLevel) { [NSException raise:NSInternalInconsistencyException format: @"EODatabaseContext:%x:transaction nesting levels do not match: " @"database has %d, adaptor has %d, " @"in [EODatabaseContext beginTransaction]", self, transactionNestingLevel, [adaptorContext transactionNestingLevel]]; } nc = [NSNotificationCenter defaultCenter]; [nc postNotificationName:EODatabaseContextWillBeginTransactionName object:self]; if (![self->adaptorContext beginTransaction]) return NO; [self privateBeginTransaction]; txBeginCount++; [nc postNotificationName:EODatabaseContextDidBeginTransactionName object:self]; return YES; } - (BOOL)commitTransaction { NSNotificationCenter *nc; _checkTxInProgress(self, __PRETTY_FUNCTION__); if ([adaptorContext transactionNestingLevel] != (unsigned)self->transactionNestingLevel) { [NSException raise:NSInternalInconsistencyException format: @"EODatabaseContext:%x:transaction nesting levels do not match: " @"database has %d, adaptor has %d, " @"in [EODatabaseContext commitTransaction]", self, transactionNestingLevel, [adaptorContext transactionNestingLevel]]; } nc = [NSNotificationCenter defaultCenter]; [nc postNotificationName:EODatabaseContextWillCommitTransactionName object:self]; if (![adaptorContext commitTransaction]) return NO; [self privateCommitTransaction]; self->txCommitCount++; [nc postNotificationName:EODatabaseContextDidCommitTransactionName object:self]; return YES; } - (BOOL)rollbackTransaction { NSNotificationCenter *nc; _checkTxInProgress(self, __PRETTY_FUNCTION__); if ([self->adaptorContext transactionNestingLevel] != (unsigned)self->transactionNestingLevel) { [NSException raise:NSInternalInconsistencyException format: @"EODatabaseContext:%x:transaction nesting levels do not match: " @"database has %d, adaptor has %d, " @"in [EODatabaseContext rollbackTransaction]", self, transactionNestingLevel, [adaptorContext transactionNestingLevel]]; } nc = [NSNotificationCenter defaultCenter]; [nc postNotificationName:EODatabaseContextWillRollbackTransactionName object:self]; if (![self->adaptorContext rollbackTransaction]) return NO; [self privateRollbackTransaction]; self->txRollbackCount++; [nc postNotificationName:EODatabaseContextDidRollbackTransactionName object:self]; return YES; } // ******************** notifications ******************** - (void)transactionDidBegin { [self->adaptorContext transactionDidBegin]; [self privateBeginTransaction]; } - (void)transactionDidCommit { _checkTxInProgress(self, __PRETTY_FUNCTION__); [self->adaptorContext transactionDidCommit]; [self privateCommitTransaction]; } - (void)transactionDidRollback { _checkTxInProgress(self, __PRETTY_FUNCTION__); [adaptorContext transactionDidRollback]; [self privateRollbackTransaction]; } /* * Nesting transactions */ - (BOOL)canNestTransactions { return [adaptorContext canNestTransactions]; } - (unsigned)transactionNestingLevel { return transactionNestingLevel; } /* * Setting the update strategy */ - (void)setUpdateStrategy:(EOUpdateStrategy)aStrategy { if ([self transactionNestingLevel]) { [NSException raise:NSInvalidArgumentException format: @"EODatabaseContext:%x: Cannot change update strategy " @"when context has a transaction open, " @"in [EODatabaseContext setUpdateStrategy]", self]; } updateStrategy = aStrategy; isKeepingSnapshots = (updateStrategy == EOUpdateWithNoLocking) ? NO : YES; isUniquingObjects = [database uniquesObjects]; } - (EOUpdateStrategy)updateStrategy { return self->updateStrategy; } - (BOOL)keepsSnapshots { return self->isKeepingSnapshots; } /* * Processing transactions internally */ - (void)privateBeginTransaction { EOTransactionScope *newScope = NULL; newScope = _newTxScope([self zone]); newScope->previous = transactionNestingLevel ? transactionStackTop : NULL; transactionStackTop = newScope; transactionNestingLevel++; if (transactionNestingLevel == 1) self->isUniquingObjects = [database uniquesObjects]; } - (void)privateCommitTransaction { EOTransactionScope *newScope = transactionStackTop; transactionStackTop = newScope->previous; transactionNestingLevel--; // In nested transaction fold updated and deleted objects // into the parent transaction; locked objects are forgotten // deleted objects are deleted form the parent transaction if (transactionNestingLevel) { // Keep updated objects [transactionStackTop->objectsUpdated addObjectsFromArray:newScope->objectsUpdated]; // Keep deleted objects [transactionStackTop->objectsDeleted addObjectsFromArray:newScope->objectsDeleted]; // Register objects in parent transaction scope [newScope->objectsDictionary transferTo:transactionStackTop->objectsDictionary objects:YES andSnapshots:YES]; } // If this was the first transaction then fold the changes // into the database; locked and updateted objects are forgotten else { int i, n; for (i = 0, n = [newScope->objectsDeleted count]; i < n; i++) [database forgetObject:[newScope->objectsDeleted objectAtIndex:i]]; // Register objects into the database if (self->isUniquingObjects || [database keepsSnapshots]) { [newScope->objectsDictionary transferTo:[database objectUniquer] objects:self->isUniquingObjects andSnapshots:[database keepsSnapshots]]; } } // Kill transaction scope _freeTxScope([self zone], newScope); } - (void)privateRollbackTransaction { EOTransactionScope *newScope = transactionStackTop; transactionStackTop = newScope->previous; transactionNestingLevel--; // Forget snapshots, updated, deleted and locked objects // in current transaction // Kill transaction scope _freeTxScope([self zone], newScope); } // Handle Objects - (void)forgetObject:(id)_object { EOTransactionScope *scope = NULL; _checkTxInProgress(self, __PRETTY_FUNCTION__); if (_object == nil) { [NSException raise:NSInvalidArgumentException format: @"EODatabaseContext:%x: Cannot forget null object, " @"in [EODatabaseContext forgetObject]", self]; } if ([EOFault isFault:_object]) { [NSException raise:NSInvalidArgumentException format: @"EODatabaseContext:%x: Cannot forget forget a fault object, " @"in [EODatabaseContext forgetObject]", self]; } [transactionStackTop->objectsDeleted addObject:_object]; for (scope = transactionStackTop; scope; scope = scope->previous) { [scope->objectsDictionary forgetObject:_object]; } } - (id)objectForPrimaryKey:(NSDictionary *)_key entity:(EOEntity *)_entity { EOTransactionScope *scope = NULL; id _object = nil; if (!self->isUniquingObjects || (_key == nil) || (_entity == nil)) return nil; _key = [_entity primaryKeyForRow:_key]; if (_key == nil) return nil; for (scope = transactionStackTop; scope; scope = scope->previous) { _object = [scope->objectsDictionary objectForPrimaryKey:_key entity:_entity]; if (_object) return _object; } return [self->database objectForPrimaryKey:_key entity:_entity]; } - (void)recordObject:(id)_object primaryKey:(NSDictionary *)_key entity:(EOEntity *)_entity snapshot:(NSDictionary *)snapshot { _checkTxInProgress(self, __PRETTY_FUNCTION__); if (_object == nil) { [NSException raise:NSInvalidArgumentException format: @"EODatabaseContext:%x: Cannot record null object, " @"in [EODatabaseContext recordObject:primaryKey:entity:snapshot:]", self]; } if ((_entity == nil) && self->isUniquingObjects) { [NSException raise:NSInvalidArgumentException format: @"EODatabaseContext:%x: Cannot record object with null entity " @"when uniquing objects, " @"in [EODatabaseContext recordObject:primaryKey:entity:snapshot:]", self]; } _key = [_entity primaryKeyForRow:_key]; if ((_key == nil) && self->isUniquingObjects) { [NSException raise:NSInvalidArgumentException format: @"EODatabaseContext:%x: Cannot record object with null key " @"when uniquing objects, " @"in [EODatabaseContext recordObject:primaryKey:entity:snapshot:]", self]; } if ((snapshot == nil) && isKeepingSnapshots && ![EOFault isFault:_object]) { [NSException raise:NSInvalidArgumentException format: @"EODatabaseContext:%x: Cannot record object with null snapshot " @"when keeping snapshots, " @"in [EODatabaseContext recordObject:primaryKey:entity:snapshot:]" @": snapshot=%s keepsSnapshots=%s isFault=%s", self, snapshot ? "yes" : "no", isKeepingSnapshots ? "yes" : "no", [EOFault isFault:_object] ? "yes" : "no"]; } if (self->isKeepingSnapshots || self->isUniquingObjects) { EOObjectUniquer *cache = transactionStackTop->objectsDictionary; [cache recordObject:_object primaryKey: self->isUniquingObjects ? _key : (NSDictionary *)nil entity: self->isUniquingObjects ? _entity : (EOEntity *)nil snapshot:self->isKeepingSnapshots ? snapshot : (NSDictionary *)nil]; } } - (void)recordObject:(id)_object primaryKey:(NSDictionary *)_key snapshot:(NSDictionary *)_snapshot { EOEntity *entity = nil; entity = [_object respondsToSelector:@selector(entity)] ? [_object entity] : [[[database adaptor] model] entityForObject:_object]; [self recordObject:_object primaryKey:_key entity:entity snapshot:_snapshot]; } - (NSDictionary *)snapshotForObject:(id)_object { EOTransactionScope *scope = NULL; EOUniquerRecord *rec = NULL; if (!isKeepingSnapshots) return nil; for (scope = transactionStackTop; scope; scope = scope->previous) { rec = [scope->objectsDictionary recordForObject:_object]; if (rec) return rec->snapshot; } rec = [[self->database objectUniquer] recordForObject:_object]; if (rec) return rec->snapshot; return nil; } - (NSDictionary*)primaryKeyForObject:(id)_object { EOTransactionScope *scope = NULL; EOUniquerRecord *rec = NULL; if ([self->database uniquesObjects]) return nil; for (scope = transactionStackTop; scope; scope = scope->previous) { rec = [scope->objectsDictionary recordForObject:_object]; if (rec) return rec->pkey; } rec = [[self->database objectUniquer] recordForObject:_object]; if (rec) return rec->pkey; return nil; } - (void)primaryKey:(NSDictionary **)_key andSnapshot:(NSDictionary **)_snapshot forObject:_object { EOTransactionScope *scope = NULL; EOUniquerRecord *rec = NULL; if (!self->isKeepingSnapshots && ![self->database uniquesObjects]) { *_key = *_snapshot = nil; return; } for (scope = transactionStackTop; scope; scope = scope->previous) { rec = [scope->objectsDictionary recordForObject:_object]; if (rec) { if (_key) *_key = rec->pkey; if (_snapshot) *_snapshot = rec->snapshot; return; } } rec = [[self->database objectUniquer] recordForObject:_object]; if (rec) { if (_key) *_key = rec->pkey; if (_snapshot) *_snapshot = rec->snapshot; return; } if (_key) *_key = nil; if (_snapshot) *_snapshot = nil; } - (void)recordLockedObject:(id)_object { _checkTxInProgress(self, __PRETTY_FUNCTION__); if (_object == nil) { [NSException raise:NSInvalidArgumentException format: @"EODatabaseContext:%x: Cannot record null object as locked, " @"in [EODatabaseContext recordLockedObject:]", self]; } if ([EOFault isFault:_object]) { [NSException raise:NSInvalidArgumentException format: @"EODatabaseContext:%x: Cannot record a fault object as locked, " @"in [EODatabaseContext recordLockedObject:]", self]; } [transactionStackTop->objectsLocked addObject:_object]; } - (BOOL)isObjectLocked:(id)_object { EOTransactionScope *scope; for (scope = transactionStackTop; scope; scope = scope->previous) { if ([scope->objectsLocked indexOfObjectIdenticalTo:_object]!=NSNotFound) return YES; } return NO; } - (void)recordUpdatedObject:(id)_object { _checkTxInProgress(self, __PRETTY_FUNCTION__); if (_object == nil) { [NSException raise:NSInvalidArgumentException format: @"EODatabaseContext:%x: Cannot record null object as updatetd, " @"in [EODatabaseContext recordUpdatedObject:]", self]; } if ([EOFault isFault:_object]) { [NSException raise:NSInvalidArgumentException format: @"EODatabaseContext:%x: Cannot record fault object as updated, " @"in [EODatabaseContext recordUpdatedObject:]", self]; } [transactionStackTop->objectsUpdated addObject:_object]; } - (BOOL)isObjectUpdated:(id)_object { EOTransactionScope *scope; for (scope = transactionStackTop; scope; scope = scope->previous) { if ([scope->objectsUpdated indexOfObjectIdenticalTo:_object] != NSNotFound) return YES; if ([scope->objectsDeleted indexOfObjectIdenticalTo:_object] != NSNotFound) return YES; } return NO; } /* description */ - (NSString *)description { return [NSString stringWithFormat: @"<%@[0x%p]: #channels=%i tx-nesting=%i>", NSStringFromClass([self class]), self, [self->channels count], [self transactionNestingLevel]]; } @end /* EODatabaseContext */ @implementation EODatabaseContext(Statistics) - (unsigned int)transactionBeginCount { return self->txBeginCount; } - (unsigned int)transactionCommitCount { return self->txCommitCount; } - (unsigned int)transactionRollbackCount { return self->txRollbackCount; } @end /* EODatabaseContext(Statistics) */ @implementation EODatabaseContext(NewInEOF2) // THREAD static Class EODatabaseContextClass = Nil; + (void)setContextClassToRegister:(Class)_cclass { EODatabaseContextClass = _cclass; } + (Class)contextClassToRegister { return EODatabaseContextClass ? EODatabaseContextClass : (Class)self; } - (EODatabaseChannel *)availableChannel { int i; for (i = [self->channels count] - 1; i >= 0; i--) { EODatabaseChannel *channel; channel = [[self->channels objectAtIndex:i] nonretainedObjectValue]; if (![channel isFetchInProgress]) return channel; } [[NSNotificationCenter defaultCenter] postNotificationName:@"EODatabaseChannelNeeded" object:self]; /* recheck for channel */ for (i = [self->channels count] - 1; i >= 0; i--) { EODatabaseChannel *channel; channel = [[self->channels objectAtIndex:i] nonretainedObjectValue]; if (![channel isFetchInProgress]) return channel; } return nil; } - (NSArray *)registeredChannels { NSMutableArray *array; int i, n; array = [NSMutableArray array]; for (i=0, n=[channels count]; i < n; i++) { EODatabaseChannel *channel = [[channels objectAtIndex:i] nonretainedObjectValue]; [array addObject:channel]; } return array; } - (void)registerChannel:(EODatabaseChannel *)_channel { [self->channels addObject:[NSValue valueWithNonretainedObject:_channel]]; } - (void)unregisterChannel:(EODatabaseChannel *)_channel { int i; for (i = [self->channels count] - 1; i >= 0; i--) { EODatabaseChannel *channel; channel = [[self->channels objectAtIndex:i] nonretainedObjectValue]; if (channel == _channel) { [channels removeObjectAtIndex:i]; break; } } } /* cooperating object store */ - (void)commitChanges { [self commitTransaction]; } - (void)rollbackChanges { [self rollbackTransaction]; } - (void)performChanges { [self notImplemented:_cmd]; } /* store specific properties */ - (NSDictionary *)valuesForKeys:(NSArray *)_keys object:(id)_object { return [_object valuesForKeys:_keys]; } /* capability */ - (BOOL)handlesFetchSpecification:(EOFetchSpecification *)_fspec { EOEntity *entity; entity = [[self database] entityNamed:[_fspec entityName]]; return entity ? YES : NO; } /* graph */ - (BOOL)ownsObject:(id)_object { EOEntity *entity; entity = [[self database] entityNamed:[_object entityName]]; return entity ? YES : NO; } - (BOOL)ownsGlobalID:(EOGlobalID *)_oid { EOEntity *entity; if (![_oid respondsToSelector:@selector(entityName)]) return NO; entity = [[self database] entityNamed:[(id)_oid entityName]]; return entity ? YES : NO; } @end /* EODatabaseContext(NewInEOF2) */ SOPE/sope-gdl1/GDLAccess/EORecordDictionary.h0000644000000000000000000000203712242733417017515 0ustar rootroot/* */ #ifndef __EORecordDictionary_h__ #define __EORecordDictionary_h__ #import typedef struct _EORecordDictionaryEntry { unsigned hash; id key; id value; } EORecordDictionaryEntry; @interface EORecordDictionary : NSDictionary { unsigned char count; EORecordDictionaryEntry entries[1]; } /* Allocating and Initializing an Dictionary */ - (id)initWithObjects:(id*)objects forKeys:(id*)keys count:(NSUInteger)count; - (id)initWithDictionary:(NSDictionary*)dictionary; /* Accessing keys and values */ - (id)objectForKey:(id)aKey; - (NSUInteger)count; - (NSEnumerator *)keyEnumerator; @end /* EORecordDictionary */ #import @interface _EORecordDictionaryKeyEnumerator : NSEnumerator { NSDictionary *dict; EORecordDictionaryEntry *currentEntry; unsigned char count; } - (id)initWithDictionary:(EORecordDictionary *)_dict firstEntry:(EORecordDictionaryEntry *)_firstEntry count:(unsigned char)_count; - (id)nextObject; @end #endif SOPE/sope-gdl1/GDLAccess/EOAttribute.h0000644000000000000000000000757612242733417016231 0ustar rootroot/* EOAttribute.h Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: August 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __EOAttribute_h__ #define __EOAttribute_h__ #import #import #import @class NSString, NSTimeZone, NSDate, NSException; @class NSMutableArray; @class EOEntity; @interface EOAttribute : NSObject { NSString *name; NSString *calendarFormat; NSTimeZone *clientTimeZone; NSTimeZone *serverTimeZone; NSString *columnName; NSString *externalType; NSString *valueClassName; NSString *valueType; NSDictionary *userDictionary; EOEntity *entity; /* non-retained */ unsigned width; struct { int allowsNull:1; int reserved:31; } flags; } /* Initializing new instances */ - (id)initWithName:(NSString *)name; /* Accessing the entity */ - (void)setEntity:(EOEntity*)entity; - (EOEntity*)entity; - (void)resetEntity; - (BOOL)hasEntity; /* Accessing the name */ - (BOOL)setName:(NSString *)name; - (NSString *)name; + (BOOL)isValidName:(NSString *)name; /* Accessing date information */ + (NSString *)defaultCalendarFormat; - (void)setCalendarFormat:(NSString *)format; - (NSString *)calendarFormat; - (void)setClientTimeZone:(NSTimeZone*)tz; - (NSTimeZone*)clientTimeZone; - (void)setServerTimeZone:(NSTimeZone*)tz; - (NSTimeZone*)serverTimeZone; /* Accessing external definitions */ - (void)setColumnName:(NSString *)columnName; - (NSString *)columnName; - (void)setExternalType:(NSString *)type; - (NSString *)externalType; /* Accessing value type information */ - (void)setValueClassName:(NSString *)name; - (NSString *)valueClassName; - (void)setValueType:(NSString *)type; - (NSString *)valueType; /* Checking type information */ - (BOOL)referencesProperty:property; /* Accessing the user dictionary */ - (void)setUserDictionary:(NSDictionary*)dictionary; - (NSDictionary*)userDictionary; /* Obsolete. This method always return NO, because you should always release a property. */ - (BOOL)referencesProperty:property; @end @interface EOAttribute (EOAttributePrivate) + (EOAttribute*)attributeFromPropertyList:(id)propertyList; - (void)replaceStringsWithObjects; - (id)propertyList; @end /* EOAttribute (EOAttributePrivate) */ @interface EOAttribute(ValuesConversion) - (id)convertValue:(id)aValue toClass:(Class)aClass forType:(NSString *)aValueType; - (id)convertValueToModel:(id)aValue; @end /* EOAttribute (ValuesConversion) */ @interface NSString (EOAttributeTypeCheck) - (BOOL)isNameOfARelationshipPath; @end @class NSMutableDictionary; @interface EOAttribute(PropertyListCoding) - (void)encodeIntoPropertyList:(NSMutableDictionary *)_plist; @end @interface EOAttribute(EOF2Additions) - (void)beautifyName; /* constraints */ - (void)setAllowsNull:(BOOL)_flag; - (BOOL)allowsNull; - (void)setWidth:(unsigned)_width; - (unsigned)width; - (NSException *)validateValue:(id *)_value; @end #endif /* __EOAttribute_h__ */ /* Local Variables: c-basic-offset: 4 tab-width: 8 End: */ SOPE/sope-gdl1/GDLAccess/EOFault.m0000644000000000000000000002251712242733417015336 0ustar rootroot/* EOAttributeOrdering.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // $Id: EOFault.m 1 2004-08-20 10:38:46Z znek $ #include "EOFault.h" #include "EOFaultHandler.h" #include "common.h" #if NeXT_RUNTIME || APPLE_RUNTIME # include #endif typedef struct { Class isa; } *my_objc_object; #if (defined(__GNU_LIBOBJC__) && (__GNU_LIBOBJC__ >= 20100911)) || defined(APPLE_RUNTIME) || defined(__GNUSTEP_RUNTIME__) # warning TODO: implement for NeXT/Apple runtime! # define object_is_instance(object) (object!=nil?YES:NO) # define class_get_super_class class_getSuperclass # define class_get_class_method class_getClassMethod # define class_get_instance_method class_getInstanceMethod # define METHOD_NULL NULL typedef struct objc_method *Method_t; #else # define object_is_instance(object) \ ((object!=nil)&&CLS_ISCLASS(((my_objc_object)object)->isa)) #endif #if __GNU_LIBOBJC__ >= 20100911 # define METHOD_NULL NULL # define class_get_super_class class_getSuperclass # define object_is_instance(object) (object!=nil?YES:NO) typedef struct objc_method *Method_t; #endif /* * EOFault class */ @implementation EOFault + (void)makeObjectIntoFault:(id)_object withHandler:(EOFaultHandler *)_handler{ [_handler setTargetClass:[_object class] extraData:((id *)_object)[1]]; ((EOFault *)_object)->isa = self; ((EOFault *)_object)->faultResolver = [_handler retain]; } + (EOFaultHandler *)handlerForFault:(id)_fault { if (![self isFault:_fault]) return nil; return ((EOFault *)_fault)->faultResolver; } /* Fault class methods */ + (void)clearFault:(id)fault { EOFault *aFault = (EOFault*)fault; int refs; /* check if fault */ if (aFault->isa != self) return; /* get fault instance reference count + 1 set in creation methods */ refs = aFault->faultResolver->faultReferences; /* make clear instance */ aFault->isa = [aFault->faultResolver targetClass]; aFault->faultResolver = [aFault->faultResolver autorelease]; aFault->faultResolver = [aFault->faultResolver extraData]; /* set references to real instance so that re-implemented retain/release mechanism take control */ while(refs-- > 0) [aFault retain]; } + (BOOL)isFault:(id)fault { static Class EOFaultClass = Nil; Class clazz; if (fault == nil) return NO; if (EOFaultClass == Nil) EOFaultClass = [EOFault class]; #if defined(APPLE_RUNTIME) || defined(__GNUSTEP_RUNTIME__) || (__GNU_LIBOBJC__ >= 20100911) for (clazz = ((EOFault *)fault)->isa; clazz; clazz = class_getSuperclass(clazz)) { #else for (clazz = ((EOFault *)fault)->isa; clazz; clazz = clazz->super_class) { #endif if (clazz == EOFaultClass) return YES; } return NO; } + (BOOL)isFault { return NO; // no class faults } - (BOOL)isFault { return YES; } + (Class)targetClassForFault:(id)_fault { EOFault *aFault = (EOFault*)_fault; // Check that argument is fault if (aFault->isa != self) return nil; return [aFault->faultResolver targetClass]; } // Fault Instance methods - (Class)superclass { #if GNU_RUNTIME return (object_is_instance(self)) ? [[self->faultResolver classForFault:self] superclass] : class_get_super_class((Class)self); #else # warning TODO: add complete implementation for NeXT/Apple runtime! return [[self->faultResolver classForFault:self] superclass]; #endif } + (Class)class { return self; } - (Class)class { return [self->faultResolver classForFault:self]; } - (BOOL)isKindOfClass:(Class)_class; { return [self->faultResolver isKindOfClass:_class forFault:self]; } - (BOOL)isMemberOfClass:(Class)_class { return [self->faultResolver isMemberOfClass:_class forFault:self]; } - (BOOL)conformsToProtocol:(Protocol *)_protocol { return [self->faultResolver conformsToProtocol:_protocol forFault:self]; } + (BOOL)respondsToSelector:(SEL)_selector { #if GNU_RUNTIME return class_get_instance_method(self, _selector) != NULL; #else # warning TODO: add complete implementation for Apple/NeXT runtime! return NO; #endif } - (BOOL)respondsToSelector:(SEL)_selector { #if GNU_RUNTIME return (object_is_instance(self)) ? [self->faultResolver respondsToSelector:_selector forFault:self] : class_get_class_method(self->isa, _selector) != METHOD_NULL; #else # warning TODO: add complete implementation for Apple/NeXT runtime! return [self->faultResolver respondsToSelector:_selector forFault:self]; #endif } // ******************** retain counting ******************** + (id)retain { return self; } - (id)retain { self->faultResolver->faultReferences++; return self; } + (oneway void)release { } - (oneway void)release { if (faultResolver->faultReferences <= 0) [self dealloc]; else faultResolver->faultReferences--; } + (NSUInteger)retainCount { return 1; } - (NSUInteger)retainCount { // For instance return faultResolver->faultReferences+1; } + (id)autorelease { return self; } - (id)autorelease { [NSAutoreleasePool addObject:self]; return self; } - (NSZone *)zone { return NSZoneFromPointer(self); } - (BOOL)isProxy { return NO; } - (BOOL)isGarbageCollectable { return NO; } + (void)dealloc { NSLog(@"WARNING: tried to deallocate EOFault class .."); } - (void)dealloc { [self->isa clearFault:self]; [self dealloc]; } /* descriptions */ - (NSString *)description { return [self->faultResolver descriptionForObject:self]; } - (NSString *)descriptionWithIndent:(unsigned)level { return [self description]; } - (NSString *)stringRepresentation { return [self description]; } - (NSString *)eoShallowDescription { return [self description]; } - (NSString *)propertyListStringWithLocale:(NSDictionary *)_locale indent:(int)_i { return [self description]; } /* Forwarding stuff */ + (void)initialize { /* Must be here as initialize is called for each root class without asking if it responds to it ! */ } static inline void _resolveFault(EOFault *self) { EOFaultHandler *handler; /* If in class */ if (!object_is_instance(self)) { [NSException raise:@"NSInvalidArgumentException" format:@"used EOFault class in forward"]; } handler = self->faultResolver; [handler completeInitializationOfObject:self]; if (self->isa == [EOFault class]) { [NSException raise:@"NSInvalidArgumentException" format: @"fault error: %@ was not cleared during fault fetching", [handler descriptionForObject:self]]; } } + (id)self { _resolveFault(self); return self; } #if 0 - (void)setObject:(id)object forKey:(id)key { _resolveFault(self); [self setObject:object forKey:key]; } - (id)objectForKey:(id)key { _resolveFault(self); return [self objectForKey:key]; } - (void)removeObjectForKey:(id)key { _resolveFault(self); [self removeObjectForKey:key]; } - (void)takeValuesFromDictionary:(NSDictionary *)dictionary { _resolveFault(self); [self takeValuesFromDictionary:dictionary]; } - (NSDictionary *)valuesForKeys:(NSArray *)keys { _resolveFault(self); return [self valuesForKeys:keys]; } - (BOOL)takeValue:(id)object forKey:(id)key { _resolveFault(self); return [self takeValue:object forKey:key]; } - (id)valueForKey:(id)key { _resolveFault(self); return [self valueForKey:key]; } - (BOOL)kvcIsPreferredInKeyPath { _resolveFault(self); return YES; } #endif /* 0 */ - (NSMethodSignature *)methodSignatureForSelector:(SEL)_sel { return [self->faultResolver methodSignatureForSelector:_sel forFault:self]; } - (void)forwardInvocation:(NSInvocation *)_invocation { if ([self->faultResolver shouldPerformInvocation:_invocation]) { _resolveFault(self); [_invocation invoke]; } } @end /* EOFault */ #if 0 @implementation EOFault(RealForwarding) #if NeXT_Foundation_LIBRARY - (void)forwardInvocation:(NSInvocation *)_inv { _resolveFault(self); [_inv setTarget:self]; [_inv invoke]; } #else - (retval_t)forward:(SEL)sel:(arglist_t)args { #if 1 && !defined(__APPLE__) Method_t forward; forward = class_get_instance_method(objc_lookup_class("NSObject"), _cmd); return ((retval_t (*)(id, SEL, SEL, arglist_t))forward->method_imp) (self, _cmd, sel, args); #else struct objc_method *m; _resolveFault(self); if ((m = class_get_instance_method(self->isa, sel)) == NULL) { NSString *r; r = [NSString stringWithFormat: @"fault error: resolved fault does not responds to selector %s", sel_get_name(sel)]; [NSException raise:@"NSInvalidArgumentException" reason:r userInfo:nil]; } return objc_msg_sendv(self, sel, args); #endif } #endif @end /* EOFault(RealForwarding) */ #endif // #if 0 SOPE/sope-gdl1/GDLAccess/EOAdaptorChannel+Attributes.h0000644000000000000000000000067512242733417021264 0ustar rootroot//$Id: EOAdaptorChannel+Attributes.h 1 2004-08-20 10:38:46Z znek $ #ifndef __EOAdaptorChannel_Attributes_h__ #define __EOAdaptorChannel_Attributes_h__ @class NSString, NSArray; #import @interface EOAdaptorChannel(Attributes) - (NSArray *)attributesForTableName:(NSString *)_tableName; - (NSArray *)primaryKeyAttributesForTableName:(NSString *)_tableName; @end #endif /* __EOAdaptorChannel_Attributes_h__ */ SOPE/sope-gdl1/GDLAccess/EOQuotedExpression.h0000644000000000000000000000262012242733417017570 0ustar rootroot/* EOQuotedExpression.h Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __EOQuotedExpression_h__ #define __EOQuotedExpression_h__ #import @class NSString; @interface EOQuotedExpression : NSObject { id expression; NSString *quote; NSString *escape; } - (id)expressionValueForContext:(id)context; - (id)initWithExpression:(id)expression quote:(NSString *)quote escape:(NSString *)escape; @end #endif /* __EOQuotedExpression_h__ */ SOPE/sope-gdl1/GDLAccess/EOAdaptor.h0000644000000000000000000001016212242733417015641 0ustar rootroot/* EOAdaptor.h Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: October 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __EOAdaptor_h__ #define __EOAdaptor_h__ #import @class NSMutableArray, NSArray, NSDictionary, NSString, NSURL; @class EOModel; @class EOAttribute; @class EOAdaptorContext; /* The EOAdaptor class could be overriden for a concrete database adaptor. You have to override only those methods marked in this header with `override'. */ /* Don't make EOAdaptor* classes garbage collectable because we want to make the instances release the database allocated resources immediately when they receive the -release message. */ @interface EOAdaptor : NSObject { @protected EOModel *model; NSString *name; NSDictionary *connectionDictionary; NSDictionary *pkeyGeneratorDictionary; NSMutableArray *contexts; // values with contexts id delegate; // not retained /* Flags used to check if the delegate responds to several messages */ BOOL delegateWillReportError:1; } /* Creating an EOAdaptor */ + (id)adaptorWithModel:(EOModel *)aModel; + (id)adaptorWithName:(NSString *)aName; + (id)adaptorForURL:(id)_url; + (NSString *)libraryDriversSubDir; - (id)initWithName:(NSString *)aName; /* Getting an adaptor's name */ - (NSString*)name; /* Get the library subdir name */ /* Setting connection information */ - (void)setConnectionDictionary:(NSDictionary*)aDictionary; - (NSDictionary*)connectionDictionary; - (BOOL)hasValidConnectionDictionary; // override /* Setting pkey generation info */ - (void)setPkeyGeneratorDictionary:(NSDictionary*)aDictionary; - (NSDictionary*)pkeyGeneratorDictionary; /* Setting the model */ - (void)setModel:(EOModel*)aModel; - (EOModel*)model; /* Creating and removing an adaptor context */ - (EOAdaptorContext*)createAdaptorContext; // override - (NSArray *)contexts; /* Checking connection status */ - (BOOL)hasOpenChannels; /* Getting adaptor-specific information */ - (Class)expressionClass; // override - (Class)adaptorContextClass; // override - (Class)adaptorChannelClass; // override - (BOOL)isValidQualifierType:(NSString*)aTypeName; // override /* Formatting SQL */ - (id)formatAttribute:(EOAttribute*)attribute; // override - (id)formatValue:value forAttribute:(EOAttribute*)attribute; // override /* Reporting errors */ - (void)reportError:(NSString*)anError; /* Setting the delegate */ - (id)delegate; - (void)setDelegate:(id)aDelegate; @end /* EOAdaptor */ @interface EOAdaptor(Private) - (void)contextDidInit:(id)aContext; - (void)contextWillDealloc:(id)aContext; @end @interface NSObject(EOAdaptorDelegate) - (BOOL)adaptor:(EOAdaptor*)anAdaptor willReportError:(NSString*)anError; @end /* NSObject(EOAdaptorDelegate) */ @interface EOAdaptor(MDlinkExtensions) - (NSString *)charConvertExpressionForAttributeNamed:(NSString *)_attrName; - (NSString *)lowerExpressionForTextAttributeNamed:(NSString *)_attrName; - (NSString *)expressionForTextValue:(id)_value; - (BOOL)attributeAllowedInDistinctSelects:(EOAttribute *)attribute; @end @interface EOAdaptor(EOF2Additions) - (BOOL)canServiceModel:(EOModel *)_model; @end #endif /* __EOAdaptor_h__*/ SOPE/sope-gdl1/GDLAccess/EOAdaptorDataSource.h0000644000000000000000000000711112242733417017614 0ustar rootroot/* EOAdaptorDataSource.h Copyright (C) SKYRIX Software AG and Helge Hess Author: Helge Hess (helge.hess@opengroupware.org) Date: 1999-2004 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // $Id: EOAdaptorDataSource.h 1 2004-08-20 10:38:46Z znek $ #ifndef __EOAdaptorDataSource_h__ #define __EOAdaptorDataSource_h__ #import @class NSArray, NSDictionary; @class EOFetchSpecification, EOAdaptorChannel, EOQualifier; /* Fetch dictionaries from database tables. The tablename has to be set in [FetchSpecification entityName]. Qualifier, sortOrdering, distinct will be evaluated. It handles now tables with more than one primary key. Its possible to set the primary key in the fetchspecification hints (EOPrimaryKeyAttributeNamesHint -> array with strings as columnnames for the PKeys; EOPrimaryKeyAttributesHint -> array with EOAttributes for the PKeys). If no primary key is set, and now primary key could find in the table schema, all keys will be taken as primary keys. If only one primary key exsist, in insert object a new key will be generatet, else all keys has to be set. If fetch hint EOFetchResultTimeZone is set (NSTimeZone), this timezone will be set in date objectes. */ extern NSString *EOPrimaryKeyAttributeNamesHint; extern NSString *EOPrimaryKeyAttributesHint; extern NSString *EOFetchResultTimeZone; @interface EOAdaptorDataSource : EODataSource { @private EOFetchSpecification *fetchSpecification; @protected EOAdaptorChannel *adChannel; EOQualifier *__qualifier; NSArray *__attributes; BOOL commitTransaction; NSDictionary *connectionDictionary; } - (id)initWithAdaptorChannel:(EOAdaptorChannel *)_channel; - (id)initWithAdaptorChannel:(EOAdaptorChannel *)_channel connectionDictionary:(NSDictionary *)_connDict; - (id)initWithAdaptorName:(NSString *)_adName connectionDictionary:(NSDictionary *)_dict primaryKeyGenerationDictionary:(NSDictionary *)_pkGen; /* Returns an array with dictionaries, who contains key/values from the entity (use entityName/qualifier/sortOrdering). Also it contains an key named 'globalID'. If EOAdaptorDataSource is initialized with initWithAdaptorChannel the globaID is an EOKeyGlobalID else if it is initialized with initWithAdaptorName the globalID is and EOAdaptorGlobalID. */ - (NSArray *)fetchObjects; /* returns an mutable dictionary */ - (id)createObject; - (void)insertObject:(id)_obj; - (void)deleteObject:(id)_obj; - (void)updateObject:(id)_obj; - (void)setFetchSpecification:(EOFetchSpecification *)_fs; - (EOFetchSpecification *)fetchSpecification; /* for subclasses */ - (EOAdaptorChannel *)beginTransaction; - (void)commitTransaction; - (void)rollbackTransaction; - (void)openChannel; - (void)closeChannel; @end #endif /* __EOAdaptorDataSource_h__ */ SOPE/sope-gdl1/GDLAccess/EOSQLExpression.m0000644000000000000000000011605412242733417017002 0ustar rootroot/* EOSQLExpression.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: September 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "EOSQLExpression.h" #include "common.h" #include "EOAdaptor.h" #include "EOAdaptorChannel.h" #include "EOAdaptorContext.h" #include "EOAttribute.h" #include "EOAttributeOrdering.h" #include "EOEntity.h" #include "EOFExceptions.h" #include "EOSQLQualifier.h" #include "EORelationship.h" #include #include #include #include #if LIB_FOUNDATION_LIBRARY # include # include #else # include "DefaultScannerHandler.h" # include "PrintfFormatScanner.h" #endif /* A SQL command is generated for an entity when you fetch, insert, update or delete an object from the database. The command includes all the attributes from entity. The biggest problem in generation of SQL commands is the generation of SELECT statements, because the tables have to be properly aliased. If an entity has only simple attributes then you have a single table in the FROM clause. If the entity has flattened attributes, then several tables appear in the FROM list; each one with a different alias. The algorithm uses a dictionary that has as keys either entities or relationships. The values in dictionary are aliases. For a simple attribute we insert in the above dictionary the attribute's entity as key and an alias for it. For a flattened attribute with the following definition: `toEntity1.toEntity2. ... toEntityn.attribute', we have to assign to each toEntityi object an alias. Let's see how each component of the SELECT command is generated. The columns list is generated by iterating over the attributes of entity. If the attribute is simple, its entity is looked up in the aliases dictionary. If the attribute is flattened, the alias of attribute is the alias of toEntityn. If the attribute is derived, each component of it is generated applying the same rules. The FROM list is generated like this. For each key in the aliases dictionary: * if the key is an entity, its external name is written followed by the alias corresponding to entity * if the key is a relationship, the external name of its destination entity is written followed by the alias corresponding to relationship. A little bit complicated is the WHERE clause. For each flattened attribute we have to generate the logic expression that selects the attribute by expressing the joins over several entities. The algorithm starts with the first relationship. An additional variable, named context is used. Its initial value is the current entity. The expression context-alias.source-attribute join-operator relationship-alias.destination-attribute is added using the AND operator to the where clause. Then the context variable is set to the current relationship. The algorithm continues with the next relationship until there are no more relationships to process. */ static EONull *null = nil; NSString *EOBindVariableNameKey = @"name"; NSString *EOBindVariablePlaceHolderKey = @"placeHolder"; NSString *EOBindVariableAttributeKey = @"attribute"; NSString *EOBindVariableValueKey = @"value"; @interface EOInsertUpdateScannerHandler : DefaultScannerHandler { NSString *value; EOAttribute *attribute; EOAdaptor *adaptor; } - (void)setValue:(NSString*)value attribute:(EOAttribute*)attribute adaptor:(EOAdaptor*)adaptor; @end @implementation EOInsertUpdateScannerHandler - (id)init { [super init]; specHandler['V'] = [self methodForSelector:@selector(convertValue:scanner:)]; return self; } - (void)dealloc { RELEASE(self->value); RELEASE(self->attribute); RELEASE(self->adaptor); [super dealloc]; } - (void)setValue:(NSString *)_value attribute:(EOAttribute*)_attribute adaptor:(EOAdaptor*)_adaptor { ASSIGNCOPY(self->value, _value); ASSIGN(self->attribute, _attribute); ASSIGN(self->adaptor, _adaptor); } - (NSString *)convertValue:(va_list *)pString scanner:(FormatScanner *)scanner{ return (self->adaptor) ? [self->adaptor formatValue:(self->value ? self->value : (NSString *)null) forAttribute:attribute] : (id)self->value; } @end /* EOInsertUpdateScannerHandler */ @implementation EOSQLExpression + (void)initialize { if (null == nil) null = [[NSNull null] retain]; } - (id)initWithEntity:(EOEntity *)_entity { if ((self = [super init])) { ASSIGN(self->entity, _entity); } return self; } - (id)init { return [self initWithEntity:nil]; } + (id)deleteExpressionWithQualifier:(EOSQLQualifier*)qualifier channel:(EOAdaptorChannel*)channel { EOSQLExpression* sqlExpression = AUTORELEASE([[self deleteExpressionClass] new]); [sqlExpression deleteExpressionWithQualifier:qualifier channel:channel]; return sqlExpression; } + (id)insertExpressionForRow:(NSDictionary *)row entity:(EOEntity*)_entity channel:(EOAdaptorChannel*)channel { EOSQLExpression* sqlExpression = AUTORELEASE([[self insertExpressionClass] new]); [sqlExpression insertExpressionForRow:row entity:_entity channel:channel]; return sqlExpression; } - (id)deleteExpressionWithQualifier:(EOSQLQualifier *)qualifier channel:(EOAdaptorChannel*)channel { NSString *sql; self = [self initWithEntity:[qualifier entity]]; self->adaptor = RETAIN([[channel adaptorContext] adaptor]); sql = [self assembleDeleteStatementWithQualifier:qualifier tableList:[entity externalName] whereClause:[self whereClauseForQualifier:qualifier]]; self->content = [sql mutableCopy]; [self finishBuildingExpression]; return self; } - (id)insertExpressionForRow:(NSDictionary *)row entity:(EOEntity*)_entity channel:(EOAdaptorChannel*)channel { NSString *sql; self = [self initWithEntity:_entity]; self->adaptor = RETAIN([[channel adaptorContext] adaptor]); sql = [self assembleInsertStatementWithRow:row tableList:[entity externalName] columnList:[self columnListForRow:row] valueList:[self valueListForRow:row]]; self->content = [sql mutableCopy]; [self finishBuildingExpression]; return self; } + (id)selectExpressionForAttributes:(NSArray *)attributes lock:(BOOL)flag qualifier:(EOSQLQualifier *)qualifier fetchOrder:(NSArray *)fetchOrder channel:(EOAdaptorChannel *)channel { EOSQLExpression* sqlExpression = AUTORELEASE([[self selectExpressionClass] new]); [sqlExpression selectExpressionForAttributes:attributes lock:flag qualifier:qualifier fetchOrder:fetchOrder channel:channel]; return sqlExpression; } - (id)selectExpressionForAttributes:(NSArray *)attributes lock:(BOOL)flag qualifier:(EOSQLQualifier *)qualifier fetchOrder:(NSArray *)fetchOrder channel:(EOAdaptorChannel *)channel { NSArray *relationshipPaths; NSString *sql; self = [self initWithEntity:[qualifier entity]]; self->adaptor = [[[channel adaptorContext] adaptor] retain]; // self->content = [NSMutableString new]; // mh: BUG!!! relationshipPaths = [self relationshipPathsForAttributes:attributes qualifier:qualifier fetchOrder:fetchOrder]; sql = [self assembleSelectStatementWithAttributes:attributes lock:flag qualifier:qualifier fetchOrder:fetchOrder selectString: [qualifier usesDistinct] ? @"SELECT DISTINCT" : @"SELECT" columnList: [self selectListWithAttributes:attributes qualifier:qualifier] tableList:[self fromClause] whereClause:[self whereClauseForQualifier:qualifier] joinClause: [self joinExpressionForRelationshipPaths:relationshipPaths] orderByClause:[self orderByClauseForFetchOrder:fetchOrder] lockClause:flag ? [self lockClause] : (NSString *)nil]; self->content = [sql mutableCopy]; [self finishBuildingExpression]; return self; } + (id)updateExpressionForRow:(NSDictionary *)row qualifier:(EOSQLQualifier *)qualifier channel:(EOAdaptorChannel *)channel { EOSQLExpression* sqlExpression = AUTORELEASE([[self updateExpressionClass] new]); [sqlExpression updateExpressionForRow:row qualifier:qualifier channel:channel]; return sqlExpression; } - (id)updateExpressionForRow:(NSDictionary *)row qualifier:(EOSQLQualifier *)qualifier channel:(EOAdaptorChannel *)channel { NSString *sql; self = [self initWithEntity:[qualifier entity]]; if (self->entity == nil) { [[[InvalidQualifierException alloc] initWithFormat:@"entity for qualifier %@ is nil", [qualifier expressionValueForContext:nil]] raise]; } self->adaptor = [[[channel adaptorContext] adaptor] retain]; self->content = [[NSMutableString alloc] init]; sql = [self assembleUpdateStatementWithRow:row qualifier:qualifier tableList:[entity externalName] updateList:[self updateListForRow:row] whereClause:[self whereClauseForQualifier:qualifier]]; [self->content appendString:sql]; [self finishBuildingExpression]; return self; } - (void)dealloc { RELEASE(self->bindings); RELEASE(self->listString); RELEASE(self->whereClauseString); RELEASE(self->entity); RELEASE(self->adaptor); RELEASE(self->entitiesAndPropertiesAliases); RELEASE(self->fromListEntities); RELEASE(self->content); [super dealloc]; } - (NSString *)selectListWithAttributes:(NSArray *)attributes qualifier:(EOSQLQualifier *)qualifier { NSMutableString *selectList; NSEnumerator *enumerator; BOOL first = YES; EOAttribute *attribute; selectList = [NSMutableString stringWithCapacity:128]; enumerator = [attributes objectEnumerator]; while ((attribute = [enumerator nextObject])) { if(first) first = NO; else [selectList appendString:@", "]; [selectList appendString:[self expressionValueForAttribute:attribute]]; } return selectList; } - (NSString *)fromClause { NSMutableString *fromClause; NSEnumerator *enumerator; BOOL first = YES; id key; fromClause = [NSMutableString stringWithCapacity:64]; enumerator = [self->fromListEntities objectEnumerator]; /* Compute the FROM list from all the aliases found in entitiesAndPropertiesAliases dictionary. Note that this dictionary contains entities and relationships. The last ones are there for flattened attributes over reflexive relationships. */ while ((key = [enumerator nextObject])) { if (first) first = NO; else [fromClause appendString:@", "]; if ([key isKindOfClass:[EORelationship class]]) { /* This key corresponds to a flattened attribute. */ [fromClause appendFormat:@"%@ %@", [[key destinationEntity] externalName], [entitiesAndPropertiesAliases objectForKey:key]]; } else { /* This is an EOEntity. */ [fromClause appendFormat:@"%@ %@", [key externalName], [entitiesAndPropertiesAliases objectForKey:key]]; } } return fromClause; } - (NSString *)whereClauseForQualifier:(EOSQLQualifier *)_qualifier { return [_qualifier expressionValueForContext:self]; } - (NSString *)joinExpressionForRelationshipPaths:(NSArray *)relationshipPaths { NSMutableString *expression; NSEnumerator *enumerator; NSMutableArray *rels; NSArray *relationshipPath; EORelationship *relationship; BOOL first = YES; expression = [NSMutableString stringWithCapacity:64]; enumerator = [relationshipPaths objectEnumerator]; rels = [[NSMutableArray alloc] initWithCapacity:4]; while ((relationshipPath = [enumerator nextObject]) != nil) { NSEnumerator *componentRelationshipsEnumerator; id context; componentRelationshipsEnumerator = [relationshipPath objectEnumerator]; context = entity; while((relationship = [componentRelationshipsEnumerator nextObject])) { if (![rels containsObject:relationship]) { id sourceAttribute, destinationAttribute; [rels addObject:relationship]; /* Compute the SQL expression string corresponding to each join in the relationship. */ sourceAttribute = [self expressionValueForAttribute: [relationship sourceAttribute] context:context]; destinationAttribute = [self expressionValueForAttribute: [relationship destinationAttribute] context: [relationship destinationEntity]]; //NSLog(@"sourceAttribute %@", sourceAttribute); //NSLog(@"destinationAttribute %@", destinationAttribute); if (first) first = NO; else [expression appendString:@" AND "]; [expression appendString:[sourceAttribute description]]; [expression appendString:@" = "]; [expression appendString:[destinationAttribute description]]; } /* Compute the next context which is the current relationship. */ context = [relationship destinationEntity]; } } [rels release]; return expression; } - (NSString *)orderByClauseForFetchOrder:(NSArray *)fetchOrder { int i, count; NSMutableString *orderBy; if ((count = [fetchOrder count]) == 0) return @""; orderBy = (id)[NSMutableString stringWithCapacity:32]; for(i = 0; i < count; i++) { id eorder; eorder = [fetchOrder objectAtIndex:i]; if (i != 0) [orderBy appendString:@", "]; if ([eorder isKindOfClass:[EOSortOrdering class]]) { EOSortOrdering *order; EOAttribute *attribute; SEL ordering; NSString *fmt; order = eorder; ordering = [order selector]; attribute = [self->entity attributeNamed:[order key]]; if (sel_eq(ordering, EOCompareCaseInsensitiveAscending) || sel_eq(ordering, EOCompareCaseInsensitiveDescending)) fmt = @"LOWER(%@)"; else fmt = @"%@"; [orderBy appendFormat:fmt, [self expressionValueForAttribute:attribute]]; if (sel_eq(ordering, EOCompareCaseInsensitiveAscending) || sel_eq(ordering, EOCompareAscending)) { [orderBy appendString:@" ASC"]; } else if (sel_eq(ordering, EOCompareCaseInsensitiveDescending) || sel_eq(ordering, EOCompareDescending)) { [orderBy appendString:@" DESC"]; } } else { EOAttributeOrdering *order; EOOrdering ordering; order = eorder; ordering = [order ordering]; [orderBy appendFormat:@"%@", [self expressionValueForAttribute:[order attribute]]]; if (ordering != EOAnyOrder) [orderBy appendString: ([order ordering] == EOAscendingOrder ? @" ASC" : @" DESC")]; } } return orderBy; } - (NSString *)literalForAttribute:(EOAttribute *)_attribute withValue:(id)_value fromRow:(NSDictionary *)_row { return (self->adaptor) ? [self->adaptor formatValue:(_value ? _value : (id)null) forAttribute:_attribute] : (id)[_value stringValue]; } - (id)updateListForRow:(NSDictionary *)row { PrintfFormatScanner *formatScanner = nil; EOInsertUpdateScannerHandler *scannerHandler = nil; NSMutableString *expression = nil; NSEnumerator *enumerator; NSString *attributeName = nil; BOOL first = YES; enumerator = [row keyEnumerator]; expression = [NSMutableString stringWithCapacity:256]; formatScanner = [[PrintfFormatScanner alloc] init]; AUTORELEASE(formatScanner); scannerHandler = [[EOInsertUpdateScannerHandler alloc] init]; AUTORELEASE(scannerHandler); [formatScanner setAllowOnlySpecifier:YES]; [formatScanner setFormatScannerHandler:scannerHandler]; while((attributeName = [enumerator nextObject])) { EOAttribute *attribute; NSString *columnName = nil; id value = nil; attribute = [entity attributeNamed:attributeName]; NSAssert1(attribute, @"attribute %@ should be non nil", attributeName); columnName = adaptor ? (NSString *)[adaptor formatAttribute:attribute] : [attribute columnName]; value = [row objectForKey:attributeName]; value = [self literalForAttribute:attribute withValue:value fromRow:row]; if (first) first = NO; else [expression appendString:@", "]; [expression appendString:columnName]; [expression appendString:@" = "]; [expression appendString:value]; } return expression; } - (id)columnListForRow:(NSDictionary *)row { NSMutableString *expression; NSEnumerator *enumerator; NSString *attributeName = nil; BOOL first = YES; expression = [NSMutableString stringWithCapacity:128]; enumerator = [row keyEnumerator]; while ((attributeName = [enumerator nextObject])) { EOAttribute *attribute; NSString *columnName; attribute = [entity attributeNamed:attributeName]; NSAssert1(attribute, @"attribute %@ should be non nil", attributeName); columnName = adaptor ? (NSString *)[adaptor formatAttribute:attribute] : [attribute columnName]; if (first) first = NO; else [expression appendString:@", "]; [expression appendString:columnName]; } return expression; } - (id)valueListForRow:(NSDictionary *)row { EOInsertUpdateScannerHandler *scannerHandler; PrintfFormatScanner *formatScanner; NSEnumerator *enumerator; NSString *attributeName = nil; NSMutableString *expression = nil; BOOL first = YES; formatScanner = [[PrintfFormatScanner alloc] init]; AUTORELEASE(formatScanner); scannerHandler = [[EOInsertUpdateScannerHandler alloc] init]; AUTORELEASE(scannerHandler); expression = [NSMutableString stringWithCapacity:256]; enumerator = [row keyEnumerator]; [formatScanner setAllowOnlySpecifier:YES]; [formatScanner setFormatScannerHandler:scannerHandler]; while ((attributeName = [enumerator nextObject])) { EOAttribute *attribute; id value; attribute = [entity attributeNamed:attributeName]; value = [row objectForKey:attributeName]; NSAssert1(attribute, @"attribute %@ should be non nil", attributeName); value = [self literalForAttribute:attribute withValue:value fromRow:row]; if (first) first = NO; else [expression appendString:@", "]; [expression appendString:value]; } return expression; } - (NSArray *)relationshipPathsForAttributes:(NSArray *)attributes qualifier:(EOSQLQualifier *)qualifier fetchOrder:(NSArray *)fetchOrder { int i, count; NSMutableSet *entities; NSMutableSet *relationshipPaths; NSEnumerator *enumerator; id entityOrRelationship; entities = [NSMutableSet set]; relationshipPaths = [NSMutableSet set]; NSAssert3(self->entity, @"entity should be non nil (attrs=%@, qual=%@, order=%@)", attributes, qualifier, fetchOrder); for (i = 0, count = [attributes count]; i < count; i++) { EOAttribute *attribute; attribute = [attributes objectAtIndex:i]; if ([attribute entity] != entity) { [[[InvalidAttributeException alloc] initWithFormat:@"all attributes must be from the same " @"entity (attribute '%@' is not in '%@')", [attribute name], [entity name]] raise]; } /* attribute is normal. */ [entities addObject:[attribute entity]]; } [relationshipPaths unionSet:[qualifier relationshipPaths]]; [entities unionSet:[qualifier additionalEntities]]; for (i = 0, count = [fetchOrder count]; i < count; i++) { EOAttribute *attribute; id eorder; eorder = [fetchOrder objectAtIndex:i]; attribute = ([eorder isKindOfClass:[EOSortOrdering class]]) ? [self->entity attributeNamed:[(EOSortOrdering *)eorder key]] : [(EOAttributeOrdering *)eorder attribute]; if ([attribute entity] != entity) { [[[InvalidAttributeException alloc] initWithFormat:@"all attributes must be from the same " @"entity (attribute '%@' is not in '%@')", [attribute name], [entity name]] raise]; } } entitiesAndPropertiesAliases = [NSMutableDictionary new]; fromListEntities = [NSMutableArray new]; enumerator = [entities objectEnumerator]; i = 1; while ((entityOrRelationship = [enumerator nextObject])) { NSString* alias = [NSString stringWithFormat:@"t%d", i++]; [entitiesAndPropertiesAliases setObject:alias forKey:entityOrRelationship]; [fromListEntities addObject:entityOrRelationship]; } return [relationshipPaths allObjects]; } - (EOEntity *)entity { return self->entity; } - (id)finishBuildingExpression { return self; } - (NSString *)lockClause { return @""; } - (NSString *)expressionValueForAttribute:(EOAttribute *)attribute context:(id)context { NSString *alias = [entitiesAndPropertiesAliases objectForKey:context]; NSString *columnName = nil; columnName = adaptor ? (NSString *)[adaptor formatAttribute:attribute] : [attribute columnName]; return alias ? (NSString *)[NSString stringWithFormat:@"%@.%@", alias, columnName] : columnName; } - (NSString *)expressionValueForAttribute:(EOAttribute *)attribute { /* attribute is a normal attribute. Its alias is the alias of its entity. */ return [self expressionValueForAttribute:attribute context:[attribute entity]]; } - (NSString *)expressionValueForAttributePath:(NSArray *)definitionArray { /* Take the alias of the last relationship. */ id relationship; NSString *alias; relationship = [definitionArray objectAtIndex:([definitionArray count] - 2)]; alias = [entitiesAndPropertiesAliases objectForKey:relationship]; return AUTORELEASE(([[NSString alloc] initWithFormat:@"%@.%@", alias, [[definitionArray lastObject] columnName]])); } - (NSString *)expressionValueForContext:(id)context { return self->content; } + (Class)selectExpressionClass { return [EOSelectSQLExpression class]; } + (Class)insertExpressionClass { return [EOInsertSQLExpression class]; } + (Class)deleteExpressionClass { return [EODeleteSQLExpression class]; } + (Class)updateExpressionClass { return [EOUpdateSQLExpression class]; } - (EOAdaptor *)adaptor { return self->adaptor; } /* description */ - (NSString *)description { NSMutableString *ms; ms = [NSMutableString stringWithCapacity:128]; [ms appendFormat:@"<0x%p[%@]:\n", self, NSStringFromClass([self class])]; if (self->entity) [ms appendFormat:@" entity=%@\n", self->entity]; if (self->adaptor) [ms appendFormat:@" adaptor=%@\n", self->adaptor]; if (self->content) [ms appendFormat:@" content='%@\n'", self->content]; if (self->entitiesAndPropertiesAliases) [ms appendFormat:@" aliases=%@\n", self->entitiesAndPropertiesAliases]; if (self->fromListEntities) [ms appendFormat:@" from-entities=%@\n", self->fromListEntities]; if (self->whereClauseString) [ms appendFormat:@" where=%@\n", self->whereClauseString]; if (self->listString) [ms appendFormat:@" list=%@\n", self->listString]; if (self->bindings) [ms appendFormat:@" bindings=%@\n", self->bindings]; [ms appendString:@">"]; return ms; } @end /* EOSQLExpression */ @implementation EOInsertSQLExpression @end /* EOInsertSQLExpression */ @implementation EOUpdateSQLExpression @end /* EOUpdateSQLExpression */ @implementation EODeleteSQLExpression @end /* EODeleteSQLExpression */ @implementation EOSQLExpression(NewInEOF2) + (EOSQLExpression *)selectStatementForAttributes:(NSArray *)_attributes lock:(BOOL)_flag fetchSpecification:(EOFetchSpecification *)_fspec entity:(EOEntity *)_entity { if (_fspec == nil) { [NSException raise:NSInvalidArgumentException format:@"missing fetch specification argument .."]; } if ([_attributes count] == 0) { [NSException raise:NSInvalidArgumentException format:@"missing attributes for select .."]; } return [self selectExpressionForAttributes:_attributes lock:_flag qualifier:[[_fspec qualifier] sqlQualifierForEntity:_entity] fetchOrder:[_fspec sortOrderings] channel:nil]; } + (EOSQLExpression *)expressionForString:(NSString *)_sql { EOSQLExpression *se; se = [[EOSQLExpression alloc] init]; [se setStatement:_sql]; return AUTORELEASE(se); } /* accessors */ - (void)setStatement:(NSString *)_stmt { id tmp; tmp = self->content; self->content = [_stmt mutableCopy]; RELEASE(tmp); } - (NSString *)statement { return self->content; } - (NSString *)whereClauseString { return self->whereClauseString; } /* tables */ - (NSString *)tableListWithRootEntity:(EOEntity *)_entity { return ([self->fromListEntities count] > 0) ? [self fromClause] : [_entity externalName]; } /* assembly */ - (NSString *)assembleDeleteStatementWithQualifier:(EOQualifier *)_qualifier tableList:(NSString *)_tableList whereClause:(NSString *)_whereClause { NSMutableString *s; s = [NSMutableString stringWithCapacity:64]; [s appendString:@"DELETE FROM "]; [s appendString:_tableList]; [s appendString:@" WHERE "]; [s appendString:_whereClause]; return s; } - (NSString *)assembleInsertStatementWithRow:(NSDictionary *)_row tableList:(NSString *)_tables columnList:(NSString *)_columns valueList:(NSString *)_values { NSMutableString *s; s = [NSMutableString stringWithCapacity:256]; [s appendString:@"INSERT INTO "]; [s appendString:_tables]; [s appendString:@" ("]; [s appendString:_columns]; [s appendString:@") VALUES ("]; [s appendString:_values]; [s appendString:@")"]; return s; } - (NSString *)assembleSelectStatementWithAttributes:(NSArray *)_attributes lock:(BOOL)_lock qualifier:(EOQualifier *)_qualifier fetchOrder:(NSArray *)_fetchOrder selectString:(NSString *)_selectString columnList:(NSString *)_columns tableList:(NSString *)_tables whereClause:(NSString *)_whereClause joinClause:(NSString *)_joinClause orderByClause:(NSString *)_orderByClause lockClause:(NSString *)_lockClause { NSMutableString *s; unsigned wlen, jlen; #if 0 #warning DEBUG LOG, REMOVE! [self logWithFormat:@"%s: '%@': %@", __PRETTY_FUNCTION__, _whereClause,self]; #endif s = [NSMutableString stringWithCapacity:256]; [s appendString:_selectString ? _selectString : (NSString *)@"SELECT"]; [s appendString:@" "]; [s appendString:_columns]; [s appendString:@" FROM "]; [s appendString:_tables]; if ([_lockClause length] > 0) { [s appendString:@" "]; [s appendString:_lockClause]; } wlen = [_whereClause length]; jlen = [_joinClause length]; if ((wlen > 0) || (jlen > 0)) [s appendString:@" WHERE "]; if (wlen > 0) [s appendString:_whereClause]; if ((wlen > 0) && (jlen > 0)) [s appendString:@" AND "]; if (jlen > 0) [s appendString:_joinClause]; if ([_orderByClause length] > 0) { [s appendString:@" ORDER BY "]; [s appendString:_orderByClause]; } return s; } - (NSString *)assembleUpdateStatementWithRow:(NSDictionary *)_row qualifier:(EOQualifier *)_qualifier tableList:(NSString *)_tables updateList:(NSString *)_updates whereClause:(NSString *)_whereClause { NSMutableString *s; s = [NSMutableString stringWithCapacity:256]; [s appendString:@"UPDATE "]; [s appendString:_tables]; [s appendString:@" SET "]; [s appendString:_updates]; [s appendString:@" WHERE "]; [s appendString:_whereClause]; return s; } - (NSString *)assembleJoinClauseWithLeftName:(NSString *)_leftName rightName:(NSString *)_rightName joinSemantic:(EOJoinSemantic)_semantic { NSMutableString *s; s = [NSMutableString stringWithCapacity:64]; [s appendString:_leftName]; switch (_semantic) { case EOInnerJoin: [s appendString:@" = "]; break; case EOFullOuterJoin: [s appendString:@" *=* "]; break; case EOLeftOuterJoin: [s appendString:@" *= "]; break; case EORightOuterJoin: [s appendString:@" =* "]; break; } [s appendString:_rightName]; return s; } /* attributes */ - (NSString *)sqlStringForAttribute:(EOAttribute *)_attribute { NSLog(@"ERROR(%s): subclasses need to override this method!", __PRETTY_FUNCTION__); return nil; } - (NSString *)sqlStringForAttributePath:(NSString *)_attrPath { NSLog(@"ERROR(%s): subclasses need to override this method!", __PRETTY_FUNCTION__); return nil; } - (NSString *)sqlStringForAttributeNamed:(NSString *)_attrName { EOAttribute *a; if ((a = [[self entity] attributeNamed:_attrName])) return [self sqlStringForAttribute:a]; return [self sqlStringForAttributePath:_attrName]; } /* bind variables */ + (BOOL)useBindVariables { return NO; } - (BOOL)mustUseBindVariableForAttribute:(EOAttribute *)_attr { return NO; } - (BOOL)shouldUseBindVariableForAttribute:(EOAttribute *)_attr { return NO; } - (NSMutableDictionary *)bindVariableDictionaryForAttribute:(EOAttribute *)_a value:(id)_value { NSMutableDictionary *d; d = [NSMutableDictionary dictionaryWithCapacity:8]; [d setObject:_a forKey:EOBindVariableAttributeKey]; [d setObject:_value ? _value : (id)null forKey:EOBindVariableValueKey]; return d; } - (void)addBindVariableDictionary:(NSMutableDictionary *)_dictionary { if (self->bindings == nil) self->bindings = [[NSMutableArray alloc] init]; } - (NSArray *)bindVariableDictionaries { return self->bindings; } /* values */ + (NSString *)formatValue:(id)_value forAttribute:(EOAttribute *)_attribute { return _value != nil ? _value : (id)null; } - (NSString *)sqlStringForValue:(id)_value attributeNamed:(NSString *)_attrName { NSMutableDictionary *bindVars; EOAttribute *attribute; attribute = [[self entity] attributeNamed:_attrName]; if ([self mustUseBindVariableForAttribute:attribute]) bindVars = [self bindVariableDictionaryForAttribute:attribute value:_value]; else if ([[self class] useBindVariables] && [self shouldUseBindVariableForAttribute:attribute]) { bindVars = [self bindVariableDictionaryForAttribute:attribute value:_value]; } else bindVars = nil; if (bindVars) { [self addBindVariableDictionary:bindVars]; return [bindVars objectForKey:EOBindVariablePlaceHolderKey]; } return [[self class] formatValue:(_value ? _value : (id)null) forAttribute:attribute]; } + (NSString *)sqlPatternFromShellPattern:(NSString *)_pattern { unsigned len; if ((len = [_pattern length]) > 0) { unsigned cstrLen = [_pattern cStringLength]; char cstrBuf[cstrLen + 1]; const char *cstr; char buf[len * 3 + 1]; unsigned i; BOOL didSomething = NO; [_pattern getCString:cstrBuf]; cstr = cstrBuf; for (i = 0; *cstr; cstr++) { switch (*cstr) { case '*': buf[i] = '%'; i++; didSomething = YES; break; case '?': buf[i] = '_'; i++; didSomething = YES; break; case '%': buf[i] = '['; i++; buf[i] = '%'; i++; buf[i] = ']'; i++; didSomething = YES; break; case '_': buf[i] = '['; i++; buf[i] = '_'; i++; buf[i] = ']'; i++; didSomething = YES; break; default: buf[i] = *cstr; i++; break; } } buf[i] = '\0'; return (didSomething) ? (NSString *)[NSString stringWithCString:buf length:i] : (NSString *)_pattern; } return _pattern; } /* SQL formats */ + (NSString *)formatSQLString:(NSString *)_sqlString format:(NSString *)_fmt { return _sqlString; } /* qualifier operators */ - (NSString *)sqlStringForSelector:(SEL)_selector value:(id)_value { if ((_value == null) || (_value == nil)) { if (sel_eq(_selector, EOQualifierOperatorEqual)) return @"is"; else if (sel_eq(_selector, EOQualifierOperatorNotEqual)) return @"is not"; } else { if (sel_eq(_selector, EOQualifierOperatorEqual)) return @"="; else if (sel_eq(_selector, EOQualifierOperatorNotEqual)) return @"<>"; } if (sel_eq(_selector, EOQualifierOperatorLessThan)) return @"<"; else if (sel_eq(_selector, EOQualifierOperatorGreaterThan)) return @">"; else if (sel_eq(_selector, EOQualifierOperatorLessThanOrEqualTo)) return @"<="; else if (sel_eq(_selector, EOQualifierOperatorGreaterThanOrEqualTo)) return @">="; else if (sel_eq(_selector, EOQualifierOperatorLike)) return @"LIKE"; else { return [NSString stringWithFormat:@"UNKNOWN<%@>", NSStringFromSelector(_selector)]; } } /* qualifiers */ - (NSString *)sqlStringForKeyComparisonQualifier:(EOKeyComparisonQualifier *)_q { NSMutableString *s; NSString *sql; s = [NSMutableString stringWithCapacity:64]; sql = [self sqlStringForAttributeNamed:[_q leftKey]]; sql = [[self class] formatSQLString:sql format:nil]; [s appendString:sql]; [s appendString:@" "]; [s appendString:[self sqlStringForSelector:[_q selector] value:nil]]; [s appendString:@" "]; sql = [self sqlStringForAttributeNamed:[_q rightKey]]; sql = [[self class] formatSQLString:sql format:nil]; [s appendString:sql]; return s; } - (NSString *)sqlStringForKeyValueQualifier:(EOKeyValueQualifier *)_q { NSMutableString *s; NSString *sql; id v; v = [_q value]; s = [NSMutableString stringWithCapacity:64]; sql = [self sqlStringForAttributeNamed:[_q key]]; sql = [[self class] formatSQLString:sql format:nil]; [s appendString:sql]; [s appendString:@" "]; sql = [self sqlStringForSelector:[_q selector] value:v]; [s appendString:sql]; [s appendString:@" "]; if (([_q selector] == EOQualifierOperatorLike) || ([_q selector] == EOQualifierOperatorCaseInsensitiveLike)) v = [[self class] sqlPatternFromShellPattern:v]; sql = [self sqlStringForValue:v attributeNamed:[_q key]]; [s appendString:sql]; return s; } - (NSString *)sqlStringForNegatedQualifier:(EOQualifier *)_q { NSMutableString *s; NSString *sql; sql = [(id)_q sqlStringForSQLExpression:self]; s = [NSMutableString stringWithCapacity:[sql length] + 8]; [s appendString:@"NOT ("]; [s appendString:sql]; [s appendString:@")"]; return s; } - (NSString *)sqlStringForConjoinedQualifiers:(NSArray *)_qs { NSMutableString *s; unsigned i, count; id (*objAtIdx)(id,SEL,unsigned); objAtIdx = (void *)[_qs methodForSelector:@selector(objectAtIndex:)]; for (i = 0, count = [_qs count], s = nil; i < count; i++) { id q; q = objAtIdx(self, @selector(objectAtIndex:), i); if (s == nil) s = [NSMutableString stringWithCapacity:128]; else [s appendString:@" AND "]; [s appendString:[q sqlStringForSQLExpression:self]]; } return s; } - (NSString *)sqlStringForDisjoinedQualifiers:(NSArray *)_qs { NSMutableString *s; unsigned i, count; id (*objAtIdx)(id,SEL,unsigned); objAtIdx = (void *)[_qs methodForSelector:@selector(objectAtIndex:)]; for (i = 0, count = [_qs count], s = nil; i < count; i++) { id q; q = objAtIdx(self, @selector(objectAtIndex:), i); if (s == nil) s = [NSMutableString stringWithCapacity:128]; else [s appendString:@" OR "]; [s appendString:[q sqlStringForSQLExpression:self]]; } return s; } /* list strings */ - (NSMutableString *)listString { if (self->listString == nil) self->listString = [[NSMutableString alloc] initWithCapacity:128]; return self->listString; } - (void)appendItem:(NSString *)_itemString toListString:(NSMutableString *)_ls { if ([_ls length] > 0) [_ls appendString:@","]; [_ls appendString:_itemString]; } /* deletes */ - (void)prepareDeleteExpressionForQualifier:(EOQualifier *)_qual { NSString *tableList, *sql; self->whereClauseString = [[(id)_qual sqlStringForSQLExpression:self] copy]; tableList = [self tableListWithRootEntity:[self entity]]; sql = [self assembleDeleteStatementWithQualifier:_qual tableList:tableList whereClause:[self whereClauseString]]; [self setStatement:sql]; } /* updates */ - (void)addUpdateListAttribute:(EOAttribute *)_attr value:(NSString *)_value { NSMutableString *s; s = [[NSMutableString alloc] initWithCapacity:32]; [s appendString:[_attr columnName]]; [s appendString:@"="]; _value = [[self class] formatSQLString:_value format:nil]; [s appendString:_value]; [self appendItem:s toListString:[self listString]]; RELEASE(s); } - (void)prepareUpdateExpressionWithRow:(NSDictionary *)_row qualifier:(EOQualifier *)_qual { NSEnumerator *keys; NSString *key; NSString *tableList, *sql; keys = [_row keyEnumerator]; while ((key = [keys nextObject])) { EOAttribute *attribute; id value; attribute = [self->entity attributeNamed:key]; value = [_row objectForKey:key]; [self addUpdateListAttribute:attribute value:value]; } self->whereClauseString = [[(id)_qual sqlStringForSQLExpression:self] copy]; tableList = [self tableListWithRootEntity:[self entity]]; sql = [self assembleUpdateStatementWithRow:_row qualifier:_qual tableList:tableList updateList:[self listString] whereClause:[self whereClauseString]]; [self setStatement:sql]; } @end /* EOSQLExpression(NewInEOF2) */ SOPE/sope-gdl1/GDLAccess/EOEntity.m0000644000000000000000000010136612242733417015537 0ustar rootroot/* EOEntity.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: August 1996 Author: Helge Hess Date: November 1999 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import "common.h" #import "EOEntity.h" #import "EOAttribute.h" #import "EOFExceptions.h" #import "EOModel.h" #import "EOPrimaryKeyDictionary.h" #import "EOSQLQualifier.h" #import "EORelationship.h" #import #import static int _compareByName(id obj1, id obj2, void * context); @interface NSObject(MappedArrayProtocol) - (NSArray *)mappedArrayUsingSelector:(SEL)_selector; @end @interface NSString(EntityBeautify) - (NSString *)_beautifyEntityName; @end @implementation EOEntity - (id)init { if ((self = [super init])) { self->attributes = [[NSArray alloc] init]; self->attributesByName = [[NSMutableDictionary alloc] init]; self->relationships = [[NSArray alloc] init]; self->relationshipsByName = [[NSMutableDictionary alloc] init]; self->classProperties = [[NSArray alloc] init]; self->model = nil; } return self; } - (void)resetAttributes { [self->attributes makeObjectsPerformSelector:@selector(resetEntity)]; } - (void)resetRelationships { [self->relationships makeObjectsPerformSelector:@selector(resetEntities)]; } - (void)dealloc { self->model = nil; RELEASE(self->qualifier); [self resetAttributes]; RELEASE(self->attributes); RELEASE(self->attributesByName); [self resetRelationships]; RELEASE(self->relationships); RELEASE(self->relationshipsByName); RELEASE(self->primaryKeyAttributes); RELEASE(self->classProperties); RELEASE(self->attributesUsedForLocking); RELEASE(self->attributesUsedForInsert); RELEASE(self->attributesUsedForFetch); RELEASE(self->relationsUsedForFetch); RELEASE(self->name); self->name = nil; RELEASE(self->className); self->className = nil; RELEASE(self->externalName); self->externalName = nil; RELEASE(self->externalQuery); self->externalQuery = nil; RELEASE(self->userDictionary); self->userDictionary = nil; RELEASE(self->primaryKeyAttributeNames); self->primaryKeyAttributeNames = nil; RELEASE(self->attributesNamesUsedForInsert); self->attributesNamesUsedForInsert = nil; RELEASE(self->classPropertyNames); self->classPropertyNames = nil; [super dealloc]; } // These methods should be here to let the library work with NeXT foundation - (id)copy { return RETAIN(self); } - (id)copyWithZone:(NSZone *)_zone { return RETAIN(self); } // Is equal only if same name; used to make aliasing ordering stable - (unsigned)hash { return [name hash]; } - (id)initWithName:(NSString *)_name { [self init]; ASSIGN(name, _name); return self; } - (BOOL)setName:(NSString *)_name { if([model entityNamed:name]) return NO; ASSIGN(name, _name); return YES; } + (BOOL)isValidName:(NSString *)attributeName { unsigned len = [attributeName cStringLength]; char buf[len + 1]; const char *s; s = buf; [attributeName getCString:buf]; if(!isalnum((int)*s) && *s != '@' && *s != '_' && *s != '#') return NO; for(++s; *s; s++) if(!isalnum((int)*s) && *s != '@' && *s != '_' && *s != '#' && *s != '$') return NO; return YES; } - (BOOL)addAttribute:(EOAttribute *)attribute { NSString* attributeName = [attribute name]; if([self->attributesByName objectForKey:attributeName]) return NO; if([self->relationshipsByName objectForKey:attributeName]) return NO; if([self createsMutableObjects]) [(NSMutableArray*)self->attributes addObject:attribute]; else { id newAttributes = [self->attributes arrayByAddingObject:attribute]; ASSIGN(self->attributes, newAttributes); } [self->attributesByName setObject:attribute forKey:attributeName]; [attribute setEntity:self]; [self invalidatePropertiesCache]; return YES; } - (void)removeAttributeNamed:(NSString *)attributeName { id attribute = [self->attributesByName objectForKey:attributeName]; if(attribute) { [attribute resetEntity]; if([self createsMutableObjects]) [(NSMutableArray*)attributes removeObject:attribute]; else { self->attributes = [AUTORELEASE(self->attributes) mutableCopy]; [(NSMutableArray*)self->attributes removeObject:attribute]; self->attributes = [AUTORELEASE(self->attributes) copy]; } [self->attributesByName removeObjectForKey:attributeName]; [self invalidatePropertiesCache]; } } - (EOAttribute *)attributeNamed:(NSString *)attributeName { return [self->attributesByName objectForKey:attributeName]; } - (BOOL)addRelationship:(EORelationship *)relationship { NSString* relationshipName = [relationship name]; if([self->attributesByName objectForKey:relationshipName]) return NO; if([self->relationshipsByName objectForKey:relationshipName]) return NO; if([self createsMutableObjects]) [(NSMutableArray*)relationships addObject:relationship]; else { id newRelationships = [self->relationships arrayByAddingObject:relationship]; ASSIGN(self->relationships, newRelationships); } [self->relationshipsByName setObject:relationship forKey:relationshipName]; [relationship setEntity:self]; [self invalidatePropertiesCache]; return YES; } - (void)removeRelationshipNamed:(NSString*)relationshipName { id relationship = [relationshipsByName objectForKey:relationshipName]; if(relationship) { [relationship setEntity:nil]; if([self createsMutableObjects]) [(NSMutableArray*)self->relationships removeObject:relationship]; else { self->relationships = [AUTORELEASE(self->relationships) mutableCopy]; [(NSMutableArray*)self->relationships removeObject:relationship]; self->relationships = [AUTORELEASE(relationships) copy]; } [self->relationshipsByName removeObjectForKey:relationship]; [self invalidatePropertiesCache]; } } - (EORelationship*)relationshipNamed:(NSString *)relationshipName { if([relationshipName isNameOfARelationshipPath]) { NSArray *defArray; int i, count; EOEntity *currentEntity = self; NSString *relName = nil; EORelationship *relationship = nil; defArray = [relationshipName componentsSeparatedByString:@"."]; relName = [defArray objectAtIndex:0]; for(i = 0, count = [defArray count]; i < count; i++) { if(![EOEntity isValidName:relName]) return nil; relationship = [currentEntity->relationshipsByName objectForKey:relName]; if(relationship == nil) return nil; currentEntity = [relationship destinationEntity]; } return relationship; } else return [self->relationshipsByName objectForKey:relationshipName]; } - (BOOL)setPrimaryKeyAttributes:(NSArray *)keys { int i, count = [keys count]; for(i = 0; i < count; i++) if(![self isValidPrimaryKeyAttribute:[keys objectAtIndex:i]]) return NO; RELEASE(self->primaryKeyAttributes); RELEASE(self->primaryKeyAttributeNames); if([keys isKindOfClass:[NSArray class]] || [keys isKindOfClass:[NSMutableArray class]]) self->primaryKeyAttributes = [keys copy]; else self->primaryKeyAttributes = [[NSArray alloc] initWithArray:keys]; self->primaryKeyAttributeNames = [NSMutableArray arrayWithCapacity:count]; for(i = 0; i < count; i++) { id key = [keys objectAtIndex:i]; [(NSMutableArray*)self->primaryKeyAttributeNames addObject:[(EOAttribute*)key name]]; } self->primaryKeyAttributeNames = RETAIN([self->primaryKeyAttributeNames sortedArrayUsingSelector:@selector(compare:)]); [self invalidatePropertiesCache]; return YES; } - (BOOL)isValidPrimaryKeyAttribute:(EOAttribute*)anAttribute { if(![anAttribute isKindOfClass:[EOAttribute class]]) return NO; if([self->attributesByName objectForKey:[anAttribute name]]) return YES; return NO; } - (NSDictionary *)primaryKeyForRow:(NSDictionary *)_row { return [EOPrimaryKeyDictionary dictionaryWithKeys: self->primaryKeyAttributeNames fromDictionary:_row]; } - (NSDictionary *)snapshotForRow:(NSDictionary *)aRow { NSArray *array; int i, n; NSMutableDictionary *dict; array = [self attributesUsedForLocking]; n = [array count]; dict = [NSMutableDictionary dictionaryWithCapacity:n]; for (i = 0; i < n; i++) { EOAttribute *attribute; NSString *attributeName; id value; attribute = [array objectAtIndex:i]; attributeName = [attribute name]; value = [aRow objectForKey:attributeName]; #if DEBUG NSString *columnName; columnName = [attribute columnName]; NSAssert1(columnName, @"missing column name in attribute %@ !", attribute); NSAssert3(value, @"missing value for column '%@' (attr '%@') in row %@", columnName, attribute, aRow); #endif [dict setObject:value forKey:attributeName]; } return dict; } /* Getting attributes used for database oprations */ - (NSArray*)attributesUsedForInsert { if (!flags.isPropertiesCacheValid) [self validatePropertiesCache]; return self->attributesUsedForInsert; } - (NSArray *)attributesUsedForFetch { if (!flags.isPropertiesCacheValid) [self validatePropertiesCache]; return self->attributesUsedForFetch; } - (NSArray *)relationsUsedForFetch { if (!flags.isPropertiesCacheValid) [self validatePropertiesCache]; return self->relationsUsedForFetch; } - (NSArray *)attributesNamesUsedForInsert { if (!flags.isPropertiesCacheValid) [self validatePropertiesCache]; return self->attributesNamesUsedForInsert; } - (BOOL)setClassProperties:(NSArray *)properties { int i, count = [properties count]; for(i = 0; i < count; i++) if(![self isValidClassProperty:[properties objectAtIndex:i]]) return NO; RELEASE(self->classProperties); self->classProperties = nil; RELEASE(self->classPropertyNames); self->classPropertyNames = nil; if([properties isKindOfClass:[NSArray class]] || [properties isKindOfClass:[NSMutableArray class]]) { self->classProperties = [properties copyWithZone:[self zone]]; } else { self->classProperties = [[NSArray allocWithZone:[self zone]] initWithArray:properties]; } self->classPropertyNames = [NSMutableArray arrayWithCapacity:count]; for(i = 0; i < count; i++) { id property = [properties objectAtIndex:i]; [(NSMutableArray*)classPropertyNames addObject:[(EOAttribute*)property name]]; } self->classPropertyNames = [self->classPropertyNames copyWithZone:[self zone]]; [self invalidatePropertiesCache]; return YES; } - (BOOL)isValidClassProperty:(id)aProperty { id thePropertyName = nil; if(!([aProperty isKindOfClass:[EOAttribute class]] || [aProperty isKindOfClass:[EORelationship class]])) return NO; thePropertyName = [(EOAttribute*)aProperty name]; if([self->attributesByName objectForKey:thePropertyName] || [self->relationshipsByName objectForKey:thePropertyName]) return YES; return NO; } - (NSArray *)relationshipsNamed:(NSString *)_relationshipPath { if([_relationshipPath isNameOfARelationshipPath]) { NSMutableArray *myRelationships = [[NSMutableArray alloc] init]; NSArray *defArray = [_relationshipPath componentsSeparatedByString:@"."]; int i, count = [defArray count] - 1; EOEntity *currentEntity = self; NSString *relName = nil; id relation = nil; for(i = 0; i < count; i++) { relName = [defArray objectAtIndex:i]; if([EOEntity isValidName:relName]) { relation = [currentEntity relationshipNamed:relName]; if(relation) { [myRelationships addObject:relation]; currentEntity = [relation destinationEntity]; } } } return AUTORELEASE(myRelationships); } return nil; } - (id)propertyNamed:(NSString *)_name { if([_name isNameOfARelationshipPath]) { NSArray *defArray = [_name componentsSeparatedByString:@"."]; EOEntity *currentEntity = self; NSString *propertyName; int i = 0, count = [defArray count]; id property; for(; i < count - 1; i++) { propertyName = [defArray objectAtIndex:i]; if(![EOEntity isValidName:propertyName]) return nil; property = [currentEntity propertyNamed:propertyName]; if(!property) return nil; currentEntity = [property destinationEntity]; } propertyName = [defArray lastObject]; property = [currentEntity attributeNamed:propertyName]; return property; } else { id attribute = nil; id relationship = nil; attribute = [self->attributesByName objectForKey:_name]; if(attribute) return attribute; relationship = [self->relationshipsByName objectForKey:_name]; if(relationship) return relationship; } return nil; } - (BOOL)setAttributesUsedForLocking:(NSArray *)_attributes { int i, count = [_attributes count]; for(i = 0; i < count; i++) if(![self isValidAttributeUsedForLocking: [_attributes objectAtIndex:i]]) return NO; RELEASE(self->attributesUsedForLocking); if([_attributes isKindOfClass:[NSArray class]] || [_attributes isKindOfClass:[NSMutableArray class]]) self->attributesUsedForLocking = [_attributes copy]; else self->attributesUsedForLocking = [[NSArray alloc] initWithArray:_attributes]; [self invalidatePropertiesCache]; return YES; } - (BOOL)isValidAttributeUsedForLocking:(EOAttribute*)anAttribute { if(!([anAttribute isKindOfClass:[EOAttribute class]] && [self->attributesByName objectForKey:[anAttribute name]])) return NO; return YES; } - (void)setModel:(EOModel *)aModel { self->model = aModel; /* non-retained */ } - (void)resetModel { self->model = nil; } - (BOOL)hasModel { return (self->model != nil) ? YES : NO; } - (void)setClassName:(NSString *)_name { if(!_name) _name = @"EOGenericRecord"; ASSIGN(self->className, _name); } - (void)setReadOnly:(BOOL)flag { flags.isReadOnly = flag; } - (BOOL)referencesProperty:(id)property { id propertyName = [(EOAttribute*)property name]; if([self->attributesByName objectForKey:propertyName] || [self->relationshipsByName objectForKey:propertyName]) return YES; return NO; } - (EOSQLQualifier*)qualifier { if (self->qualifier == nil) { self->qualifier = [[EOSQLQualifier allocWithZone:[self zone]] initWithEntity:self qualifierFormat:nil]; } return self->qualifier; } // accessors - (void)setExternalName:(NSString*)_name { ASSIGN(externalName, _name); } - (NSString *)externalName { return self->externalName; } - (void)setExternalQuery:(NSString*)query { ASSIGN(externalQuery, query); } - (NSString *)externalQuery { return self->externalQuery; } - (void)setUserDictionary:(NSDictionary*)dict { ASSIGN(userDictionary, dict); } - (NSDictionary *)userDictionary { return self->userDictionary; } - (NSString *)name { return self->name; } - (BOOL)isReadOnly { return self->flags.isReadOnly; } - (NSString *)className { return self->className; } - (NSArray *)attributesUsedForLocking { return self->attributesUsedForLocking; } - (NSArray *)classPropertyNames { return self->classPropertyNames; } - (NSArray *)classProperties { return self->classProperties; } - (NSArray *)primaryKeyAttributes { return self->primaryKeyAttributes; } - (NSArray *)primaryKeyAttributeNames { return self->primaryKeyAttributeNames; } - (NSArray *)relationships { return self->relationships; } - (EOModel *)model { return self->model; } - (NSArray *)attributes { return self->attributes; } /* EOEntityCreation */ + (EOEntity *)entityFromPropertyList:(id)propertyList model:(EOModel *)_model { NSDictionary *plist = propertyList; EOEntity *entity; NSArray *array; NSEnumerator *enumerator; id attributePList; id relationshipPList; entity = [[[EOEntity alloc] init] autorelease]; [entity setCreateMutableObjects:YES]; entity->name = RETAIN([plist objectForKey:@"name"]); entity->className = RETAIN([plist objectForKey:@"className"]); entity->externalName = RETAIN([plist objectForKey:@"externalName"]); entity->externalQuery = RETAIN([plist objectForKey:@"externalQuery"]); entity->userDictionary = RETAIN([plist objectForKey:@"userDictionary"]); array = [plist objectForKey:@"attributes"]; enumerator = [array objectEnumerator]; while ((attributePList = [enumerator nextObject])) { EOAttribute *attribute; attribute = [EOAttribute attributeFromPropertyList:attributePList]; if (![entity addAttribute:attribute]) { NSLog(@"duplicate name for attribute '%@' in entity '%@'", [attribute name], [entity name]); [_model errorInReading]; } } entity->attributesUsedForLocking = RETAIN([plist objectForKey:@"attributesUsedForLocking"]); entity->classPropertyNames = RETAIN([plist objectForKey:@"classProperties"]); if ((attributePList = [plist objectForKey:@"primaryKeyAttributes"])) { entity->primaryKeyAttributeNames = RETAIN([attributePList sortedArrayUsingSelector:@selector(compare:)]); } else if ((attributePList = [plist objectForKey:@"primaryKeyAttribute"])) entity->primaryKeyAttributeNames = RETAIN([NSArray arrayWithObject:attributePList]); array = [plist objectForKey:@"relationships"]; enumerator = [array objectEnumerator]; while((relationshipPList = [enumerator nextObject])) { EORelationship *relationship = [EORelationship relationshipFromPropertyList:relationshipPList model:_model]; if(![entity addRelationship:relationship]) { NSLog(@"duplicate name for relationship '%@' in entity '%@'", [relationship name], [entity name]); [_model errorInReading]; } } [entity setCreateMutableObjects:NO]; return entity; } - (void)replaceStringsWithObjects { NSEnumerator *enumerator = nil; EOAttribute *attribute = nil; NSString *attributeName = nil; NSString *propertyName = nil; NSMutableArray *array = nil; int i, count; enumerator = [self->primaryKeyAttributeNames objectEnumerator]; RELEASE(self->primaryKeyAttributes); self->primaryKeyAttributes = AUTORELEASE([NSMutableArray new]); while ((attributeName = [enumerator nextObject])) { attribute = [self attributeNamed:attributeName]; if((attribute == nil) || ![self isValidPrimaryKeyAttribute:attribute]) { NSLog(@"invalid attribute name specified as primary key attribute " @"'%s' in entity '%s'", [attributeName cString], [name cString]); [self->model errorInReading]; } else [(NSMutableArray*)self->primaryKeyAttributes addObject:attribute]; } self->primaryKeyAttributes = [self->primaryKeyAttributes copy]; enumerator = [self->classPropertyNames objectEnumerator]; RELEASE(self->classProperties); self->classProperties = AUTORELEASE([NSMutableArray new]); while((propertyName = [enumerator nextObject])) { id property; property = [self propertyNamed:propertyName]; if(!property || ![self isValidClassProperty:property]) { NSLog(@"invalid property '%s' specified as class property in " @"entity '%s'", [propertyName cString], [name cString]); [self->model errorInReading]; } else [(NSMutableArray*)self->classProperties addObject:property]; } self->classProperties = [self->classProperties copy]; array = AUTORELEASE([NSMutableArray new]); [array setArray:self->attributesUsedForLocking]; RELEASE(self->attributesUsedForLocking); count = [array count]; for(i = 0; i < count; i++) { attributeName = [array objectAtIndex:i]; attribute = [self attributeNamed:attributeName]; if(!attribute || ![self isValidAttributeUsedForLocking:attribute]) { NSLog(@"invalid attribute specified as attribute used for " @"locking '%@' in entity '%@'", attributeName, name); [self->model errorInReading]; } else [array replaceObjectAtIndex:i withObject:attribute]; } self->attributesUsedForLocking = [array copy]; } - (id)propertyList { id propertyList; propertyList = [NSMutableDictionary dictionary]; [self encodeIntoPropertyList:propertyList]; return propertyList; } - (void)setCreateMutableObjects:(BOOL)flag { if(self->flags.createsMutableObjects == flag) return; self->flags.createsMutableObjects = flag; if(self->flags.createsMutableObjects) { self->attributes = [AUTORELEASE(self->attributes) mutableCopy]; self->relationships = [AUTORELEASE(self->relationships) mutableCopy]; } else { self->attributes = [AUTORELEASE(self->attributes) copy]; self->relationships = [AUTORELEASE(self->relationships) copy]; } } - (BOOL)createsMutableObjects { return self->flags.createsMutableObjects; } #if 0 static inline void _printIds(NSArray *a, const char *pfx, const char *indent) { int i; if (pfx == NULL) pfx = ""; if (indent == NULL) indent = " "; printf("%s", pfx); for (i = 0; i < [a count]; i++) printf("%s0x%p\n", indent, (unsigned)[a objectAtIndex:i]); } #endif static inline BOOL _containsObject(NSArray *a, id obj) { id (*objAtIdx)(NSArray*, SEL, int idx); register int i; objAtIdx = (void *)[a methodForSelector:@selector(objectAtIndex:)]; for (i = [a count] - 1; i >= 0; i--) { register id o; o = objAtIdx(a, @selector(objectAtIndex:), i); if (o == obj) return YES; } return NO; } - (void)validatePropertiesCache { NSMutableArray *updAttr = [NSMutableArray new]; NSMutableArray *updName = [NSMutableArray new]; NSMutableArray *fetAttr = [NSMutableArray new]; NSMutableArray *fetRels = [NSMutableArray new]; int i; [self invalidatePropertiesCache]; #ifdef DEBUG NSAssert((updAttr != nil) && (updName != nil) && (fetAttr != nil) && (fetRels != nil), @"allocation of array failed !"); NSAssert(self->primaryKeyAttributes, @"no pkey attributes are set !"); NSAssert(self->attributesUsedForLocking, @"no locking attrs are set !"); NSAssert(self->classProperties, @"no class properties are set !"); #endif //_printIds(self->attributes, "attrs:\n", " "); //_printIds(self->attributesUsedForLocking, "lock:\n", " "); for (i = ([self->attributes count] - 1); i >= 0; i--) { EOAttribute *attr = [self->attributes objectAtIndex:i]; BOOL pk, lk, cp, sa; pk = _containsObject(self->primaryKeyAttributes, attr); lk = _containsObject(self->attributesUsedForLocking, attr); cp = _containsObject(self->classProperties, attr); sa = YES; #if 0 NSLog(@"attribute %@ pk=%i lk=%i cp=%i sa=%i", [attr name], pk, lk, cp, sa); #endif if ((pk || lk || cp) && (!_containsObject(fetAttr, attr))) [fetAttr addObject:attr]; if ((pk || lk || cp) && (sa) && (!_containsObject(updAttr, attr))) { [updAttr addObject:attr]; [updName addObject:[attr name]]; } } for (i = [relationships count]-1; i >= 0; i--) { id rel = [relationships objectAtIndex:i]; if (_containsObject(classProperties, rel)) [fetRels addObject:rel]; } RELEASE(self->attributesUsedForInsert); self->attributesUsedForInsert = [[NSArray alloc] initWithArray:updAttr]; RELEASE(self->relationsUsedForFetch); self->relationsUsedForFetch = [[NSArray alloc] initWithArray:fetRels]; RELEASE(self->attributesUsedForFetch); self->attributesUsedForFetch = [[NSArray alloc] initWithArray: [fetAttr sortedArrayUsingFunction:_compareByName context:nil]]; RELEASE(self->attributesNamesUsedForInsert); attributesNamesUsedForInsert = [updName copy]; if ([self->attributesUsedForFetch count] == 0) { NSLog(@"WARNING: entity %@ has no fetch attributes: " @"attributes=%@ !", self, [[(id)self->attributes mappedArrayUsingSelector:@selector(name)] componentsJoinedByString:@","]); } RELEASE(updAttr); updAttr = nil; RELEASE(fetAttr); fetAttr = nil; RELEASE(fetRels); fetRels = nil; RELEASE(updName); updName = nil; self->flags.isPropertiesCacheValid = YES; } - (void)invalidatePropertiesCache { if (flags.isPropertiesCacheValid) { RELEASE(self->attributesUsedForInsert); RELEASE(self->attributesUsedForFetch); RELEASE(self->relationsUsedForFetch); RELEASE(self->attributesNamesUsedForInsert); self->attributesUsedForInsert = nil; self->attributesUsedForFetch = nil; self->relationsUsedForFetch = nil; self->attributesNamesUsedForInsert = nil; flags.isPropertiesCacheValid = NO; } } // description - (NSString *)description { return [NSString stringWithFormat: @"<%@[0x%p]: name=%@ className=%@ tableName=%@ " @"readOnly=%s>", NSStringFromClass([self class]), self, [self name], [self className], [self externalName], [self isReadOnly] ? "YES" : "NO" ]; } @end /* EOEntity (EOEntityCreation) */ @implementation EOEntity(ValuesConversion) - (NSDictionary *)convertValuesToModel:(NSDictionary *)aRow { NSMutableDictionary *dict; NSEnumerator *enumerator; NSString *key; dict = [NSMutableDictionary dictionaryWithCapacity:[aRow count]]; enumerator = [aRow keyEnumerator]; while ((key = [enumerator nextObject]) != nil) { id old = [aRow objectForKey:key]; id new = [[self attributeNamed:key] convertValueToModel:old]; if (new != nil) [dict setObject:new forKey:key]; } return [dict count] > 0 ? dict : (NSMutableDictionary *)nil; } static int _compareByName(id obj1, id obj2, void * context) { return [[(EOAttribute*)obj1 name] compare:[(EOAttribute*)obj2 name]]; } @end /* EOAttribute (ValuesConversion) */ @implementation EOEntity(EOF2Additions) - (BOOL)isAbstractEntity { return NO; } /* ids */ - (EOGlobalID *)globalIDForRow:(NSDictionary *)_row { static Class EOKeyGlobalIDClass = Nil; unsigned int keyCount = [self->primaryKeyAttributeNames count]; id values[keyCount]; unsigned int i; for (i = 0; i < keyCount; i++) { NSString *attrName; attrName = [self->primaryKeyAttributeNames objectAtIndex:i]; values[i] = [_row objectForKey:attrName]; if (values[i] == nil) return nil; } if (EOKeyGlobalIDClass == Nil) EOKeyGlobalIDClass = [EOKeyGlobalID class]; return [EOKeyGlobalIDClass globalIDWithEntityName:self->name keys:&(values[0]) keyCount:keyCount zone:[self zone]]; } - (BOOL)isPrimaryKeyValidInObject:(id)_object { unsigned int keyCount = [self->primaryKeyAttributeNames count]; unsigned int i; if (_object == nil) return NO; for (i = 0; i < keyCount; i++) { if ([_object valueForKey:[self->primaryKeyAttributeNames objectAtIndex:i]] == nil) return NO; } return YES; } /* refs to other models */ - (NSArray *)externalModelsReferenced { NSEnumerator *e; EORelationship *relship; NSMutableArray *result; EOModel *thisModel; thisModel = [self model]; result = nil; e = [self->relationships objectEnumerator]; while ((relship = [e nextObject]) != nil) { EOEntity *targetEntity; EOModel *extModel; targetEntity = [relship destinationEntity]; extModel = [targetEntity model]; if (extModel != thisModel) { if (result == nil) result = [NSMutableArray array]; [result addObject:extModel]; } } return result != nil ? (id)result : [NSArray array]; } /* fetch specs */ - (EOFetchSpecification *)fetchSpecificationNamed:(NSString *)_name { return nil; } - (NSArray *)fetchSpecificationNames { return nil; } /* names */ - (void)beautifyName { [self setName:[[self name] _beautifyEntityName]]; } @end /* EOEntity(EOF2Additions) */ @implementation EOEntity(PropertyListCoding) static inline void _addToPropList(NSMutableDictionary *propertyList, id _value, NSString *key) { if (_value) [propertyList setObject:_value forKey:key]; } - (void)encodeIntoPropertyList:(NSMutableDictionary *)_plist { int i, count; _addToPropList(_plist, self->name, @"name"); _addToPropList(_plist, self->className, @"className"); _addToPropList(_plist, self->externalName, @"externalName"); _addToPropList(_plist, self->externalQuery, @"externalQuery"); _addToPropList(_plist, self->userDictionary, @"userDictionary"); if ((count = [self->attributes count])) { id attributesPList; attributesPList = [NSMutableArray array]; for (i = 0; i < count; i++) { NSMutableDictionary *attributePList; attributePList = [[NSMutableDictionary alloc] init]; [[self->attributes objectAtIndex:i] encodeIntoPropertyList:attributePList]; [attributesPList addObject:attributePList]; RELEASE(attributePList); } _addToPropList(_plist, attributesPList, @"attributes"); } if ((count = [self->attributesUsedForLocking count])) { id attributesUsedForLockingPList; attributesUsedForLockingPList = [NSMutableArray array]; for (i = 0; i < count; i++) { id attributePList; attributePList = [(EOAttribute*)[self->attributesUsedForLocking objectAtIndex:i] name]; [attributesUsedForLockingPList addObject:attributePList]; } _addToPropList(_plist, attributesUsedForLockingPList, @"attributesUsedForLocking"); } if ((count = [self->classProperties count])) { id classPropertiesPList = nil; classPropertiesPList = [NSMutableArray array]; for (i = 0; i < count; i++) { id classPropertyPList; classPropertyPList = [(EOAttribute*)[self->classProperties objectAtIndex:i] name]; [classPropertiesPList addObject:classPropertyPList]; } _addToPropList(_plist, classPropertiesPList, @"classProperties"); } if ((count = [self->primaryKeyAttributes count])) { id primaryKeyAttributesPList; primaryKeyAttributesPList = [NSMutableArray array]; for (i = 0; i < count; i++) { id attributePList; attributePList = [(EOAttribute*)[self->primaryKeyAttributes objectAtIndex:i] name]; [primaryKeyAttributesPList addObject:attributePList]; } _addToPropList(_plist, primaryKeyAttributesPList, @"primaryKeyAttributes"); } if ((count = [self->relationships count])) { id relationshipsPList; relationshipsPList = [NSMutableArray array]; for (i = 0; i < count; i++) { NSMutableDictionary *relationshipPList; relationshipPList = [NSMutableDictionary dictionary]; [[self->relationships objectAtIndex:i] encodeIntoPropertyList:relationshipPList]; [relationshipsPList addObject:relationshipPList]; } _addToPropList(_plist, relationshipsPList, @"relationships"); } } @end /* EOEntity(PropertyListCoding) */ @implementation NSString(EntityBeautify) - (NSString *)_beautifyEntityName { if ([self length] == 0) return @""; else { unsigned clen = 0; char *s = NULL; unsigned cnt, cnt2; clen = [self cStringLength]; #if GNU_RUNTIME s = objc_atomic_malloc(clen + 4); #else s = malloc(clen + 4); #endif [self getCString:s maxLength:clen]; for (cnt = cnt2 = 0; cnt < clen; cnt++, cnt2++) { if ((s[cnt] == '_') && (s[cnt + 1] != '\0')) { s[cnt2] = toupper(s[cnt + 1]); cnt++; } else if ((s[cnt] == '2') && (s[cnt + 1] != '\0')) { s[cnt2] = s[cnt]; cnt++; cnt2++; s[cnt2] = toupper(s[cnt]); } else s[cnt2] = tolower(s[cnt]); } s[cnt2] = '\0'; s[0] = toupper(s[0]); #if !LIB_FOUNDATION_LIBRARY { NSString *os; os = [NSString stringWithCString:s]; free(s); return os; } #else return [NSString stringWithCStringNoCopy:s freeWhenDone:YES]; #endif } } @end SOPE/sope-gdl1/GDLAccess/EOAdaptorChannel.h0000644000000000000000000001610512242733417017135 0ustar rootroot/* EOAdaptorChannel.h Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: October 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __EOAdaptorChannel_h__ #define __EOAdaptorChannel_h__ #import @class NSArray, NSMutableArray, NSDictionary, NSMutableDictionary, NSString; @class NSMutableString, NSCalendarDate, NSException; @class EOModel, EOEntity, EOAttribute, EOSQLQualifier, EOAdaptorContext; /* The EOAdaptorChannel class can be subclassed in a database adaptor. You have to override only those methods marked in this header with `override'. */ @interface EOAdaptorChannel : NSObject { @protected EOAdaptorContext *adaptorContext; id delegate; // not retained /* Flags that determine the state of the adaptor */ BOOL isFetchInProgress; BOOL isOpen; BOOL debugEnabled; /* Flags used to check if the delegate responds to several messages */ struct { BOOL willInsertRow:1; BOOL didInsertRow:1; BOOL willUpdateRow:1; BOOL didUpdateRow:1; BOOL willDeleteRows:1; BOOL didDeleteRows:1; BOOL willSelectAttributes:1; BOOL didSelectAttributes:1; BOOL willFetchAttributes:1; BOOL didFetchAttributes:1; BOOL didChangeResultSet:1; BOOL didFinishFetching:1; BOOL willEvaluateExpression:1; BOOL didEvaluateExpression:1; } delegateRespondsTo; } + (NSCalendarDate*)dateForAttribute:(EOAttribute*)attr year:(int)year month:(unsigned)month day:(unsigned)day hour:(unsigned)hour minute:(unsigned)minute second:(unsigned)second zone:(NSZone*)zone; /* Initializing an adaptor context */ - (id)initWithAdaptorContext:(EOAdaptorContext*)adaptorContext; /* Getting the adaptor context */ - (EOAdaptorContext*)adaptorContext; /* Opening and closing a channel */ - (BOOL)isOpen; - (BOOL)openChannel; - (void)closeChannel; /* Modifying rows, new world methods */ - (NSException *)insertRowX:(NSDictionary *)_row forEntity:(EOEntity *)_entity; - (NSException *)updateRowX:(NSDictionary*)aRow describedByQualifier:(EOSQLQualifier*)aQualifier; - (NSException *)deleteRowsDescribedByQualifierX:(EOSQLQualifier*)aQualifier; /* Modifying rows, old world methods (DEPRECATED) */ - (BOOL)insertRow:(NSDictionary *)aRow forEntity:(EOEntity *)anEntity; - (BOOL)updateRow:(NSDictionary *)aRow describedByQualifier:(EOSQLQualifier *)aQualifier; - (BOOL)deleteRowsDescribedByQualifier:(EOSQLQualifier *)aQualifier; /* Fetching rows */ - (BOOL)selectAttributes:(NSArray *)attributes describedByQualifier:(EOSQLQualifier *)aQualifier fetchOrder:(NSArray *)aFetchOrder lock:(BOOL)aLockFlag; - (NSException *)selectAttributesX:(NSArray *)attributes describedByQualifier:(EOSQLQualifier *)aQualifier fetchOrder:(NSArray *)aFetchOrder lock:(BOOL)aLockFlag; - (NSArray *)describeResults:(BOOL)_beautifyNames; // override - (NSArray *)describeResults; - (NSMutableDictionary*)fetchAttributes:(NSArray *)attributes withZone:(NSZone *)zone; - (BOOL)isFetchInProgress; - (void)cancelFetch; // override - (NSMutableDictionary *)dictionaryWithObjects:(id *)objects forAttributes:(NSArray *)attributes zone:(NSZone *)zone; - (NSMutableDictionary *)primaryFetchAttributes:(NSArray *)attributes withZone:(NSZone *)zone; // override /* Sending SQL to the server */ - (BOOL)evaluateExpression:(NSString *)_anExpression; // override - (NSException *)evaluateExpressionX:(NSString*)_sql; /* Getting schema information */ - (EOModel*)describeModelWithTableNames:(NSArray*)tableNames; // override - (NSArray*)describeTableNames; // override - (BOOL)readTypesForEntity:(EOEntity*)anEntity; // override - (BOOL)readTypeForAttribute:(EOAttribute*)anAttribute; // override /* Debugging */ - (void)setDebugEnabled:(BOOL)flag; - (BOOL)isDebugEnabled; /* Setting the channel's delegate */ - (id)delegate; - (void)setDelegate:aDelegate; @end /* EOAdaptorChannel*/ @interface EOAdaptorChannel(PrimaryKeyGeneration) // new in EOF2 - (NSDictionary *)primaryKeyForNewRowWithEntity:(EOEntity *)_entity; @end @class EOEntity, EOFetchSpecification; @interface EOAdaptorChannel(EOF2Additions) - (void)selectAttributes:(NSArray *)_attributes fetchSpecification:(EOFetchSpecification *)_fspec lock:(BOOL)_flag entity:(EOEntity *)_entity; - (void)setAttributesToFetch:(NSArray *)_attributes; - (NSArray *)attributesToFetch; - (NSMutableDictionary *)fetchRowWithZone:(NSZone *)_zone; @end #import @interface NSObject(EOAdaptorChannelDelegation) - (EODelegateResponse)adaptorChannel:aChannel willInsertRow:(NSMutableDictionary*)aRow forEntity:(EOEntity*)anEntity; - (void)adaptorChannel:channel didInsertRow:(NSDictionary*)aRow forEntity:(EOEntity*)anEntity; - (EODelegateResponse)adaptorChannel:aChannel willUpdateRow:(NSMutableDictionary*)aRow describedByQualifier:(EOSQLQualifier*)aQualifier; - (void)adaptorChannel:aChannel didUpdateRow:(NSDictionary*)aRow describedByQualifier:(EOSQLQualifier*)aQualifier; - (EODelegateResponse)adaptorChannel:aChannel willDeleteRowsDescribedByQualifier:(EOSQLQualifier*)aQualifier; - (void)adaptorChannel:aChannel didDeleteRowsDescribedByQualifier:(EOSQLQualifier*)aQualifier; - (EODelegateResponse)adaptorChannel:aChannel willSelectAttributes:(NSMutableArray*)attributes describedByQualifier:(EOSQLQualifier*)aQualifier fetchOrder:(NSMutableArray*)aFetchOrder lock:(BOOL)aLockFlag; - (void)adaptorChannel:aChannel didSelectAttributes:(NSArray*)attributes describedByQualifier:(EOSQLQualifier*)aQualifier fetchOrder:(NSArray*)aFetchOrder lock:(BOOL)aLockFlag; - (NSMutableDictionary*)adaptorChannel:aChannel willFetchAttributes:(NSArray*)attributes withZone:(NSZone*)zone; - (NSMutableDictionary*)adaptorChannel:aChannel didFetchAttributes:(NSMutableDictionary*)attributes withZone:(NSZone*)zone; - (void)adaptorChannelDidChangeResultSet:aChannel; - (void)adaptorChannelDidFinishFetching:aChannel; - (EODelegateResponse)adaptorChannel:aChannel willEvaluateExpression:(NSMutableString*)anExpression; - (void)adaptorChannel:aChannel didEvaluateExpression:(NSString*)anExpression; @end /* NSObject(EOAdaptorChannelDelegation) */ #endif /* __EOAdaptorChannel_h__ */ SOPE/sope-gdl1/GDLAccess/common.h0000644000000000000000000001363712242733417015325 0ustar rootroot/* EOAdaptorChannel.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: October 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __common_h__ #define __common_h__ #include #include #ifndef __WIN32__ # include # include #endif #include #include #include #import #import #if !(COCOA_Foundation_LIBRARY || NeXT_Foundation_LIBRARY || GNUSTEP_BASE_LIBRARY) # import #endif #import #if NeXT_RUNTIME || APPLE_RUNTIME # define sel_eq(sela,selb) (sela==selb?YES:NO) # ifndef SEL_EQ # define SEL_EQ(__A__,__B__) (__A__==__B__?YES:NO) # endif #endif #if __GNU_LIBOBJC__ >= 20100911 # define sel_eq(__A__,__B__) sel_isEqual(__A__,__B__) # ifndef SEL_EQ # define SEL_EQ(__A__,__B__) sel_isEqual(__A__,__B__) # endif #endif #if LIB_FOUNDATION_LIBRARY # import #else # include # include #endif // ******************** common functions ******************** static inline void *Malloc(int) __attribute__((unused)); static inline void *Calloc(int, int) __attribute__((unused)); static inline void *Realloc(void*, int) __attribute__((unused)); static inline void Free(void*) __attribute__((unused)); static inline int Strlen(const char*) __attribute__((unused)); static inline char* Strdup(const char*) __attribute__((unused)); static inline char* Strcpy (char*, const char*) __attribute__((unused)); static inline char* Strncpy (char*, const char*, unsigned) __attribute__((unused)); static inline char* Strcat (char*, const char*) __attribute__((unused)); static inline char* Strncat (char*, const char*, unsigned) __attribute__((unused)); static inline int Strcmp(const char*, const char*) __attribute__((unused)); static inline int Strncmp(const char*, const char*, unsigned) __attribute__((unused)); static inline int Atoi(const char*) __attribute__((unused)); static inline long Atol(const char*) __attribute__((unused)); static inline void *Malloc(int size) { return malloc(size); } static inline void *MallocAtomic(int size) { return malloc(size); } static inline void Free(void* p) { if (p) free(p); } static inline void *Calloc(int elem, int size) { return calloc(elem, size); } static inline void *CallocAtomic(int elem, int size) { return calloc(elem, size); } static inline void *Realloc(void* p, int size) { return realloc(p, size); } static inline int Strlen(const char* s) { return s ? strlen(s) : 0; } static inline char* Strdup(const char* s) { return s ? strcpy(Malloc(strlen(s) + 1), s) : NULL; } static inline char* Strcpy (char* d, const char* s) { return s && d ? strcpy(d, s) : d; } static inline char* Strncpy (char* d, const char* s, unsigned size) { return s && d ? strncpy(d, s, size) : d; } static inline char* Strcat (char* d, const char* s) { return s && d ? strcat(d, s) : d; } static inline char* Strncat (char* d, const char* s , unsigned size) { return s && d ? strncat(d, s , size) : d; } static inline int Strcmp(const char* p, const char* q) { if(!p) { if(!q) return 0; else return -1; } else { if(!q) return 1; else return strcmp(p, q); } } static inline int Strncmp(const char* p, const char* q, unsigned size) { if(!p) { if(!q) return 0; else return -1; } else { if(!q) return 1; else return strncmp(p, q, size); } } static inline int Atoi(const char* str) { return str ? atoi(str) : 0; } static inline long Atol(const char *str) { return str ? atol(str) : 0; } #ifndef MAX #define MAX(a, b) \ ({typedef _ta = (a), _tb = (b); \ _ta _a = (a); _tb _b = (b); \ _a > _b ? _a : _b; }) #endif #ifndef MIN #define MIN(a, b) \ ({typedef _ta = (a), _tb = (b); \ _ta _a = (a); _tb _b = (b); \ _a < _b ? _a : _b; }) #endif #if !LIB_FOUNDATION_LIBRARY #ifndef CREATE_AUTORELEASE_POOL #define CREATE_AUTORELEASE_POOL(pool) \ id pool = [[NSAutoreleasePool alloc] init] #endif #endif /* ! LIB_FOUNDATION_LIBRARY */ #if !LIB_FOUNDATION_LIBRARY static inline char *Ltoa(long nr, char *str, int base) { char buff[34], rest, is_negative; int ptr; ptr = 32; buff[33] = '\0'; if(nr < 0) { is_negative = 1; nr = -nr; } else is_negative = 0; while(nr != 0) { rest = nr % base; if(rest > 9) rest += 'A' - 10; else rest += '0'; buff[ptr--] = rest; nr /= base; } if(ptr == 32) buff[ptr--] = '0'; if(is_negative) buff[ptr--] = '-'; Strcpy(str, &buff[ptr+1]); return(str); } #endif #if !LIB_FOUNDATION_LIBRARY @interface NSObject(FoundationExtGDLAccess) - (void)subclassResponsibility:(SEL)sel; - (void)notImplemented:(SEL)sel; @end #endif #if !GNU_RUNTIME # ifndef SEL_EQ # define SEL_EQ(__A__,__B__) (__A__==__B__ ? YES : NO) # endif #else # ifndef SEL_EQ # include # define SEL_EQ(__A__,__B__) sel_eq(__A__,__B__) # endif #endif #endif /* __common_h__ */ SOPE/sope-gdl1/GDLAccess/EOExpressionArray.h0000644000000000000000000000641712242733417017415 0ustar rootroot/* EOExpressionArray.h Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: September 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __EOExpressionArray_h__ #define __EOExpressionArray_h__ #import @class EOAttribute, EOEntity, EOExpressionArray; @protocol EOExpressionContext - (NSString *)expressionValueForAttribute:(EOAttribute *)anAttribute; - (NSString *)expressionValueForAttributePath:(NSArray *)path; @end /* Notes In LSExtendedSearchCommand this is bound to the 'content' of EOSQLQualifier and contains an array like: "(", "(", "(", LOWER, "(", { allowsNull=Y; columnName=name; width=50;...}, ... " = ", 0, ")", ")" so it seems to be a stream of tokens and an EOAttribute mixed in for column keys. Apparently only EOSQLExpression supports the 'EOExpressionContext'? */ @interface EOExpressionArray : NSObject < NSMutableCopying > { @protected NSMutableArray *array; NSString *prefix; NSString *infix; NSString *suffix; } /* Initializing instances */ - (id)initWithPrefix:(NSString*)prefix infix:(NSString*)infix suffix:(NSString*)suffix; /* Accessing the components */ - (void)setPrefix:(NSString*)prefix; - (NSString*)prefix; - (void)setInfix:(NSString*)infix; - (NSString*)infix; - (void)setSuffix:(NSString*)suffix; - (NSString*)suffix; /* Checking contents */ - (BOOL)referencesObject:(id)anObject; - (NSString *)expressionValueForContext:(id)ctx; + (EOExpressionArray *)parseExpression:(NSString *)expression entity:(EOEntity *)entity replacePropertyReferences:(BOOL)flag; + (EOExpressionArray *)parseExpression:(NSString *)expression entity:(EOEntity *)entity replacePropertyReferences:(BOOL)flag relationshipPaths:(NSMutableArray *)relationshipPaths; // array compatibility - (void)addObjectsFromExpressionArray:(EOExpressionArray *)_array; - (void)insertObject:(id)_obj atIndex:(NSUInteger)_idx; - (void)addObjectsFromArray:(NSArray *)_array; - (void)addObject:(id)_object; - (NSUInteger)indexOfObject:(id)_object; - (id)objectAtIndex:(NSUInteger)_idx; - (id)lastObject; - (NSUInteger)count; - (NSEnumerator *)objectEnumerator; - (NSEnumerator *)reverseObjectEnumerator; @end /* EOExpressionArray */ @interface NSObject (EOExpression) - (NSString *)expressionValueForContext:(id)context; @end #endif /* __EOExpressionArray_h__ */ /* Local Variables: c-basic-offset: 4 tab-width: 8 End: */ SOPE/sope-gdl1/GDLAccess/EOOrQualifier+SQL.m0000644000000000000000000000400512242733417017130 0ustar rootroot/* EOAdaptorChannel.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: October 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // $Id: EOOrQualifier+SQL.m 1 2004-08-20 10:38:46Z znek $ #import "EOSQLQualifier.h" #include "common.h" @implementation EOOrQualifier(SQLQualifier) /* SQL qualifier generation */ - (EOSQLQualifier *)sqlQualifierForEntity:(EOEntity *)_entity { unsigned cc = [self->qualifiers count]; if (cc == 0) return nil; else if (cc == 1) return [[self->qualifiers objectAtIndex:0] sqlQualifierForEntity:_entity]; else if (cc == 2) { id left; id right; left = [[self->qualifiers objectAtIndex:0] sqlQualifierForEntity:_entity]; right = [[self->qualifiers objectAtIndex:1] sqlQualifierForEntity:_entity]; [left disjoinWithQualifier:right]; return left; } else { EOSQLQualifier *masterQ; unsigned i; for (i = 0, masterQ = nil; i < cc; i++) { EOSQLQualifier *q; q = [[self->qualifiers objectAtIndex:i] sqlQualifierForEntity:_entity]; if (masterQ == nil) masterQ = q; else [masterQ disjoinWithQualifier:q]; } return masterQ; } } @end /* EOOrQualifier */ SOPE/sope-gdl1/GDLAccess/Version0000644000000000000000000000004512242733417015221 0ustar rootroot# version file SUBMINOR_VERSION:=63 SOPE/sope-gdl1/GDLAccess/load-EOAdaptor.m0000644000000000000000000000405512242733417016567 0ustar rootroot/* EOAdaptorChannel.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: October 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // $Id: load-EOAdaptor.m 1 2004-08-20 10:38:46Z znek $ #import #include #include int main(int argc, char **argv, char **env) { NSAutoreleasePool *pool; NSArray *args; NSString *adaptorName; EOAdaptor *adaptor; pool = [[NSAutoreleasePool alloc] init]; #if LIB_FOUNDATION_LIBRARY [NSProcessInfo initializeWithArguments:argv count:argc environment:env]; #endif args = [[NSProcessInfo processInfo] arguments]; if ([args count] < 2) { fprintf(stderr, "usage: %s adaptorname\n", argv[0]); exit(10); } adaptorName = [args objectAtIndex:1]; NS_DURING { adaptor = [EOAdaptor adaptorWithName:adaptorName]; } NS_HANDLER { fprintf(stderr, "ERROR: %s: %s\n", [[localException name] cString], [[localException reason] cString]); adaptor = nil; } NS_ENDHANDLER; if (adaptor) { printf("did load adaptor: %s\n", [[adaptor name] cString]); exit(0); } [pool release]; fprintf(stderr, "ERROR: failed to load adaptor '%s'.\n", [adaptorName cString]); exit (1); return 1; } SOPE/sope-gdl1/GDLAccess/eoaccess.m0000644000000000000000000000575512242733417015631 0ustar rootroot/* EOAdaptorChannel.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: October 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // $Id: eoaccess.m 1 2004-08-20 10:38:46Z znek $ #include "GDLAccess.h" #include "EOArrayProxy.h" @implementation GDLAccess - (void)_staticLinkClasses { [EOAdaptor class]; [EOAdaptorChannel class]; [EOAdaptorContext class]; [EOArrayProxy class]; [EOAttribute class]; [EOAttributeOrdering class]; [EODatabase class]; [EODatabaseChannel class]; [EODatabaseContext class]; [EOEntity class]; [EOFException class]; [ObjectNotAvailableException class]; [PropertyDefinitionException class]; [DestinationEntityDoesntMatchDefinitionException class]; [InvalidNameException class]; [InvalidPropertyException class]; [RelationshipMustBeToOneException class]; [InvalidValueTypeException class]; [InvalidAttributeException class]; [InvalidQualifierException class]; [EOAdaptorException class]; [CannotFindAdaptorBundleException class]; [InvalidAdaptorBundleException class]; [InvalidAdaptorStateException class]; [DataTypeMappingNotSupportedException class]; [ChannelIsNotOpenedException class]; [AdaptorIsFetchingException class]; [AdaptorIsNotFetchingException class]; [NoTransactionInProgressException class]; [TooManyOpenedChannelsException class]; [EOModel class]; [EOObjectUniquer class]; [EOPrimaryKeyDictionary class]; [EOSQLQualifier class]; [EOQuotedExpression class]; [EORelationship class]; [EOSQLExpression class]; #if 0 [EOSelectSQLExpression class]; [EOInsertSQLExpression class]; [EOUpdateSQLExpression class]; [EODeleteSQLExpression class]; #endif } - (void)_staticLinkCategories { } - (void)_staticLinkModules { } @end /* GDLAccess */ SOPE/sope-gdl1/GDLAccess/COPYING.LIB0000644000000000000000000006126112242733417015320 0ustar rootroot GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, 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 library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] 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 Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, 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 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 a program 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. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, 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 companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. 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, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library 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 compile 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) 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. c) 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. d) 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 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. 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 to 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 Library 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 Appendix: 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 Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, 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! SOPE/sope-gdl1/GDLAccess/EODatabase.m0000644000000000000000000003236512242733417015771 0ustar rootroot/* EODatabase.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Mircea Oancea Date: 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import "common.h" #import "EODatabase.h" #import "EOAdaptor.h" #import "EOModel.h" #import "EOEntity.h" #import "EOGenericRecord.h" #import "EODatabaseContext.h" #import "EOObjectUniquer.h" #import "EODatabaseFault.h" NSTimeInterval NSDistantPastTimeInterval = 0.0; @implementation EODatabase // Database Global Methods static NSMutableArray *databaseInstances = nil; static NSRecursiveLock *lock = nil; + (void)initialize { static BOOL isInitialized = NO; // THREAD if (!isInitialized) { isInitialized = YES; databaseInstances = [[NSMutableArray alloc] init]; lock = [[NSRecursiveLock alloc] init]; } } static inline void _addDatabaseInstance(EODatabase *_db) { [lock lock]; [databaseInstances addObject:[NSValue valueWithNonretainedObject:_db]]; [lock unlock]; } static inline void _removeDatabaseInstance(EODatabase *_db) { [lock lock]; { int i; for (i = [databaseInstances count] - 1; i >= 0; i--) { EODatabase *db; db = [[databaseInstances objectAtIndex:i] nonretainedObjectValue]; if (db == _db) { [databaseInstances removeObjectAtIndex:i]; break; } } } [lock unlock]; } /* * Initializing new instances */ - (id)initWithAdaptor:(EOAdaptor *)_adaptor { if (_adaptor == nil) { AUTORELEASE(self); return nil; } self->adaptor = RETAIN(_adaptor); self->objectsDictionary = [[EOObjectUniquer allocWithZone:[self zone]] init]; self->contexts = [[NSMutableArray allocWithZone:[self zone]] init]; self->flags.isUniquingObjects = YES; self->flags.isKeepingSnapshots = YES; self->flags.isLoggingWarnings = YES; _addDatabaseInstance(self); return self; } - (id)initWithModel:(EOModel *)_model { return [self initWithAdaptor:[EOAdaptor adaptorWithModel:_model]]; } - (id)init { return [self initWithAdaptor:nil]; } - (void)dealloc { _removeDatabaseInstance(self); RELEASE(self->adaptor); RELEASE(self->objectsDictionary); RELEASE(self->contexts); [super dealloc]; } // accessors - (EOAdaptor *)adaptor { return self->adaptor; } - (EOObjectUniquer *)objectUniquer { return self->objectsDictionary; } // Checking connection status - (BOOL)hasOpenChannels { int i; for (i = ([self->contexts count] - 1); i >= 0; i--) { if ([[[self->contexts objectAtIndex:i] nonretainedObjectValue] hasOpenChannels]) return YES; } return NO; } /* * Getting the database contexts */ - (id)createContext { return AUTORELEASE([[EODatabaseContext alloc] initWithDatabase:self]); } - (NSArray *)contexts { NSMutableArray *array = nil; int i, n; n = [self->contexts count]; array = [[NSMutableArray alloc] initWithCapacity:n]; for (i = 0; i < n; i++) { EODatabaseContext *ctx; ctx = [[self->contexts objectAtIndex:i] nonretainedObjectValue]; [array addObject:ctx]; } return AUTORELEASE(array); } - (void)contextDidInit:(id)_context { [self->contexts addObject:[NSValue valueWithNonretainedObject:_context]]; } - (void)contextWillDealloc:(id)aContext { int i; for (i = [self->contexts count]-1; i >= 0; i--) { if ([[self->contexts objectAtIndex:i] nonretainedObjectValue] == aContext) { [self->contexts removeObjectAtIndex:i]; break; } } } /* * Uniquing/snapshotting */ - (void)setUniquesObjects:(BOOL)yn { if ([self hasOpenChannels]) { [NSException raise:NSInvalidArgumentException format: @"EODatabase:%x: All channels must be closed when changing " @"uniquing mode in the EODatabase, " @"in [EODatabase setUniquesObjects:]", self]; } if ((!yn) && (self->flags.isUniquingObjects)) [self->objectsDictionary forgetAllObjects]; self->flags.isUniquingObjects = yn; } - (BOOL)uniquesObjects { return self->flags.isUniquingObjects; } - (void)setKeepsSnapshots:(BOOL)yn { if ([self hasOpenChannels]) { [NSException raise:NSInvalidArgumentException format: @"EODatabase:%x: All channels must be closed when changing " @"snapshoting mode in the EODatabase, " @"in [EODatabase setKeepsSnapshots:]", self]; } if ((yn == NO) && self->flags.isKeepingSnapshots) [self->objectsDictionary forgetAllSnapshots]; self->flags.isKeepingSnapshots = yn; } - (BOOL)keepsSnapshots { return self->flags.isKeepingSnapshots; } // ******************** Handle Objects ******************** - (void)forgetAllObjects { [self->objectsDictionary forgetAllObjects]; } + (void)forgetObject:(id)_object { static Class UniquerClass = Nil; if (UniquerClass == Nil) UniquerClass = [EOObjectUniquer class]; [(EOObjectUniquer *)UniquerClass forgetObject:_object]; [lock lock]; { int i; for (i = [databaseInstances count] - 1; i >= 0; i--) { EODatabase *db; db = [[databaseInstances objectAtIndex:i] nonretainedObjectValue]; [db forgetObject:_object]; } } [lock unlock]; } - (void)forgetObject:(id)_object { /* NSLog(@"DB[0x%p]: forget object 0x%p<%s> entity=%@", self, _object, class_get_class_name(*(Class *)_object), [[_object entity] name]); */ [self->objectsDictionary forgetObject:_object]; } - (void)forgetAllSnapshots { [self->objectsDictionary forgetAllSnapshots]; } - (id)objectForPrimaryKey:(NSDictionary *)_key entity:(EOEntity *)_entity { if (self->flags.isUniquingObjects && (_key != nil) && (_entity != nil)) { _key = [_entity primaryKeyForRow:_key]; if (_key == nil) return nil; else { id object = [self->objectsDictionary objectForPrimaryKey:_key entity:_entity]; #if 0 if (object) { if (![object isKindOfClass:[EOGenericRecord class]]) NSLog(@"object 0x%p pkey=%@ entity=%@", object, _key, _entity); } #endif return object; } } return nil; } - (NSDictionary *)snapshotForObject:_object { EOUniquerRecord* rec = [self->objectsDictionary recordForObject:_object]; return rec ? rec->snapshot : nil; } - (NSDictionary *)primaryKeyForObject:(id)_object { EOUniquerRecord* rec = [self->objectsDictionary recordForObject:_object]; return rec ? rec->pkey : nil; } - (void)primaryKey:(NSDictionary**)_key andSnapshot:(NSDictionary**)_snapshot forObject:(id)_object { EOUniquerRecord *rec = [self->objectsDictionary recordForObject:_object]; if (rec) { if (_key) *_key = rec->pkey; if (_snapshot) *_snapshot = rec->snapshot; } else { if (_key) *_key = nil; if (_snapshot) *_snapshot = nil; } } - (void)recordObject:(id)_object primaryKey:(NSDictionary *)_key snapshot:(NSDictionary *)_snapshot { EOEntity *entity; entity = [_object respondsToSelector:@selector(entity)] ? [_object entity] : [[self->adaptor model] entityForObject:_object]; [self recordObject:_object primaryKey:_key entity:entity snapshot:_snapshot]; } - (void)recordObject:(id)_object primaryKey:(NSDictionary *)_key entity:(EOEntity *)_entity snapshot:(NSDictionary *)_snapshot { if (_object == nil) { [NSException raise:NSInvalidArgumentException format: @"EODatabase:%x: Cannot record null object, " @"in [EODatabase recordObject:primaryKey:entity:snapshot:]", self]; } if ((_entity == nil) && self->flags.isUniquingObjects) { [NSException raise:NSInvalidArgumentException format: @"EODatabase:%x: Cannot record object with null entity " @"when the database is uniquing objects, " @"in [EODatabase recordObject:primaryKey:entity:snapshot:]", self]; } _key = [_entity primaryKeyForRow:_key]; if ((_key == nil) && self->flags.isUniquingObjects) { [NSException raise:NSInvalidArgumentException format: @"EODatabase:%x: Cannot record object with null key " @"when the database is uniquing objects, " @"in [EODatabase recordObject:primaryKey:entity:snapshot:]", self]; } if ((_snapshot == nil) && self->flags.isKeepingSnapshots) { [NSException raise:NSInvalidArgumentException format: @"EODatabase:%x: Cannot record object with null snapshot " @"when the database is keeping snapshots, " @"in [EODatabase recordObject:primaryKey:entity:snapshot:]", self]; } [objectsDictionary recordObject:_object primaryKey: self->flags.isUniquingObjects ? _key:(NSDictionary *)nil entity:self->flags.isUniquingObjects ?_entity : (EOEntity *)nil snapshot: self->flags.isKeepingSnapshots ? _snapshot : (NSDictionary *)nil]; } - (BOOL)isObject:(id)_object updatedOutsideContext:(EODatabaseContext *)_context { int i; for (i = [contexts count] - 1; i >= 0; i--) { EODatabaseContext *ctx; ctx = [[self->contexts objectAtIndex:i] nonretainedObjectValue]; if ((ctx != _context) && [ctx isObjectUpdated:_object]) return YES; } return NO; } // ******************** Error messages ******************** - (void)setLogsErrorMessages:(BOOL)yn { self->flags.isLoggingWarnings = yn; } - (BOOL)logsErrorMessages { return self->flags.isLoggingWarnings; } - (void)reportErrorFormat:(NSString*)format, ... { va_list va; va_start(va, format); [self reportErrorFormat:format arguments:va]; va_end(va); } - (void)reportErrorFormat:(NSString*)format arguments:(va_list)arguments { [self reportError:AUTORELEASE([[NSString alloc] initWithFormat:format arguments:arguments])]; } - (void)reportError:(NSString*)error { if (self->flags.isLoggingWarnings) NSLog(@"EODatabase:%x:%@", self, error); } @end /* EODatabase */ @implementation EODatabase(EOF2Additions) - (NSArray *)models { EOModel *model; model = [[self adaptor] model]; return model ? [NSArray arrayWithObject:model] : nil; } - (void)addModel:(EOModel *)_model { EOModel *model; model = [[self adaptor] model]; if (model == nil) [[self adaptor] setModel:_model]; else [self notImplemented:_cmd]; } - (BOOL)addModelIfCompatible:(EOModel *)_model { NSEnumerator *e; EOModel *m; if (![[self adaptor] canServiceModel:_model]) return NO; e = [[self models] objectEnumerator]; while ((m = [e nextObject])) { if (m == _model) return YES; if (![[m adaptorName] isEqualToString:[_model adaptorName]]) return NO; } [self addModel:_model]; return YES; } - (EOEntity *)entityForObject:(id)_object { return [[[self adaptor] model] entityForObject:_object]; } - (EOEntity *)entityNamed:(NSString *)_name { return [[[self adaptor] model] entityNamed:_name]; } /* snapshots */ - (void)forgetSnapshotsForGlobalIDs:(NSArray *)_gids { NSEnumerator *e; EOGlobalID *gid; e = [_gids objectEnumerator]; while ((gid = [e nextObject])) [self forgetSnapshotsForGlobalID:gid]; } - (void)forgetSnapshotsForGlobalID:(EOGlobalID *)_gid { [self notImplemented:_cmd]; } - (void)recordSnapshot:(NSDictionary *)_snapshot forGlobalID:(EOGlobalID *)_gid { [self notImplemented:_cmd]; } - (void)recordSnapshots:(NSDictionary *)_snapshots { NSEnumerator *gids; EOGlobalID *gid; gids = [_snapshots keyEnumerator]; while ((gid = [gids nextObject])) [self recordSnapshot:[_snapshots objectForKey:gid] forGlobalID:gid]; } - (void)recordSnapshot:(NSArray *)_gids forSourceGlobalID:(EOGlobalID *)_gid relationshipName:(NSString *)_name { /* to-many snapshot */ [self notImplemented:_cmd]; } - (void)recordToManySnapshots:(NSDictionary *)_snapshots { NSEnumerator *gids; EOGlobalID *gid; gids = [_snapshots keyEnumerator]; while ((gid = [gids nextObject])) { NSDictionary *d; NSEnumerator *relNames; NSString *relName; d = [_snapshots objectForKey:gid]; relNames = [d keyEnumerator]; while ((relName = [relNames nextObject])) { [self recordSnapshot:[d objectForKey:relName] forSourceGlobalID:gid relationshipName:relName]; } } } - (NSDictionary *)snapshotForGlobalID:(EOGlobalID *)_gid after:(NSTimeInterval)_duration { NSLog(@"ERROR(%s): subclasses must override this method!", __PRETTY_FUNCTION__); return nil; } - (NSDictionary *)snapshotForGlobalID:(EOGlobalID *)_gid { return [self snapshotForGlobalID:_gid after:NSDistantPastTimeInterval]; } @end /* EODatabase(EOF2Additions) */ SOPE/sope-gdl1/GDLAccess/EOFExceptions.h0000644000000000000000000000570312242733417016503 0ustar rootroot/* EOFExceptions.h Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: August 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __EOFExceptions_h__ #define __EOFExceptions_h__ #import @class NSString; @class EOEntity; @class EORelationship; @class EOAdaptorChannel; @interface EOFException : NSException @end @interface ObjectNotAvailableException : EOFException - initWithEntity:entity andPrimaryKey:key; @end @interface PropertyDefinitionException : EOFException @end @interface DestinationEntityDoesntMatchDefinitionException : PropertyDefinitionException - initForDestination:(EOEntity*)destinationEntity andDefinition:(NSString*)definition relationship:(EORelationship*)relationship; @end @interface InvalidNameException : PropertyDefinitionException - initWithName:(NSString*)name; @end @interface InvalidPropertyException : PropertyDefinitionException - initWithName:propertyNamed entity:currentEntity; @end @interface RelationshipMustBeToOneException : PropertyDefinitionException - initWithName:propertyNamed entity:currentEntity; @end @interface InvalidValueTypeException : PropertyDefinitionException - initWithType:type; @end @interface InvalidAttributeException : EOFException @end @interface InvalidQualifierException : EOFException @end @interface EOAdaptorException : EOFException @end @interface CannotFindAdaptorBundleException : EOAdaptorException @end @interface InvalidAdaptorBundleException : EOAdaptorException @end @interface InvalidAdaptorStateException : EOAdaptorException { id adaptor; } + exceptionWithAdaptor:(id)adaptor; @end @interface DataTypeMappingNotSupportedException : EOAdaptorException @end @interface ChannelIsNotOpenedException : InvalidAdaptorStateException @end @interface AdaptorIsFetchingException : InvalidAdaptorStateException @end @interface AdaptorIsNotFetchingException : InvalidAdaptorStateException @end @interface NoTransactionInProgressException : InvalidAdaptorStateException @end @interface TooManyOpenedChannelsException : EOAdaptorException @end #endif /* __EOFExceptions_h__ */ /* Local Variables: c-basic-offset: 4 tab-width: 8 End: */ SOPE/sope-gdl1/GDLAccess/EORelationship.m0000644000000000000000000003701112242733417016717 0ustar rootroot/* EORelationship.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: August 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import "common.h" #import "EOModel.h" #import "EOAttribute.h" #import "EOEntity.h" #import "EORelationship.h" #import "EOExpressionArray.h" #import "EOFExceptions.h" #import static EONull *null = nil; @interface EOJoin : EORelationship // for adaptor compability @end @implementation EORelationship + (void)initialize { if (null == nil) null = [[EONull null] retain]; } - (id)init { if ((self = [super init])) { self->flags.createsMutableObjects = YES; self->entity = nil; self->destinationEntity = nil; } return self; } - (id)initWithName:(NSString*)_name { if ((self = [self init])) { self->name = _name; } return self; } - (void)dealloc { RELEASE(self->name); RELEASE(self->definition); RELEASE(self->userDictionary); self->entity = nil; if ([self->destinationEntity isKindOfClass:[NSString class]]) RELEASE(self->destinationEntity); // else: non-retained EOEntity self->destinationEntity = nil; RELEASE(self->componentRelationships); RELEASE(self->sourceAttribute); RELEASE(self->destinationAttribute); [super dealloc]; } // These methods should be here to let the library work with NeXT foundation - (id)copy { return RETAIN(self); } - (id)copyWithZone:(NSZone *)_zone { return RETAIN(self); } // Is equal only if same name; used to make aliasing ordering stable - (unsigned)hash { return [self->name hash]; } + (BOOL)isValidName:(NSString*)_name { return [EOEntity isValidName:_name]; } - (void)setDefinition:(NSString *)def { // TODO: do we need this? if (def == nil) { [NSException raise:NSInvalidArgumentException format:@"invalid (nil) definition argument ..."]; } if ([def isNameOfARelationshipPath]) { NSArray *defArray = nil; int count; defArray = [def componentsSeparatedByString:@"."]; count = [defArray count]; RELEASE(self->componentRelationships); self->componentRelationships = [[NSMutableArray alloc] initWithCapacity:count]; flags.isFlattened = YES; NS_DURING { EOEntity *currentEntity = self->entity; id relationship = nil; int i; for (i = 0; i < count; i++) { id relationshipName = [defArray objectAtIndex:i]; /* Take the address of `relationship' to force the compiler to not allocate it into a register. */ *(&relationship) = [currentEntity relationshipNamed: relationshipName]; if (!relationship) [[[InvalidPropertyException alloc] initWithName:relationshipName entity:currentEntity] raise]; [self->componentRelationships addObject:relationship]; flags.isToMany |= [relationship isToMany]; currentEntity = [relationship destinationEntity]; } if (self->destinationEntity && ![self->destinationEntity isEqual:currentEntity]) [[[DestinationEntityDoesntMatchDefinitionException alloc] initForDestination:self->destinationEntity andDefinition:def relationship:self] raise]; if ([self->destinationEntity isKindOfClass:[NSString class]]) RELEASE(self->destinationEntity); self->destinationEntity = currentEntity; /* non-retained */ if ([self->destinationEntity isKindOfClass:[NSString class]]) RETAIN(self->destinationEntity); } NS_HANDLER { RELEASE(self->componentRelationships); self->componentRelationships = nil; [localException raise]; } NS_ENDHANDLER; } else [[[InvalidNameException alloc] initWithName:def] raise]; ASSIGN(self->definition, def); } - (BOOL)setToMany:(BOOL)_flag { if ([self isFlattened]) return NO; self->flags.isToMany = _flag; return YES; } - (BOOL)isToMany { return self->flags.isToMany; } - (BOOL)setName:(NSString *)_name { if ([self->entity referencesProperty:_name]) return NO; ASSIGN(self->name, _name); return NO; } - (NSString *)name { return self->name; } - (BOOL)isCompound { return NO; } - (NSString *)expressionValueForContext:(id)_ctx { return self->name; } - (void)setEntity:(EOEntity *)_entity { self->entity = _entity; /* non-retained */ } - (EOEntity *)entity { return self->entity; } - (void)resetEntities { self->entity = nil; self->destinationEntity = nil; } - (BOOL)hasEntity { return (self->entity != nil) ? YES : NO; } - (BOOL)hasDestinationEntity { return (self->destinationEntity != nil) ? YES : NO; } - (void)setUserDictionary:(NSDictionary *)dict { ASSIGN(self->userDictionary, dict); } - (NSDictionary *)userDictionary { return self->userDictionary; } - (NSArray *)joins { return self->sourceAttribute ? [NSArray arrayWithObject:self] : nil; } - (NSString *)definition { return self->definition; } - (NSArray *)sourceAttributes { return [NSArray arrayWithObject:self->sourceAttribute]; } - (NSArray *)destinationAttributes { return [NSArray arrayWithObject:self->destinationAttribute]; } - (EOEntity *)destinationEntity { return self->destinationEntity; } - (BOOL)isFlattened { return self->flags.isFlattened; } - (NSArray *)componentRelationships { return self->componentRelationships; } - (BOOL)referencesProperty:(id)_property { if ([self->sourceAttribute isEqual:_property]) return YES; if ([self->destinationAttribute isEqual:_property]) return YES; if ([self->componentRelationships indexOfObject:_property] != NSNotFound) return YES; return NO; } - (NSDictionary *)foreignKeyForRow:(NSDictionary *)_row { int j, i, n = [_row count]; id keys[n], vals[n]; for (i = j = 0, n = 1; j < n; j++) { EOAttribute *keyAttribute = self->sourceAttribute; EOAttribute *fkeyAttribute = self->destinationAttribute; NSString *key = nil; NSString *fkey = nil; id value = nil; key = [keyAttribute name]; fkey = [fkeyAttribute name]; value = [_row objectForKey:key]; if (value) { vals[i] = value; keys[i] = fkey; i++; } else { NSLog(@"%s: could not get value of key %@ (foreignKey=%@)", __PRETTY_FUNCTION__, key, fkey); } } return AUTORELEASE([[NSDictionary alloc] initWithObjects:vals forKeys:keys count:i]); } - (NSString *)description { return [[self propertyList] description]; } @end /* EORelationship */ @implementation EORelationship (EORelationshipPrivate) + (EORelationship *)relationshipFromPropertyList:(id)_plist model:(EOModel *)model { NSDictionary *plist = _plist; EORelationship *relationship = nil; NSArray *array = nil; NSEnumerator *enumerator = nil; id joinPList = nil; relationship = [[[EORelationship alloc] init] autorelease]; [relationship setCreateMutableObjects:YES]; [relationship setName:[plist objectForKey:@"name"]]; [relationship setUserDictionary: [plist objectForKey:@"userDictionary"]]; if ((array = [plist objectForKey:@"joins"])) { enumerator = [array objectEnumerator]; joinPList = [enumerator nextObject]; [relationship loadJoinPropertyList:joinPList]; joinPList = [enumerator nextObject]; NSAssert(joinPList == nil, @"a relationship only supports one join !"); } else { [relationship loadJoinPropertyList:_plist]; } relationship->destinationEntity = RETAIN([plist objectForKey:@"destination"]); // retained string relationship->flags.isToMany = [[plist objectForKey:@"isToMany"] isEqual:@"Y"]; relationship->flags.isMandatory = [[plist objectForKey:@"isMandatory"] isEqual:@"Y"]; /* Do not send here the -setDefinition: message because the relationships are not yet created from the model file. */ relationship->definition = RETAIN([plist objectForKey:@"definition"]); return relationship; } - (void)replaceStringsWithObjects { EOModel *model = [self->entity model]; if (self->destinationEntity) { // now self->destinationEntity is NSString and retained !! id destinationEntityName = AUTORELEASE(self->destinationEntity); self->destinationEntity = [model entityNamed:destinationEntityName]; // now hold entity non-retained if (self->destinationEntity == nil) { NSLog(@"invalid entity name '%@' specified as destination entity " @"for relationship '%@' in entity '%@'", destinationEntityName, name, [self->entity name]); [model errorInReading]; } } if (!(self->destinationEntity || self->definition)) { NSLog(@"relationship '%@' in entity '%@' is incompletely specified: " @"no destination entity or definition.", name, [self->entity name]); [model errorInReading]; } if (self->definition && (self->sourceAttribute != nil)) { NSLog(@"relationship '%@' in entity '%@': flattened relationships " @"cannot have joins", name, [self->entity name]); [model errorInReading]; } if (self->sourceAttribute) { EOEntity *attributeEntity; EOAttribute *attribute = nil; #if 0 attributeEntity = self->flags.isToMany ? self->destinationEntity : self->entity; #endif attributeEntity = self->entity; attribute = [attributeEntity attributeNamed:(NSString*)self->sourceAttribute]; if (attribute) [self setSourceAttribute:attribute]; else { [model errorInReading]; NSLog(@"invalid attribute name '%@' specified as source attribute for " @"join in relationship '%@' in entity '%@' (dest='%@')", sourceAttribute, [self name], [self->entity name], [self->destinationEntity name]); } #if 0 attributeEntity = self->flags.isToMany ? self->entity : self->destinationEntity; #endif attributeEntity = self->destinationEntity; attribute = [attributeEntity attributeNamed:(NSString*)destinationAttribute]; if (attribute) [self setDestinationAttribute:attribute]; else { [model errorInReading]; NSLog(@"invalid attribute name '%@' specified as destination " @"attribute for join in relationship '%@' in entity '%@' (dest='%@')", destinationAttribute, [self name], [self->entity name], [self->destinationEntity name]); } } [self setCreateMutableObjects:NO]; } - (void)initFlattenedRelationship { if (self->definition) { NS_DURING [self setDefinition:self->definition]; NS_HANDLER { NSLog([localException reason]); [[self->entity model] errorInReading]; } NS_ENDHANDLER; } } - (id)propertyList { NSMutableDictionary *propertyList = nil; propertyList = [NSMutableDictionary dictionary]; [self encodeIntoPropertyList:propertyList]; return propertyList; } - (void)setCreateMutableObjects:(BOOL)flag { if (self->flags.createsMutableObjects == flag) return; self->flags.createsMutableObjects = flag; } - (BOOL)createsMutableObjects { return self->flags.createsMutableObjects; } - (int)compareByName:(EORelationship *)_other { return [[(EORelationship *)self name] compare:[_other name]]; } /* EOJoin */ - (void)loadJoinPropertyList:(id)propertyList { NSDictionary *plist = propertyList; NSString *joinOperatorPList; NSString *joinSemanticPList; id tmp; tmp = [plist objectForKey:@"sourceAttribute"]; [self setSourceAttribute:tmp]; tmp = [plist objectForKey:@"destinationAttribute"]; [self setDestinationAttribute:tmp]; if ((joinOperatorPList = [plist objectForKey:@"joinOperator"])) { NSAssert([joinOperatorPList isEqual:@"EOJoinEqualTo"], @"only EOJoinEqualTo is supported as the join operator !"); } if ((joinSemanticPList = [plist objectForKey:@"joinSemantic"])) { NSAssert([joinSemanticPList isEqual:@"EOInnerJoin"], @"only EOInnerJoin is supported as the join semantic !"); } } - (void)setDestinationAttribute:(EOAttribute*)attribute { ASSIGN(self->destinationAttribute, attribute); } - (EOAttribute*)destinationAttribute { return self->destinationAttribute; } - (void)setSourceAttribute:(EOAttribute *)attribute { ASSIGN(self->sourceAttribute, attribute); } - (EOAttribute*)sourceAttribute { return self->sourceAttribute; } - (EOJoinOperator)joinOperator { return EOJoinEqualTo; } - (EOJoinSemantic)joinSemantic { return EOInnerJoin; } - (EORelationship*)relationship { return self; } // misc - (void)addJoin:(EOJoin *)_join { [self setSourceAttribute:[_join sourceAttribute]]; [self setDestinationAttribute:[_join destinationAttribute]]; } /* PropertyListCoding */ static inline void _addToPropList(NSMutableDictionary *_plist, id _value, NSString *key) { if (_value) [_plist setObject:_value forKey:key]; } - (void)encodeIntoPropertyList:(NSMutableDictionary *)_plist { _addToPropList(_plist, self->name, @"name"); _addToPropList(_plist, self->definition, @"definition"); _addToPropList(_plist, self->userDictionary, @"userDictionary"); if (self->sourceAttribute) { // has join ? _addToPropList(_plist, [self->sourceAttribute name], @"sourceAttribute"); _addToPropList(_plist, [self->destinationAttribute name], @"destinationAttribute"); _addToPropList(_plist, [[self->sourceAttribute entity] name], @"destination"); } if (![self isFlattened] && self->destinationEntity) { _addToPropList(_plist, [self->destinationEntity name], @"destination"); } if (![self isFlattened]) _addToPropList(_plist, flags.isToMany ? @"Y" : @"N", @"isToMany"); if (![self isMandatory]) _addToPropList(_plist, flags.isMandatory ? @"Y" : @"N", @"isMandatory"); } /* EOF2Additions */ /* constraints */ - (void)setIsMandatory:(BOOL)_flag { self->flags.isMandatory = _flag ? 1 : 0; } - (BOOL)isMandatory { return self->flags.isMandatory ? YES : NO; } - (NSException *)validateValue:(id *)_value { if (_value == NULL) return nil; /* check 'mandatory' constraint */ if (self->flags.isMandatory) { if (self->flags.isToMany) { if ([*_value count] == 0) { NSLog(@"WARNING(%s): tried to use value %@" @"with mandatory toMany relationship %@", __PRETTY_FUNCTION__, *_value, self); } } else { if ((*_value == nil) || (*_value == null)) { NSLog(@"WARNING(%s): tried to use value %@" @"with mandatory toOne relationship %@", __PRETTY_FUNCTION__, *_value, self); } } } return nil; } @end /* EORelationship */ @implementation EOJoin @end /* EOJoin */ SOPE/sope-gdl1/GDLAccess/EOQualifier+SQL.m0000644000000000000000000001023412242733417016630 0ustar rootroot/* EOAdaptorChannel.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: October 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // $Id: EOQualifier+SQL.m 1 2004-08-20 10:38:46Z znek $ #include "EOSQLExpression.h" #include "EOSQLQualifier.h" #include #include "common.h" @implementation EOAndQualifier(SQLGeneration) - (NSString *)sqlStringForSQLExpression:(EOSQLExpression *)_sqlExpr { return [_sqlExpr sqlStringForConjoinedQualifiers:[self qualifiers]]; } - (EOQualifier *)schemaBasedQualifierWithRootEntity:(EOEntity *)_entity { NSArray *array; id objects[self->count + 1]; unsigned i; IMP objAtIdx; objAtIdx = [self->qualifiers methodForSelector:@selector(objectAtIndex:)]; for (i = 0; i < self->count; i++) { id q, newq; q = objAtIdx(self->qualifiers, @selector(objectAtIndex:), i); newq = [q schemaBasedQualifierWithRootEntity:_entity]; if (newq == nil) newq = q; objects[i] = newq; } array = [NSArray arrayWithObjects:objects count:self->count]; return [[[[self class] alloc] initWithQualifierArray:array] autorelease]; } @end /* EOAndQualifier(SQLGeneration) */ @implementation EOOrQualifier(SQLGeneration) - (NSString *)sqlStringForSQLExpression:(EOSQLExpression *)_sqlExpr { return [_sqlExpr sqlStringForDisjoinedQualifiers:[self qualifiers]]; } - (EOQualifier *)schemaBasedQualifierWithRootEntity:(EOEntity *)_entity { NSArray *array; id objects[self->count + 1]; unsigned i; IMP objAtIdx; objAtIdx = [self->qualifiers methodForSelector:@selector(objectAtIndex:)]; for (i = 0; i < self->count; i++) { id q, newq; q = objAtIdx(self->qualifiers, @selector(objectAtIndex:), i); newq = [q schemaBasedQualifierWithRootEntity:_entity]; if (newq == nil) newq = q; objects[i] = newq; } array = [NSArray arrayWithObjects:objects count:self->count]; return [[[[self class] alloc] initWithQualifierArray:array] autorelease]; } @end /* EOOrQualifier(SQLGeneration) */ @implementation EONotQualifier(SQLGeneration) - (NSString *)sqlStringForSQLExpression:(EOSQLExpression *)_sqlExpr { return [_sqlExpr sqlStringForNegatedQualifier:[self qualifier]]; } - (EOQualifier *)schemaBasedQualifierWithRootEntity:(EOEntity *)_entity { EOQualifier *sq; sq = [(id)self->qualifier schemaBasedQualifierWithRootEntity:_entity]; if (sq == self->qualifier) return self; sq = [[EONotQualifier alloc] initWithQualifier:sq]; return [sq autorelease]; } @end /* EONotQualifier(SQLGeneration) */ @implementation EOKeyValueQualifier(SQLGeneration) - (NSString *)sqlStringForSQLExpression:(EOSQLExpression *)_sqlExpr { return [_sqlExpr sqlStringForKeyValueQualifier:self]; } - (EOQualifier *)schemaBasedQualifierWithRootEntity:(EOEntity *)_entity { NSLog(@"ERROR(%s): subclasses need to override this method!", __PRETTY_FUNCTION__); return nil; } @end /* EOKeyValueQualifier(SQLGeneration) */ @implementation EOKeyComparisonQualifier(SQLGeneration) - (NSString *)sqlStringForSQLExpression:(EOSQLExpression *)_sqlExpr { return [_sqlExpr sqlStringForKeyComparisonQualifier:self]; } - (EOQualifier *)schemaBasedQualifierWithRootEntity:(EOEntity *)_entity { NSLog(@"ERROR(%s): subclasses need to override this method!", __PRETTY_FUNCTION__); return nil; } @end /* EOKeyComparisonQualifier(SQLGeneration) */ SOPE/sope-gdl1/GDLAccess/EOEntityClassDescription.m0000644000000000000000000001410712242733417020725 0ustar rootroot/* EOAttributeOrdering.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // $Id: EOEntityClassDescription.m 1 2004-08-20 10:38:46Z znek $ #import "common.h" #import "EOEntity.h" #import "EOAttribute.h" #import "EORelationship.h" #import #import @interface EOClassDescription(ClassDesc) /* TODO: check, whether this can be removed */ + (NSClassDescription *)classDescriptionForEntityName:(NSString *)_entityName; @end @implementation EOEntityClassDescription - (id)initWithEntity:(EOEntity *)_entity { self->entity = RETAIN(_entity); return self; } - (void)dealloc { RELEASE(self->entity); [super dealloc]; } /* creating instances */ - (id)createInstanceWithEditingContext:(id)_ec globalID:(EOGlobalID *)_oid zone:(NSZone *)_zone { Class eoClass; id eo; eoClass = NSClassFromString([self->entity className]); eo = [eoClass allocWithZone:_zone]; if ([eo respondsToSelector: @selector(initWithEditingContext:classDescription:globalID:)]) eo = [eo initWithEditingContext:_ec classDescription:self globalID:_oid]; else eo = [eo init]; return AUTORELEASE(eo); } /* accessors */ - (EOEntity *)entity { return self->entity; } /* model */ - (NSString *)entityName { return [self->entity name]; } - (NSArray *)attributeKeys { NSArray *attrs = [self->entity attributes]; unsigned int attrCount = [attrs count]; id keys[attrCount]; unsigned int i; for (i = 0; i < attrCount; i++) { EOAttribute *attribute; attribute = [attrs objectAtIndex:i]; keys[i] = [attribute name]; } return [NSArray arrayWithObjects:keys count:attrCount]; } - (NSArray *)toManyRelationshipKeys { NSArray *relships = [self->entity relationships]; unsigned int attrCount = [relships count]; id keys[attrCount]; unsigned int i, j; for (i = 0, j = 0; i < attrCount; i++) { EORelationship *relship; relship = [relships objectAtIndex:i]; if ([relship isToMany]) { keys[j] = [relship name]; } } return [NSArray arrayWithObjects:keys count:j]; } - (NSArray *)toOneRelationshipKeys { NSArray *relships = [self->entity relationships]; unsigned int attrCount = [relships count]; id keys[attrCount]; unsigned int i, j; for (i = 0, j = 0; i < attrCount; i++) { EORelationship *relship; relship = [relships objectAtIndex:i]; if (![relship isToMany]) { keys[j] = [relship name]; } } return [NSArray arrayWithObjects:keys count:j]; } - (NSClassDescription *)classDescriptionForDestinationKey:(NSString *)_key { /* TODO: is this used anywhere?, maybe remove? */ EORelationship *relship; NSString *targetEntityName; if ((relship = [self->entity relationshipNamed:_key]) == nil) return nil; if ([relship isToMany]) return nil; targetEntityName = [[relship entity] name]; return [EOClassDescription classDescriptionForEntityName:targetEntityName]; } /* validation */ - (NSException *)validateObjectForSave:(id)_object { NSMutableArray *exceptions; NSArray *attrs; unsigned int count, i; exceptions = nil; /* validate attributes */ attrs = [self->entity attributes]; count = [attrs count]; for (i = 0; i < count; i++) { EOAttribute *attribute; NSException *exception; id oldValue, newValue; attribute = [attrs objectAtIndex:i]; oldValue = [_object storedValueForKey:[attribute name]]; newValue = oldValue; if ((exception = [attribute validateValue:&newValue])) { /* validation failed */ if (exceptions == nil) exceptions = [NSMutableArray array]; [exceptions addObject:exception]; } else if (oldValue != newValue) { /* apply new value to object (value was changed by val-method) */ [_object takeStoredValue:newValue forKey:[attribute name]]; } } /* validate relationships */ attrs = [self->entity relationships]; count = [attrs count]; for (i = 0; i < count; i++) { EORelationship *relationship; NSException *exception; id oldValue, newValue; relationship = [attrs objectAtIndex:i]; oldValue = [_object storedValueForKey:[relationship name]]; newValue = oldValue; if ((exception = [relationship validateValue:&newValue])) { /* validation failed */ if (exceptions == nil) exceptions = [NSMutableArray array]; [exceptions addObject:exception]; } else if (oldValue != newValue) { /* apply new value to object (value was changed by val-method) */ [_object takeStoredValue:newValue forKey:[relationship name]]; } } /* process exceptions */ if ((count = [exceptions count]) == 0) return nil; if (count == 1) return [exceptions objectAtIndex:0]; { NSException *master; NSMutableDictionary *ui; master = [exceptions objectAtIndex:0]; ui = [[master userInfo] mutableCopy]; if (ui == nil) ui = [[NSMutableDictionary alloc] init]; [ui setObject:exceptions forKey:@"EOAdditionalExceptions"]; master = [NSException exceptionWithName:[master name] reason:[master reason] userInfo:ui]; [ui release]; ui = nil; return master; } } @end /* EOEntityClassDescription */ SOPE/sope-gdl1/GDLAccess/EODatabaseFaultResolver.h0000644000000000000000000000457012242733417020477 0ustar rootroot/* EODatabaseFaultResolver.h Copyright (C) 1996 Free Software Foundation, Inc. Author: Mircea Oancea Date: 1996 Author: Helge Hess Date: 1999 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __EODatabaseFaultResolver_h__ #define __EODatabaseFaultResolver_h__ #import @class EODatabaseChannel; @class EOSQLQualifier; @class EOEntity; @interface EODatabaseFaultResolver : EOFaultHandler { @public EODatabaseChannel *channel; } - (id)initWithDatabaseChannel:(EODatabaseChannel*)aChannel zone:(NSZone*)zone targetClass:(Class)targetClass; - (Class)targetClass; - (NSDictionary *)primaryKey; - (EOEntity *)entity; - (EOSQLQualifier *)qualifier; - (NSArray *)fetchOrder; - (EODatabaseChannel *)databaseChannel; @end /* EODatabaseFaultResolver */ @interface EOArrayFault : EODatabaseFaultResolver { EOSQLQualifier *qualifier; NSArray *fetchOrder; } - (id)initWithQualifier:(EOSQLQualifier *)qualifier fetchOrder:(NSArray *)fetchOrder databaseChannel:(EODatabaseChannel *)channel zone:(NSZone *)zone targetClass:(Class)targetClass; - (EOEntity *)entity; - (EOSQLQualifier *)qualifier; - (NSArray *)fetchOrder; @end @interface EOObjectFault : EODatabaseFaultResolver { EOEntity *entity; NSDictionary *primaryKey; } - (id)initWithPrimaryKey:(NSDictionary *)key entity:(EOEntity *)entity databaseChannel:(EODatabaseChannel *)channel zone:(NSZone *)zone targetClass:(Class)targetClass ; - (NSDictionary*)primaryKey; - (EOEntity*)entity; @end #endif /* __EODatabaseFaultResolver_h__ */ SOPE/sope-gdl1/GDLAccess/EODatabase.h0000644000000000000000000001044112242733417015753 0ustar rootroot/* EODatabase.h Copyright (C) 1996 Free Software Foundation, Inc. Author: Mircea Oancea Date: 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __eoaccess_EODatabase_h__ #define __eoaccess_EODatabase_h__ #import #import @class NSArray; @class NSMutableArray; @class NSDictionary; @class NSMutableDictionary; @class NSString; @class NSMutableString; @class EOAdaptor; @class EOModel; @class EOEntity; @class EOObjectUniquer; @class EODatabase, EODatabaseContext, EODatabaseChannel; @protocol EOObjectRegistry - (void)forgetObject:(id)anObj; - (id)objectForPrimaryKey:(NSDictionary *)aKey entity:(EOEntity *)anEntity; /* retrieving snapshots and primary keys */ - (NSDictionary *)snapshotForObject:(id)anObj; - (NSDictionary *)primaryKeyForObject:(id)anObj; - (void)primaryKey:(NSDictionary **)aKey andSnapshot:(NSDictionary **)aSnapshot forObject:(id)anObj; /* recording objects */ - (void)recordObject:(id)anObj primaryKey:(NSDictionary *)aKey snapshot:(NSDictionary *)aSnapshot; - (void)recordObject:(id)anObj primaryKey:(NSDictionary *)aKey entity:(EOEntity *)anEntity snapshot:(NSDictionary *)aSnapshot; @end @interface EODatabase : NSObject < EOObjectRegistry > { @private EOAdaptor *adaptor; EOObjectUniquer *objectsDictionary; NSMutableArray *contexts; struct { BOOL isUniquingObjects:1; BOOL isKeepingSnapshots:1; BOOL isLoggingWarnings:1; } flags; } // Initializing new instances - (id)initWithAdaptor:(EOAdaptor *)anAdaptor; - (id)initWithModel:(EOModel *)aModel; // Getting the adaptor - (EOAdaptor*)adaptor; // Getting the database contexts - (id)createContext; - (NSArray*)contexts; // Checking connection status - (BOOL)hasOpenChannels; // Uniquing/snapshotting - (void)setUniquesObjects:(BOOL)yn; - (BOOL)uniquesObjects; - (void)setKeepsSnapshots:(BOOL)yn; - (BOOL)keepsSnapshots; // Handle Objects + (void)forgetObject:(id)anObj; - (void)forgetAllObjects; - (void)forgetAllSnapshots; - (BOOL)isObject:(id)anObj updatedOutsideContext:(EODatabaseContext *)aContext; // Error messages - (BOOL)logsErrorMessages; - (void)setLogsErrorMessages:(BOOL)yn; - (void)reportError:(NSString*)error; - (void)reportErrorFormat:(NSString*)format, ...; - (void)reportErrorFormat:(NSString*)format arguments:(va_list)arguments; @end /* EODatabase */ /* * Methods used by database classes internally */ @interface EODatabase(Private) - (void)contextDidInit:(id)aContext; - (void)contextWillDealloc:(id)aContext; - (EOObjectUniquer*)objectUniquer; @end @class EOGlobalID; extern NSTimeInterval NSDistantPastTimeInterval; @interface EODatabase(EOF2Additions) /* models */ - (NSArray *)models; - (void)addModel:(EOModel *)_model; - (BOOL)addModelIfCompatible:(EOModel *)_model; /* entities */ - (EOEntity *)entityForObject:(id)_object; - (EOEntity *)entityNamed:(NSString *)_name; /* snapshots */ - (void)recordSnapshot:(NSDictionary *)_snapshot forGlobalID:(EOGlobalID *)_gid; - (void)recordSnapshots:(NSDictionary *)_snapshots; - (void)recordSnapshot:(NSArray *)_gids forSourceGlobalID:(EOGlobalID *)_gid relationshipName:(NSString *)_name; - (void)recordToManySnapshots:(NSDictionary *)_snapshots; - (NSDictionary *)snapshotForGlobalID:(EOGlobalID *)_gid after:(NSTimeInterval)_duration; - (NSDictionary *)snapshotForGlobalID:(EOGlobalID *)_gid; - (void)forgetSnapshotsForGlobalIDs:(NSArray *)_gids; - (void)forgetSnapshotsForGlobalID:(EOGlobalID *)_gid; @end #endif /* __eoaccess_EODatabase_h__ */ SOPE/sope-gdl1/GDLAccess/EOModel.h0000644000000000000000000000652512242733417015317 0ustar rootroot/* EOModel.h Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: August 1996 This file is part of the GNUstep Database Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __EOModel_h__ #define __EOModel_h__ #import @class EOEntity; @interface EOModel : NSObject { NSString *name; NSString *path; NSString *adaptorName; NSString *adaptorClassName; NSDictionary *connectionDictionary; NSDictionary *pkeyGeneratorDictionary; NSDictionary *userDictionary; NSArray *entities; // values with EOEntities NSMutableDictionary *entitiesByName; // name/value with EOEntity NSMutableDictionary *entitiesByClassName; // class name/value with EOEntity struct { BOOL createsMutableObjects:1; BOOL errors:1; } flags; } /* Searching for a model file */ + (NSString*)findPathForModelNamed:(NSString*)name; /* Initializing instances */ - (id)initWithContentsOfFile:(NSString*)filename; - (id)initWithPropertyList:propertyList; - (id)initWithName:(NSString*)name; /* Getting the filename */ - (NSString*)path; /* Getting a property list representation */ - (id)modelAsPropertyList; /* Getting the name */ - (NSString*)name; /* Using entities */ - (BOOL)addEntity:(EOEntity *)entity; - (void)removeEntityNamed:(NSString *)name; - (EOEntity *)entityNamed:(NSString *)name; - (NSArray *)entities; /* Checking references */ - (NSArray *)referencesToProperty:(id)property; /* Getting an object's entity */ - (EOEntity *)entityForObject:(id)object; /* Adding model information */ - (BOOL)incorporateModel:(EOModel *)model; /* Accessing the adaptor bundle */ - (void)setAdaptorName:(NSString *)adaptorName; - (NSString *)adaptorName; /* Setting and getting the adaptor class name. */ - (void)setAdaptorClassName:(NSString *)adaptorClassName; - (NSString *)adaptorClassName; /* Accessing the connection dictionary */ - (void)setConnectionDictionary:(NSDictionary *)connectionDictionary; - (NSDictionary *)connectionDictionary; /* Accessing the pkey generator dictionary */ - (void)setPkeyGeneratorDictionary:(NSDictionary *)connectionDictionary; - (NSDictionary *)pkeyGeneratorDictionary; /* Accessing the user dictionary */ - (void)setUserDictionary:(NSDictionary *)dictionary; - (NSDictionary *)userDictionary; @end @interface EOModel (EOModelPrivate) - (void)setCreateMutableObjects:(BOOL)flag; - (BOOL)createsMutableObjects; - (void)errorInReading; @end /* EOModel (EOModelPrivate) */ @interface EOModel(NewInEOF2) - (void)loadAllModelObjects; @end #endif /* __EOModel_h__ */ SOPE/sope-gdl1/GDLAccess/libGDLAccess.def0000644000000000000000000000467212242733417016562 0ustar rootrootEXPORTS __objc_class_name_EOAdaptor; __objc_class_name_EOAdaptorChannel; __objc_class_name_EOAdaptorContext; __objc_class_name_EOArrayProxy; __objc_class_name_EOAttribute; __objc_class_name_EOAttributeOrdering; __objc_class_name_EODatabase; __objc_class_name_EODatabaseChannel; __objc_class_name_EODatabaseContext; __objc_class_name_EODatabaseFault; __objc_class_name_EODatabaseFaultResolver; __objc_class_name_EOArrayFault; __objc_class_name_EOObjectFault; __objc_class_name_EOEntity; __objc_class_name_EOEntityClassDescription; __objc_class_name_EOExpressionArray; __objc_class_name_EOFException; __objc_class_name_ObjectNotAvailableException; __objc_class_name_PropertyDefinitionException; __objc_class_name_DestinationEntityDoesntMatchDefinitionException; __objc_class_name_InvalidNameException; __objc_class_name_InvalidPropertyException; __objc_class_name_RelationshipMustBeToOneException; __objc_class_name_InvalidValueTypeException; __objc_class_name_InvalidAttributeException; __objc_class_name_InvalidQualifierException; __objc_class_name_EOAdaptorException; __objc_class_name_CannotFindAdaptorBundleException; __objc_class_name_InvalidAdaptorBundleException; __objc_class_name_InvalidAdaptorStateException; __objc_class_name_DataTypeMappingNotSupportedException; __objc_class_name_ChannelIsNotOpenedException; __objc_class_name_AdaptorIsFetchingException; __objc_class_name_AdaptorIsNotFetchingException; __objc_class_name_NoTransactionInProgressException; __objc_class_name_TooManyOpenedChannelsException; __objc_class_name_EOKeySortOrdering; __objc_class_name_EOModel; __objc_class_name_EOModelGroup; __objc_class_name_EOObjectUniquer; __objc_class_name_EOSinglePrimaryKeyDictionary; __objc_class_name_EOSinglePrimaryKeyDictionaryEnumerator; __objc_class_name_EOMultiplePrimaryKeyDictionary; __objc_class_name_EOPrimaryKeyDictionary; __objc_class_name_EOQualifierScannerHandler; __objc_class_name_EOQualifierEnumScannerHandler; __objc_class_name_EOQuotedExpression; __objc_class_name_EORelationship; __objc_class_name_EOJoin; __objc_class_name_EOSelectScannerHandler; __objc_class_name_EOInsertUpdateScannerHandler; __objc_class_name_EOSQLExpression; __objc_class_name_EOSelectSQLExpression; __objc_class_name_EOInsertSQLExpression; __objc_class_name_EOUpdateSQLExpression; __objc_class_name_EODeleteSQLExpression; __objc_class_name_EOQualifierJoinHolder; __objc_class_name_EOSQLQualifier; __objc_class_name_eoaccess; SOPE/sope-gdl1/PostgreSQL/0000755000000000000000000000000012242733417014125 5ustar rootrootSOPE/sope-gdl1/PostgreSQL/PostgreSQL72Exception.h0000644000000000000000000000266512242733417020342 0ustar rootroot/* PostgreSQL72Exception.h Copyright (C) 1999 MDlink online service center GmbH and Helge Hess Author: Helge Hess (helge@mdlink.de) This file is part of the PostgreSQL72 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ___PostgreSQL72_Exception_H___ #define ___PostgreSQL72_Exception_H___ #import @interface PostgreSQL72Exception : NSException { } + (void)raiseWithFormat:(NSString *)_format, ...; @end @interface PostgreSQL72CouldNotOpenChannelException : PostgreSQL72Exception { } @end @interface PostgreSQL72CouldNotConnectException : PostgreSQL72CouldNotOpenChannelException { } @end @interface PostgreSQL72CouldNotBindException : PostgreSQL72Exception { } @end #endif SOPE/sope-gdl1/PostgreSQL/test.eomodel0000644000000000000000000000120112242733417016444 0ustar rootroot{ EOModelVersion = 1; adaptorClassName = PostgreSQLAdaptor; adaptorName = PostgreSQL; entities = ( { name = Doof; externalName = doof; className = EOGenericRecord; primaryKeyAttributes = ( pkey ); attributesUsedForLocking = ( pkey ); classProperties = ( pkey ); attributes = ( { valueClassName = NSNumber; columnName = pkey; name = pkey; valueType = i; externalType = INT; // t_id }, ); } ); } SOPE/sope-gdl1/PostgreSQL/NSNumber+PGVal.m0000644000000000000000000001175412242733417016751 0ustar rootroot/* NSString+PGVal.m Copyright (C) 1999 MDlink online service center GmbH and Helge Hess Copyright (C) 2000-2005 SKYRIX Software AG and Helge Hess Author: Helge Hess (helge.hess@opengroupware.org) This file is part of the PostgreSQL72 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import #include "PostgreSQL72Channel.h" #include "common.h" @implementation NSNumber(PostgreSQL72Values) static BOOL debugOn = NO; static Class NSNumberClass = Nil; static NSNumber *yesNum = nil; static NSNumber *noNum = nil; + (id)valueFromCString:(const char *)_cstr length:(int)_length postgreSQLType:(NSString *)_type attribute:(EOAttribute *)_attribute adaptorChannel:(PostgreSQL72Channel *)_channel { // TODO: can we avoid the lowercaseString? unsigned len; unichar c1; if ((len = [_type length]) == 0) return nil; if (NSNumberClass == Nil) NSNumberClass = [NSNumber class]; c1 = [_type characterAtIndex:0]; switch (c1) { case 'f': case 'F': { if (len < 5) break; if ([[_type lowercaseString] hasPrefix:@"float"]) return [NSNumberClass numberWithDouble:atof(_cstr)]; break; } case 's': case 'S': { if (len < 8) break; if ([[_type lowercaseString] hasPrefix:@"smallint"]) return [NSNumberClass numberWithShort:atoi(_cstr)]; break; } case 'i': case 'I': { if (len < 3) break; if ([[_type lowercaseString] hasPrefix:@"int"]) return [NSNumberClass numberWithInt:atoi(_cstr)]; } case 'b': case 'B': { if (len < 4) break; if (![[_type lowercaseString] hasPrefix:@"bool"]) break; if (yesNum == nil) yesNum = [[NSNumberClass numberWithBool:YES] retain]; if (noNum == nil) noNum = [[NSNumberClass numberWithBool:NO] retain]; if (_length == 0) return noNum; switch (*_cstr) { case 't': case 'T': case 'y': case 'Y': case '1': return yesNum; default: return noNum; } } } return nil; } + (id)valueFromBytes:(const void *)_bytes length:(int)_length postgreSQLType:(NSString *)_type attribute:(EOAttribute *)_attribute adaptorChannel:(PostgreSQL72Channel *)_channel { #if COCOA_Foundation_LIBRARY || NeXT_Foundation_LIBRARY NSLog(@"%s: not implemented!", __PRETTY_FUNCTION__); return nil; #else return [self notImplemented:_cmd]; #endif } - (NSString *)stringValueForPostgreSQLType:(NSString *)_type attribute:(EOAttribute *)_attribute { // TODO: can we avoid the lowercaseString? unsigned len; unichar c1; if (debugOn) NSLog(@"%s(type=%@,attr=%@)", __PRETTY_FUNCTION__, _type, _attribute); if ((len = [_type length]) == 0) { if (debugOn) NSLog(@" no type, return string"); return [self stringValue]; } if (len < 4) { /* apparently this is 'INT'? */ if (debugOn) NSLog(@" type len < 4 (%@), return string", _type); #if GNUSTEP_BASE_LIBRARY /* on gstep-base -stringValue of bool's return YES or NO, which seems to be different on Cocoa and liBFoundation. */ { static Class BoolClass = Nil; if (BoolClass == Nil) BoolClass = NSClassFromString(@"NSBoolNumber"); if ([self isKindOfClass:BoolClass]) return [self boolValue] ? @"1" : @"0"; } #endif return [self stringValue]; } c1 = [_type characterAtIndex:0]; if (debugOn) NSLog(@" typecode '%c' ...", c1); switch (c1) { case 'b': case 'B': if (![[_type lowercaseString] hasPrefix:@"bool"]) break; return [self boolValue] ? @"true" : @"false"; case 'm': case 'M': { if (![[_type lowercaseString] hasPrefix:@"money"]) break; return [@"$" stringByAppendingString:[self stringValue]]; } case 'c': case 'C': case 't': case 'T': case 'v': case 'V': { static NSMutableString *ms = nil; // reuse mstring, THREAD _type = [_type lowercaseString]; if (!([_type hasPrefix:@"char"] || [_type hasPrefix:@"varchar"] || [_type hasPrefix:@"text"])) break; // TODO: can we get this faster?! if (ms == nil) ms = [[NSMutableString alloc] initWithCapacity:256]; [ms setString:@"'"]; [ms appendString:[self stringValue]]; [ms appendString:@"'"]; return [[ms copy] autorelease]; } } return [self stringValue]; } @end /* NSNumber(PostgreSQL72Values) */ SOPE/sope-gdl1/PostgreSQL/fhs.make0000644000000000000000000000122512242733417015544 0ustar rootroot# postprocessing # FHS support (this is a hack and is going to be done by gstep-make!) ifneq ($(FHS_INSTALL_ROOT),) FHS_LIB_DIR=$(CONFIGURE_FHS_INSTALL_LIBDIR) FHS_DB_DIR=$(FHS_LIB_DIR)sope-$(SOPE_MAJOR_VERSION).$(SOPE_MINOR_VERSION)/dbadaptors/ fhs-db-dirs :: $(MKDIRS) $(FHS_DB_DIR) move-bundles-to-fhs :: fhs-db-dirs @echo "moving bundles $(BUNDLE_INSTALL_DIR) to $(FHS_DB_DIR) .." for i in $(BUNDLE_NAME); do \ j="$(FHS_DB_DIR)/$${i}$(BUNDLE_EXTENSION)"; \ if test -d $$j; then rm -r $$j; fi; \ mv "$(BUNDLE_INSTALL_DIR)/$${i}$(BUNDLE_EXTENSION)" $$j; \ done move-to-fhs :: move-bundles-to-fhs after-install :: move-to-fhs endif SOPE/sope-gdl1/PostgreSQL/EOAttribute+PostgreSQL72.h0000644000000000000000000000275212242733417020643 0ustar rootroot/* EOAttribute+PostgreSQL72.h Copyright (C) 1999 MDlink online service center GmbH and Helge Hess Copyright (C) 2000-2004 SKYRIX Software AG and Helge Hess Author: Helge Hess (helge.hess@opengroupware.org) This file is part of the PostgreSQL72 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ___PostgreSQL72_EOAttribute_H___ #define ___PostgreSQL72_EOAttribute_H___ #import #include @class NSString; @interface EOAttribute(PostgreSQL72AttributeAdditions) - (void)loadValueClassAndTypeUsingPostgreSQLType:(Oid)_type size:(int)_size modification:(int)_modification binary:(BOOL)_isBinary; - (void)loadValueClassForExternalPostgreSQLType:(NSString *)_type; @end #endif /* ___PostgreSQL72_EOAttribute_H___ */ SOPE/sope-gdl1/PostgreSQL/README0000644000000000000000000000271512242733417015012 0ustar rootrootPostgreSQL Adaptor ================== Install PostgreSQL: cd /INTERNET/suse72/dvd/ cd ap3 rpm -Uvh postgresql.rpm cd ap2 rpm -Uvh postgresql-lib.rpm rpm -Uvh postgresql-server.rpm rpm -Uvh postgresql-devel.rpm Configure PostgreSQL: su - postgres vi .bashrc -> export PGDATA=/var/lib/pgsql/data source .bashrc initdb su - root /etc/rc.d/postgresql start su - postgres createdb OpenGroupware createuser ogo vi data/pg_hba.conf > add line: "host all 192.168.0.1 255.255.255.0 trust" PostgreSQL starten: /etc/rc.d/postgresql restart Configure the Adaptor PGDebugEnabled NOTES ===== Querying the tables of a database --------------------------------- SELECT relname FROM pg_class WHERE ( relkind = 'r') AND relname !~ '^pg_' AND relname !~ '^xinv[0-9]+' ORDER BY relname; und die infos dazu mit: SELECT a.attnum, a.attname, t.typname, a.attlen, a.attnotnull FROM pg_class c, pg_attribute a, pg_type t WHERE c.relname = 'TABELLENNAME_HERE' AND a.attnum > 0 AND a.attrelid = c.oid AND a.atttypid = t.oid ORDER BY attnum; Quering the databases of a server --------------------------------- SELECT * FROM pg_database You need a database to connect PostgreSQL using libpq, but 'template1' should always be available. Fetch DB-names and their DBA: SELECT DISTINCT dbs.datname, users.usename FROM pg_database dbs, pg_user users WHERE dbs.datdba=users.usesysid SOPE/sope-gdl1/PostgreSQL/PostgreSQL72Values.h0000644000000000000000000000461112242733417017634 0ustar rootroot/* PostgreSQL72Values.h Copyright (C) 1999 MDlink online service center GmbH and Helge Hess Author: Helge Hess (helge@mdlink.de) This file is part of the PostgreSQL72 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ___PostgreSQL72_Values_H___ #define ___PostgreSQL72_Values_H___ #import #import #import #import #import #import "PostgreSQL72Exception.h" @class EOAttribute; @class PostgreSQL72Channel; @interface PostgreSQL72DataTypeMappingException : PostgreSQL72Exception - (id)initWithObject:(id)_obj forAttribute:(EOAttribute *)_attr andPostgreSQLType:(NSString *)_dt inChannel:(PostgreSQL72Channel *)_channel; @end @protocol PostgreSQL72Values + (id)valueFromCString:(const char *)_cstr length:(int)_length postgreSQLType:(NSString *)_type attribute:(EOAttribute *)_attribute adaptorChannel:(PostgreSQL72Channel *)_channel; + (id)valueFromBytes:(const void *)_bytes length:(int)_length postgreSQLType:(NSString *)_type attribute:(EOAttribute *)_attribute adaptorChannel:(PostgreSQL72Channel *)_channel; - (NSString *)stringValueForPostgreSQLType:(NSString *)_type attribute:(EOAttribute *)_attribute; @end @interface NSString(PostgreSQL72Values) < PostgreSQL72Values > @end @interface NSNumber(PostgreSQL72Values) < PostgreSQL72Values > @end @interface NSData(PostgreSQL72Values) < PostgreSQL72Values > @end @interface NSCalendarDate(PostgreSQL72Values) < PostgreSQL72Values > @end @interface EONull(PostgreSQL72Values) - (NSString *)stringValueForPostgreSQLType:(NSString *)_type attribute:(EOAttribute *)_attribute; @end #endif SOPE/sope-gdl1/PostgreSQL/pgconfig.h0000644000000000000000000000310612242733417016072 0ustar rootroot/* PostgreSQL72Channel.m Copyright (C) 1999 MDlink online service center GmbH and Helge Hess Copyright (C) 2000-2006 SKYRIX Software AG and Helge Hess Author: Helge Hess (helge.hess@opengroupware.org) This file is part of the PostgreSQL Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef PG_MAJOR_VERSION /* PostgreSQL 7.4 and up do not have those versioning checks */ #define NG_HAS_NOTICE_PROCESSOR 1 #define NG_HAS_BINARY_TUPLES 1 #define NG_HAS_FMOD 1 #define NG_SET_CLIENT_ENCODING 1 #else /* PG_MAJOR_VERSION processing */ #if PG_MAJOR_VERSION >= 6 && PG_MINOR_VERSION > 3 # define NG_HAS_NOTICE_PROCESSOR 1 # define NG_HAS_BINARY_TUPLES 1 # define NG_HAS_FMOD 1 #endif #if PG_MAJOR_VERSION >= 7 && PG_MINOR_VERSION > 3 # define NG_SET_CLIENT_ENCODING 1 #endif #endif /* PG_MAJOR_VERSION processing */ SOPE/sope-gdl1/PostgreSQL/types.psql0000644000000000000000000000042412242733417016172 0ustar rootroot # type test table create table pgtypetest ( t_int2 int2, t_int4 int4, t_int8 int8, t_int int, t_varchar255 varchar(255), t_datetime datetime, t_timestamp timestamp, t_timestamp_wtz timestamp with time zone ); SOPE/sope-gdl1/PostgreSQL/GNUmakefile0000644000000000000000000000365712242733417016212 0ustar rootroot# # GNUmakefile # # Copyright (C) 2004-2007 SKYRIX Software AG # # Author: Helge Hess (helge.hess@skyrix.com) # # This file is part of the PostgreSQL Adaptor Library # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; see the file COPYING.LIB. # If not, write to the Free Software Foundation, # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. include ../../config.make include $(GNUSTEP_MAKEFILES)/common.make include ../Version include ./Version BUNDLE_NAME = PostgreSQL PostgreSQL_PCH_FILE = common.h PostgreSQL_OBJC_FILES = \ PGConnection.m \ PGResultSet.m \ PostgreSQL72Expression.m \ PostgreSQL72Adaptor.m \ PostgreSQL72Context.m \ PostgreSQL72Channel.m \ PostgreSQL72Channel+Model.m \ PostgreSQL72Exception.m \ NSString+PostgreSQL72.m \ EOAttribute+PostgreSQL72.m \ NSString+PGVal.m \ NSData+PGVal.m \ NSCalendarDate+PGVal.m \ NSNumber+PGVal.m \ EOKeyGlobalID+PGVal.m \ NSNull+PGVal.m \ NSNumber+ExprValue.m \ PostgreSQL72DataTypeMappingException.m PostgreSQL_PRINCIPAL_CLASS = PostgreSQL72Adaptor BUNDLE_INSTALL = PostgreSQL # Use .gdladaptor as the bundle extension BUNDLE_EXTENSION = .gdladaptor PostgreSQL_RESOURCE_FILES += Version # tool TOOL_NAME = gdltest gdltest_OBJC_FILES = gdltest.m -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/bundle.make #include $(GNUSTEP_MAKEFILES)/tool.make -include GNUmakefile.postamble SOPE/sope-gdl1/PostgreSQL/PostgreSQL-Info.plist0000644000000000000000000000110212242733417020070 0ustar rootroot CFBundleExecutable PostgreSQL CFBundleIdentifier org.OpenGroupware.SOPE.sope-gdl1.PostgreSQL CFBundlePackageType BNDL CFBundleSignature ???? CFBundleVersion 4.5.48 NSPrincipalClass PostgreSQL72Adaptor SOPE/sope-gdl1/PostgreSQL/PostgreSQL72Adaptor.m0000644000000000000000000001103212242733417017767 0ustar rootroot/* PostgreSQL72Adaptor.m Copyright (C) 1999 MDlink online service center GmbH and Helge Hess Copyright (C) 2000-2004 SKYRIX Software AG and Helge Hess Author: Helge Hess (helge.hess@opengroupware.org) This file is part of the PostgreSQL72 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "common.h" #include "PostgreSQL72Adaptor.h" #include "PostgreSQL72Context.h" #include "PostgreSQL72Channel.h" #include "PostgreSQL72Expression.h" #include "PostgreSQL72Values.h" #include "PGConnection.h" @implementation PostgreSQL72Adaptor static BOOL debugOn = NO; - (id)initWithName:(NSString *)_name { if ((self = [super initWithName:_name])) { } return self; } - (void)gcFinalize { } - (void)dealloc { // NSLog(@"%s", __PRETTY_FUNCTION__); [self gcFinalize]; [super dealloc]; } /* NSCopying methods */ - (id)copyWithZone:(NSZone *)_zone { return [self retain]; } /* connections */ - (NSString *)_copyOfConDictString:(NSString *)_key { return [[[[self connectionDictionary] objectForKey:_key] copy] autorelease]; } - (NSString *)serverName { NSString *serverName; serverName = [[self connectionDictionary] objectForKey:@"hostName"]; if (serverName == nil) { // lookup env-variable serverName = [[[NSProcessInfo processInfo] environment] objectForKey:@"PGHOST"]; } return [[serverName copy] autorelease]; } - (NSString *)loginName { return [self _copyOfConDictString:@"userName"]; } - (NSString *)loginPassword { return [self _copyOfConDictString:@"password"]; } - (NSString *)databaseName { return [self _copyOfConDictString:@"databaseName"]; } - (NSString *)port { return [self _copyOfConDictString:@"port"]; } - (NSString *)options { return [self _copyOfConDictString:@"options"]; } - (NSString *)tty { return [self _copyOfConDictString:@"tty"]; } /* sequence for primary key generation */ - (NSString *)primaryKeySequenceName { NSString *seqName; seqName = [[self pkeyGeneratorDictionary] objectForKey:@"primaryKeySequenceName"]; return [[seqName copy] autorelease]; } - (NSString *)newKeyExpression { NSString *newKeyExpr; newKeyExpr = [[self pkeyGeneratorDictionary] objectForKey:@"newKeyExpression"]; return [[newKeyExpr copy] autorelease]; } /* formatting */ - (NSString *)charConvertExpressionForAttributeNamed:(NSString *)_attrName { return _attrName; } - (id)formatValue:(id)value forAttribute:(EOAttribute *)attribute { /* This formats values into SQL constants, eg: @"blah" will be converted to 'blah' */ NSString *result; result = [value stringValueForPostgreSQLType:[attribute externalType] attribute:attribute]; if (debugOn) { NSLog(@"formatting value '%@'(%@) result '%@'", value, NSStringFromClass([value class]), result); NSLog(@" value class %@ attr %@ attr type %@", [value class], attribute, [attribute externalType]); } return result; } - (BOOL)attributeAllowedInDistinctSelects:(EOAttribute *)_attr { return YES; } /* types */ - (BOOL)isValidQualifierType:(NSString *)_typeName { return YES; } /* adaptor info */ - (Class)adaptorContextClass { return [PostgreSQL72Context class]; } - (Class)adaptorChannelClass { return [PostgreSQL72Channel class]; } - (Class)expressionClass { return [PostgreSQL72Expression class]; } @end /* PostgreSQL72Adaptor */ void __linkPostgreSQL72Adaptor(void) { extern void __link_EOAttributePostgreSQL72(); extern void __link_NSStringPostgreSQL72(); extern void __link_PostgreSQL72ChannelModel(); extern void __link_PostgreSQL72Values(); ; [PostgreSQL72Channel class]; [PostgreSQL72Context class]; [PostgreSQL72Exception class]; [PostgreSQL72Expression class]; __link_EOAttributePostgreSQL72(); __link_NSStringPostgreSQL72(); //__link_PostgreSQL72ChannelModel(); __link_PostgreSQL72Values(); __linkPostgreSQL72Adaptor(); } SOPE/sope-gdl1/PostgreSQL/PostgreSQL72Channel.m0000644000000000000000000005433112242733417017756 0ustar rootroot/* PostgreSQL72Channel.m Copyright (C) 1999 MDlink online service center GmbH and Helge Hess Copyright (C) 2000-2008 SKYRIX Software AG and Helge Hess Author: Helge Hess (helge.hess@opengroupware.org) This file is part of the PostgreSQL72 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #import "common.h" #import "PostgreSQL72Channel.h" #import "PostgreSQL72Adaptor.h" #import "PostgreSQL72Exception.h" #import "NSString+PostgreSQL72.h" #import "PostgreSQL72Values.h" #import "EOAttribute+PostgreSQL72.h" #include "PGConnection.h" #include "pgconfig.h" #ifndef MIN # define MIN(x, y) ((x > y) ? y : x) #endif // TODO: what does this do? #define MAX_CHAR_BUF 16384 @interface PostgreSQL72Channel(Privates) - (void)_resetEvaluationState; @end @implementation PostgreSQL72Channel #if NG_SET_CLIENT_ENCODING static NSString *PGClientEncoding = @"UTF8"; #endif static int MaxOpenConnectionCount = -1; static BOOL debugOn = NO; static NSNull *null = nil; static NSNumber *yesObj = nil; static Class StringClass = Nil; static Class MDictClass = Nil; + (void)initialize { NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; if (null == nil) null = [[NSNull null] retain]; if (yesObj == nil) yesObj = [[NSNumber numberWithBool:YES] retain]; StringClass = [NSString class]; MDictClass = [NSMutableDictionary class]; MaxOpenConnectionCount = [ud integerForKey:@"PGMaxOpenConnectionCount"]; if (MaxOpenConnectionCount < 2) MaxOpenConnectionCount = 50; debugOn = [ud boolForKey:@"PGDebugEnabled"]; } - (id)initWithAdaptorContext:(EOAdaptorContext*)_adaptorContext { if ((self = [super initWithAdaptorContext:_adaptorContext])) { [self setDebugEnabled:debugOn]; self->_attributesForTableName = [[MDictClass alloc] initWithCapacity:16]; self->_primaryKeysNamesForTableName = [[MDictClass alloc] initWithCapacity:16]; } return self; } /* collection */ - (void)dealloc { [self _resetEvaluationState]; if ([self isOpen]) [self closeChannel]; [self->_attributesForTableName release]; [self->_primaryKeysNamesForTableName release]; [super dealloc]; } /* NSCopying methods */ - (id)copyWithZone:(NSZone *)zone { return [self retain]; } /* debugging */ - (void)setDebugEnabled:(BOOL)_flag { self->isDebuggingEnabled = _flag; } - (BOOL)isDebugEnabled { return self->isDebuggingEnabled; } - (void)receivedMessage:(NSString *)_message { NSLog(@"%@: message: %@", self, _message); } static void _pgMessageProcessor(void *_channel, const char *_msg) __attribute__((unused)); static void _pgMessageProcessor(void *_channel, const char *_msg) { [(id)_channel receivedMessage: _msg ? [StringClass stringWithUTF8String:_msg] : nil]; } /* cleanup */ - (void)_resetResults { [self->resultSet clear]; [self->resultSet release]; self->resultSet = nil; } /* open/close */ static int openConnectionCount = 0; - (BOOL)isOpen { return [self->connection isValid]; } - (BOOL)openChannel { PostgreSQL72Adaptor *adaptor; if ([self->connection isValid]) { NSLog(@"%s: Connection already open !!!", __PRETTY_FUNCTION__); return NO; } adaptor = (PostgreSQL72Adaptor *)[adaptorContext adaptor]; if (![super openChannel]) return NO; #if HEAVY_DEBUG NSLog(@"+++++++++ %s: openConnectionCount %d", __PRETTY_FUNCTION__, openConnectionCount); #endif if (openConnectionCount > MaxOpenConnectionCount) { [PostgreSQL72CouldNotOpenChannelException raise:@"NoMoreConnections" format: @"cannot open a additional connection !"]; return NO; } self->connection = [[PGConnection alloc] initWithHostName:[adaptor serverName] port:[(id)[adaptor port] stringValue] options:[adaptor options] tty:[adaptor tty] database:[adaptor databaseName] login:[adaptor loginName] password:[adaptor loginPassword]]; if (![self->connection isValid]) { // could not login .. NSLog(@"WARNING: could not open pgsql channel to %@@%@ host %@:%@", [adaptor loginName], [adaptor databaseName], [adaptor serverName], [adaptor port]); return NO; } /* PQstatus */ if (![self->connection isConnectionOK]) { NSLog(@"could not open channel to %@@%@", [adaptor databaseName], [adaptor serverName]); [self->connection finish]; [self->connection release]; self->connection = nil; return NO; } /* set message callback */ [self->connection setNoticeProcessor:_pgMessageProcessor context:self]; /* set client encoding */ #if NG_SET_CLIENT_ENCODING if (![self->connection setClientEncoding:PGClientEncoding]) { NSLog(@"WARNING: could not set client encoding to: '%s'", PGClientEncoding); } #endif /* log */ if (isDebuggingEnabled) NSLog(@"PostgreSQL72 connection established: %@", self->connection); #if HEAVY_DEBUG NSLog(@"---------- %s: %@ opens channel count[%d]", __PRETTY_FUNCTION__, self, openConnectionCount); #endif openConnectionCount++; if (isDebuggingEnabled) { NSLog(@"PostgreSQL72 channel 0x%p opened (connection=%@)", self, self->connection); } return YES; } - (void)primaryCloseChannel { self->tupleCount = 0; self->fieldCount = 0; self->containsBinaryData = NO; if (self->fieldInfo) { free(self->fieldInfo); self->fieldInfo = NULL; } [self _resetResults]; [self->cmdStatus release]; self->cmdStatus = nil; [self->cmdTuples release]; self->cmdTuples = nil; if (self->connection) { [self->connection finish]; #if HEAVY_DEBUG NSLog(@"---------- %s: %@ close channel count[%d]", __PRETTY_FUNCTION__, self, openConnectionCount); #endif openConnectionCount--; if (isDebuggingEnabled) { fprintf(stderr, "PostgreSQL72 connection dropped 0x%p (channel=0x%p)\n", self->connection, self); } [self->connection release]; self->connection = nil; } } - (void)closeChannel { [super closeChannel]; [self primaryCloseChannel]; } /* fetching rows */ - (void)cancelFetch { if (![self isOpen]) { [PostgreSQL72Exception raise:@"ChannelNotOpenException" format:@"No fetch in progress, connection is not open" @" (channel=%@)", self]; } #if HEAVY_DEBUG NSLog(@"canceling fetch (%i tuples remaining).", (self->tupleCount - self->currentTuple)); #endif self->tupleCount = 0; self->currentTuple = 0; self->fieldCount = 0; self->containsBinaryData = NO; if (self->fieldInfo) { free(self->fieldInfo); self->fieldInfo = NULL; } [self _resetResults]; [self->cmdStatus release]; self->cmdStatus = nil; [self->cmdTuples release]; self->cmdTuples = nil; /* new caches which require a constant _attributes argument */ if (self->fieldIndices) free(self->fieldIndices); self->fieldIndices = NULL; if (self->fieldKeys) free(self->fieldKeys); self->fieldKeys = NULL; if (self->fieldValues) free(self->fieldValues); self->fieldValues = NULL; [super cancelFetch]; } - (NSArray *)describeResults:(BOOL)_beautifyNames { int cnt; NSMutableArray *result; NSMutableDictionary *usedNames; if (![self isFetchInProgress]) { [PostgreSQL72Exception raise:@"NoFetchInProgress" format:@"No fetch in progress (channel=%@)", self]; } result = [[NSMutableArray alloc] initWithCapacity:self->fieldCount]; usedNames = [[MDictClass alloc] initWithCapacity:self->fieldCount]; for (cnt = 0; cnt < self->fieldCount; cnt++) { EOAttribute *attribute = nil; NSString *columnName; NSString *attrName; columnName = [[StringClass alloc] initWithUTF8String:self->fieldInfo[cnt].name]; attrName = _beautifyNames ? [columnName _pgModelMakeInstanceVarName] : columnName; if ([[usedNames objectForKey:attrName] boolValue]) { // TODO: move name generation code to different method! int cnt2 = 0; char buf[64]; NSString *newAttrName = nil; for (cnt2 = 2; cnt2 < 100; cnt2++) { NSString *s; sprintf(buf, "%i", cnt2); s = [[StringClass alloc] initWithUTF8String:buf]; newAttrName = [attrName stringByAppendingString:s]; [s release]; s= nil; if (![[usedNames objectForKey:newAttrName] boolValue]) { attrName = newAttrName; break; } } } [usedNames setObject:yesObj forKey:attrName]; attribute = [[EOAttribute alloc] init]; [attribute setName:attrName]; [attribute setColumnName:columnName]; //NSLog(@"column: %@", columnName); [attribute loadValueClassAndTypeUsingPostgreSQLType: self->fieldInfo[cnt].type size:self->fieldInfo[cnt].size modification:self->fieldInfo[cnt].modification binary:self->containsBinaryData]; [result addObject:attribute]; [columnName release]; columnName = nil; [attribute release]; attribute = nil; } [usedNames release]; usedNames = nil; return [result autorelease]; } - (void)_fillFieldNamesForAttributes:(NSArray *)_attributes count:(unsigned)attrCount { // Note: this optimization requires that the "_attributes" array does // note change between invocations! // TODO: should add a sanity check for that! NSMutableArray *fieldNames; unsigned nFields, i; unsigned cnt; if (self->fieldIndices) return; self->fieldIndices = calloc(attrCount + 2, sizeof(int)); // TODO: we could probably cache the field-name array for much more speed ! fieldNames = [[NSMutableArray alloc] initWithCapacity:32]; nFields = [self->resultSet fieldCount]; for (i = 0; i < nFields; i++) [fieldNames addObject:[self->resultSet fieldNameAtIndex:i]]; for (cnt = 0; cnt < attrCount; cnt++) { EOAttribute *attribute; #ifndef GDL_USE_PQFNUMBER_INDEX NSUInteger res; #endif attribute = [_attributes objectAtIndex:cnt]; #if GDL_USE_PQFNUMBER_INDEX self->fieldIndices[cnt] = [self->resultSet indexOfFieldNamed:[attribute columnName]]; if (self->fieldIndices[cnt] == -1) { [PostgreSQL72Exception raiseWithFormat: @"attribute %@ not covered by query", attribute]; } #else res = [fieldNames indexOfObject:[attribute columnName]]; if (res == NSNotFound) { [PostgreSQL72Exception raiseWithFormat: @"attribute %@ not covered by query", attribute]; } self->fieldIndices[cnt] = (int)res; #endif [fieldNames replaceObjectAtIndex:self->fieldIndices[cnt] withObject:null]; } [fieldNames release]; fieldNames = nil; } - (NSMutableDictionary *)primaryFetchAttributes:(NSArray *)_attributes withZone:(NSZone *)_zone { NSMutableDictionary *row; unsigned attrCount; int *indices; unsigned cnt, fieldDictCount; if (self->currentTuple == self->tupleCount) { if (self->resultSet != nil) [self cancelFetch]; return nil; } attrCount = [_attributes count]; [self _fillFieldNamesForAttributes:_attributes count:attrCount]; indices = self->fieldIndices; if (self->fieldKeys == NULL) self->fieldKeys = calloc(attrCount + 1, sizeof(NSString *)); if (self->fieldValues == NULL) self->fieldValues = calloc(attrCount + 1, sizeof(id)); fieldDictCount = 0; for (cnt = 0; cnt < attrCount; cnt++) { EOAttribute *attribute; NSString *attrName; id value = nil; Class valueClass = Nil; const char *pvalue; int vallen; attribute = [_attributes objectAtIndex:cnt]; attrName = [attribute name]; if ([self->resultSet isNullTuple:self->currentTuple atIndex:indices[cnt]]){ self->fieldKeys[fieldDictCount] = attrName; self->fieldValues[fieldDictCount] = null; fieldDictCount++; continue; } valueClass = NSClassFromString([attribute valueClassName]); if (valueClass == Nil) { NSLog(@"ERROR(%s): %@: got no value class for column:\n" @" attribute=%@\n type=%@", __PRETTY_FUNCTION__, self, attrName, [attribute externalType]); continue; } pvalue = [self->resultSet rawValueOfTuple:self->currentTuple atIndex:indices[cnt]]; vallen = [self->resultSet lengthOfTuple:self->currentTuple atIndex:indices[cnt]]; if (self->containsBinaryData) { // pvalue is stored in internal representation value = [valueClass valueFromBytes:pvalue length:vallen postgreSQLType:[attribute externalType] attribute:attribute adaptorChannel:self]; } else { // pvalue is ascii string value = [valueClass valueFromCString:pvalue length:vallen postgreSQLType:[attribute externalType] attribute:attribute adaptorChannel:self]; } if (value == nil) { NSLog(@"ERROR(%s): %@: got no value for column:\n" @" attribute=%@\n valueClass=%@\n type=%@", __PRETTY_FUNCTION__, self, attrName, NSStringFromClass(valueClass), [attribute externalType]); continue; } /* add to dictionary */ self->fieldKeys[fieldDictCount] = attrName; self->fieldValues[fieldDictCount] = value; fieldDictCount++; } self->currentTuple++; // TODO: we would need to have a copy on write dict here, ideally with // the keys being reused for each fetch-loop row = [[MDictClass alloc] initWithObjects:self->fieldValues forKeys:self->fieldKeys count:fieldDictCount]; return [row autorelease]; } /* sending sql to server */ - (void)_resetEvaluationState { self->isFetchInProgress = NO; self->tupleCount = 0; self->fieldCount = 0; self->currentTuple = 0; self->containsBinaryData = NO; if (self->fieldInfo) { free(self->fieldInfo); self->fieldInfo = NULL; } /* new caches which require a constant _attributes argument */ if (self->fieldIndices) free(self->fieldIndices); self->fieldIndices = NULL; if (self->fieldKeys) free(self->fieldKeys); self->fieldKeys = NULL; if (self->fieldValues) free(self->fieldValues); self->fieldValues = NULL; } - (NSException *)_processEvaluationTuplesOKForExpression:(NSString *)_sql { int i; self->isFetchInProgress = YES; self->tupleCount = [self->resultSet tupleCount]; self->fieldCount = [self->resultSet fieldCount]; self->containsBinaryData = [self->resultSet containsBinaryTuples]; self->fieldInfo = calloc(self->fieldCount + 1, sizeof(PostgreSQL72FieldInfo)); for (i = 0; i < self->fieldCount; i++) { self->fieldInfo[i].name = PQfname(self->resultSet->results, i); self->fieldInfo[i].type = PQftype(self->resultSet->results, i); self->fieldInfo[i].size = [self->resultSet fieldSizeAtIndex:i]; self->fieldInfo[i].modification = [self->resultSet modifierAtIndex:i]; } self->cmdStatus = [[self->resultSet commandStatus] copy]; self->cmdTuples = [[self->resultSet commandTuples] copy]; if (delegateRespondsTo.didEvaluateExpression) [delegate adaptorChannel:self didEvaluateExpression:_sql]; #if HEAVY_DEBUG NSLog(@"tuples %i fields %i status %@", self->tupleCount, self->fieldCount, self->cmdStatus); #endif return nil; } - (NSException *)_handleBadResponseError { NSString *s; [self _resetResults]; s = [NSString stringWithFormat:@"bad pgsql response (channel=%@): %@", self, [self->connection errorMessage]]; return [PostgreSQL72Exception exceptionWithName:@"PostgreSQL72BadResponse" reason:s userInfo:nil]; } - (NSException *)_handleNonFatalEvaluationError { NSString *s; [self _resetResults]; s = [NSString stringWithFormat:@"pgsql error (channel=%@): %@", self, [self->connection errorMessage]]; return [PostgreSQL72Exception exceptionWithName:@"PostgreSQL72Error" reason:s userInfo:nil]; } - (NSException *)_handleFatalEvaluationError { NSString *s; [self _resetResults]; s = [NSString stringWithFormat:@"fatal pgsql error (channel=%@): %@", self, [self->connection errorMessage]]; return [PostgreSQL72Exception exceptionWithName:@"PostgreSQL72FatalError" reason:s userInfo:nil]; } - (NSException *)evaluateExpressionX:(NSString *)_expression { BOOL result; *(&result) = YES; if (_expression == nil) { return [NSException exceptionWithName:NSInvalidArgumentException reason:@"parameter for evaluateExpression: " @"must not be null" userInfo:nil]; } *(&_expression) = [[_expression mutableCopy] autorelease]; if (delegateRespondsTo.willEvaluateExpression) { EODelegateResponse response; response = [delegate adaptorChannel:self willEvaluateExpression: (NSMutableString *)_expression]; if (response == EODelegateRejects) { return [NSException exceptionWithName:@"EODelegateRejects" reason:@"delegate rejected insert" userInfo:nil]; } if (response == EODelegateOverrides) return nil; } if (![self isOpen]) { return [PostgreSQL72Exception exceptionWithName:@"ChannelNotOpenException" reason: @"PostgreSQL72 connection is not open" userInfo:nil]; } if (self->resultSet != nil) { return [PostgreSQL72Exception exceptionWithName: @"CommandInProgressException" reason:@"an evaluation is in progress" userInfo:nil]; } if (isDebuggingEnabled) NSLog(@"PG0x%p SQL: %@", self, _expression); [self _resetEvaluationState]; self->resultSet = [[self->connection execute:_expression] retain]; if (self->resultSet == nil) { return [PostgreSQL72Exception exceptionWithName:@"ExecutionFailed" reason:@"the PQexec() failed" userInfo:nil]; } /* process results */ switch (PQresultStatus(self->resultSet->results)) { case PGRES_EMPTY_QUERY: case PGRES_COMMAND_OK: [self _resetResults]; if (delegateRespondsTo.didEvaluateExpression) [delegate adaptorChannel:self didEvaluateExpression:_expression]; return nil; case PGRES_TUPLES_OK: return [self _processEvaluationTuplesOKForExpression:_expression]; case PGRES_COPY_OUT: case PGRES_COPY_IN: [self _resetResults]; return [PostgreSQL72Exception exceptionWithName:@"UnsupportedOperation" reason:@"copy(out|in) not supported" userInfo:nil]; case PGRES_BAD_RESPONSE: return [self _handleBadResponseError]; case PGRES_NONFATAL_ERROR: return [self _handleNonFatalEvaluationError]; case PGRES_FATAL_ERROR: return [self _handleFatalEvaluationError]; default: return [NSException exceptionWithName:@"PostgreSQLEvalFailed" reason:@"generic reason" userInfo:nil]; } } - (BOOL)evaluateExpression:(NSString *)_sql { NSException *e; NSString *n; if ((e = [self evaluateExpressionX:_sql]) == nil) return YES; /* for compatibility with non-X methods, translate some errors to a bool */ n = [e name]; if ([n isEqualToString:@"EOEvaluationError"]) return NO; if ([n isEqualToString:@"EODelegateRejects"]) return NO; [e raise]; return NO; } /* description */ - (NSString *)description { NSMutableString *ms; ms = [NSMutableString stringWithCapacity:128]; [ms appendFormat:@"<0x%p[%@]:", self, NSStringFromClass([self class])]; if (self->connection) [ms appendFormat:@" connection=%@", self->connection]; else [ms appendString:@" not-connected"]; [ms appendString:@">"]; return ms; } @end /* PostgreSQL72Channel */ @implementation PostgreSQL72Channel(PrimaryKeyGeneration) - (NSDictionary *)primaryKeyForNewRowWithEntity:(EOEntity *)_entity { NSArray *pkeys; PostgreSQL72Adaptor *adaptor; NSString *seqName, *seq; NSDictionary *pkey; pkeys = [_entity primaryKeyAttributeNames]; adaptor = (id)[[self adaptorContext] adaptor]; seqName = [adaptor primaryKeySequenceName]; pkey = nil; seq = nil; seq = [seqName length] > 0 ? [StringClass stringWithFormat:@"SELECT NEXTVAL ('%@')", seqName] : (id)[adaptor newKeyExpression]; // TODO: since we use evaluateExpressionX, we should not see exceptions? NS_DURING { if ([self evaluateExpressionX:seq] == nil) { id key = nil; if (self->tupleCount > 0) { if ([self->resultSet isNullTuple:0 atIndex:0]) key = [null retain]; else { const char *pvalue; if (self->containsBinaryData) { #if COCOA_Foundation_LIBRARY || NeXT_Foundation_LIBRARY NSLog(@"%s: binary data not implemented!", __PRETTY_FUNCTION__); #else [self notImplemented:_cmd]; #endif } pvalue = [self->resultSet rawValueOfTuple:0 atIndex:0]; if (pvalue) key = [[NSNumber alloc] initWithInt:atoi(pvalue)]; } } [self cancelFetch]; if (key) { pkey = [NSDictionary dictionaryWithObject:key forKey:[pkeys objectAtIndex:0]]; [key release]; key = nil; } } } NS_HANDLER pkey = nil; NS_ENDHANDLER; return pkey; } @end /* PostgreSQL72Channel(PrimaryKeyGeneration) */ void __link_PostgreSQL72Channel() { // used to force linking of object file __link_PostgreSQL72Channel(); } SOPE/sope-gdl1/PostgreSQL/COPYING0000644000000000000000000004307612242733417015172 0ustar rootroot GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, 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 Appendix: 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) 19yy 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., 675 Mass Ave, Cambridge, MA 02139, 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) 19yy 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. SOPE/sope-gdl1/PostgreSQL/NSData+PGVal.m0000644000000000000000000000720312242733417016364 0ustar rootroot/* NSData+PGVal.m Copyright (C) 1999 MDlink online service center GmbH and Helge Hess Copyright (C) 2000-2005 SKYRIX Software AG and Helge Hess Author: Helge Hess (helge.hess@opengroupware.org) This file is part of the PostgreSQL72 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import #include "PostgreSQL72Values.h" #include "PostgreSQL72Channel.h" #include "common.h" @implementation NSData(PostgreSQL72Values) static BOOL doDebug = NO; static NSData *EmptyData = nil; + (id)valueFromCString:(const char *)_cstr length:(int)_length postgreSQLType:(NSString *)_type attribute:(EOAttribute *)_attribute adaptorChannel:(PostgreSQL72Channel *)_channel { if (_length == 0) { if (EmptyData == nil) EmptyData = [[NSData alloc] init]; return EmptyData; } return [[[self alloc] initWithBytes:_cstr length:_length] autorelease]; } + (id)valueFromBytes:(const void *)_bytes length:(int)_length postgreSQLType:(NSString *)_type attribute:(EOAttribute *)_attribute adaptorChannel:(PostgreSQL72Channel *)_channel { if (_length == 0) { if (EmptyData == nil) EmptyData = [[NSData alloc] init]; return EmptyData; } return [[[self alloc] initWithBytes:_bytes length:_length] autorelease]; } - (NSString *)stringValueForPostgreSQLType:(NSString *)_type attribute:(EOAttribute *)_attribute { // TODO: UNICODE // TODO: this method looks slow // example type: "VARCHAR(4000)" static NSStringEncoding enc = 0; NSString *str, *t; unsigned len; unichar c1; if ((len = [self length]) == 0) return @""; if (enc == 0) { // enc = [NSString defaultCStringEncoding]; enc = NSUTF8StringEncoding; NSLog(@"Note: PostgreSQL adaptor using '%@' encoding for data=>string " @"conversion.", [NSString localizedNameOfStringEncoding:enc]); } str = [[NSString alloc] initWithData:self encoding:enc]; if (doDebug) { NSLog(@"Note: made string (len=%i) for data (len=%i), type %@", [str length], [self length], _type); } if ((len = [_type length]) == 0) { NSLog(@"WARNING(%s): missing type for data=>string conversion!", __PRETTY_FUNCTION__); return [str autorelease]; } c1 = [_type characterAtIndex:0]; switch (c1) { case 'c': case 'C': // char case 'v': case 'V': // varchar case 'm': case 'M': // money case 't': case 'T': // text t = [_type lowercaseString]; if ([t hasPrefix:@"char"] || [t hasPrefix:@"varchar"] || [t hasPrefix:@"money"] || [t hasPrefix:@"text"]) { if (doDebug) NSLog(@" converting type: %@", t); t = [[str stringValueForPostgreSQLType:_type attribute:_attribute] copy]; [str release]; if (doDebug) NSLog(@" result len %i", [t length]); return [t autorelease]; } } NSLog(@"WARNING(%s): no processing of type '%@' for " @"data=>string conversion!", __PRETTY_FUNCTION__, _type); return [str autorelease];; } @end /* NSData(PostgreSQL72Values) */ SOPE/sope-gdl1/PostgreSQL/condict.plist0000644000000000000000000000021612242733417016624 0ustar rootroot{ hostName = "localhost"; userName = "helge"; password = "helgehelge"; databaseName = "hhtest1"; port = 5432; } SOPE/sope-gdl1/PostgreSQL/PostgreSQL72Channel+Model.m0000644000000000000000000003075212242733417021013 0ustar rootroot/* PostgreSQL72Channel+Model.m Copyright (C) 1999 MDlink online service center GmbH and Helge Hess Copyright (C) 2000-2008 SKYRIX Software AG and Helge Hess Author: Helge Hess (helge.hess@opengroupware.org) This file is part of the PostgreSQL72 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "PostgreSQL72Channel.h" #include "NSString+PostgreSQL72.h" #include "EOAttribute+PostgreSQL72.h" #import "common.h" @interface EORelationship(FixMe) - (void)addJoin:(id)_join; @end @implementation PostgreSQL72Channel(ModelFetching) static BOOL debugOn = NO; - (NSArray *)_attributesForTableName:(NSString *)_tableName { NSMutableArray *attributes; NSString *sqlExpr; NSArray *resultDescription; NSDictionary *row; if (![_tableName length]) return nil; attributes = [self->_attributesForTableName objectForKey:_tableName]; if (attributes != nil) return attributes; sqlExpr = @"SELECT a.attnum, a.attname, t.typname, a.attlen, a.attnotnull " @"FROM pg_class c, pg_attribute a, pg_type t " @"WHERE c.relname='%@' AND a.attnum>0 AND a.attrelid=c.oid AND " @"a.atttypid=t.oid " @"ORDER BY attnum;"; sqlExpr = [NSString stringWithFormat:sqlExpr, _tableName]; if (![self evaluateExpression:sqlExpr]) { fprintf(stderr, "Could not evaluate column-describe '%s' on table '%s'\n", [sqlExpr UTF8String], [_tableName UTF8String]); return nil; } resultDescription = [self describeResults]; attributes = [NSMutableArray arrayWithCapacity:16]; while ((row = [self fetchAttributes:resultDescription withZone:NULL])) { EOAttribute *attribute; NSString *columnName, *externalType, *attrName; columnName = [[row objectForKey:@"attname"] stringValue]; attrName = [columnName _pgModelMakeInstanceVarName]; externalType = [[row objectForKey:@"typname"] stringValue]; attribute = [[EOAttribute alloc] init]; [attribute setColumnName:columnName]; [attribute setName:attrName]; [attribute setExternalType:externalType]; [attribute loadValueClassForExternalPostgreSQLType:externalType]; [attributes addObject:attribute]; [attribute release]; attribute = nil; } [self->_attributesForTableName setObject:attributes forKey:_tableName]; if (debugOn) NSLog(@"%s: got attrs: %@", __PRETTY_FUNCTION__, attributes); return attributes; } - (NSArray *)_primaryKeysNamesForTableName:(NSString *)_tableName { NSArray *pkNameForTableName = nil; NSMutableArray *primaryKeys = nil; NSString *selectExpression; NSArray *resultDescription = nil; NSString *columnNameKey = nil; NSDictionary *row = nil; if ([_tableName length] == 0) return nil; pkNameForTableName = [self->_primaryKeysNamesForTableName objectForKey:_tableName]; if (pkNameForTableName != nil) return pkNameForTableName; selectExpression = [NSString stringWithFormat: @"SELECT attname FROM pg_attribute WHERE " @"attrelid IN (SELECT a.indexrelid FROM " @"pg_index a, pg_class b WHERE " @"a.indexrelid = b.oid AND " @"b.relname in (SELECT indexname FROM " @"pg_indexes WHERE " @"tablename = '%@') " @"AND a.indisprimary)", _tableName]; if (![self evaluateExpression:selectExpression]) return nil; resultDescription = [self describeResults]; columnNameKey = [(EOAttribute *)[resultDescription objectAtIndex:0] name]; primaryKeys = [NSMutableArray arrayWithCapacity:4]; while ((row = [self fetchAttributes:resultDescription withZone:NULL])) [primaryKeys addObject:[row objectForKey:columnNameKey]]; pkNameForTableName = primaryKeys; [self->_primaryKeysNamesForTableName setObject:pkNameForTableName forKey:_tableName]; return pkNameForTableName; } - (NSArray *)_foreignKeysForTableName:(NSString *)_tableName { return nil; } - (EOModel *)describeModelWithTableNames:(NSArray *)_tableNames { NSMutableArray *buildRelShips = [NSMutableArray arrayWithCapacity:64]; EOModel *model = AUTORELEASE([EOModel new]); int cnt, tc = [_tableNames count]; for (cnt = 0; cnt < tc; cnt++) { NSMutableDictionary *relNamesUsed; NSMutableArray *classProperties; NSMutableArray *primaryKeyAttributes; NSString *tableName; NSArray *attributes; NSArray *pkeys; NSArray *fkeys; EOEntity *entity; int cnt2, ac, fkc; relNamesUsed = [NSMutableDictionary dictionaryWithCapacity:4]; classProperties = [NSMutableArray arrayWithCapacity:16]; primaryKeyAttributes = [NSMutableArray arrayWithCapacity:2]; tableName = [_tableNames objectAtIndex:cnt]; attributes = [self _attributesForTableName:tableName]; pkeys = [self _primaryKeysNamesForTableName:tableName]; fkeys = [self _foreignKeysForTableName:tableName]; entity = [[EOEntity new] autorelease]; ac = [attributes count]; fkc = [fkeys count]; [entity setName:[tableName _pgModelMakeClassName]]; [entity setClassName: [@"EO" stringByAppendingString: [tableName _pgModelMakeClassName]]]; [entity setExternalName:tableName]; [classProperties addObjectsFromArray:[entity classProperties]]; [primaryKeyAttributes addObjectsFromArray:[entity primaryKeyAttributes]]; [model addEntity:entity]; for (cnt2 = 0; cnt2 < ac; cnt2++) { EOAttribute *attribute = [attributes objectAtIndex:cnt2]; NSString *columnName = [attribute columnName]; attribute = [attributes objectAtIndex:cnt2]; columnName = [attribute columnName]; [entity addAttribute:attribute]; [classProperties addObject:attribute]; if ([pkeys containsObject:columnName]) [primaryKeyAttributes addObject:attribute]; } [entity setClassProperties:classProperties]; [entity setPrimaryKeyAttributes:primaryKeyAttributes]; for (cnt2 = 0; cnt2 < fkc; cnt2++) { NSDictionary *fkey; NSMutableArray *classProperties; NSString *sa, *da, *dt; EORelationship *rel; EOJoin *join; NSString *relName = nil; fkey = [fkeys objectAtIndex:cnt2]; classProperties = [NSMutableArray arrayWithCapacity:16]; sa = [fkey objectForKey:@"sourceAttr"]; da = [fkey objectForKey:@"targetAttr"]; dt = [fkey objectForKey:@"targetTable"]; rel = [[[EORelationship alloc] init] autorelease]; // TODO: do something about the join (just use rel?) join = [[[NSClassFromString(@"EOJoin") alloc] init] autorelease]; if ([pkeys containsObject:sa]) relName = [@"to" stringByAppendingString:[dt _pgModelMakeClassName]]; else { relName = [@"to" stringByAppendingString: [[sa _pgModelMakeInstanceVarName] _pgStringWithCapitalizedFirstChar]]; if ([relName hasSuffix:@"Id"]) relName = [relName substringToIndex:([relName length] - 2)]; } if ([relNamesUsed objectForKey:relName] != nil) { int useCount = [[relNamesUsed objectForKey:relName] intValue]; [relNamesUsed setObject:[NSNumber numberWithInt:(useCount++)] forKey:relName]; relName = [NSString stringWithFormat:@"%@%d", relName, useCount]; } else [relNamesUsed setObject:[NSNumber numberWithInt:0] forKey:relName]; [rel setName:relName]; //[rel setDestinationEntity:(EOEntity *)[dt _pgModelMakeClassName]]; [rel setToMany:NO]; // TODO: EOJoin is removed, fix this ... [(id)join setSourceAttribute: (EOAttribute *)[sa _pgModelMakeInstanceVarName]]; [(id)join setDestinationAttribute: (EOAttribute *)[da _pgModelMakeInstanceVarName]]; [rel addJoin:join]; [entity addRelationship:rel]; [classProperties addObjectsFromArray:[entity classProperties]]; [classProperties addObject:rel]; [entity setClassProperties:classProperties]; [buildRelShips addObject:rel]; } [entity setAttributesUsedForLocking:[entity attributes]]; } [buildRelShips makeObjectsPerformSelector: @selector(replaceStringsWithObjects)]; /* // make reverse relations { int cnt, rc = [buildRelShips count]; for (cnt = 0; cnt < rc; cnt++) { EORelationship *rel = [buildRelShips objectAtIndex:cnt]; NSMutableArray *classProperties = [NSMutableArray new]; EORelationship *reverse = [rel reversedRelationShip]; EOEntity *entity = [rel destinationEntity]; NSArray *pkeys = [entity primaryKeyAttributes]; BOOL isToMany = [reverse isToMany]; EOAttribute *sa = [[[reverse joins] lastObject] sourceAttribute]; NSString *relName = nil; if ([pkeys containsObject:sa] || isToMany) relName = [@"to" stringByAppendingString: [(EOEntity *)[reverse destinationEntity] name]]; else { relName = [@"to" stringByAppendingString: [[[sa name] _pgModelMakeInstanceVarName] _pgStringWithCapitalizedFirstChar]]; if ([relName hasSuffix:@"Id"]) { int cLength = [relName cStringLength]; relName = [relName substringToIndex:cLength - 2]; } } if ([entity relationshipNamed:relName]) { int cnt = 1; NSString *numName; numName = [NSString stringWithFormat:@"%s%d", [relName cString], cnt]; while ([entity relationshipNamed:numName]) { cnt++; numName = [NSString stringWithFormat:@"%s%d", [relName cString], cnt]; } relName = numName; } [reverse setName:relName]; [entity addRelationship:reverse]; [classProperties addObjectsFromArray:[entity classProperties]]; [classProperties addObject:reverse]; [entity setClassProperties:classProperties]; } } */ [model setAdaptorName:@"PostgreSQL72"]; [model setAdaptorClassName:@"PostgreSQL72Adaptor"]; [model setConnectionDictionary: [[adaptorContext adaptor] connectionDictionary]]; return model; } - (NSArray *)_runSingleColumnQuery:(NSString *)_query { NSMutableArray *names; NSArray *resultDescription; NSString *attributeName; NSDictionary *row; if (![self evaluateExpression:_query]) { fprintf(stderr, "Could not evaluate expression: '%s'\n", #if LIB_FOUNDATION_LIBRARY [_query cString] #else [_query UTF8String] #endif ); return nil; } resultDescription = [self describeResults]; attributeName = [(EOAttribute *)[resultDescription objectAtIndex:0] name]; names = [NSMutableArray arrayWithCapacity:16]; while ((row = [self fetchAttributes:resultDescription withZone:NULL])) [names addObject:[row objectForKey:attributeName]]; return names; } - (NSArray *)describeTableNames { NSString *sql; sql = @"SELECT relname " @"FROM pg_class " @"WHERE (relkind='r') AND (relname !~ '^pg_') AND " @"(relname !~ '^xinv[0-9]+') " @"ORDER BY relname"; return [self _runSingleColumnQuery:sql]; } - (NSArray *)describeDatabaseNames { return [self _runSingleColumnQuery: @"SELECT datname FROM pg_database ORDER BY datname"]; } - (NSArray *)describeUserNames { return [self _runSingleColumnQuery:@"SELECT usename FROM pg_user"]; } @end /* PostgreSQL72Channel(ModelFetching) */ void __link_PostgreSQL72ChannelModel() { // used to force linking of object file __link_PostgreSQL72ChannelModel(); } SOPE/sope-gdl1/PostgreSQL/NSNull+PGVal.m0000644000000000000000000000234612242733417016430 0ustar rootroot/* NSNull+PGVal.m Copyright (C) 1999 MDlink online service center GmbH and Helge Hess Copyright (C) 2000-2006 SKYRIX Software AG and Helge Hess Author: Helge Hess (helge@opengroupware.org) This file is part of the PostgreSQL72 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "common.h" @implementation NSNull(PostgreSQL72Values) - (NSString *)stringValueForPostgreSQLType:(NSString *)_type attribute:(EOAttribute *)_attribute { return @"null"; } @end /* NSNull(PostgreSQL72Values) */ SOPE/sope-gdl1/PostgreSQL/PostgreSQL72DataTypeMappingException.m0000644000000000000000000000462612242733417023316 0ustar rootroot/* PostgreSQL72Values.m Copyright (C) 1999 MDlink online service center GmbH and Helge Hess Author: Helge Hess (helge@mdlink.de) This file is part of the PostgreSQL72 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import "PostgreSQL72Values.h" #import "common.h" #if !LIB_FOUNDATION_LIBRARY @interface PostgreSQL72DataTypeMappingException(Privates) - (void)setName:(NSString *)_name; - (void)setReason:(NSString *)_reason; - (void)setUserInfo:(NSDictionary *)_ui; @end #endif @implementation PostgreSQL72DataTypeMappingException - (id)initWithObject:(id)_obj forAttribute:(EOAttribute *)_attr andPostgreSQLType:(NSString *)_dt inChannel:(PostgreSQL72Channel *)_channel; { NSString *typeName = nil; typeName = _dt; if (typeName == nil) typeName = [NSString stringWithFormat:@"Oid[%i]", _dt]; // TODO: fix for Cocoa/gstep Foundation? [self setName:@"DataTypeMappingNotSupported"]; [self setReason:[NSString stringWithFormat: @"mapping between %@ and " @"postgres type %@ is not supported", [_obj description], NSStringFromClass([_obj class]), typeName]]; [self setUserInfo:[NSDictionary dictionaryWithObjectsAndKeys: _attr, @"attribute", _channel, @"channel", _obj, @"object", nil]]; return self; } @end /* PostgreSQL72DataTypeMappingException */ void __link_PostgreSQL72Values() { // used to force linking of object file __link_PostgreSQL72Values(); } SOPE/sope-gdl1/PostgreSQL/NSNumber+ExprValue.m0000644000000000000000000000273012242733417017705 0ustar rootroot/* NSNumber+ExprValue.m Copyright (C) 2007 Helge Hess Author: Helge Hess (helge@opengroupware.org) This file is part of the PostgreSQL Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #if GNUSTEP_BASE_LIBRARY #include "common.h" @implementation NSNumber(ExprValue) - (NSString *)expressionValueForContext:(id)_context { /* on gstep-base -stringValue of bool's return YES or NO, which seems to be different on Cocoa and liBFoundation. */ static Class BoolClass = Nil; if (BoolClass == Nil) BoolClass = NSClassFromString(@"NSBoolNumber"); if ([self isKindOfClass:BoolClass]) return [self boolValue] ? @"1" : @"0"; return [self stringValue]; } @end /* NSNumber(ExprValue) */ #endif /* GNUSTEP_BASE_LIBRARY */ SOPE/sope-gdl1/PostgreSQL/NSString+PostgreSQL72.m0000644000000000000000000001060612242733417020165 0ustar rootroot/* NSString+PostgreSQL72.m Copyright (C) 1999 MDlink online service center GmbH and Helge Hess Copyright (C) 2000-2006 SKYRIX Software AG and Helge Hess Author: Helge Hess (helge.hess@opengroupware.org) This file is part of the PostgreSQL72 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #if LIB_FOUNDATION_BOEHM_GC # include #endif #include "common.h" #import "NSString+PostgreSQL72.h" @implementation NSString(PostgreSQL72MiscStrings) - (NSString *)_pgModelMakeInstanceVarName { unsigned clen; unichar *us; int cnt, cnt2; if ([self length] == 0) return @""; // TODO: do use UTF-8 here clen = [self length]; us = malloc((clen + 10) * sizeof(unichar)); [self getCharacters:us]; us[clen] = 0; // Note: upper/lower detection is not strictly correct ... (no unicode) for (cnt = cnt2 = 0; cnt < clen; cnt++, cnt2++) { if ((us[cnt] == '_') && (us[cnt + 1] != '\0')) { us[cnt2] = toupper(us[cnt + 1]); cnt++; } else if ((us[cnt] == '2') && (us[cnt + 1] != '\0')) { us[cnt2] = us[cnt]; cnt++; cnt2++; us[cnt2] = toupper(us[cnt]); } else us[cnt2] = tolower(us[cnt]); } us[cnt2] = '\0'; return [NSString stringWithCharacters:us length:cnt2]; } - (NSString *)_pgModelMakeClassName { unsigned clen = 0; unichar *us; int cnt, cnt2; if ([self length] == 0) return @""; // TODO: use UTF-8 here clen = [self length]; us = malloc((clen + 10) * sizeof(unichar)); [self getCharacters:us]; us[clen] = 0; for (cnt = cnt2 = 0; cnt < clen; cnt++, cnt2++) { if ((us[cnt] == '_') && (us[cnt + 1] != '\0')) { us[cnt2] = toupper(us[cnt + 1]); cnt++; } else if ((us[cnt] == '2') && (us[cnt + 1] != '\0')) { us[cnt2] = us[cnt]; cnt++; cnt2++; us[cnt2] = toupper(us[cnt]); } else us[cnt2] = tolower(us[cnt]); } us[cnt2] = '\0'; us[0] = toupper(us[0]); return [NSString stringWithCharacters:us length:cnt2]; } static NSCharacterSet *upperSet = nil; static NSCharacterSet *spaceSet = nil; - (NSString *)_pgStringWithCapitalizedFirstChar { if (upperSet == nil) upperSet = [[NSCharacterSet uppercaseLetterCharacterSet] retain]; if ([self length] == 0) return @""; if ([upperSet characterIsMember:[self characterAtIndex:0]]) return [[self copy] autorelease]; { NSMutableString *str = [NSMutableString stringWithCapacity:[self length]]; [str appendString:[[self substringToIndex:1] uppercaseString]]; [str appendString:[self substringFromIndex:1]]; return [[str copy] autorelease]; } } - (NSString *)_pgStripEndSpaces { NSMutableString *str; unichar (*charAtIndex)(id, SEL, int); NSRange range; if ([self length] == 0) return @""; if (spaceSet == nil) spaceSet = [[NSCharacterSet whitespaceCharacterSet] retain]; str = [NSMutableString stringWithCapacity:[self length]]; charAtIndex = (unichar (*)(id, SEL, int)) [self methodForSelector:@selector(characterAtIndex:)]; range.length = 0; for (range.location = ([self length] - 1); range.location >= 0; range.location++, range.length++) { unichar c; c = charAtIndex(self, @selector(characterAtIndex:), range.location); if (![spaceSet characterIsMember:c]) break; } if (range.length > 0) { [str appendString:self]; [str deleteCharactersInRange:range]; return AUTORELEASE([str copy]); } return AUTORELEASE([self copy]); } @end /* NSString(PostgreSQL72MiscStrings) */ void __link_NSStringPostgreSQL72() { // used to force linking of object file __link_NSStringPostgreSQL72(); } SOPE/sope-gdl1/PostgreSQL/EOKeyGlobalID+PGVal.m0000644000000000000000000000273112242733417017565 0ustar rootroot/* EOKeyGlobalID+PGVal.m Copyright (C) 2006 SKYRIX Software AG and Helge Hess Author: Helge Hess (helge.hess@opengroupware.org) This file is part of the PostgreSQL Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include "PostgreSQL72Channel.h" #include "common.h" @implementation EOKeyGlobalID(PostgreSQL72Values) - (NSString *)stringValueForPostgreSQLType:(NSString *)_type attribute:(EOAttribute *)_attribute { if (self->count == 0) { NSLog(@"ERROR(%s): got a EOKeyGlobalID w/o key values: %@", __PRETTY_FUNCTION__, self); return nil; } return [self->values[0] stringValueForPostgreSQLType:_type attribute:_attribute]; } @end /* EOKeyGlobalID(PostgreSQL72Values) */ SOPE/sope-gdl1/PostgreSQL/PostgreSQL72Channel.h0000644000000000000000000000451312242733417017746 0ustar rootroot/* PostgreSQL72Channel.h Copyright (C) 1999 MDlink online service center GmbH and Helge Hess Copyright (C) 2000-2004 SKYRIX Software AG and Helge Hess Author: Helge Hess (helge.hess@opengroupware.org) This file is part of the PostgreSQL72 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ___PostgreSQL72_Channel_H___ #define ___PostgreSQL72_Channel_H___ #include #include @class NSArray, NSString, NSMutableDictionary; @class PGConnection, PGResultSet; typedef struct { const char *name; Oid type; int size; int modification; } PostgreSQL72FieldInfo; @interface PostgreSQL72Channel : EOAdaptorChannel { // connection is valid after an openChannel call PGConnection *connection; // valid during -evaluateExpression: PGResultSet *resultSet; int tupleCount; int fieldCount; BOOL containsBinaryData; PostgreSQL72FieldInfo *fieldInfo; NSString *cmdStatus; NSString *cmdTuples; int currentTuple; // turns on/off channel debugging BOOL isDebuggingEnabled; NSMutableDictionary *_attributesForTableName; NSMutableDictionary *_primaryKeysNamesForTableName; int *fieldIndices; NSString **fieldKeys; id *fieldValues; } - (void)setDebugEnabled:(BOOL)_flag; - (BOOL)isDebugEnabled; @end @interface NSObject(Sybase10ChannelDelegate) - (NSArray*)postgreSQLChannel:(PostgreSQL72Channel *)channel willFetchAttributes:(NSArray *)attributes; - (BOOL)postgreSQLChannel:(PostgreSQL72Channel *)channel willReturnRow:(NSDictionary *)row; @end #endif /* ___PostgreSQL72_Channel_H___ */ SOPE/sope-gdl1/PostgreSQL/NSCalendarDate+PGVal.m0000644000000000000000000001454012242733417020024 0ustar rootroot/* NSCalendarDate+PGVal.m Copyright (C) 1999 MDlink online service center GmbH and Helge Hess Copyright (C) 2000-2008 SKYRIX Software AG and Helge Hess Author: Helge Hess (helge@opengroupware.org) This file is part of the PostgreSQL72 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import #include "PostgreSQL72Channel.h" #include "common.h" // Sybase Date: Oct 21 1997 9:52:26:000PM static NSString *PGSQL_DATETIME_FORMAT = @"%b %d %Y %I:%M:%S:000%p"; @implementation NSCalendarDate(PostgreSQL72Values) /* Format: '2001-07-26 14:00:00+02' (len 22) '2001-07-26 14:00:00+09:30' (len 25) '2008-01-31 14:00:57.249+01' (len 26) 0123456789012345678901234 Matthew: "07/25/2003 06:00:00 CDT". */ static Class NSCalDateClass = Nil; static NSTimeZone *DefServerTimezone = nil; static NSTimeZone *gmt = nil; static NSTimeZone *gmt01 = nil; static NSTimeZone *gmt02 = nil; + (id)valueFromCString:(const char *)_cstr length:(int)_length postgreSQLType:(NSString *)_type attribute:(EOAttribute *)_attribute adaptorChannel:(PostgreSQL72Channel *)_channel { char buf[28]; char *p; NSTimeZone *attrTZ; NSCalendarDate *date; int year, month, day, hour, min, sec, tzOffset = 0; char *tok; if (_length == 0) return nil; if (_length != 22 && _length != 25 && _length != 26) { // TODO: add support for "2001-07-26 14:00:00" (len=19) // TBD: add support for "2008-01-31 14:00:57.249+01" (len=26) NSLog(@"ERROR(%s): unexpected string '%s' for date type '%@', returning " @"now (expected format: '2001-07-26 14:00:00+02')", __PRETTY_FUNCTION__, _cstr, _type); return [NSCalendarDate date]; } strncpy(buf, _cstr, 26); buf[26] = '\0'; tok = buf; year = atoi(strsep(&tok, "-")); month = atoi(strsep(&tok, "-")); day = atoi(strsep(&tok, " ")); hour = atoi(strsep(&tok, ":")); min = atoi(strsep(&tok, ":")); tzOffset = 0; if (tok != NULL && (p = strchr(tok, '+')) != NULL) tzOffset = +1; else if (tok != NULL && (p = strchr(tok, '-')) != NULL) tzOffset = -1; else tzOffset = 0; // TBD: warn? if (tzOffset != 0) { int tzHours, tzMins = 0; p++; // skip +/- tzHours = atoi(strsep(&p, ":")); if (p != NULL) tzMins = atoi(p); tzMins = tzHours * 60 + tzMins; tzOffset = tzOffset < 0 ? -tzMins : tzMins; } /* extract seconds */ sec = atoi(strsep(&tok, ":+.")); #if HEAVY_DEBUG NSLog(@"DATE: %s => %04i-%02i-%02i %02i:%02i:%02i", buf, year, month, day, hour, min, sec); #endif #if HEAVY_DEBUG NSLog(@"DATE: %s => OFFSET %i", _cstr, tzOffset); #endif /* TODO: cache all timezones (just 26 ;-) */ switch (tzOffset) { case 0: if (gmt == nil) { gmt = [[NSTimeZone timeZoneForSecondsFromGMT:0] retain]; NSAssert(gmt, @"could not create GMT timezone?!"); } attrTZ = gmt; break; case 60: if (gmt01 == nil) { gmt01 = [[NSTimeZone timeZoneForSecondsFromGMT:3600] retain]; NSAssert(gmt01, @"could not create GMT+01 timezone?!"); } attrTZ = gmt01; break; case 120: if (gmt02 == nil) { gmt02 = [[NSTimeZone timeZoneForSecondsFromGMT:7200] retain]; NSAssert(gmt02, @"could not create GMT+02 timezone?!"); } attrTZ = gmt02; break; default: { /* cache the first, "alternative" timezone */ static int firstTZOffset = 0; // can use 0 since GMT is a separate case static NSTimeZone *firstTZ = nil; if (firstTZOffset == 0) { firstTZOffset = tzOffset; firstTZ = [[NSTimeZone timeZoneForSecondsFromGMT:(tzOffset*60)] retain]; } attrTZ = (firstTZOffset == tzOffset) ? firstTZ : [NSTimeZone timeZoneForSecondsFromGMT:(tzOffset * 60)]; break; } } if (NSCalDateClass == Nil) NSCalDateClass = [NSCalendarDate class]; date = [NSCalDateClass dateWithYear:year month:month day:day hour:hour minute:min second:sec timeZone:attrTZ]; if (date == nil) { NSLog(@"ERROR(%s): could not construct date from string '%s': " @"year=%i,month=%i,day=%i,hour=%i,minute=%i,second=%i, tz=%@", __PRETTY_FUNCTION__, _cstr, year, month, day, hour, min, sec, attrTZ); } return date; } + (id)valueFromBytes:(const void *)_bytes length:(int)_length postgreSQLType:(NSString *)_type attribute:(EOAttribute *)_attribute adaptorChannel:(PostgreSQL72Channel *)_channel { #if COCOA_Foundation_LIBRARY || NeXT_Foundation_LIBRARY NSLog(@"%s: not implemented!", __PRETTY_FUNCTION__); return nil; #else return [self notImplemented:_cmd]; #endif } - (NSString *)stringValueForPostgreSQLType:(NSString *)_type attribute:(EOAttribute *)_attribute { #if 0 NSString *format; #endif EOQuotedExpression *expr; NSTimeZone *serverTimeZone; NSString *format; NSString *val; if ((serverTimeZone = [_attribute serverTimeZone]) == nil ) { if (DefServerTimezone == nil) { DefServerTimezone = [[NSTimeZone localTimeZone] retain]; NSLog(@"Note: PostgreSQL72 adaptor using timezone '%@' as default", DefServerTimezone); } serverTimeZone = DefServerTimezone; } #if 0 format = [_attribute calendarFormat]; #else /* hm, why is that? */ format = @"%Y-%m-%d %H:%M:%S%z"; #endif if (format == nil) format = PGSQL_DATETIME_FORMAT; [self setTimeZone:serverTimeZone]; val = [self descriptionWithCalendarFormat:format]; expr = [[EOQuotedExpression alloc] initWithExpression:val quote:@"\'" escape:@"\\'"]; val = [[expr expressionValueForContext:nil] retain]; [expr release]; return [val autorelease]; } @end /* NSCalendarDate(PostgreSQL72Values) */ SOPE/sope-gdl1/PostgreSQL/ChangeLog0000644000000000000000000002744612242733417015714 0ustar rootroot2008-07-02 Adam Williams * NSString+PGVal.m: quote single quote in expressions with double quote (was backslash) (v4.7.54) 2008-02-09 Helge Hess * NSCalendarDate+PGVal.m: rewrote date parsing to use strsep(), now works with date strings containing milliseconds (which we ignore) (v4.7.53) * v4.7.52 * NSString+PostgreSQL72.m: properly use -length, not -cStringLength * PostgreSQL72Channel+Model.m, PGResultSet.m: use -UTF8String instead of -cString 2007-09-27 Helge Hess * PostgreSQL72Context.m: changed to use -evaluateExpressionX: for transaction queries, log error exceptions (v4.7.51) 2007-06-09 Helge Hess * added NSNumber+ExprValue.m which returns 0/1 for bool values on GNUstep-Base (v4.7.50) 2007-03-22 Helge Hess * EOAttribute+PostgreSQL72.m: removed sql3types.h from inclusion (which was not available on Ubuntu/PG 8.1.4), hopefully it still compiles with all relevant PG versions (v4.5.49) 2006-09-30 Helge Hess * v4.5.48 * always use UTF-8 as the transport encoding (was Latin1 before), enforce that by setting the connection client encoding (when possible) * added category to convert EOKeyGlobalIDs to SQL (required by OGo trunk) * moved NSNull/pgval category to own file * moved PostgreSQL version detection to pgconfig.h file, properly detect new PostgreSQL versions by a missing PG_MAJOR_VERSION define (and enable NG_SET_CLIENT_ENCODING etc in this case) 2006-07-04 Helge Hess * fixed some 64bit issues (v4.5.47) * use %p for pointer formats, fixed gcc 4.1 warnings (v4.5.46) 2005-08-16 Helge Hess * GNUmakefile.preamble: added OSX framework compilation (v4.5.45) 2005-08-08 Helge Hess * removed CVS Id fields (v4.5.44) 2005-08-08 Sebastian Ley * GNUmakefile.preamble: use 'pg_config' tool to determine PostgreSQL include/lib locations (v4.5.43) 2005-07-27 Helge Hess * v4.5.42 * PostgreSQL72Channel+Model.m: fixed an EOJoin related gcc 4.0 warning * NSCalendarDate+PGVal.m: fixed gcc 4.0 signed-warnings 2005-04-21 Helge Hess * PostgreSQL72Channel.m: changed for -describeResults: API (v4.5.41) 2005-01-14 Helge Hess * EOAttribute+PostgreSQL72.m: map PG oid's to NSStrings (avoids issues when fetching from core PG tables) (v4.5.40) 2005-01-06 Helge Hess * NSCalendarDate+PGVal.m: fixed a warning on Xcode (v4.5.39) 2004-12-14 Marcus Mueller * PostgreSQL.xcode: minor fixes and updated 2004-11-04 Helge Hess * use Version file for install directory location 2004-09-22 Marcus Mueller * PostgreSQL.xcode: new Xcode project. This requires you have a recent PostgreSQL installed in /usr/local/pgsql. * PostgreSQL-Info.plist: new bundle info for Xcode * PostgreSQL72-Info.plist: removed old bundle info 2004-09-11 Marcus Mueller * GNUmakefile.preamble: minor changes for inline compilation with GNUSTEP_BUILD_DIR set elsewhere (v1.1.38) 2004-09-06 Helge Hess * EOAttribute+PostgreSQL72.m: use same exception handling on all Foundations (v1.1.37) 2004-08-29 Helge Hess * added hack to install the project in FHS locations - the DB adaptor will be installed in FHS_INSTALL_ROOT if specified (eg make FHS_INSTALL_ROOT=/usr/local) (v1.1.36) 2004-08-27 Helge Hess * GNUmakefile*: renamed bundle to PostgreSQL, now installs in Library/GDLAdaptors-1.1/ (v1.1.35) 2004-08-21 Helge Hess * renamed from (misleading name) PostgreSQL72 to PostgreSQL * fixed for SOPE 3.3 directory layout (v1.0.34) 2004-08-20 Helge Hess * moved from ThirdParty to SOPE/sope-gdl1 (v1.0.33) 2004-07-06 Helge Hess * PostgreSQL72Channel.m: ensure that the port is passed to the connection as a string object (v1.0.32) 2004-06-29 Helge Hess * GNUmakefile.preamble: added include path to SOPE/skyrix-core for "inline" compilation (v1.0.31) 2004-06-28 Helge Hess * PostgreSQL72Channel.m: do not raise errors in handler methods, but return them for processing by the new X methods (v1.0.30) * PostgreSQL72Channel.m: implement a specific -evaluateExpressionX:, use that in -primaryKeyForNewRowWithEntity: (v1.0.29) 2004-06-22 Helge Hess * v1.0.28 * PostgreSQL72Adaptor.m: some code cleanups * PostgreSQL72Channel+Model.m: fixed a gstep-base warning * NSNumber+PGVal.m ([NSNumber -stringValueForPostgreSQLType:attribute:]): fixed rendering of bool numbers for gstep-base (-stringValue of bool numbers return 'YES'/'NO' on gstep-base while 1 or 0 on Cocoa and libFoundation) 2004-06-21 Helge Hess * EOAttribute+PostgreSQL72.m: added "cardinal_number", "character_data" as known types (v1.0.27) * PostgreSQL72Channel+Model.m: code cleanups (v1.0.26) 2004-06-16 Helge Hess * NSString+PGVal.m, PGConnection.m: fixed some gcc 3.4 warnings (v1.0.25) 2004-06-16 Helge Hess * v1.0.24 * PostgreSQL72Channel: rewrote to use PGResultSet. Removed processing of oid-status which apparently was completely broken before! * PGConnection.m: added new PGResultSet object 2004-06-15 Helge Hess * v1.0.23 * PostgreSQL72Channel+Model.m: added -describeDatabaseNames and -describeUserNames methods * PostgreSQL72Adaptor.m: minor code cleanups * v1.0.22 * various files: fixed warnings on MacOSX with gstep-make * PostgreSQL72Channel.h: rewritten to use PGConnection object * started PGConnection object to remove low-level libpq things from the channel (which can then concentrate on implementing the API) 2004-06-06 Helge Hess * fixed some MacOSX compilation warnings (v1.0.21) 2004-05-04 Helge Hess * GNUmakefile.preamble (PostgreSQL72_BUNDLE_LIBS): added missing libs for current Panther PostgreSQL compilation (v1.0.20) 2004-03-01 Helge Hess * GNUmakefile.preamble: fixed makefile for "inline" compilation (v1.0.19) 2004-02-12 Helge Hess * v1.0.18 * EOAttribute+PostgreSQL72.m: fixed exception for MacOSX * GNUmakefile.preamble: added yet another special case to locate the PostgreSQL header files ... 2004-02-10 Helge Hess * PostgreSQL72Channel.m: only set client encoding when being compiled with PostgreSQL 7.3+ (seems to have problems with umlauts on Debian 7.2) (v1.0.17) 2004-02-08 Helge Hess * PostgreSQL72Channel.m: explicitly set connection encoding to Latin1 to avoid problems with databases created as Unicode (v1.0.16) 2004-01-07 Helge Hess * PostgreSQL72Exception.m: minor cleanup, include stdarg.h for varargs processing (might fix compilation on Solaris) (v1.0.15) 2004-01-07 Helge Hess * PostgreSQL72Channel.m: do cache attribute name field indices during invocations, minor performance optimization to fetch method (which requires that the attributes argument is constant!) (v1.0.14) * PostgreSQL72Channel.m: raise default value for max-connection count to 50, various cleanups and minor fixes (v1.0.13) 2003-12-26 Helge Hess * NSData+PGVal.m ([NSData -stringValueForPostgreSQLType:attribute:]): fixed a bug in the data=>string conversion. Types like "VARCHAR(4000)" where not properly converted, eg a long obj_property value (v1.0.12) 2003-12-13 Helge Hess * GNUmakefile.preamble: fixed include flags, so that GDLAccess must not be installed prior compiling the adaptor (v1.0.11) 2003-12-11 Helge Hess * GNUmakefile (BUNDLE_INSTALL_DIR): install into GNUSTEP_INSTALLATION_DIR instead of GNUSTEP_SYSTEM_ROOT (v1.0.10) 2003-09-03 Helge Hess * GNUmakefile.preamble: added /usr/include/postgresql as an include search path - this is the position of the headers under Debian (v1.0.9) 2003-07-30 Helge Hess * NSCalendarDate+PGVal.m: added support for 4 digit timezone offsets (eg +09:30) when parsing PG date values (v1.0.8) 2003-07-28 Helge Hess * NSCalendarDate+PGVal.m: fixed two more bugs introduced in 1.0.5 ... (v1.0.7) 2003-07-28 Bjoern Stierand * NSCalendarDate+PGVal.m: fixed release bug introduced in 1.0.5, wrong variable was returned leading to a memory error (v1.0.6) 2003-07-27 Helge Hess * PostgreSQL72Values.m: split up into separate files, added several performance optimizations to base value creation code (v1.0.5) 2003-07-23 Helge Hess * more fixes to the include pathes, do not include using but always using (v1.0.4) 2003-07-21 Helge Hess * some include cleanups for FreeBSD (reported by Mirko Viviani), fixed some warnings (v1.0.3) Wed May 14 11:27:21 2003 Jan Reichmann * PostgreSQL72Values.m: use lowercase type to determine sql type (bug 126) (v1.0.2) 2003-05-07 Helge Hess * v1.0.1 * PostgreSQL72Channel.m: small cleanups, speed improvement on attrname creation (used no autorelease pools ...) * GNUmakefile (PostgreSQL72_RESOURCE_FILES): added a Version file Mon May 5 16:27:40 2003 Jan Reichmann * PostgreSQL72Values.m: implement valueFromCString, valueFromBytes, stringValueForPostgreSQLType for NSData+PostgreSQL72Values (bug 126) Mon Dec 23 18:20:13 2002 Helge Hess * ported to MacOSX 10.2.3 (do not use * EOAttribute+PostgreSQL72.m: add timestamptz type Tue Nov 5 10:02:45 2002 Jan Reichmann * PostgreSQLChannel.m: add PGMaxOpenConnectionCount - Default to set the max number of open postgres connections Fri Oct 18 19:15:15 2002 Jan Reichmann * EOAttribute+PostgreSQL72.m: add postgres types Thu Aug 22 11:08:35 2002 Jan Reichmann * PostgreSQL72Channel.m, PostgreSQL72Values.m: -fixed bug (attributes with the same name were not fetched (both attrs. where set to the first attr.-value) -fixed escape-bug Thu Jun 13 14:57:10 2002 Jan41 Reichmann * PostgreSQL72Values.m: remove Logs Tue Jun 11 14:43:14 2002 Jan41 Reichmann * PostgreSQL72Context.m: remove abort() :( Mon Mar 18 12:53:42 CET 2002 Jan41 Reichmann * PostgreSQLValues.m, *Channel.*: add caches for attributes/ add get primary key infos Mon Mar 11 12:02:24 2002 Jan41 Reichmann * PostgreSQLValues.m: fixed CAL-FORMAT Entry Thu Aug 16 14:13:10 2001 Martin Hoerning * PostgreSQLChannel.m: fixed RETAIN-BUGS, removed LOGS Fri Jul 27 17:32:17 2001 Jan Reichmann * EOAttribute+PostgreSQL.m: fixed timezone bugs Thu Jul 5 14:08:11 2001 Helge Hess * reactivated for SkyDev41 Tue Feb 2 09:01:10 1999 Helge Hess * created ChangeLog SOPE/sope-gdl1/PostgreSQL/NSString+PostgreSQL72.h0000644000000000000000000000242012242733417020153 0ustar rootroot/* NSString+PostgreSQL72.h Copyright (C) 1999 MDlink online service center GmbH and Helge Hess Author: Helge Hess (helge@mdlink.de) This file is part of the PostgreSQL72 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ___PostgreSQL72_NSString_H___ #define ___PostgreSQL72_NSString_H___ #import @interface NSString(PostgreSQL72MiscStrings) - (NSString *)_pgModelMakeInstanceVarName; - (NSString *)_pgModelMakeClassName; - (NSString *)_pgStringWithCapitalizedFirstChar; - (NSString *)_pgStripEndSpaces; @end #endif SOPE/sope-gdl1/PostgreSQL/PostgreSQL72Expression.m0000644000000000000000000000564312242733417020547 0ustar rootroot/* PostgreSQL72Expression.m Copyright (C) 1999 MDlink online service center GmbH and Helge Hess Copyright (C) 2000-2006 SKYRIX Software AG and Helge Hess Author: Helge Hess (helge@opengroupware.org) This file is part of the PostgreSQL Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "PostgreSQL72Expression.h" #include "common.h" @implementation PostgreSQL72Expression + (Class)selectExpressionClass { return [PostgreSQL72SelectSQLExpression class]; } @end /* PostgreSQL72Expression */ @implementation PostgreSQL72SelectSQLExpression - (id)selectExpressionForAttributes:(NSArray *)attributes lock:(BOOL)flag qualifier:(EOSQLQualifier *)qualifier fetchOrder:(NSArray *)fetchOrder channel:(EOAdaptorChannel *)channel { lock = flag; [super selectExpressionForAttributes:attributes lock:flag qualifier:qualifier fetchOrder:fetchOrder channel:channel]; return self; } - (NSString *)fromClause { NSMutableString *fromClause; NSEnumerator *enumerator; BOOL first = YES; id key; fromClause = [NSMutableString stringWithCapacity:64]; enumerator = [fromListEntities objectEnumerator]; [fromClause appendString:@" "]; // Compute the FROM list from all the aliases found in // entitiesAndPropertiesAliases dictionary. Note that this dictionary // contains entities and relationships. The last ones are there for // flattened attributes over reflexive relationships. while ((key = [enumerator nextObject]) != nil) { if(first) first = NO; else [fromClause appendString:@", "]; [fromClause appendString: [key isKindOfClass:[EORelationship class]] ? [[key destinationEntity] externalName] // flattened attribute : [key externalName]]; // EOEntity [fromClause appendString:@" "]; [fromClause appendString: [[entitiesAndPropertiesAliases objectForKey:key] stringValue]]; #if 0 if (lock) [fromClause appendString:@" HOLDLOCK"]; #endif } return fromClause; } @end void __link_PostgreSQL72Expression() { // used to force linking of object file __link_PostgreSQL72Expression(); } SOPE/sope-gdl1/PostgreSQL/PostgreSQL72Context.h0000644000000000000000000000233512242733417020022 0ustar rootroot/* PostgreSQL72Context.h Copyright (C) 1999 MDlink online service center GmbH and Helge Hess Author: Helge Hess (helge@mdlink.de) This file is part of the PostgreSQL72 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ___PostgreSQL72_Context_H___ #define ___PostgreSQL72_Context_H___ #import @interface PostgreSQL72Context : EOAdaptorContext - (BOOL)primaryBeginTransaction; - (BOOL)primaryCommitTransaction; - (BOOL)primaryRollbackTransaction; @end #endif SOPE/sope-gdl1/PostgreSQL/PGResultSet.m0000644000000000000000000000677012242733417016476 0ustar rootroot/* PGConnection.m Copyright (C) 2004-2006 SKYRIX Software AG and Helge Hess Author: Helge Hess (helge.hess@opengroupware.org) This file is part of the PostgreSQL72 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "PGConnection.h" #include "common.h" #include #include "pgconfig.h" @implementation PGResultSet /* wraps PGresult */ - (id)initWithConnection:(PGConnection *)_con handle:(void *)_handle { if (_handle == NULL) { [self release]; return nil; } if ((self = [super init])) { self->connection = [_con retain]; self->results = _handle; } return self; } - (void)dealloc { [self clear]; [self->connection release]; [super dealloc]; } /* accessors */ - (BOOL)isValid { return self->results != NULL ? YES : NO; } - (BOOL)containsBinaryTuples { #if NG_HAS_BINARY_TUPLES if (self->results == NULL) return NO; return PQbinaryTuples(self->results) ? YES : NO; #else return NO; #endif } - (NSString *)commandStatus { char *cstr; if (self->results == NULL) return nil; if ((cstr = PQcmdStatus(self->results)) == NULL) return nil; return [self->connection _stringFromCString:cstr]; } - (NSString *)commandTuples { char *cstr; if (self->results == NULL) return nil; if ((cstr = PQcmdTuples(self->results)) == NULL) return nil; return [self->connection _stringFromCString:cstr]; } /* fields */ - (unsigned)fieldCount { return self->results != NULL ? PQnfields(self->results) : 0; } - (NSString *)fieldNameAtIndex:(unsigned int)_idx { // TODO: charset if (self->results == NULL) return nil; return [self->connection _stringFromCString:PQfname(self->results, _idx)]; } - (int)indexOfFieldNamed:(NSString *)_name { return PQfnumber(self->results, [_name UTF8String]); } - (int)fieldSizeAtIndex:(unsigned int)_idx { if (self->results == NULL) return 0; return PQfsize(self->results, _idx); } - (int)modifierAtIndex:(unsigned int)_idx { if (self->results == NULL) return 0; #if NG_HAS_FMOD return PQfmod(self->results, _idx); #else return 0; #endif } /* tuples */ - (unsigned int)tupleCount { if (self->results == NULL) return 0; return PQntuples(self->results); } - (BOOL)isNullTuple:(int)_tuple atIndex:(unsigned int)_idx { if (self->results == NULL) return NO; return PQgetisnull(self->results, _tuple, _idx) ? YES : NO; } - (void *)rawValueOfTuple:(int)_tuple atIndex:(unsigned int)_idx { if (self->results == NULL) return NULL; return PQgetvalue(self->results, _tuple, _idx); } - (int)lengthOfTuple:(int)_tuple atIndex:(unsigned int)_idx { if (self->results == NULL) return 0; return PQgetlength(self->results, _tuple, _idx); } /* operations */ - (void)clear { if (self->results == NULL) return; PQclear(self->results); self->results = NULL; } @end /* PGResultSet */ SOPE/sope-gdl1/PostgreSQL/PostgreSQL72Channel+Model.h0000644000000000000000000000262112242733417021000 0ustar rootroot/* PostgreSQL72Channel+Model.h Copyright (C) 1999 MDlink online service center GmbH and Helge Hess Copyright (C) 2000-2004 SKYRIX Software AG and Helge Hess Author: Helge Hess (helge.hess@opengroupware.org) This file is part of the PostgreSQL72 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ___PostgreSQL72_ModelFetching_H___ #define ___PostgreSQL72_ModelFetching_H___ #import "PostgreSQL72Channel.h" @class NSArray; @class EOModel; @interface PostgreSQL72Channel(ModelFetching) - (EOModel *)describeModelWithTableNames:(NSArray *)_tableNames; - (NSArray *)describeUserNames; - (NSArray *)describeTableNames; - (NSArray *)describeDatabaseNames; @end #endif SOPE/sope-gdl1/PostgreSQL/PostgreSQL72Context.m0000644000000000000000000000523312242733417020027 0ustar rootroot/* PostgreSQL72Context.m Copyright (C) 1999 MDlink online service center GmbH and Helge Hess Copyright (C) 2007 Helge Hess Author: Helge Hess (helge@mdlink.de) This file is part of the PostgreSQL72 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import "PostgreSQL72Context.h" #import "PostgreSQL72Channel.h" #include "common.h" @implementation PostgreSQL72Context - (void)channelDidInit:_channel { if ([channels count] > 0) { [NSException raise:@"TooManyOpenChannelsException" format:@"SybaseAdaptor10 only supports one channel per context"]; } [super channelDidInit:_channel]; } - (BOOL)primaryBeginTransaction { NSException *error; error = [[[channels lastObject] nonretainedObjectValue] evaluateExpressionX:@"BEGIN TRANSACTION"]; if (error == nil) return YES; NSLog(@"%s: could not begin transaction: %@", __PRETTY_FUNCTION__, error); return NO; } - (BOOL)primaryCommitTransaction { NSException *error; error = [[[channels lastObject] nonretainedObjectValue] evaluateExpressionX:@"COMMIT TRANSACTION"]; if (error == nil) return YES; NSLog(@"%s: could not commit transaction: %@", __PRETTY_FUNCTION__, error); return NO; } - (BOOL)primaryRollbackTransaction { NSException *error; error = [[[channels lastObject] nonretainedObjectValue] evaluateExpressionX:@"ROLLBACK TRANSACTION"]; if (error == nil) return YES; NSLog(@"%s: could not rollback transaction: %@", __PRETTY_FUNCTION__, error); return NO; } - (BOOL)canNestTransactions { return NO; } /* NSCopying methods */ - (id)copyWithZone:(NSZone *)zone { // called when the object is used in some datastructures? return [self retain]; } @end /* PostgreSQL72Context */ void __link_PostgreSQL72Context() { // used to force linking of object file __link_PostgreSQL72Context(); } SOPE/sope-gdl1/PostgreSQL/GNUmakefile.preamble0000644000000000000000000000452412242733417017772 0ustar rootroot# # GNUmakefile # # Copyright (C) 2003-2005 SKYRIX Software AG # # Author: Helge Hess (helge.hess@skyrix.com) # # This file is part of the PostgreSQL Adaptor Library # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; see the file COPYING.LIB. # If not, write to the Free Software Foundation, # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. SOPE_ROOT=../.. ifeq ($(frameworks),yes) BUNDLE_INSTALL_DIR := $(FRAMEWORK_INSTALL_DIR)/GDLAccess.framework/Resources/GDLAdaptors/ else BUNDLE_INSTALL_DIR = $(SOPE_DBADAPTORS)/ endif # PG config ADDITIONAL_INCLUDE_DIRS += -I$(shell pg_config --includedir) PG_LIB_DIRS += -L$(shell pg_config --libdir) PostgreSQL_BUNDLE_LIBS += -lpq # set compile flags and go ADDITIONAL_INCLUDE_DIRS += \ -I../GDLAccess -I.. ADDITIONAL_INCLUDE_DIRS += \ -I.. -I$(SOPE_ROOT) \ -I$(SOPE_ROOT)/sope-core/ \ -I$(SOPE_ROOT)/sope-core/NGExtensions # TODO: is this required? ADDITIONAL_INCLUDE_DIRS += \ -I/usr/local/include # dependencies ifneq ($(frameworks),yes) PostgreSQL_BUNDLE_LIBS += -lGDLAccess -lEOControl gdltest_TOOL_LIBS += -lGDLAccess else PostgreSQL_BUNDLE_LIBS += -framework GDLAccess -framework EOControl gdltest_TOOL_LIBS += -framework GDLAccess endif # library/framework search pathes DEP_DIRS = \ ../GDLAccess \ $(SOPE_ROOT)/sope-core/EOControl ifneq ($(frameworks),yes) ADDITIONAL_LIB_DIRS += \ $(foreach dir,$(DEP_DIRS),\ -L$(GNUSTEP_BUILD_DIR)/$(dir)/$(GNUSTEP_OBJ_DIR_NAME)) else ADDITIONAL_LIB_DIRS += \ $(foreach dir,$(DEP_DIRS),-F$(GNUSTEP_BUILD_DIR)/$(dir)) endif SYSTEM_LIB_DIR += $(CONFIGURE_SYSTEM_LIB_DIR) $(PG_LIB_DIRS) # TODO: not necessary? covered by pg_config? #ifeq ($(FOUNDATION_LIB),apple) #PostgreSQL_BUNDLE_LIBS += -lssl -lcrypto #ADDITIONAL_INCLUDE_DIRS += -I/Library/PostgreSQL/include/ #endif SOPE/sope-gdl1/PostgreSQL/gdltest.m0000644000000000000000000001212312242733417015750 0ustar rootroot/* gdltest.m Copyright (C) 1999 MDlink online service center GmbH and Helge Hess Copyright (C) 2000-2005 SKYRIX Software AG and Helge Hess Author: Helge Hess (helge.hess@opengroupware.org) This file is part of the PostgreSQL72 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import #import #include int main(int argc, char **argv, char **env) { EOModel *m = nil; EOAdaptor *a; EOAdaptorContext *ctx; EOAdaptorChannel *ch; NSDictionary *conDict; NSString *expr; [NSProcessInfo initializeWithArguments:argv count:argc environment:env]; NS_DURING { conDict = [NSDictionary dictionaryWithContentsOfFile:@"condict.plist"]; NSLog(@"condict is %@", conDict); if ((a = [EOAdaptor adaptorWithName:@"PostgreSQL"]) == nil) { NSLog(@"found no PostgreSQL adaptor .."); exit(1); } NSLog(@"got adaptor %@", a); [a setConnectionDictionary:conDict]; NSLog(@"got adaptor with condict %@", a); ctx = [a createAdaptorContext]; ch = [ctx createAdaptorChannel]; #if 1 m = AUTORELEASE([[EOModel alloc] initWithContentsOfFile:@"test.eomodel"]); if (m) { [a setModel:m]; [a setConnectionDictionary:conDict]; } #endif expr = [[NSUserDefaults standardUserDefaults] stringForKey:@"sql"]; NSLog(@"opening channel .."); [ch setDebugEnabled:YES]; if ([ch openChannel]) { NSLog(@"channel is open"); if ([ctx beginTransaction]) { NSLog(@"began tx .."); /* do something */ { NSAutoreleasePool *pool = [NSAutoreleasePool new]; EOEntity *e; EOSQLQualifier *q; NSArray *attrs; #if 1 /* fetch some expr */ if (expr) { if ([ch evaluateExpression:expr]) { NSDictionary *record; attrs = [ch describeResults]; NSLog(@"results: %@", attrs); while ((record = [ch fetchAttributes:attrs withZone:nil])) NSLog(@"fetched %@", record); } } #endif /* fetch some doof records */ e = [m entityNamed:@"Doof"]; NSLog(@"entity: %@", e); if (e == nil) exit(1); q = [e qualifier]; attrs = [e attributes]; if ([ch selectAttributes:attrs describedByQualifier:q fetchOrder:nil lock:NO]) { NSDictionary *record; while ((record = [ch fetchAttributes:attrs withZone:nil])) { NSLog(@"fetched %@ birthday %@", [record valueForKey:@"pkey"], [record valueForKey:@"companyId"]); } } else NSLog(@"Could not select .."); /* fetch some team records */ if ((e = [m entityNamed:@"Team"])) { q = [e qualifier]; attrs = [e attributes]; if ([ch selectAttributes:attrs describedByQualifier:q fetchOrder:nil lock:NO]) { NSDictionary *record; while ((record = [ch fetchAttributes:attrs withZone:nil])) { NSLog(@"fetched %@ birthday %@", [record valueForKey:@"description"], [record valueForKey:@"companyId"]); } } else NSLog(@"Could not select .."); } /* do some update */ if ((e = [m entityNamed:@"Person"])) { attrs = [e attributes]; q = [[EOSQLQualifier alloc] initWithEntity:e qualifierFormat:@"%A='helge'", @"login"]; AUTORELEASE(q); if ([ch selectAttributes:attrs describedByQualifier:q fetchOrder:nil lock:NO]) { NSDictionary *record; record = [ch fetchAttributes:attrs withZone:nil]; } else NSLog(@"Could not select .."); } RELEASE(pool); } NSLog(@"committing tx .."); if ([ctx commitTransaction]) NSLog(@" could commit."); else NSLog(@" commit failed."); } NSLog(@"closing channel .."); [ch closeChannel]; } } NS_HANDLER { fprintf(stderr, "exception: %s\n", [[localException description] cString]); abort(); } NS_ENDHANDLER; return 0; } SOPE/sope-gdl1/PostgreSQL/EOAttribute+PostgreSQL72.m0000644000000000000000000001573312242733417020653 0ustar rootroot/* EOAttribute+PostgreSQL72.m Copyright (C) 1999 MDlink online service center GmbH and Helge Hess Copyright (C) 2000-2004 SKYRIX Software AG and Helge Hess Author: Helge Hess (helge.hess@opengroupware.org) This file is part of the PostgreSQL72 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "common.h" #include "EOAttribute+PostgreSQL72.h" #if 0 #include #else #include #endif //#include // Sybase dateformat: (need to be corrected for PostgreSQL) static NSString *PGSQL_DATETIME_FORMAT = @"%b %d %Y %I:%M:%S:000%p"; static NSString *PGSQL_TIMESTAMP_FORMAT = @"%Y-%m-%d %H:%M:%S%z"; @implementation EOAttribute(PostgreSQL72AttributeAdditions) - (void)loadValueClassAndTypeUsingPostgreSQLType:(Oid)_type size:(int)_size modification:(int)_modification binary:(BOOL)_isBinary { if (_isBinary) [self setValueClassName:@"NSData"]; switch (_type) { /* where in the PostgreSQL72 headers are these OIDs defined ??? */ case BOOLOID: [self setExternalType:@"bool"]; [self setValueClassName:@"NSNumber"]; [self setValueType:@"i"]; return; case NAMEOID: [self setExternalType:@"name"]; [self setValueClassName:@"NSString"]; return; case TEXTOID: [self setExternalType:@"textoid"]; [self setValueClassName:@"NSString"]; return; case INT2OID: [self setExternalType:@"int2"]; [self setValueClassName:@"NSNumber"]; [self setValueType:@"d"]; return; case INT4OID: [self setExternalType:@"int4"]; [self setValueClassName:@"NSNumber"]; [self setValueType:@"d"]; return; case INT8OID: [self setExternalType:@"int8"]; [self setValueClassName:@"NSNumber"]; [self setValueType:@"d"]; return; case CHAROID: [self setExternalType:@"char"]; [self setValueClassName:@"NSString"]; break; case VARCHAROID: [self setExternalType:@"varchar"]; [self setValueClassName:@"NSString"]; break; case NUMERICOID: [self setExternalType:@"numeric"]; [self setValueClassName:@"NSNumber"]; [self setValueType:@"d"]; break; case FLOAT4OID: [self setExternalType:@"float4"]; [self setValueClassName:@"NSNumber"]; [self setValueType:@"f"]; break; case FLOAT8OID: [self setExternalType:@"float8"]; [self setValueClassName:@"NSNumber"]; [self setValueType:@"f"]; break; case DATEOID: [self setExternalType:@"datetime"]; [self setValueClassName:@"NSCalendarDate"]; [self setCalendarFormat:PGSQL_DATETIME_FORMAT]; break; case TIMEOID: [self setExternalType:@"time"]; [self setValueClassName:@"NSCalendarDate"]; [self setCalendarFormat:PGSQL_DATETIME_FORMAT]; break; case TIMESTAMPOID: [self setExternalType:@"timestamp"]; [self setValueClassName:@"NSCalendarDate"]; [self setCalendarFormat:PGSQL_DATETIME_FORMAT]; break; case TIMESTAMPTZOID: [self setExternalType:@"timestamptz"]; [self setValueClassName:@"NSCalendarDate"]; [self setCalendarFormat:PGSQL_DATETIME_FORMAT]; break; case BITOID: [self setExternalType:@"bit"]; break; default: NSLog(@"What is PGSQL Oid %i ???", _type); break; } } - (void)loadValueClassForExternalPostgreSQLType:(NSString *)_type { if ([_type isEqualToString:@"bool"]) { [self setValueClassName:@"NSNumber"]; [self setValueType:@"i"]; } else if ([_type isEqualToString:@"int2"]) { [self setValueClassName:@"NSNumber"]; [self setValueType:@"i"]; } else if ([_type isEqualToString:@"int4"]) { [self setValueClassName:@"NSNumber"]; [self setValueType:@"i"]; } else if ([_type isEqualToString:@"float4"]) { [self setValueClassName:@"NSNumber"]; [self setValueType:@"f"]; } else if ([_type isEqualToString:@"float8"]) { [self setValueClassName:@"NSNumber"]; [self setValueType:@"d"]; } else if ([_type isEqualToString:@"decimal"]) { [self setValueClassName:@"NSNumber"]; [self setValueType:@"d"]; } else if ([_type isEqualToString:@"numeric"]) { [self setValueClassName:@"NSNumber"]; [self setValueType:@"d"]; } else if ([_type isEqualToString:@"cardinal_number"]) { // TODO: not sure whether this is correct (comes from sql_features table) [self setValueClassName:@"NSNumber"]; [self setValueType:@"d"]; } else if ([_type isEqualToString:@"name"]) { [self setExternalType:@"name"]; [self setValueClassName:@"NSString"]; } else if ([_type isEqualToString:@"varchar"]) { [self setExternalType:@"varchar"]; [self setValueClassName:@"NSString"]; } else if ([_type isEqualToString:@"char"]) { [self setExternalType:@"char"]; [self setValueClassName:@"NSString"]; } else if ([_type isEqualToString:@"character_data"]) { // TODO: not sure whether this is correct (comes from sql_features table) [self setExternalType:@"character_data"]; [self setValueClassName:@"NSString"]; } else if ([_type isEqualToString:@"timestamp"]) { [self setValueClassName:@"NSCalendarDate"]; [self setCalendarFormat:PGSQL_TIMESTAMP_FORMAT]; } else if ([_type isEqualToString:@"timestamptz"]) { [self setValueClassName:@"NSCalendarDate"]; [self setCalendarFormat:PGSQL_TIMESTAMP_FORMAT]; } else if ([_type isEqualToString:@"datetime"]) { [self setValueClassName:@"NSCalendarDate"]; [self setCalendarFormat:PGSQL_DATETIME_FORMAT]; } else if ([_type isEqualToString:@"date"]) { [self setValueClassName:@"NSString"]; } else if ([_type isEqualToString:@"time"]) { [self setValueClassName:@"NSString"]; } else if ([_type isEqualToString:@"text"]) { [self setValueClassName:@"NSString"]; } else if ([_type isEqualToString:@"oid"]) { // TODO: is this correct? [self setValueClassName:@"NSString"]; } else { NSLog(@"%s: invalid argument %@", __PRETTY_FUNCTION__, _type); [NSException raise:@"InvalidArgumentException" format: @"invalid PostgreSQL72 type %@ passed to " @"-loadValueClassForExternalPostgreSQLType:", _type]; } } @end /* EOAttribute(PostgreSQL72) */ void __link_EOAttributePostgreSQL72() { // used to force linking of object file __link_EOAttributePostgreSQL72(); } SOPE/sope-gdl1/PostgreSQL/NSString+PGVal.m0000644000000000000000000000773512242733417016773 0ustar rootroot/* NSString+PGVal.m Copyright (C) 1999 MDlink online service center GmbH and Helge Hess Copyright (C) 2000-2006 SKYRIX Software AG and Helge Hess Author: Helge Hess (helge.hess@opengroupware.org) This file is part of the PostgreSQL Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "PostgreSQL72Channel.h" #include "common.h" @implementation NSString(PostgreSQL72Values) static Class NSStringClass = Nil; static id (*ctor)(id, SEL, const char *) = NULL; + (id)valueFromCString:(const char *)_cstr length:(int)_length postgreSQLType:(NSString *)_type attribute:(EOAttribute *)_attribute adaptorChannel:(PostgreSQL72Channel *)_channel { // TODO: would be better if this would return a retained object to avoid // the dreaded autorelease pool if (_cstr == NULL) return nil; if (*_cstr == '\0') return @""; if (NSStringClass == Nil) NSStringClass = [NSString class]; if (ctor == NULL) { ctor = (void *) [NSStringClass methodForSelector:@selector(stringWithUTF8String:)]; } // TODO: cache IMP of selector return ctor != NULL ? ctor(NSStringClass, @selector(stringWithUTF8String:), _cstr) : [NSStringClass stringWithUTF8String:_cstr]; } + (id)valueFromBytes:(const void *)_bytes length:(int)_length postgreSQLType:(NSString *)_type attribute:(EOAttribute *)_attribute adaptorChannel:(PostgreSQL72Channel *)_channel { #if COCOA_Foundation_LIBRARY || NeXT_Foundation_LIBRARY NSLog(@"%s: not implemented!", __PRETTY_FUNCTION__); return nil; #else return [self notImplemented:_cmd]; #endif } - (NSString *)stringValueForPostgreSQLType:(NSString *)_type attribute:(EOAttribute *)_attribute { // TODO: all this looks slow ... NSUInteger len, i, strLen, destI; unichar c1; NSString *format, *result; BOOL escaped; unichar *sourceStr, *destStr; if ((len = [_type length]) == 0) return self; c1 = [_type characterAtIndex:0]; switch (c1) { case 'c': case 'C': case 'v': case 'V': case 't': case 'T': { if (len < 4) return self; _type = [_type lowercaseString]; // looks slow if (!([_type hasPrefix:@"char"] || [_type hasPrefix:@"varchar"] || [_type hasPrefix:@"text"])) break; escaped = NO; strLen = [self length]; sourceStr = malloc (sizeof (unichar) * strLen); [self getCharacters: sourceStr]; destStr = malloc (sizeof (unichar) * strLen * 2); destI = 0; for (i = 0; i < strLen; i++) switch (sourceStr[i]) { case '\\': escaped = YES; case '\'': destStr[destI] = sourceStr[i]; destI++; default: destStr[destI] = sourceStr[i]; destI++; } free (sourceStr); result = [[NSString alloc] initWithCharactersNoCopy: destStr length: destI freeWhenDone: YES]; [result autorelease]; if (escaped) format = @"E'%@'"; else format = @"'%@'"; return [NSString stringWithFormat: format, result]; } case 'm': case 'M': { if (len < 5) { if ([[_type lowercaseString] hasPrefix:@"money"]) return [@"$" stringByAppendingString:self]; } break; } } return self; } @end /* NSString(PostgreSQL72Values) */ SOPE/sope-gdl1/PostgreSQL/PostgreSQL72Adaptor.h0000644000000000000000000000433012242733417017765 0ustar rootroot/* PostgreSQL72Adaptor.h Copyright (C) 1999 MDlink online service center GmbH and Helge Hess Copyright (C) 2000-2004 SKYRIX Software AG and Helge Hess Author: Helge Hess (helge.hess@opengroupware.org) This file is part of the PostgreSQL72 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ___PostgreSQL72_Adaptor_H___ #define ___PostgreSQL72_Adaptor_H___ /* The PostgreSQL72 adaptor. The connection dictionary of this adaptor understands these keys: hostName port options tty userName password databaseName The adaptor is based on libpq. */ #import #import #import @class NSString, NSMutableDictionary, NSArray; @interface PostgreSQL72Adaptor : EOAdaptor { } - (id)initWithName:(NSString *)_name; /* connection management */ - (NSString *)serverName; - (NSString *)loginName; - (NSString *)loginPassword; - (NSString *)databaseName; - (NSString *)port; - (NSString *)options; - (NSString *)tty; - (NSString *)newKeyExpression; /* sequence for primary key generation */ - (NSString *)primaryKeySequenceName; /* value formatting */ - (id)formatValue:(id)value forAttribute:(EOAttribute *)attribute; /* attribute typing */ - (BOOL)attributeAllowedInDistinctSelects:(EOAttribute *)_attr; /* classes used */ - (Class)adaptorContextClass; // PostgreSQL72Context - (Class)adaptorChannelClass; // PostgreSQL72Channel - (Class)expressionClass; // PostgreSQL72Expression @end #endif SOPE/sope-gdl1/PostgreSQL/TODO0000644000000000000000000000011612242733417014613 0ustar rootrootTODO ==== - cache field-names in PostgreSQL72Channel -primaryFetch (see TODO) SOPE/sope-gdl1/PostgreSQL/postgres_types.h0000644000000000000000000000201712242733417017370 0ustar rootroot/* TBD: explain this! */ #define BOOLOID 16 #define BYTEAOID 17 #define CHAROID 18 #define NAMEOID 19 #define INT8OID 20 #define INT2OID 21 #define INT2VECTOROID 22 #define INT4OID 23 #define REGPROCOID 24 #define TEXTOID 25 #define OIDOID 26 #define TIDOID 27 #define XIDOID 28 #define CIDOID 29 #define OIDVECTOROID 30 #define POINTOID 600 #define LSEGOID 601 #define PATHOID 602 #define BOXOID 603 #define POLYGONOID 604 #define LINEOID 628 #define FLOAT4OID 700 #define FLOAT8OID 701 #define ABSTIMEOID 702 #define RELTIMEOID 703 #define TINTERVALOID 704 #define UNKNOWNOID 705 #define CIRCLEOID 718 #define CASHOID 790 #define MACADDROID 829 #define INETOID 869 #define CIDROID 650 #define ACLITEMSIZE 8 #define BPCHAROID 1042 #define VARCHAROID 1043 #define DATEOID 1082 #define TIMEOID 1083 #define TIMESTAMPOID 1114 #define TIMESTAMPTZOID 1184 #define INTERVALOID 1186 #define TIMETZOID 1266 #define BITOID 1560 #define VARBITOID 1562 #define NUMERICOID 1700 #define REFCURSOROID 1790 SOPE/sope-gdl1/PostgreSQL/PostgreSQL72Exception.m0000644000000000000000000000337112242733417020342 0ustar rootroot/* PostgreSQL72Exception.m Copyright (C) 1999 MDlink online service center GmbH and Helge Hess Author: Helge Hess (helge@mdlink.de) This file is part of the PostgreSQL72 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include "PostgreSQL72Exception.h" #include "common.h" #include @implementation PostgreSQL72Exception + (void)raiseWithFormat:(NSString *)_format, ... { NSString *tmp = nil; va_list ap; va_start(ap, _format); tmp = [[NSString alloc] initWithFormat:_format arguments:ap]; va_end(ap); [tmp autorelease]; [[[self alloc] initWithName:NSStringFromClass([self class]) reason:tmp userInfo:nil] raise]; } @end /* PostgreSQL72Exception */ @implementation PostgreSQL72CouldNotOpenChannelException @end @implementation PostgreSQL72CouldNotConnectException @end @implementation PostgreSQL72CouldNotBindException @end void __link_PostgreSQL72Exception() { // used to force linking of object file __link_PostgreSQL72Exception(); } SOPE/sope-gdl1/PostgreSQL/PGConnection.h0000644000000000000000000000612712242733417016632 0ustar rootroot/* PGConnection.h Copyright (C) 2004-2006 SKYRIX Software AG and Helge Hess Author: Helge Hess (helge.hess@opengroupware.org) This file is part of the PostgreSQL72 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ___PostgreSQL72_PGConnection_H___ #define ___PostgreSQL72_PGConnection_H___ #import @class NSString, NSException; @class PGResultSet; @interface PGConnection : NSObject { @public void *_connection; } - (id)initWithHostName:(NSString *)_host port:(NSString *)_port options:(NSString *)_options tty:(NSString *)_tty database:(NSString *)_dbname login:(NSString *)_login password:(NSString *)_pwd; /* accessors */ - (BOOL)isValid; /* connect operations */ - (NSException *)startConnectWithInfo:(NSString *)_conninfo; // async - (NSException *)connectWithInfo:(NSString *)_conninfo; - (NSException *)connectWithHostName:(NSString *)_host port:(NSString *)_port options:(NSString *)_options tty:(NSString *)_tty database:(NSString *)_dbname login:(NSString *)_login password:(NSString *)_pwd; - (void)finish; - (BOOL)isConnectionOK; /* message callbacks */ - (BOOL)setNoticeProcessor:(void *)_callback context:(void *)_ctx; /* settings */ - (BOOL)setClientEncoding:(NSString *)_encoding; /* errors */ - (NSString *)errorMessage; /* queries */ - (void *)rawExecute:(NSString *)_sql; - (void)clearRawResults:(void *)_ptr; - (PGResultSet *)execute:(NSString *)_sql; /* support */ - (const char *)_cstrFromString:(NSString *)_s; - (NSString *)_stringFromCString:(const char *)_cstr; @end @interface PGResultSet : NSObject { @protected PGConnection *connection; @public void *results; } - (id)initWithConnection:(PGConnection *)_con handle:(void *)_handle; /* accessors */ - (BOOL)isValid; - (BOOL)containsBinaryTuples; - (NSString *)commandStatus; - (NSString *)commandTuples; /* fields */ - (unsigned)fieldCount; - (NSString *)fieldNameAtIndex:(unsigned int)_idx; - (int)indexOfFieldNamed:(NSString *)_name; - (int)fieldSizeAtIndex:(unsigned int)_idx; - (int)modifierAtIndex:(unsigned int)_idx; /* tuples */ - (unsigned int)tupleCount; - (BOOL)isNullTuple:(int)_tuple atIndex:(unsigned int)_idx; - (void *)rawValueOfTuple:(int)_tuple atIndex:(unsigned int)_idx; - (int)lengthOfTuple:(int)_tuple atIndex:(unsigned int)_idx; /* operations */ - (void)clear; @end #endif /* ___PostgreSQL72_PGConnection_H___ */ SOPE/sope-gdl1/PostgreSQL/common.h0000644000000000000000000000250112242733417015564 0ustar rootroot/* common.h Copyright (C) 2000-2004 SKYRIX Software AG and Helge Hess Copyright (C) 1999 MDlink online service center GmbH and Helge Hess Author: Helge Hess (helge.hess@opengroupware.org) This file is part of the PostgreSQL Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ___PostgreSQL_common_H___ #define ___PostgreSQL_common_H___ #include #include #include #if !LIB_FOUNDATION_LIBRARY # include # include #endif #include #endif /* ___PostgreSQL_common_H___ */ SOPE/sope-gdl1/PostgreSQL/Version0000644000000000000000000000011612242733417015473 0ustar rootroot# version file SUBMINOR_VERSION:=54 # v4.5.41 requires libGDLAccess v4.5.50 SOPE/sope-gdl1/PostgreSQL/COPYING.LIB0000644000000000000000000006126112242733417015573 0ustar rootroot GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, 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 library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] 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 Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, 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 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 a program 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. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, 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 companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. 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, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library 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 compile 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) 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. c) 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. d) 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 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. 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 to 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 Library 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 Appendix: 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 Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, 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! SOPE/sope-gdl1/PostgreSQL/PGConnection.m0000644000000000000000000001311012242733417016625 0ustar rootroot/* PGConnection.m Copyright (C) 2004-2006 SKYRIX Software AG and Helge Hess Author: Helge Hess (helge.hess@opengroupware.org) This file is part of the PostgreSQL72 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "PGConnection.h" #include "common.h" #include #include "pgconfig.h" @implementation PGConnection static BOOL debugOn = NO; - (id)initWithHostName:(NSString *)_host port:(NSString *)_port options:(NSString *)_options tty:(NSString *)_tty database:(NSString *)_dbname login:(NSString *)_login password:(NSString *)_pwd { if ((self = [self init])) { NSException *error; error = [self connectWithHostName:_host port:_port options:_options tty:_tty database:_dbname login:_login password:_pwd]; if (error != nil) { if (debugOn) NSLog(@"%s: could not connect: %@", __PRETTY_FUNCTION__, error); [self release]; return nil; } } return self; } - (void)dealloc { [self finish]; [super dealloc]; } /* support */ - (const char *)_cstrFromString:(NSString *)_s { // TODO: fix API, check what the API string encoding is return [_s UTF8String]; } - (NSString *)_stringFromCString:(const char *)_cstr { return [NSString stringWithUTF8String:_cstr]; } /* accessors */ - (BOOL)isValid { return self->_connection != NULL ? YES : NO; } /* errors */ - (NSException *)_makeConnectException:(const char *)_func { return [NSException exceptionWithName:@"PGConnectFailed" reason:[NSString stringWithCString:_func] userInfo:nil]; } /* connect operations */ - (void)_disconnect { if (self->_connection != NULL) [self finish]; } - (NSException *)startConnectWithInfo:(NSString *)_conninfo { [self _disconnect]; self->_connection = PQconnectStart([self _cstrFromString:_conninfo]); if (self->_connection == NULL) return [self _makeConnectException:__PRETTY_FUNCTION__]; return nil; } // TODO: add method for polling connect status - (NSException *)connectWithInfo:(NSString *)_conninfo { [self _disconnect]; self->_connection = PQconnectdb([self _cstrFromString:_conninfo]); if (self->_connection == NULL) return [self _makeConnectException:__PRETTY_FUNCTION__]; [self execute: @"SET standard_conforming_strings TO 'on'"]; return nil; } - (NSException *)connectWithHostName:(NSString *)_host port:(NSString *)_port options:(NSString *)_options tty:(NSString *)_tty database:(NSString *)_dbname login:(NSString *)_login password:(NSString *)_pwd { [self _disconnect]; self->_connection = PQsetdbLogin([self _cstrFromString:_host], [self _cstrFromString:_port], [self _cstrFromString:_options], [self _cstrFromString:_tty], [self _cstrFromString:_dbname], [self _cstrFromString:_login], [self _cstrFromString:_pwd]); if (self->_connection == NULL) return [self _makeConnectException:__PRETTY_FUNCTION__]; /* The PG adaptor always produce conform strings. We set this parameter to make sure the "\" character is never interpreted as an escape character, unless otherwise specified (by using E'...'). */ [self execute: @"SET standard_conforming_strings TO 'on'"]; return nil; } - (void)finish { if (self->_connection != NULL) { PQfinish(self->_connection); self->_connection = NULL; } } - (BOOL)isConnectionOK { if (![self isValid]) return NO; return PQstatus(self->_connection) == CONNECTION_OK ? YES : NO; } /* message callbacks */ - (BOOL)setNoticeProcessor:(void *)_callback context:(void *)_ctx { #if NG_HAS_NOTICE_PROCESSOR PQsetNoticeProcessor(self->_connection, _callback, _ctx); return YES; // TODO: improve error handling #else return NO; #endif } /* settings */ - (BOOL)setClientEncoding:(NSString *)_encoding { return PQsetClientEncoding(self->_connection, [self _cstrFromString:_encoding]) == 0 ? YES : NO; } /* errors */ - (NSString *)errorMessage { if (![self isValid]) return nil; return [self _stringFromCString:PQerrorMessage(self->_connection)]; } /* queries */ - (void *)rawExecute:(NSString *)_sql { return PQexec(self->_connection, [self _cstrFromString:_sql]); } - (void)clearRawResults:(void *)_ptr { if (_ptr == NULL) return; PQclear(_ptr); } - (PGResultSet *)execute:(NSString *)_sql { void *handle; if ((handle = [self rawExecute:_sql]) == NULL) return nil; return [[[PGResultSet alloc] initWithConnection:self handle:handle] autorelease]; } /* debugging */ - (BOOL)isDebuggingEnabled { return debugOn; } /* description */ - (NSString *)description { NSMutableString *ms; ms = [NSMutableString stringWithCapacity:128]; [ms appendFormat:@"<0x%p[%@]: ", self, NSStringFromClass([self class])]; if ([self isValid]) [ms appendFormat:@" connection=0x%p", self->_connection]; else [ms appendString:@" not-connected"]; [ms appendString:@">"]; return ms; } @end /* PGConnection */ SOPE/sope-gdl1/PostgreSQL/PostgreSQL72Expression.h0000644000000000000000000000302612242733417020533 0ustar rootroot/* PostgreSQL72Expression.h Copyright (C) 1999 MDlink online service center GmbH and Helge Hess Author: Helge Hess (helge@mdlink.de) This file is part of the PostgreSQL72 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ___Postgre_SQLExpression_H___ #define ___Postgre_SQLExpression_H___ #include @class NSString, NSArray; @class EOSQLQualifier, EOAdaptorChannel; @interface PostgreSQL72Expression : EOSQLExpression + (Class)selectExpressionClass; @end @interface PostgreSQL72SelectSQLExpression : EOSelectSQLExpression { BOOL lock; } - (id)selectExpressionForAttributes:(NSArray *)attributes lock:(BOOL)flag qualifier:(EOSQLQualifier *)qualifier fetchOrder:(NSArray *)fetchOrder channel:(EOAdaptorChannel *)channel; - (NSString *)fromClause; @end #endif SOPE/sope-gdl1/SQLite3/0000755000000000000000000000000012242733417013346 5ustar rootrootSOPE/sope-gdl1/SQLite3/test.eomodel0000644000000000000000000000131612242733417015674 0ustar rootroot{ EOModelVersion = 1; adaptorClassName = SQLiteAdaptor; adaptorName = SQLite3; entities = ( { /* CREATE TABLE my_table ( pkey INT PRIMARY KEY ); */ name = MyEntity; externalName = my_table; className = EOGenericRecord; primaryKeyAttributes = ( pkey ); attributesUsedForLocking = ( pkey ); classProperties = ( pkey ); attributes = ( { valueClassName = NSNumber; columnName = pkey; name = pkey; valueType = i; externalType = INT; // t_id }, ); } ); } SOPE/sope-gdl1/SQLite3/fhs.make0000644000000000000000000000122512242733417014765 0ustar rootroot# postprocessing # FHS support (this is a hack and is going to be done by gstep-make!) ifneq ($(FHS_INSTALL_ROOT),) FHS_LIB_DIR=$(CONFIGURE_FHS_INSTALL_LIBDIR) FHS_DB_DIR=$(FHS_LIB_DIR)sope-$(SOPE_MAJOR_VERSION).$(SOPE_MINOR_VERSION)/dbadaptors/ fhs-db-dirs :: $(MKDIRS) $(FHS_DB_DIR) move-bundles-to-fhs :: fhs-db-dirs @echo "moving bundles $(BUNDLE_INSTALL_DIR) to $(FHS_DB_DIR) .." for i in $(BUNDLE_NAME); do \ j="$(FHS_DB_DIR)/$${i}$(BUNDLE_EXTENSION)"; \ if test -d $$j; then rm -r $$j; fi; \ mv "$(BUNDLE_INSTALL_DIR)/$${i}$(BUNDLE_EXTENSION)" $$j; \ done move-to-fhs :: move-bundles-to-fhs after-install :: move-to-fhs endif SOPE/sope-gdl1/SQLite3/README0000644000000000000000000000720512242733417014232 0ustar rootroot# SQLite3 Adaptor Note: this is far from being complete! The adaptor is currently a fork of the PostgreSQL adaptor. TODO ==== - check EOAttribute+SQLite: -loadValueClassAndTypeUsingSQLiteType:... - SQLiteChannel.m: -primaryFetchAttributes => check field name processing - rewrite for exception less operation - implement more methods in SQLiteChannel+Model (hard with SQLite though) Basics ====== Open a Shell: sqlite3 OGo > insert schema > select * from date_x; Configure the Adaptor (below does not work yet for SQLite3!) Defaults write ogo-webui-1.0a LSAdaptor SQLite3 Defaults write ogo-webui-1.0a LSConnectionDictionary \ '{ databaseName = OGo; }' Defaults write ogo-webui-1.0a PKeyGeneratorDictionary \ "{ newKeyExpression=\"select nextval(\\'key_generator\\');\" }" SQLiteDebugEnabled Setup gdltest Database ====================== sqlite3 Test.sqldb sqlite> CREATE TABLE my_table ( pkey INT PRIMARY KEY ); Sequential execution ==================== http://www.hwaci.com/sw/sqlite/c_interface.html ---snip--- typedef struct sqlite_vm sqlite_vm; int sqlite_compile( sqlite *db, /* The open database */ const char *zSql, /* SQL statement to be compiled */ const char **pzTail, /* OUT: uncompiled tail of zSql */ sqlite_vm **ppVm, /* OUT: the virtual machine to execute zSql */ char **pzErrmsg /* OUT: Error message. */ ); int sqlite_step( sqlite_vm *pVm, /* The virtual machine to execute */ int *pN, /* OUT: Number of columns in result */ const char ***pazValue, /* OUT: Column data */ const char ***pazColName /* OUT: Column names and datatypes */ ); int sqlite_finalize( sqlite_vm *pVm, /* The virtual machine to be finalized */ char **pzErrMsg /* OUT: Error message */ ); ---snap--- Error-Codes =========== ---snip--- #define SQLITE_OK 0 /* Successful result */ #define SQLITE_ERROR 1 /* SQL error or missing database */ #define SQLITE_INTERNAL 2 /* An internal logic error in SQLite */ #define SQLITE_PERM 3 /* Access permission denied */ #define SQLITE_ABORT 4 /* Callback routine requested an abort */ #define SQLITE_BUSY 5 /* The database file is locked */ #define SQLITE_LOCKED 6 /* A table in the database is locked */ #define SQLITE_NOMEM 7 /* A malloc() failed */ #define SQLITE_READONLY 8 /* Attempt to write a readonly database */ #define SQLITE_INTERRUPT 9 /* Operation terminated by sqlite_interrupt() */ #define SQLITE_IOERR 10 /* Some kind of disk I/O error occurred */ #define SQLITE_CORRUPT 11 /* The database disk image is malformed */ #define SQLITE_NOTFOUND 12 /* (Internal Only) Table or record not found */ #define SQLITE_FULL 13 /* Insertion failed because database is full */ #define SQLITE_CANTOPEN 14 /* Unable to open the database file */ #define SQLITE_PROTOCOL 15 /* Database lock protocol error */ #define SQLITE_EMPTY 16 /* (Internal Only) Database table is empty */ #define SQLITE_SCHEMA 17 /* The database schema changed */ #define SQLITE_TOOBIG 18 /* Too much data for one row of a table */ #define SQLITE_CONSTRAINT 19 /* Abort due to contraint violation */ #define SQLITE_MISMATCH 20 /* Data type mismatch */ #define SQLITE_MISUSE 21 /* Library used incorrectly */ #define SQLITE_NOLFS 22 /* Uses OS features not supported on host */ #define SQLITE_AUTH 23 /* Authorization denied */ #define SQLITE_ROW 100 /* sqlite_step() has another row ready */ #define SQLITE_DONE 101 /* sqlite_step() has finished executing */ ---snap--- SOPE/sope-gdl1/SQLite3/SQLiteAdaptor.m0000644000000000000000000000777512242733417016220 0ustar rootroot/* SQLiteAdaptor.m Copyright (C) 2003-2005 SKYRIX Software AG Author: Helge Hess (helge.hess@skyrix.com) This file is part of the SQLite Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "SQLiteAdaptor.h" #include "SQLiteContext.h" #include "SQLiteChannel.h" #include "SQLiteExpression.h" #include "SQLiteValues.h" #include "common.h" @implementation SQLiteAdaptor - (NSDictionary *)connectionDictionaryForNSURL:(NSURL *)_url { /* "Database URLs" We use the schema: SQLite3://localhost/dbpath/foldername */ NSMutableDictionary *md; NSString *p; if ((p = [_url path]) == nil) return nil; p = [p stringByDeletingLastPathComponent]; if ([p length] == 0) p = [_url path]; md = [NSMutableDictionary dictionaryWithCapacity:8]; [md setObject:p forKey:@"databaseName"]; return md; } - (id)initWithName:(NSString *)_name { if ((self = [super initWithName:_name])) { } return self; } /* NSCopying methods */ - (id)copyWithZone:(NSZone *)_zone { return [self retain]; } // connections - (NSString *)serverName { return @"localhost"; } - (NSString *)loginName { return @"no-login-required"; } - (NSString *)loginPassword { return @"no-pwd-required"; } - (NSString *)databaseName { return [[[[self connectionDictionary] objectForKey:@"databaseName"] copy] autorelease]; } - (NSString *)port { return @"no-port-required"; } - (NSString *)options { return [[[[self connectionDictionary] objectForKey:@"options"] copy] autorelease]; } /* sequence for primary key generation */ - (NSString *)primaryKeySequenceName { NSString *seqName; seqName = [[self pkeyGeneratorDictionary] objectForKey:@"primaryKeySequenceName"]; return [[seqName copy] autorelease]; } - (NSString *)newKeyExpression { NSString *newKeyExpr; newKeyExpr = [[self pkeyGeneratorDictionary] objectForKey:@"newKeyExpression"]; return [[newKeyExpr copy] autorelease]; } // formatting - (NSString *)charConvertExpressionForAttributeNamed:(NSString *)_attrName { return _attrName; } - (id)formatValue:(id)value forAttribute:(EOAttribute *)attribute { NSString *result; result = [value stringValueForSQLite3Type:[attribute externalType] attribute:attribute]; //NSLog(@"formatting value %@ result %@", value, result); //NSLog(@" value class %@ attr %@ attr type %@", // [value class], attribute, [attribute externalType]); return result; } - (BOOL)attributeAllowedInDistinctSelects:(EOAttribute *)_attr { return YES; } /* types */ - (BOOL)isValidQualifierType:(NSString *)_typeName { return YES; } /* adaptor info */ - (Class)adaptorContextClass { return [SQLiteContext class]; } - (Class)adaptorChannelClass { return [SQLiteChannel class]; } - (Class)expressionClass { return [SQLiteExpression class]; } @end /* SQLiteAdaptor */ void __linkSQLiteAdaptor(void) { extern void __link_EOAttributeSQLite(); extern void __link_NSStringSQLite(); extern void __link_SQLiteChannelModel(); extern void __link_SQLiteValues(); ; [SQLiteChannel class]; [SQLiteContext class]; [SQLiteException class]; [SQLiteExpression class]; __link_EOAttributeSQLite(); __link_NSStringSQLite(); //__link_SQLiteChannelModel(); __link_SQLiteValues(); __linkSQLiteAdaptor(); } SOPE/sope-gdl1/SQLite3/GNUmakefile0000644000000000000000000000340712242733417015424 0ustar rootroot# # GNUmakefile # # Copyright (C) 2005 Helge Hess # # Author: Helge Hess (helge.hess@opengroupware.org) # # This file is part of the SQLite Adaptor Library # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; see the file COPYING.LIB. # If not, write to the Free Software Foundation, # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. include ../../config.make include $(GNUSTEP_MAKEFILES)/common.make include ../Version include ./Version BUNDLE_NAME = SQLite3 SQLite3_PCH_FILE = common.h SQLite3_OBJC_FILES = \ SQLiteExpression.m \ SQLiteAdaptor.m \ SQLiteContext.m \ SQLiteChannel.m \ SQLiteChannel+Model.m \ SQLiteException.m \ SQLiteValues.m \ NSString+SQLite.m \ EOAttribute+SQLite.m \ NSString+SQLiteVal.m \ NSData+SQLiteVal.m \ NSCalendarDate+SQLiteVal.m \ NSNumber+SQLiteVal.m \ SQLite3_PRINCIPAL_CLASS = SQLiteAdaptor BUNDLE_INSTALL = SQLite3 # Use .gdladaptor as the bundle extension BUNDLE_EXTENSION = .gdladaptor SQLite3_RESOURCE_FILES += Version # tool TOOL_NAME = gdltest gdltest_OBJC_FILES = gdltest.m -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/bundle.make ifeq ($(test),yes) include $(GNUSTEP_MAKEFILES)/tool.make endif -include GNUmakefile.postamble SOPE/sope-gdl1/SQLite3/SQLiteChannel+Model.h0000644000000000000000000000231112242733417017202 0ustar rootroot/* SQLiteChannel+Model.h Copyright (C) 2003-2005 SKYRIX Software AG Author: Helge Hess (helge.hess@skyrix.com) This file is part of the SQLite Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ___SQLite_ModelFetching_H___ #define ___SQLite_ModelFetching_H___ #import "SQLiteChannel.h" @class NSArray; @class EOModel; @interface SQLiteChannel(ModelFetching) - (EOModel *)describeModelWithTableNames:(NSArray *)_tableNames; - (NSArray *)describeTableNames; @end #endif SOPE/sope-gdl1/SQLite3/SQLiteAdaptor.h0000644000000000000000000000353612242733417016202 0ustar rootroot/* SQLiteAdaptor.h Copyright (C) 2003-2005 SKYRIX Software AG Author: Helge Hess (helge.hess@skyrix.com) This file is part of the SQLite Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ___SQLite_Adaptor_H___ #define ___SQLite_Adaptor_H___ /* The SQLite adaptor. The connection dictionary of this adaptor understands these keys: databaseName The adaptor is based on libsqlite. */ #import #import #import @class NSString, NSMutableDictionary; @interface SQLiteAdaptor : EOAdaptor { } - (id)initWithName:(NSString *)_name; // connection management - (NSString *)databaseName; - (NSString *)newKeyExpression; // sequence for primary key generation - (NSString *)primaryKeySequenceName; // value formatting - (id)formatValue:(id)value forAttribute:(EOAttribute *)attribute; // attribute typing - (BOOL)attributeAllowedInDistinctSelects:(EOAttribute *)_attr; // classes used - (Class)adaptorContextClass; // SQLiteContext - (Class)adaptorChannelClass; // SQLiteChannel - (Class)expressionClass; // SQLiteExpression @end #endif SOPE/sope-gdl1/SQLite3/condict.plist0000644000000000000000000000004312242733417016043 0ustar rootroot{ databaseName = "Test.sqldb"; } SOPE/sope-gdl1/SQLite3/NSData+SQLiteVal.m0000644000000000000000000000522312242733417016440 0ustar rootroot/* NSData+SQLiteVal.m Copyright (C) 2003-2005 SKYRIX Software AG Author: Helge Hess (helge.hess@skyrix.com) This file is part of the SQLite Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "SQLiteValues.h" #include "SQLiteChannel.h" #import #include "common.h" @implementation NSData(SQLiteValues) - (id)initWithSQLiteInt:(int)_value { return [self initWithBytes:&_value length:sizeof(int)]; } - (id)initWithSQLiteDouble:(double)_value { return [self initWithBytes:&_value length:sizeof(double)]; } - (id)initWithSQLiteText:(const unsigned char *)_value { return [self initWithBytes:_value length:strlen((char *)_value)]; } - (id)initWithSQLiteData:(const void *)_value length:(int)_length { return [self initWithBytes:_value length:_length]; } - (NSString *)stringValueForSQLite3Type:(NSString *)_type attribute:(EOAttribute *)_attribute { // TODO: UNICODE // TODO: this method looks slow static NSStringEncoding enc = 0; NSString *str, *t; unsigned len; unichar c1; if ((len = [self length]) == 0) return @""; if (enc == 0) { enc = [NSString defaultCStringEncoding]; NSLog(@"Note: SQLite adaptor using '%@' encoding for data=>string " @"conversion.", [NSString localizedNameOfStringEncoding:enc]); } str = [[NSString alloc] initWithData:self encoding:enc]; if (((len = [_type length]) == 0) || (len != 4 && len != 5 && len != 7)) return [str autorelease]; c1 = [_type characterAtIndex:0]; switch (c1) { case 'c': case 'C': case 'v': case 'V': case 'm': case 'M': case 't': case 'T': t = [_type lowercaseString]; if ([t hasPrefix:@"char"] || [t hasPrefix:@"varchar"] || [t hasPrefix:@"money"] || [t hasPrefix:@"text"]) { t = [[str stringValueForSQLite3Type:_type attribute:_attribute] retain]; [str release]; return [t autorelease]; } } return [str autorelease];; } @end /* NSData(SQLiteValues) */ SOPE/sope-gdl1/SQLite3/SQLiteChannel.h0000644000000000000000000000346412242733417016160 0ustar rootroot/* SQLiteChannel.h Copyright (C) 2003-2005 Helge Hess Author: Helge Hess (helge.hess@opengroupware.org) This file is part of the SQLite Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ___SQLite_Channel_H___ #define ___SQLite_Channel_H___ #include @class NSArray, NSString, NSMutableDictionary; @interface SQLiteChannel : EOAdaptorChannel { // connection is valid after an openChannel call void *_connection; // valid during -evaluateExpression: void *statement; BOOL hasPendingRow; BOOL isDone; void *results; // turns on/off channel debugging BOOL isDebuggingEnabled; NSMutableDictionary *_attributesForTableName; NSMutableDictionary *_primaryKeysNamesForTableName; } - (void)setDebugEnabled:(BOOL)_flag; - (BOOL)isDebugEnabled; @end @interface NSObject(Sybase10ChannelDelegate) - (NSArray*)sqlite3Channel:(SQLiteChannel *)channel willFetchAttributes:(NSArray *)attributes; - (BOOL)sqlite3Channel:(SQLiteChannel *)channel willReturnRow:(NSDictionary *)row; @end #endif /* ___SQLite_Channel_H___ */ SOPE/sope-gdl1/SQLite3/SQLiteValues.h0000644000000000000000000000425612242733417016047 0ustar rootroot/* SQLiteValues.h Copyright (C) 1999-2005 MDlink online service center GmbH and Helge Hess Author: Helge Hess (helge@mdlink.de) This file is part of the SQLite Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ___SQLite_Values_H___ #define ___SQLite_Values_H___ #import #import #import #import #import #import "SQLiteException.h" @class EOAttribute; @class SQLiteChannel; @interface SQLiteDataTypeMappingException : SQLiteException - (id)initWithObject:(id)_obj forAttribute:(EOAttribute *)_attr andSQLite3Type:(NSString *)_dt inChannel:(SQLiteChannel *)_channel; @end @protocol SQLiteValues - (NSString *)stringValueForSQLite3Type:(NSString *)_type attribute:(EOAttribute *)_attribute; @end @interface NSObject(SQLiteValues) - (id)initWithSQLiteInt:(int)_value; - (id)initWithSQLiteText:(const unsigned char *)_value; - (id)initWithSQLiteDouble:(double)_value; - (id)initWithSQLiteData:(const void *)_data length:(int)_length; @end @interface NSString(SQLiteValues) < SQLiteValues > @end @interface NSNumber(SQLiteValues) < SQLiteValues > @end @interface NSData(SQLiteValues) < SQLiteValues > @end @interface NSCalendarDate(SQLiteValues) < SQLiteValues > @end @interface EONull(SQLiteValues) - (NSString *)stringValueForSQLite3Type:(NSString *)_type attribute:(EOAttribute *)_attribute; @end #endif /* ___SQLite_Values_H___ */ SOPE/sope-gdl1/SQLite3/NSCalendarDate+SQLiteVal.m0000644000000000000000000001445512242733417020105 0ustar rootroot/* NSCalendarDate+SQLiteVal.m Copyright (C) 2003-2005 SKYRIX Software AG Author: Helge Hess (helge.hess@skyrix.com) This file is part of the SQLite Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import #include "SQLiteChannel.h" #include "common.h" #if COCOA_Foundation_LIBRARY || NeXT_Foundation_LIBRARY @interface NSCalendarDate(UsedPrivates) - (id)initWithTimeIntervalSince1970:(NSTimeInterval)_tv; @end #endif static NSString *SQLITE3_DATETIME_FORMAT = @"%b %d %Y %I:%M:%S:000%p"; @implementation NSCalendarDate(SQLiteValues) /* Format: '2001-07-26 14:00:00+02' '2001-07-26 14:00:00+09:30' 0123456789012345678901234 Matthew: "07/25/2003 06:00:00 CDT". */ static Class NSCalDateClass = Nil; static NSTimeZone *DefServerTimezone = nil; static NSTimeZone *gmt = nil; static NSTimeZone *gmt01 = nil; static NSTimeZone *gmt02 = nil; - (id)initWithSQLiteData:(const void *)_value length:(int)_length { static char buf[28]; // reused buffer, THREAD const char *_cstr = _value; char *p; NSTimeZone *attrTZ; NSCalendarDate *date; int year, month, day, hour, min, sec, tzOffset; if (_length == 0) return nil; if (_length != 22 && _length != 25) { NSLog(@"ERROR(%s): unexpected date string '%s', returning now" @" (expected format: '2001-07-26 14:00:00+02')", __PRETTY_FUNCTION__, _cstr); return [NSCalendarDate date]; } strncpy(buf, _cstr, 25); buf[25] = '\0'; /* perform on reverse, so that we don't overwrite with null-terminators */ if (_length == 22) { p = &(buf[19]); tzOffset = atoi(p) * 60; } else if (_length >= 25) { int mins; p = &(buf[23]); mins = atoi(p); buf[22] = '\0'; // the ':' p = &(buf[19]); tzOffset = atoi(p) * 60; tzOffset = tzOffset > 0 ? (tzOffset + mins) : (tzOffset - mins); } p = &(buf[17]); buf[19] = '\0'; sec = atoi(p); p = &(buf[14]); buf[16] = '\0'; min = atoi(p); p = &(buf[11]); buf[13] = '\0'; hour = atoi(p); p = &(buf[8]); buf[10] = '\0'; day = atoi(p); p = &(buf[5]); buf[7] = '\0'; month = atoi(p); p = &(buf[0]); buf[4] = '\0'; year = atoi(p); /* TODO: cache all timezones (just 26 ;-) */ switch (tzOffset) { case 0: if (gmt == nil) { gmt = [[NSTimeZone timeZoneForSecondsFromGMT:0] retain]; NSAssert(gmt, @"could not create GMT timezone?!"); } attrTZ = gmt; break; case 60: if (gmt01 == nil) { gmt01 = [[NSTimeZone timeZoneForSecondsFromGMT:3600] retain]; NSAssert(gmt01, @"could not create GMT+01 timezone?!"); } attrTZ = gmt01; break; case 120: if (gmt02 == nil) { gmt02 = [[NSTimeZone timeZoneForSecondsFromGMT:7200] retain]; NSAssert(gmt02, @"could not create GMT+02 timezone?!"); } attrTZ = gmt02; break; default: { /* cache the first, "alternative" timezone */ static int firstTZOffset = 0; // can use 0 since GMT is a separate case static NSTimeZone *firstTZ = nil; if (firstTZOffset == 0) { firstTZOffset = tzOffset; firstTZ = [[NSTimeZone timeZoneForSecondsFromGMT:(tzOffset*60)] retain]; } attrTZ = (firstTZOffset == tzOffset) ? firstTZ : [NSTimeZone timeZoneForSecondsFromGMT:(tzOffset * 60)]; break; } } if (NSCalDateClass == Nil) NSCalDateClass = [NSCalendarDate class]; date = [NSCalDateClass dateWithYear:year month:month day:day hour:hour minute:min second:sec timeZone:attrTZ]; if (date == nil) { NSLog(@"ERROR(%s): could not construct date from string '%s': " @"year=%i,month=%i,day=%i,hour=%i,minute=%i,second=%i, tz=%@", __PRETTY_FUNCTION__, _cstr, year, month, day, hour, min, sec, attrTZ); } return date; } - (id)initWithSQLiteDouble:(double)_value { return [self initWithTimeIntervalSince1970:_value]; } - (id)initWithSQLiteInt:(int)_value { return [self initWithSQLiteDouble:_value]; } - (id)initWithSQLiteText:(const unsigned char *)_value { return [self initWithSQLiteData:_value length:strlen((char *)_value)]; } /* generating value */ - (NSString *)stringValueForSQLite3Type:(NSString *)_type attribute:(EOAttribute *)_attribute { #if 0 NSString *format; #endif EOQuotedExpression *expr; NSTimeZone *serverTimeZone; NSString *format; NSString *val; unsigned len; unichar c1; if ((len = [_type length]) == 0) c1 = 0; else c1 = [_type characterAtIndex:0]; if (c1 == 'i' || c1 == 'I') { // INTEGER char buf[64]; sprintf(buf, "%d", ((unsigned int)[self timeIntervalSince1970])); return [NSString stringWithCString:buf]; } if (c1 == 'r' || c1 == 'R') { // REAL char buf[64]; // TODO: check format sprintf(buf, "%f", [self timeIntervalSince1970]); return [NSString stringWithCString:buf]; } if ((serverTimeZone = [_attribute serverTimeZone]) == nil ) { if (DefServerTimezone == nil) { DefServerTimezone = [[NSTimeZone localTimeZone] retain]; NSLog(@"Note: SQLite adaptor using timezone '%@' as default", DefServerTimezone); } serverTimeZone = DefServerTimezone; } #if 0 format = [_attribute calendarFormat]; #else /* hm, why is that? */ format = @"%Y-%m-%d %H:%M:%S%z"; #endif if (format == nil) format = SQLITE3_DATETIME_FORMAT; [self setTimeZone:serverTimeZone]; val = [self descriptionWithCalendarFormat:format]; expr = [[EOQuotedExpression alloc] initWithExpression:val quote:@"\'" escape:@"\\'"]; val = [[expr expressionValueForContext:nil] retain]; [expr release]; return [val autorelease]; } @end /* NSCalendarDate(SQLiteValues) */ SOPE/sope-gdl1/SQLite3/ChangeLog0000644000000000000000000000453712242733417015131 0ustar rootroot2006-10-29 Marcus Mueller * SQLite3.xcodeproj: link against the system version of sqlite3 rather than a custom version in /usr/local. 2006-07-04 Helge Hess * use %p for pointer formats, fixed gcc 4.1 warnings (v4.5.21) 2005-08-16 Helge Hess * GNUmakefile.preamble: added OSX framework compilation (v4.5.20) 2005-08-08 Helge Hess * GNUmakefile.preamble: fixed pathes for inline-compilation (v4.5.19) 2005-07-27 Helge Hess * fixed gcc 4.0 warnings (char signedness) (v4.5.18) 2005-04-21 Helge Hess * v4.5.17 * NSString+SQLiteVal.m: fixed a gcc 3.4.3 warning * SQLiteChannel.m: changed for -describeResults: API 2005-04-12 Helge Hess * SQLiteChannel.m: bumped max connection count from 15 to 150 (v4.5.16) 2005-04-11 Helge Hess * SQLiteChannel.h, SQLiteAdaptor.m: removed unused ivars (v4.5.15) 2005-02-24 Helge Hess * NSString+SQLiteVal.m, NSCalendarDate+SQLiteVal.m: improved SQL value generation (v4.5.14) * v4.5.13 * NSString+SQLiteVal.m: fixed a warning on MacOSX * NSCalendarDate+SQLiteVal.m: added some support for creating NSCalendarDate's from SQLite base types * SQLiteValues.m: fixed some MacOSX compile warning * GNUmakefile.preamble: added missing bundle dependency on GDLAccess 2005-02-21 Marcus Mueller * v4.5.12 * common.h: added #include of for definitions of required macros * SQLite3.xcode: added * SQLite3-Info.plist: added 2005-02-21 Helge Hess * v4.5.11 * SQLiteChannel.m: fixed an issue with fetching empty tables * SQLiteChannel.m: properly generate the trailing ';' for SQL expressions * SQLiteAdaptor.m: added special url=>condict handling (the whole URL path is taken as the database name) 2005-02-20 Helge Hess * SQLiteChannel.m: implemented -describeResults (v4.5.10) * most SQL operations based on models are implemented now (v4.5.9) * made gdltest work again * added work on the SQLite3 adaptor to SOPE 4.5 repository * removed some PostgreSQL stuff * created ChangeLog SOPE/sope-gdl1/SQLite3/SQLiteChannel.m0000644000000000000000000004301512242733417016161 0ustar rootroot/* SQLiteChannel.m Copyright (C) 2003-2005 SKYRIX Software AG Author: Helge Hess (helge.hess@skyrix.com) This file is part of the SQLite Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include "SQLiteChannel.h" #include "SQLiteAdaptor.h" #include "SQLiteException.h" #include "NSString+SQLite.h" #include "SQLiteValues.h" #include "EOAttribute+SQLite.h" #include "common.h" #ifndef MIN # define MIN(x, y) ((x > y) ? y : x) #endif #define MAX_CHAR_BUF 16384 @implementation SQLiteChannel static EONull *null = nil; + (void)initialize { if (null == NULL) null = [[EONull null] retain]; } - (id)initWithAdaptorContext:(EOAdaptorContext*)_adaptorContext { if ((self = [super initWithAdaptorContext:_adaptorContext])) { [self setDebugEnabled:[[NSUserDefaults standardUserDefaults] boolForKey:@"SQLiteDebugEnabled"]]; self->_attributesForTableName = [[NSMutableDictionary alloc] initWithCapacity:16]; self->_primaryKeysNamesForTableName = [[NSMutableDictionary alloc] initWithCapacity:16]; } return self; } - (void)_adaptorWillFinalize:(id)_adaptor { } - (void)dealloc { if ([self isOpen]) [self closeChannel]; [self->_attributesForTableName release]; [self->_primaryKeysNamesForTableName release]; [super dealloc]; } /* NSCopying methods */ - (id)copyWithZone:(NSZone *)zone { return [self retain]; } // debugging - (void)setDebugEnabled:(BOOL)_flag { self->isDebuggingEnabled = _flag; } - (BOOL)isDebugEnabled { return self->isDebuggingEnabled; } - (void)receivedMessage:(NSString *)_message { NSLog(@"%@: message %@.", _message); } /* open/close */ static int openConnectionCount = 0; - (BOOL)isOpen { return (self->_connection != NULL) ? YES : NO; } - (int)maxOpenConnectionCount { static int MaxOpenConnectionCount = -1; if (MaxOpenConnectionCount != -1) return MaxOpenConnectionCount; MaxOpenConnectionCount = [[NSUserDefaults standardUserDefaults] integerForKey:@"SQLiteMaxOpenConnectionCount"]; if (MaxOpenConnectionCount == 0) MaxOpenConnectionCount = 150; return MaxOpenConnectionCount; } - (BOOL)openChannel { const char *cDBName; SQLiteAdaptor *adaptor; int rc; if (self->_connection) { NSLog(@"%s: Connection already open !!!", __PRETTY_FUNCTION__); return NO; } adaptor = (SQLiteAdaptor *)[adaptorContext adaptor]; if (![super openChannel]) return NO; if (openConnectionCount > [self maxOpenConnectionCount]) { [SQLiteCouldNotOpenChannelException raise:@"NoMoreConnections" format:@"cannot open a additional connection !"]; return NO; } cDBName = [[adaptor databaseName] UTF8String]; rc = sqlite3_open(cDBName, (void *)&(self->_connection)); if (rc != SQLITE_OK) { // could not login .. // Note: connection *is* set! (might be required to deallocate) NSLog(@"WARNING: could not open SQLite connection to database '%@': %s", [adaptor databaseName], sqlite3_errmsg(self->_connection)); sqlite3_close(self->_connection); return NO; } if (isDebuggingEnabled) NSLog(@"SQLite connection established 0x%p", self->_connection); #if 0 NSLog(@"---------- %s: %@ opens channel count[%d]", __PRETTY_FUNCTION__, self, openConnectionCount); #endif openConnectionCount++; #if LIB_FOUNDATION_BOEHM_GC [GarbageCollector registerForFinalizationObserver:self selector:@selector(_adaptorWillFinalize:) object:[[self adaptorContext] adaptor]]; #endif if (isDebuggingEnabled) { NSLog(@"SQLite channel 0x%p opened (connection=0x%p,%s)", self, self->_connection, cDBName); } return YES; } - (void)primaryCloseChannel { if (self->statement != NULL) { sqlite3_finalize(self->statement); self->statement = NULL; } if (self->_connection != NULL) { sqlite3_close(self->_connection); #if 0 NSLog(@"---------- %s: %@ close channel count[%d]", __PRETTY_FUNCTION__, self, openConnectionCount); #endif openConnectionCount--; if (isDebuggingEnabled) { fprintf(stderr, "SQLite connection dropped 0x%p (channel=0x%p)\n", self->_connection, self); } self->_connection = NULL; } } - (void)closeChannel { [super closeChannel]; [self primaryCloseChannel]; } /* fetching rows */ - (NSException *)_makeSQLiteStep { NSString *r; const char *em; int rc; rc = sqlite3_step(self->statement); #if 0 NSLog(@"STEP: %i (row=%i, done=%i, mis=%i)", rc, SQLITE_ROW, SQLITE_DONE, SQLITE_MISUSE); #endif if (rc == SQLITE_ROW) { self->hasPendingRow = YES; self->isDone = NO; return nil /* no error */; } if (rc == SQLITE_DONE) { self->hasPendingRow = NO; self->isDone = YES; return nil /* no error */; } if (rc == SQLITE_ERROR) r = [NSString stringWithUTF8String:sqlite3_errmsg(self->_connection)]; else if (rc == SQLITE_MISUSE) r = @"The SQLite step function was called in an incorrect way"; else if (rc == SQLITE_BUSY) r = @"The SQLite is busy."; else r = [NSString stringWithFormat:@"Unexpected SQLite error: %i", rc]; if ((em = sqlite3_errmsg(self->_connection)) != NULL) r = [r stringByAppendingFormat:@": %s", em]; return [SQLiteException exceptionWithName:@"FetchFailed" reason:r userInfo:nil]; } - (void)cancelFetch { if (self->statement != NULL) { sqlite3_finalize(self->statement); self->statement = NULL; } self->isDone = NO; self->hasPendingRow = NO; [super cancelFetch]; } - (NSArray *)describeResults:(BOOL)_beautifyNames { // TODO: make exception-less method int cnt, fieldCount; NSMutableArray *result = nil; NSMutableDictionary *usedNames = nil; NSNumber *yesObj; yesObj = [NSNumber numberWithBool:YES]; if (![self isFetchInProgress]) { [SQLiteException raise:@"NoFetchInProgress" format:@"No fetch in progress (channel=%@)", self]; } /* we need to fetch a row to get the info */ if (!self->hasPendingRow) { NSException *error; if ((error = [self _makeSQLiteStep]) != nil) { [self cancelFetch]; [error raise]; // raise error, TODO: make exception-less method return nil; } } if (!self->hasPendingRow) /* no rows available */ return nil; fieldCount = sqlite3_column_count(self->statement); /* old code below */ result = [[NSMutableArray alloc] initWithCapacity:fieldCount]; usedNames = [[NSMutableDictionary alloc] initWithCapacity:fieldCount]; for (cnt = 0; cnt < fieldCount; cnt++) { EOAttribute *attribute = nil; NSString *columnName = nil; NSString *attrName = nil; columnName = [NSString stringWithCString: sqlite3_column_name(self->statement, cnt)]; attrName = _beautifyNames ? [columnName _sqlite3ModelMakeInstanceVarName] : columnName; if ([[usedNames objectForKey:attrName] boolValue]) { int cnt2 = 0; char buf[64]; NSString *newAttrName = nil; for (cnt2 = 2; cnt2 < 100; cnt2++) { NSString *s; sprintf(buf, "%i", cnt2); // TODO: unicode s = [[NSString alloc] initWithCString:buf]; newAttrName = [attrName stringByAppendingString:s]; [s release]; if (![[usedNames objectForKey:newAttrName] boolValue]) { attrName = newAttrName; break; } } } [usedNames setObject:yesObj forKey:attrName]; attribute = [[EOAttribute alloc] init]; [attribute setName:attrName]; [attribute setColumnName:columnName]; switch (sqlite3_column_type(self->statement, cnt)) { case SQLITE_INTEGER: [attribute setExternalType:@"INTEGER"]; [attribute setValueClassName:@"NSNumber"]; [attribute setValueType:@"d"]; break; case SQLITE_FLOAT: [attribute setExternalType:@"REAL"]; [attribute setValueClassName:@"NSNumber"]; [attribute setValueType:@"f"]; break; case SQLITE_TEXT: [attribute setExternalType:@"TEXT"]; [attribute setValueClassName:@"NSString"]; break; case SQLITE_BLOB: [attribute setExternalType:@"BLOB"]; [attribute setValueClassName:@"NSData"]; break; case SQLITE_NULL: NSLog(@"WARNING(%s): got SQLite NULL type at column %i, can't derive " @"type information.", __PRETTY_FUNCTION__, cnt); [attribute setExternalType:@"NULL"]; [attribute setValueClassName:@"NSNull"]; break; default: NSLog(@"ERROR(%s): unexpected SQLite type at column %i", __PRETTY_FUNCTION__, cnt); break; } [result addObject:attribute]; [attribute release]; } [usedNames release]; usedNames = nil; return [result autorelease]; } - (BOOL)isColumnNullInCurrentRow:(int)_column { /* Note: NULL in SQLite is represented as empty strings ..., don't know what to do about that? At least Sybase 10 doesn't support empty strings strings as well and converts them to a single space. So maybe it is reasonable to map empty strings to NSNull? Or is this column-type SQLITE_NULL? If so, thats rather weird, since the type query does not take a row. */ return NO; } - (NSMutableDictionary *)primaryFetchAttributes:(NSArray *)_attributes withZone:(NSZone *)_zone { /* Note: we expect that the attributes match the generated SQL. This is because auto-generated SQL can contain SQL table prefixes (like alias.column-name which cannot be detected using the attributes schema) */ // TODO: add a primaryFetchAttributesX method? NSMutableDictionary *row = nil; NSException *error; unsigned attrCount = [_attributes count]; unsigned cnt; if (self->statement == NULL) { NSLog(@"ERROR: no fetch in progress?"); [self cancelFetch]; return nil; } if (!self->hasPendingRow && !self->isDone) { if ((error = [self _makeSQLiteStep]) != nil) { [self cancelFetch]; [error raise]; // raise error, TODO: make exception-less method return nil; } } if (self->isDone) { /* step was fine, but we are at the end */ [self cancelFetch]; return nil; } self->hasPendingRow = NO; /* consume the row */ /* build row */ row = [NSMutableDictionary dictionaryWithCapacity:attrCount]; for (cnt = 0; cnt < attrCount; cnt++) { EOAttribute *attribute; NSString *attrName; id value = nil; attribute = [_attributes objectAtIndex:cnt]; attrName = [attribute name]; if ([self isColumnNullInCurrentRow:cnt]) { value = [null retain]; } else { Class valueClass; valueClass = NSClassFromString([attribute valueClassName]); if (valueClass == Nil) { NSLog(@"ERROR(%s): %@: got no value class for column:\n" @" attribute=%@\n type=%@", __PRETTY_FUNCTION__, self, attrName, [attribute externalType]); value = null; continue; } switch (sqlite3_column_type(self->statement, cnt)) { case SQLITE_INTEGER: value = [[valueClass alloc] initWithSQLiteInt:sqlite3_column_int(self->statement, cnt)]; break; case SQLITE_FLOAT: value = [[valueClass alloc] initWithSQLiteDouble: sqlite3_column_double(self->statement, cnt)]; break; case SQLITE_TEXT: value = [[valueClass alloc] initWithSQLiteText: sqlite3_column_text(self->statement, cnt)]; break; case SQLITE_BLOB: value = [[valueClass alloc] initWithSQLiteData: sqlite3_column_blob(self->statement, cnt) length:sqlite3_column_bytes(self->statement, cnt)]; break; case SQLITE_NULL: value = [null retain]; break; default: NSLog(@"ERROR(%s): unexpected SQLite type at column %i", __PRETTY_FUNCTION__, cnt); continue; } if (value == nil) { NSLog(@"ERROR(%s): %@: got no value for column:\n" @" attribute=%@\n valueClass=%@\n type=%@", __PRETTY_FUNCTION__, self, attrName, NSStringFromClass(valueClass), [attribute externalType]); continue; } } if (value != nil) { [row setObject:value forKey:attrName]; [value release]; } } return row; } /* sending SQL to server */ - (NSException *)evaluateExpressionX:(NSString *)_expression { NSMutableString *sql; NSException *error; BOOL result; const char *s; const char *tails = NULL; int rc; *(&result) = YES; if (_expression == nil) { [NSException raise:@"InvalidArgumentException" format:@"parameter for evaluateExpression: " @"must not be null (channel=%@)", self]; } sql = [[_expression mutableCopy] autorelease]; [sql appendString:@";"]; /* ask delegate */ if (delegateRespondsTo.willEvaluateExpression) { EODelegateResponse response; response = [delegate adaptorChannel:self willEvaluateExpression:sql]; if (response == EODelegateRejects) { return [NSException exceptionWithName:@"EODelegateRejects" reason:@"delegate rejected insert" userInfo:nil]; } if (response == EODelegateOverrides) return nil; } /* check some preconditions */ if (![self isOpen]) { return [SQLiteException exceptionWithName:@"ChannelNotOpenException" reason:@"SQLite connection is not open" userInfo:nil]; } if (self->statement != NULL) { return [SQLiteException exceptionWithName:@"CommandInProgressException" reason:@"an evaluation is in progress" userInfo:nil]; return NO; } if ([self isFetchInProgress]) { NSLog(@"WARNING: a fetch is still in progress: %@", self); [self cancelFetch]; } if (isDebuggingEnabled) NSLog(@"%@ SQL: %@", self, sql); /* reset environment */ self->isFetchInProgress = NO; self->isDone = NO; self->hasPendingRow = NO; s = [sql UTF8String]; rc = sqlite3_prepare(self->_connection, s, strlen(s), (void *)&(self->statement), &tails); if (rc != SQLITE_OK) { NSString *r; [self cancelFetch]; // TODO: improve error r = [NSString stringWithFormat:@"could not parse SQL statement: %s", sqlite3_errmsg(self->_connection)]; return [SQLiteException exceptionWithName:@"ExecutionFailed" reason:r userInfo:nil]; } /* step to first row */ if ([sql hasPrefix:@"SELECT"] || [sql hasPrefix:@"select"]) { self->isFetchInProgress = YES; NSAssert(self->statement, @"missing statement"); } else { if ((error = [self _makeSQLiteStep]) != nil) { [self cancelFetch]; return error; } self->isFetchInProgress = self->hasPendingRow; if (!self->isFetchInProgress) { sqlite3_finalize(self->statement); self->statement = NULL; } } /* only on empty results? */ if (delegateRespondsTo.didEvaluateExpression) [delegate adaptorChannel:self didEvaluateExpression:sql]; return nil /* everything is OK */; } - (BOOL)evaluateExpression:(NSString *)_sql { NSException *e; NSString *n; if ((e = [self evaluateExpressionX:_sql]) == nil) return YES; /* for compatibility with non-X methods, translate some errors to a bool */ n = [e name]; if ([n isEqualToString:@"EOEvaluationError"]) return NO; if ([n isEqualToString:@"EODelegateRejects"]) return NO; [e raise]; return NO; } /* description */ - (NSString *)description { NSMutableString *ms; ms = [NSMutableString stringWithCapacity:64]; [ms appendFormat:@"<%@[0x%p] connection=0x%p", NSStringFromClass([self class]), self, self->_connection]; [ms appendString:@">"]; return ms; } @end /* SQLiteChannel */ @implementation SQLiteChannel(PrimaryKeyGeneration) - (NSDictionary *)primaryKeyForNewRowWithEntity:(EOEntity *)_entity { NSArray *pkeys; SQLiteAdaptor *adaptor; NSString *seqName, *seq; NSDictionary *pkey; pkeys = [_entity primaryKeyAttributeNames]; adaptor = (id)[[self adaptorContext] adaptor]; seqName = [adaptor primaryKeySequenceName]; pkey = nil; seq = nil; seq = ([seqName length] > 0) ? [NSString stringWithFormat:@"SELECT NEXTVAL ('%@')", seqName] : (id)[adaptor newKeyExpression]; NS_DURING { if ([self evaluateExpression:seq]) { id key = nil; NSLog(@"ERROR: new key creation is not implemented in SQLite yet!"); if ([self isFetchInProgress]) { NSLog(@"Primary key eval returned results .."); } // TODO NSLog(@"%s: PKEY GEN NOT IMPLEMENTED!", __PRETTY_FUNCTION__); [self cancelFetch]; if (key != nil) { pkey = [NSDictionary dictionaryWithObject:key forKey:[pkeys objectAtIndex:0]]; } } } NS_HANDLER { pkey = nil; } NS_ENDHANDLER; return pkey; } @end /* SQLiteChannel(PrimaryKeyGeneration) */ void __link_SQLiteChannel() { // used to force linking of object file __link_SQLiteChannel(); } SOPE/sope-gdl1/SQLite3/SQLiteContext.m0000644000000000000000000000422312242733417016233 0ustar rootroot/* SQLiteContext.m Copyright (C) 2003-2005 SKYRIX Software AG Author: Helge Hess (helge.hess@skyrix.com) This file is part of the SQLite Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "SQLiteContext.h" #include "SQLiteChannel.h" #include "common.h" @implementation SQLiteContext - (void)channelDidInit:_channel { if ([channels count] > 0) { [NSException raise:@"TooManyOpenChannelsException" format:@"SQLite3 only supports one channel per context"]; } [super channelDidInit:_channel]; } - (BOOL)primaryBeginTransaction { BOOL result; result = [[[channels lastObject] nonretainedObjectValue] evaluateExpression:@"BEGIN TRANSACTION"]; return result; } - (BOOL)primaryCommitTransaction { BOOL result; result = [[[channels lastObject] nonretainedObjectValue] evaluateExpression:@"COMMIT TRANSACTION"]; return result; } - (BOOL)primaryRollbackTransaction { BOOL result; result = [[[channels lastObject] nonretainedObjectValue] evaluateExpression:@"ROLLBACK TRANSACTION"]; return result; } - (BOOL)canNestTransactions { return NO; } // NSCopying methods - (id)copyWithZone:(NSZone *)zone { return [self retain]; } @end /* SQLiteContext */ void __link_SQLiteContext() { // used to force linking of object file __link_SQLiteContext(); } SOPE/sope-gdl1/SQLite3/SQLiteException.m0000644000000000000000000000324112242733417016544 0ustar rootroot/* SQLiteException.m Copyright (C) 2003-2005 Helge Hess Author: Helge Hess (helge.hess@opengroupware.org) This file is part of the SQLite Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import #import "SQLiteException.h" #include "common.h" @implementation SQLiteException + (void)raiseWithFormat:(NSString *)_format, ... { NSString *tmp = nil; va_list ap; va_start(ap, _format); tmp = [[NSString allocWithZone:[self zone]] initWithFormat:_format arguments:ap]; va_end(ap); AUTORELEASE(tmp); [[[self alloc] initWithName:NSStringFromClass([self class]) reason:tmp userInfo:nil] raise]; } @end @implementation SQLiteCouldNotOpenChannelException @end @implementation SQLiteCouldNotConnectException @end @implementation SQLiteCouldNotBindException @end void __link_SQLiteException() { // used to force linking of object file __link_SQLiteException(); } SOPE/sope-gdl1/SQLite3/SQLiteExpression.m0000644000000000000000000000537612242733417016760 0ustar rootroot/* SQLiteExpression.m Copyright (C) 2003-2005 Helge Hess Author: Helge Hess (helge.hess@opengroupware.org) This file is part of the SQLite Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include "SQLiteExpression.h" @implementation SQLiteExpression + (Class)selectExpressionClass { return [SQLiteSelectSQLExpression class]; } @end /* SQLiteExpression */ @implementation SQLiteSelectSQLExpression - (id)selectExpressionForAttributes:(NSArray *)attributes lock:(BOOL)flag qualifier:(EOSQLQualifier *)qualifier fetchOrder:(NSArray *)fetchOrder channel:(EOAdaptorChannel *)channel { lock = flag; [super selectExpressionForAttributes:attributes lock:flag qualifier:qualifier fetchOrder:fetchOrder channel:channel]; return self; } - (NSString *)fromClause { NSMutableString *fromClause; NSEnumerator *enumerator; BOOL first = YES; id key; fromClause = [NSMutableString stringWithCString:" "]; enumerator = [fromListEntities objectEnumerator]; // Compute the FROM list from all the aliases found in // entitiesAndPropertiesAliases dictionary. Note that this dictionary // contains entities and relationships. The last ones are there for // flattened attributes over reflexive relationships. while((key = [enumerator nextObject])) { if(first) first = NO; else [fromClause appendString:@", "]; [fromClause appendFormat:@"%@ %@", [key isKindOfClass:[EORelationship class]] ? [[key destinationEntity] externalName] // flattened attribute : [key externalName], // EOEntity [entitiesAndPropertiesAliases objectForKey:key]]; #if 0 if (lock) [fromClause appendString:@" HOLDLOCK"]; #endif } return fromClause; } @end /* SQLiteSelectSQLExpression */ void __link_SQLiteExpression() { // used to force linking of object file __link_SQLiteExpression(); } SOPE/sope-gdl1/SQLite3/SQLiteValues.m0000644000000000000000000000754412242733417016057 0ustar rootroot/* SQLiteValues.m Copyright (C) 1999-2005 MDlink online service center GmbH and Helge Hess Author: Helge Hess (helge@mdlink.de) This file is part of the SQLite Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import "SQLiteValues.h" #import "common.h" @implementation SQLiteDataTypeMappingException - (id)initWithObject:(id)_obj forAttribute:(EOAttribute *)_attr andSQLite3Type:(NSString *)_dt inChannel:(SQLiteChannel *)_channel; { NSDictionary *ui; NSString *typeName = nil; NSString *r; typeName = _dt; if (typeName == nil) typeName = [NSString stringWithFormat:@"Oid[%i]", _dt]; r = [NSString stringWithFormat: @"mapping between %@ and " @"SQLite type %@ is not supported", [_obj description], NSStringFromClass([_obj class]), typeName]; ui = [NSDictionary dictionaryWithObjectsAndKeys: _attr, @"attribute", _channel, @"channel", _obj, @"object", nil]; return [self initWithName:@"DataTypeMappingNotSupported" reason:r userInfo:ui]; } @end /* SQLiteDataTypeMappingException */ @implementation NSNull(SQLiteValues) - (NSString *)stringValueForSQLite3Type:(NSString *)_type attribute:(EOAttribute *)_attribute { return @"null"; } @end /* NSNull(SQLiteValues) */ @implementation NSObject(SQLiteValues) - (id)initWithSQLiteInt:(int)_value { if ([self respondsToSelector:@selector(initWithInt:)]) return [(NSNumber *)self initWithInt:_value]; if ([self respondsToSelector:@selector(initWithDouble:)]) return [(NSNumber *)self initWithDouble:_value]; if ([self respondsToSelector:@selector(initWithString:)]) { NSString *s; char buf[256]; sprintf(buf, "%i", _value); s = [[NSString alloc] initWithCString:buf]; self = [(NSString *)self initWithString:s]; [s release]; return self; } [self release]; return nil; } - (id)initWithSQLiteDouble:(double)_value { if ([self respondsToSelector:@selector(initWithDouble:)]) return [(NSNumber *)self initWithDouble:_value]; [self release]; return nil; } - (id)initWithSQLiteText:(const unsigned char *)_value { if ([self respondsToSelector:@selector(initWithString:)]) { NSString *s; s = [[NSString alloc] initWithUTF8String:(char *)_value]; self = [(NSString *)self initWithString:s]; [s release]; return self; } [self release]; return nil; } - (id)initWithSQLiteData:(const void *)_data length:(int)_length { if ([self respondsToSelector:@selector(initWithBytes:length:)]) return [(NSData *)self initWithBytes:_data length:_length]; if ([self respondsToSelector:@selector(initWithData:)]) { NSData *d; d = [[NSData alloc] initWithBytes:_data length:_length]; self = [(NSData *)self initWithData:d]; [d release]; return self; } [self release]; return nil; } @end /* NSObject(SQLiteValues) */ void __link_SQLiteValues() { // used to force linking of object file __link_SQLiteValues(); } SOPE/sope-gdl1/SQLite3/NSNumber+SQLiteVal.m0000644000000000000000000000572612242733417017027 0ustar rootroot/* SQLiteAdaptor.h Copyright (C) 2003-2005 SKYRIX Software AG Author: Helge Hess (helge.hess@skyrix.com) This file is part of the SQLite Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import #include "SQLiteChannel.h" #include "common.h" @implementation NSNumber(SQLiteValues) - (id)initWithSQLiteInt:(int)_value { return [self initWithInt:_value]; } - (id)initWithSQLiteDouble:(double)_value { return [self initWithDouble:_value]; } - (id)initWithSQLiteText:(const unsigned char *)_value { return index((char *)_value, '.') != NULL ? [self initWithDouble:atof((char *)_value)] : [self initWithInt:atoi((char *)_value)]; } - (id)initWithSQLiteData:(const void *)_value length:(int)_length { switch (_length) { case 1: return [self initWithUnsignedChar:*(char *)_value]; case 2: return [self initWithShort:*(short *)_value]; case 4: return [self initWithInt:*(int *)_value]; case 8: return [self initWithDouble:*(double *)_value]; } [self release]; return nil; } - (NSString *)stringValueForSQLite3Type:(NSString *)_type attribute:(EOAttribute *)_attribute { // TODO: can we avoid the lowercaseString? unsigned len; unichar c1; if ((len = [_type length]) == 0) return [self stringValue]; if (len < 4) return [self stringValue]; c1 = [_type characterAtIndex:0]; switch (c1) { case 'b': case 'B': if (![[_type lowercaseString] hasPrefix:@"bool"]) break; return [self boolValue] ? @"true" : @"false"; case 'm': case 'M': { if (![[_type lowercaseString] hasPrefix:@"money"]) break; return [@"$" stringByAppendingString:[self stringValue]]; } case 'c': case 'C': case 't': case 'T': case 'v': case 'V': { static NSMutableString *ms = nil; // reuse mstring, THREAD _type = [_type lowercaseString]; if (!([_type hasPrefix:@"char"] || [_type hasPrefix:@"varchar"] || [_type hasPrefix:@"text"])) break; // TODO: can we get this faster?! if (ms == nil) ms = [[NSMutableString alloc] initWithCapacity:256]; [ms setString:@"'"]; [ms appendString:[self stringValue]]; [ms appendString:@"'"]; return [[ms copy] autorelease]; } } return [self stringValue]; } @end /* NSNumber(SQLiteValues) */ SOPE/sope-gdl1/SQLite3/GNUmakefile.preamble0000644000000000000000000000373512242733417017216 0ustar rootroot# # GNUmakefile # # Copyright (C) 2003-2005 Helge Hess # # Author: Helge Hess (helge.hess@opengroupware.org) # # This file is part of the SQLite3 Adaptor Library # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; see the file COPYING.LIB. # If not, write to the Free Software Foundation, # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. SOPE_ROOT=../.. ifeq ($(frameworks),yes) BUNDLE_INSTALL_DIR := $(FRAMEWORK_INSTALL_DIR)/GDLAccess.framework/Resources/GDLAdaptors/ else BUNDLE_INSTALL_DIR = $(SOPE_DBADAPTORS)/ endif # SQLite3 config SQLite3_BUNDLE_LIBS += -lsqlite3 # set compile flags and go ADDITIONAL_INCLUDE_DIRS += \ -I../GDLAccess -I.. ADDITIONAL_INCLUDE_DIRS += \ -I.. -I../.. \ -I$(SOPE_ROOT)/sope-core/ \ -I$(SOPE_ROOT)/sope-core/NGExtensions # dependencies ifneq ($(frameworks),yes) SQLite3_BUNDLE_LIBS += -lGDLAccess -lEOControl gdltest_TOOL_LIBS += -lGDLAccess -lEOControl else SQLite3_BUNDLE_LIBS += -framework GDLAccess -framework EOControl gdltest_TOOL_LIBS += -framework GDLAccess -framework EOControl endif # library/framework search pathes DEP_DIRS = \ ../GDLAccess \ $(SOPE_ROOT)/sope-core/EOControl ifneq ($(frameworks),yes) ADDITIONAL_LIB_DIRS += \ $(foreach dir,$(DEP_DIRS),\ -L$(GNUSTEP_BUILD_DIR)/$(dir)/$(GNUSTEP_OBJ_DIR_NAME)) else ADDITIONAL_LIB_DIRS += \ $(foreach dir,$(DEP_DIRS),-F$(GNUSTEP_BUILD_DIR)/$(dir)) endif SYSTEM_LIB_DIR += $(CONFIGURE_SYSTEM_LIB_DIR) SOPE/sope-gdl1/SQLite3/gdltest.m0000644000000000000000000001234512242733417015177 0ustar rootroot/* gdltest.m Copyright (C) 1999-2005 MDlink online service center GmbH and Helge Hess Author: Helge Hess (helge@mdlink.de) This file is part of the SQLite Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import #import #include static void fetchExprInChannel(NSString *expr, EOAdaptorChannel *ch) { NSArray *attrs; NSDictionary *record; if (![ch evaluateExpression:expr]) { NSLog(@"ERROR: failed to evaluate: %@", expr); return; } attrs = [ch describeResults]; NSLog(@"results: %@", attrs); while ((record = [ch fetchAttributes:attrs withZone:nil]) != nil) NSLog(@"fetched %@", record); } static void fetchSomePersonRecord(EOEntity *e, EOAdaptorChannel *ch) { EOSQLQualifier *q; NSArray *attrs; attrs = [e attributes]; q = [[EOSQLQualifier alloc] initWithEntity:e qualifierFormat:@"%A='helge'", @"login"]; [q autorelease]; if ([ch selectAttributes:attrs describedByQualifier:q fetchOrder:nil lock:NO]) { NSDictionary *record; record = [ch fetchAttributes:attrs withZone:nil]; } else NSLog(@"Could not select .."); } static void fetchSomeTeamRecords(EOEntity *e, EOAdaptorChannel *ch) { EOSQLQualifier *q; NSArray *attrs; q = [e qualifier]; attrs = [e attributes]; if ([ch selectAttributes:attrs describedByQualifier:q fetchOrder:nil lock:NO]) { NSDictionary *record; while ((record = [ch fetchAttributes:attrs withZone:NULL]) != nil) { NSLog(@"fetched %@ birthday %@", [record valueForKey:@"description"], [record valueForKey:@"companyId"]); } } else NSLog(@"Could not select team records .."); } static void runtestInOpenChannel(EOAdaptorChannel *ch) { NSAutoreleasePool *pool = [NSAutoreleasePool new]; EOEntity *e; EOSQLQualifier *q; NSArray *attrs; EOAdaptorContext *ctx; EOModel *m; NSString *expr; ctx = [ch adaptorContext]; m = [[ctx adaptor] model]; expr = [[NSUserDefaults standardUserDefaults] stringForKey:@"sql"]; NSLog(@"channel is open"); if (![ctx beginTransaction]) { NSLog(@"ERROR: could not begin transaction ..."); return; } NSLog(@"began tx .."); /* do something */ pool = [[NSAutoreleasePool alloc] init]; #if 1 if (expr) fetchExprInChannel(expr, ch); #endif /* fetch some MyEntity records */ e = [m entityNamed:@"MyEntity"]; NSLog(@"entity: %@", e); if (e == nil) exit(1); q = [e qualifier]; attrs = [e attributes]; // NSLog(@"ATTRS: %@", attrs); if ([ch selectAttributes:attrs describedByQualifier:q fetchOrder:nil lock:NO]) { NSDictionary *record; while ((record = [ch fetchAttributes:attrs withZone:nil]) != nil) NSLog(@"fetched record: %@", record); } else NSLog(@"Could not select .."); /* some OGo fetches */ if ((e = [m entityNamed:@"Team"]) != nil) fetchSomeTeamRecords(e, ch); if ((e = [m entityNamed:@"Person"]) != nil) fetchSomePersonRecord(e, ch); /* tear down */ [pool release]; NSLog(@"committing tx .."); if ([ctx commitTransaction]) NSLog(@" could commit."); else NSLog(@" commit failed."); } static void runtest(void) { EOModel *m = nil; EOAdaptor *a; EOAdaptorContext *ctx; EOAdaptorChannel *ch; NSDictionary *conDict; NS_DURING { conDict = [NSDictionary dictionaryWithContentsOfFile:@"condict.plist"]; NSLog(@"condict is %@", conDict); if ((a = [EOAdaptor adaptorWithName:@"SQLite3"]) == nil) { NSLog(@"found no SQLite3 adaptor .."); exit(1); } NSLog(@"got adaptor %@", a); [a setConnectionDictionary:conDict]; NSLog(@"got adaptor with condict %@", a); ctx = [a createAdaptorContext]; ch = [ctx createAdaptorChannel]; #if 1 m = AUTORELEASE([[EOModel alloc] initWithContentsOfFile:@"test.eomodel"]); if (m) { [a setModel:m]; [a setConnectionDictionary:conDict]; } #endif NSLog(@"opening channel .."); [ch setDebugEnabled:YES]; if ([ch openChannel]) { runtestInOpenChannel(ch); NSLog(@"closing channel .."); [ch closeChannel]; } } NS_HANDLER { fprintf(stderr, "exception: %s\n", [[localException description] cString]); abort(); } NS_ENDHANDLER; } int main(int argc, char **argv, char **env) { NSAutoreleasePool *pool; pool = [[NSAutoreleasePool alloc] init]; [NSProcessInfo initializeWithArguments:argv count:argc environment:env]; runtest(); [pool release]; return 0; } SOPE/sope-gdl1/SQLite3/EOAttribute+SQLite.m0000644000000000000000000001414712242733417017057 0ustar rootroot/* EOAttribute+SQLite.m Copyright (C) 1999 MDlink online service center GmbH and Helge Hess Author: Helge Hess (helge@mdlink.de) This file is part of the SQLite Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "common.h" #import "EOAttribute+SQLite.h" static NSString *SQLITE3_DATETIME_FORMAT = @"%b %d %Y %I:%M:%S:000%p"; static NSString *SQLITE3_TIMESTAMP_FORMAT = @"%Y-%m-%d %H:%M:%S%z"; @implementation EOAttribute(SQLiteAttributeAdditions) - (void)loadValueClassAndTypeUsingSQLiteType:(int)_type size:(int)_size modification:(int)_modification binary:(BOOL)_isBinary { /* This method makes no sense with SQLite? */ if (_isBinary) [self setValueClassName:@"NSData"]; #if 0 switch (_type) { case BOOLOID: [self setExternalType:@"bool"]; [self setValueClassName:@"NSNumber"]; [self setValueType:@"i"]; return; case NAMEOID: [self setExternalType:@"name"]; [self setValueClassName:@"NSString"]; return; case TEXTOID: [self setExternalType:@"textoid"]; [self setValueClassName:@"NSString"]; return; case INT2OID: [self setExternalType:@"int2"]; [self setValueClassName:@"NSNumber"]; [self setValueType:@"d"]; return; case INT4OID: [self setExternalType:@"int4"]; [self setValueClassName:@"NSNumber"]; [self setValueType:@"d"]; return; case INT8OID: [self setExternalType:@"int8"]; [self setValueClassName:@"NSNumber"]; [self setValueType:@"d"]; return; case CHAROID: [self setExternalType:@"char"]; [self setValueClassName:@"NSString"]; break; case VARCHAROID: [self setExternalType:@"varchar"]; [self setValueClassName:@"NSString"]; break; case NUMERICOID: [self setExternalType:@"numeric"]; [self setValueClassName:@"NSNumber"]; [self setValueType:@"d"]; break; case FLOAT4OID: [self setExternalType:@"float4"]; [self setValueClassName:@"NSNumber"]; [self setValueType:@"f"]; break; case FLOAT8OID: [self setExternalType:@"float8"]; [self setValueClassName:@"NSNumber"]; [self setValueType:@"f"]; break; case DATEOID: [self setExternalType:@"datetime"]; [self setValueClassName:@"NSCalendarDate"]; [self setCalendarFormat:SQLITE3_DATETIME_FORMAT]; break; case TIMEOID: [self setExternalType:@"time"]; [self setValueClassName:@"NSCalendarDate"]; [self setCalendarFormat:SQLITE3_DATETIME_FORMAT]; break; case TIMESTAMPOID: [self setExternalType:@"timestamp"]; [self setValueClassName:@"NSCalendarDate"]; [self setCalendarFormat:SQLITE3_DATETIME_FORMAT]; break; case TIMESTAMPTZOID: [self setExternalType:@"timestamptz"]; [self setValueClassName:@"NSCalendarDate"]; [self setCalendarFormat:SQLITE3_DATETIME_FORMAT]; break; case BITOID: [self setExternalType:@"bit"]; break; default: NSLog(@"What is SQLITE3 Oid %i ???", _type); break; } #endif } - (void)loadValueClassForExternalSQLiteType:(NSString *)_type { if ([_type isEqualToString:@"bool"]) { [self setValueClassName:@"NSNumber"]; [self setValueType:@"i"]; } else if ([_type isEqualToString:@"int2"]) { [self setValueClassName:@"NSNumber"]; [self setValueType:@"i"]; } else if ([_type isEqualToString:@"int4"]) { [self setValueClassName:@"NSNumber"]; [self setValueType:@"i"]; } else if ([_type isEqualToString:@"float4"]) { [self setValueClassName:@"NSNumber"]; [self setValueType:@"f"]; } else if ([_type isEqualToString:@"float8"]) { [self setValueClassName:@"NSNumber"]; [self setValueType:@"d"]; } else if ([_type isEqualToString:@"decimal"]) { [self setValueClassName:@"NSNumber"]; [self setValueType:@"d"]; } else if ([_type isEqualToString:@"numeric"]) { [self setValueClassName:@"NSNumber"]; [self setValueType:@"d"]; } else if ([_type isEqualToString:@"name"]) { [self setExternalType:@"name"]; [self setValueClassName:@"NSString"]; } else if ([_type isEqualToString:@"varchar"]) { [self setExternalType:@"varchar"]; [self setValueClassName:@"NSString"]; } else if ([_type isEqualToString:@"char"]) { [self setExternalType:@"char"]; [self setValueClassName:@"NSString"]; } else if ([_type isEqualToString:@"timestamp"]) { [self setValueClassName:@"NSCalendarDate"]; [self setCalendarFormat:SQLITE3_TIMESTAMP_FORMAT]; } else if ([_type isEqualToString:@"timestamptz"]) { [self setValueClassName:@"NSCalendarDate"]; [self setCalendarFormat:SQLITE3_TIMESTAMP_FORMAT]; } else if ([_type isEqualToString:@"datetime"]) { [self setValueClassName:@"NSCalendarDate"]; [self setCalendarFormat:SQLITE3_DATETIME_FORMAT]; } else if ([_type isEqualToString:@"date"]) { [self setValueClassName:@"NSString"]; } else if ([_type isEqualToString:@"time"]) { [self setValueClassName:@"NSString"]; } else if ([_type isEqualToString:@"text"]) { [self setValueClassName:@"NSString"]; } else { NSLog(@"invalid argument %@", _type); [NSException raise:@"InvalidArgumentException" format:@"invalid SQLite type %@ passed to %s", _type, __PRETTY_FUNCTION__]; } } @end /* EOAttribute(SQLite) */ void __link_EOAttributeSQLite() { // used to force linking of object file __link_EOAttributeSQLite(); } SOPE/sope-gdl1/SQLite3/SQLite3-Info.plist0000644000000000000000000000126712242733417016546 0ustar rootroot CFBundleDevelopmentRegion English CFBundleExecutable SQLite3 CFBundleIdentifier org.OpenGroupware.SOPE.sope-gdl1.SQLite3 CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType BNDL CFBundleSignature ???? CFBundleVersion 4.5.21 NSPrincipalClass SQLite3Adaptor SOPE/sope-gdl1/SQLite3/SQLiteException.h0000644000000000000000000000262712242733417016546 0ustar rootroot/* SQLiteException.h Copyright (C) 1999-2005 MDlink online service center GmbH and Helge Hess Author: Helge Hess (helge@mdlink.de) This file is part of the SQLite Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ___SQLite_Exception_H___ #define ___SQLite_Exception_H___ #import @interface SQLiteException : NSException { } + (void)raiseWithFormat:(NSString *)_format, ...; @end @interface SQLiteCouldNotOpenChannelException : SQLiteException { } @end @interface SQLiteCouldNotConnectException : SQLiteCouldNotOpenChannelException { } @end @interface SQLiteCouldNotBindException : SQLiteException { } @end #endif /* ___SQLite_Exception_H___ */ SOPE/sope-gdl1/SQLite3/NSString+SQLiteVal.m0000644000000000000000000000602612242733417017037 0ustar rootroot/* SQLiteAdaptor.h Copyright (C) 2003-2005 SKYRIX Software AG Author: Helge Hess (helge.hess@skyrix.com) This file is part of the SQLite Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "SQLiteChannel.h" #include #import #include "common.h" @implementation NSString(SQLiteValues) static Class EOExprClass = Nil; - (id)initWithSQLiteInt:(int)_value { char buf[256]; sprintf(buf, "%i", _value); return [self initWithCString:buf]; } - (id)initWithSQLiteDouble:(double)_value { char buf[256]; sprintf(buf, "%g", _value); return [self initWithCString:buf]; } - (id)initWithSQLiteText:(const unsigned char *)_value { return [self initWithUTF8String:(char *)_value]; } - (id)initWithSQLiteData:(const void *)_value length:(int)_length { NSData *d; d = [[NSData alloc] initWithBytes:_value length:_length]; self = [self initWithData:d encoding:NSUTF8StringEncoding]; [d release]; return self; } /* generate SQL value */ - (NSString *)stringValueForSQLite3Type:(NSString *)_type attribute:(EOAttribute *)_attribute { // TODO: all this looks slow ... unsigned len; unichar c1; if ((len = [_type length]) == 0) return self; c1 = [_type characterAtIndex:0]; switch (c1) { case 'c': case 'C': // char case 'v': case 'V': // varchar case 't': case 'T': { // text NSString *s; id expr; if (len < 4) return self; _type = [_type lowercaseString]; if (!([_type hasPrefix:@"char"] || [_type hasPrefix:@"varchar"] || [_type hasPrefix:@"text"])) break; /* TODO: creates too many autoreleased strings :-( */ expr = [self stringByReplacingString:@"\\" withString:@"\\\\"]; if (EOExprClass == Nil) EOExprClass = [EOQuotedExpression class]; expr = [[EOExprClass alloc] initWithExpression:expr quote:@"'" escape:@"\\'"]; s = [[(EOQuotedExpression *)expr expressionValueForContext:nil] retain]; [expr release]; return [s autorelease]; } case 'i': case 'I': { // int char buf[128]; sprintf(buf, "%i", [self intValue]); return [NSString stringWithCString:buf]; } default: NSLog(@"WARNING(%s): return string as is for type %@", __PRETTY_FUNCTION__, _type); break; } return self; } @end /* NSString(SQLiteValues) */ SOPE/sope-gdl1/SQLite3/EOAttribute+SQLite.h0000644000000000000000000000253712242733417017052 0ustar rootroot/* EOAttribute+SQLite.h Copyright (C) 2003-2004 Helge Hess Author: Helge Hess (helge.hess@opengroupware.org) This file is part of the SQLite Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ___SQLite_EOAttribute_H___ #define ___SQLite_EOAttribute_H___ #import #include @class NSString; @interface EOAttribute(SQLiteAttributeAdditions) - (void)loadValueClassAndTypeUsingSQLiteType:(int)_type size:(int)_size modification:(int)_modification binary:(BOOL)_isBinary; - (void)loadValueClassForExternalSQLiteType:(NSString *)_type; @end #endif /* ___SQLite_EOAttribute_H___ */ SOPE/sope-gdl1/SQLite3/common.h0000644000000000000000000000233512242733417015012 0ustar rootroot/* common.h Copyright (C) 1999-2005 MDlink online service center GmbH and Helge Hess Author: Helge Hess (helge@mdlink.de) This file is part of the SQLite3 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ___SQLite3_common_H___ #define ___SQLite3_common_H___ #import #include #include #include #import #include #include #endif /* ___SQLite3_common_H___ */ SOPE/sope-gdl1/SQLite3/Version0000644000000000000000000000011612242733417014714 0ustar rootroot# Version file SUBMINOR_VERSION:=21 # v4.5.17 requires libGDLAccess v4.5.50 SOPE/sope-gdl1/SQLite3/NSString+SQLite.m0000644000000000000000000001070012242733417016366 0ustar rootroot/* NSString+SQLite.m Copyright (C) 1999 MDlink online service center GmbH and Helge Hess Author: Helge Hess (helge@mdlink.de) This file is part of the SQLite Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // $Id: NSString+SQLite.m,v 1.1 2004/06/14 14:27:44 helge Exp $ #if LIB_FOUNDATION_BOEHM_GC # include #endif #import #include "common.h" #import "NSString+SQLite.h" @implementation NSString(SQLiteMiscStrings) - (NSString *)_sqlite3ModelMakeInstanceVarName { if ([self length] == 0) return @""; else { unsigned clen = 0; char *s = NULL; int cnt, cnt2; clen = [self cStringLength]; s = malloc(clen + 10); [self getCString:s maxLength:clen]; for (cnt = cnt2 = 0; cnt < clen; cnt++, cnt2++) { if ((s[cnt] == '_') && (s[cnt + 1] != '\0')) { s[cnt2] = toupper(s[cnt + 1]); cnt++; } else if ((s[cnt] == '2') && (s[cnt + 1] != '\0')) { s[cnt2] = s[cnt]; cnt++; cnt2++; s[cnt2] = toupper(s[cnt]); } else s[cnt2] = tolower(s[cnt]); } s[cnt2] = '\0'; return [[[NSString alloc] initWithCStringNoCopy:s length:strlen(s) freeWhenDone:YES] autorelease]; } } - (NSString *)_sqlite3ModelMakeClassName { if ([self length] == 0) return @""; else { unsigned clen = 0; char *s = NULL; int cnt, cnt2; clen = [self cStringLength]; s = malloc(clen + 10); [self getCString:s maxLength:clen]; for (cnt = cnt2 = 0; cnt < clen; cnt++, cnt2++) { if ((s[cnt] == '_') && (s[cnt + 1] != '\0')) { s[cnt2] = toupper(s[cnt + 1]); cnt++; } else if ((s[cnt] == '2') && (s[cnt + 1] != '\0')) { s[cnt2] = s[cnt]; cnt++; cnt2++; s[cnt2] = toupper(s[cnt]); } else s[cnt2] = tolower(s[cnt]); } s[cnt2] = '\0'; s[0] = toupper(s[0]); return [[[NSString alloc] initWithCStringNoCopy:s length:strlen(s) freeWhenDone:YES] autorelease]; } } - (NSString *)_sqlite3StringWithCapitalizedFirstChar { NSCharacterSet *upperSet = [NSCharacterSet uppercaseLetterCharacterSet]; if ([self length] == 0) return @""; else if ([upperSet characterIsMember:[self characterAtIndex:0]]) return [[self copy] autorelease]; else { NSMutableString *str = [NSMutableString stringWithCapacity:[self length]]; [str appendString:[[self substringToIndex:1] uppercaseString]]; [str appendString:[self substringFromIndex:1]]; return [[str copy] autorelease]; } } - (NSString *)_sqlite3StripEndSpaces { if ([self isNotEmpty]) { NSCharacterSet *spaceSet; NSMutableString *str; unichar (*charAtIndex)(id, SEL, int); NSRange range; spaceSet = [NSCharacterSet whitespaceCharacterSet]; str = [NSMutableString stringWithCapacity:[self length]]; charAtIndex = (unichar (*)(id, SEL, int)) [self methodForSelector:@selector(characterAtIndex:)]; range.length = 0; for (range.location = ([self length] - 1); range.location >= 0; range.location++, range.length++) { unichar c; c = (unichar)(int)charAtIndex(self, @selector(characterAtIndex:), range.location); if (![spaceSet characterIsMember:c]) break; } if (range.length > 0) { [str appendString:self]; [str deleteCharactersInRange:range]; return AUTORELEASE([str copy]); } } return AUTORELEASE([self copy]); } @end void __link_NSStringSQLite() { // used to force linking of object file __link_NSStringSQLite(); } SOPE/sope-gdl1/SQLite3/COPYING.LIB0000644000000000000000000006126112242733417015014 0ustar rootroot GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, 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 library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] 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 Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, 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 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 a program 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. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, 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 companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. 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, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library 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 compile 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) 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. c) 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. d) 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 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. 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 to 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 Library 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 Appendix: 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 Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, 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! SOPE/sope-gdl1/SQLite3/SQLiteExpression.h0000644000000000000000000000304712242733417016744 0ustar rootroot/* SQLiteExpression.h Copyright (C) 1999-2005 MDlink online service center GmbH and Helge Hess Author: Helge Hess (helge@mdlink.de) This file is part of the SQLite Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ___SQLite3_SQLExpression_H___ #define ___SQLite3_SQLExpression_H___ #include @class NSString, NSArray; @class EOSQLQualifier, EOAdaptorChannel; @interface SQLiteExpression : EOSQLExpression + (Class)selectExpressionClass; @end @interface SQLiteSelectSQLExpression : EOSelectSQLExpression { BOOL lock; } - (id)selectExpressionForAttributes:(NSArray *)attributes lock:(BOOL)flag qualifier:(EOSQLQualifier *)qualifier fetchOrder:(NSArray *)fetchOrder channel:(EOAdaptorChannel *)channel; - (NSString *)fromClause; @end #endif /* ___SQLite3_SQLExpression_H___ */ SOPE/sope-gdl1/SQLite3/NSString+SQLite.h0000644000000000000000000000245112242733417016365 0ustar rootroot/* NSString+SQLite.h Copyright (C) 1999-2005 MDlink online service center GmbH and Helge Hess Author: Helge Hess (helge@mdlink.de) This file is part of the SQLite Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ___SQLite_NSString_H___ #define ___SQLite_NSString_H___ #import @interface NSString(SQLiteMiscStrings) - (NSString *)_sqlite3ModelMakeInstanceVarName; - (NSString *)_sqlite3ModelMakeClassName; - (NSString *)_sqlite3StringWithCapitalizedFirstChar; - (NSString *)_sqlite3StripEndSpaces; @end #endif /* ___SQLite_NSString_H___ */ SOPE/sope-gdl1/SQLite3/SQLiteContext.h0000644000000000000000000000225412242733417016230 0ustar rootroot/* SQLiteContext.h Copyright (C) 2003-2005 SKYRIX Software AG Author: Helge Hess (helge.hess@skyrix.com) This file is part of the SQLite Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ___SQLite_Context_H___ #define ___SQLite_Context_H___ #import @interface SQLiteContext : EOAdaptorContext - (BOOL)primaryBeginTransaction; - (BOOL)primaryCommitTransaction; - (BOOL)primaryRollbackTransaction; @end #endif SOPE/sope-gdl1/SQLite3/SQLiteChannel+Model.m0000644000000000000000000002520012242733417017211 0ustar rootroot/* SQLiteChannel+Model.m Copyright (C) 2003-2005 SKYRIX Software AG Author: Helge Hess (helge.hess@skyrix.com) This file is part of the SQLite Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "SQLiteChannel.h" #include "NSString+SQLite.h" #include "EOAttribute+SQLite.h" #include "common.h" @interface EORelationship(FixMe) - (void)addJoin:(id)_join; @end @implementation SQLiteChannel(ModelFetching) - (NSArray *)_attributesForTableName:(NSString *)_tableName { NSMutableArray *attributes; NSString *sqlExpr; NSArray *resultDescription; NSDictionary *row; if ([_tableName length] == 0) return nil; attributes = [self->_attributesForTableName objectForKey:_tableName]; if (attributes == nil) { #if 1 // TODO: we would need to parse the SQL field of 'sqlite_master'? NSLog(@"ERROR(%s): operation not supported on SQLite!", __PRETTY_FUNCTION__); return nil; #else sqlExpr = [NSString stringWithFormat:sqlExpr, _tableName]; #endif if (![self evaluateExpression:sqlExpr]) { fprintf(stderr, "Couldn`t evaluate column-describe '%s' on table '%s'\n", [sqlExpr cString], [_tableName cString]); return nil; } resultDescription = [self describeResults]; attributes = [NSMutableArray arrayWithCapacity:16]; while ((row = [self fetchAttributes:resultDescription withZone:NULL])) { EOAttribute *attribute; NSString *columnName = nil; NSString *externalType = nil; NSString *attrName = nil; columnName = [[row objectForKey:@"attname"] stringValue]; attrName = [columnName _sqlite3ModelMakeInstanceVarName]; externalType = [[row objectForKey:@"typname"] stringValue]; attribute = [[EOAttribute alloc] init]; [attribute setColumnName:columnName]; [attribute setName:attrName]; [attribute setExternalType:externalType]; [attribute loadValueClassForExternalSQLiteType:externalType]; [attributes addObject:attribute]; [attribute release]; } [self->_attributesForTableName setObject:attributes forKey:_tableName]; //NSLog(@"got attrs: %@", attributes); } return attributes; } - (NSArray *)_primaryKeysNamesForTableName:(NSString *)_tableName { //NSArray *pkNameForTableName = nil; if ([_tableName length] == 0) return nil; NSLog(@"ERROR(%s): operation not supported on SQLite!", __PRETTY_FUNCTION__); return nil; } - (NSArray *)_foreignKeysForTableName:(NSString *)_tableName { return nil; } - (EOModel *)describeModelWithTableNames:(NSArray *)_tableNames { // TODO: is this correct for SQLite?! NSMutableArray *buildRelShips; EOModel *model; int cnt, tc; buildRelShips = [NSMutableArray arrayWithCapacity:64]; model = [[[EOModel alloc] init] autorelease]; for (cnt = 0, tc = [_tableNames count]; cnt < tc; cnt++) { NSMutableDictionary *relNamesUsed; NSMutableArray *classProperties, *primaryKeyAttributes; NSString *tableName; NSArray *attributes, *pkeys, *fkeys; EOEntity *entity; int cnt2, ac, fkc; relNamesUsed = [NSMutableDictionary dictionaryWithCapacity:16]; classProperties = [NSMutableArray arrayWithCapacity:16]; primaryKeyAttributes = [NSMutableArray arrayWithCapacity:2]; tableName = [_tableNames objectAtIndex:cnt]; attributes = [self _attributesForTableName:tableName]; pkeys = [self _primaryKeysNamesForTableName:tableName]; fkeys = [self _foreignKeysForTableName:tableName]; entity = [[[EOEntity alloc] init] autorelease]; ac = [attributes count]; fkc = [fkeys count]; [entity setName:[tableName _sqlite3ModelMakeClassName]]; [entity setClassName: [@"EO" stringByAppendingString: [tableName _sqlite3ModelMakeClassName]]]; [entity setExternalName:tableName]; [classProperties addObjectsFromArray:[entity classProperties]]; [primaryKeyAttributes addObjectsFromArray:[entity primaryKeyAttributes]]; [model addEntity:entity]; for (cnt2 = 0; cnt2 < ac; cnt2++) { EOAttribute *attribute = [attributes objectAtIndex:cnt2]; NSString *columnName = [attribute columnName]; [entity addAttribute:attribute]; [classProperties addObject:attribute]; if ([pkeys containsObject:columnName]) [primaryKeyAttributes addObject:attribute]; } [entity setClassProperties:classProperties]; [entity setPrimaryKeyAttributes:primaryKeyAttributes]; for (cnt2 = 0; cnt2 < fkc; cnt2++) { NSDictionary *fkey; NSMutableArray *classProperties; NSString *sa, *da, *dt; EORelationship *rel; EOJoin *join; // TODO: fix me, EOJoin is deprecated NSString *relName; fkey = [fkeys objectAtIndex:cnt2]; classProperties = [NSMutableArray arrayWithCapacity:8]; sa = [fkey objectForKey:@"sourceAttr"]; da = [fkey objectForKey:@"targetAttr"]; dt = [fkey objectForKey:@"targetTable"]; rel = [[[EORelationship alloc] init] autorelease]; // TODO: fix me join = [[[NSClassFromString(@"EOJoin") alloc] init] autorelease]; if ([pkeys containsObject:sa]) { relName = [@"to" stringByAppendingString: [dt _sqlite3ModelMakeClassName]]; } else { relName = [@"to" stringByAppendingString: [[sa _sqlite3ModelMakeInstanceVarName] _sqlite3StringWithCapitalizedFirstChar]]; if ([relName hasSuffix:@"Id"]) { int cLength = [relName cStringLength]; relName = [relName substringToIndex:cLength - 2]; } } if ([relNamesUsed objectForKey:relName]) { int useCount = [[relNamesUsed objectForKey:relName] intValue]; [relNamesUsed setObject:[NSNumber numberWithInt:(useCount++)] forKey:relName]; relName = [NSString stringWithFormat:@"%s%d", [relName cString], useCount]; } else [relNamesUsed setObject:[NSNumber numberWithInt:0] forKey:relName]; [rel setName:relName]; //[rel setDestinationEntity:(EOEntity *)[dt _sqlite3ModelMakeClassName]]; [rel setToMany:NO]; // TODO: EOJoin is removed, fix this ... [(id)join setSourceAttribute: (EOAttribute *)[sa _sqlite3ModelMakeInstanceVarName]]; [(id)join setDestinationAttribute: (EOAttribute *)[da _sqlite3ModelMakeInstanceVarName]]; [rel addJoin:join]; [entity addRelationship:rel]; [classProperties addObjectsFromArray:[entity classProperties]]; [classProperties addObject:rel]; [entity setClassProperties:classProperties]; [buildRelShips addObject:rel]; } [entity setAttributesUsedForLocking:[entity attributes]]; } [buildRelShips makeObjectsPerformSelector: @selector(replaceStringsWithObjects)]; /* // make reverse relations { int cnt, rc = [buildRelShips count]; for (cnt = 0; cnt < rc; cnt++) { EORelationship *rel = [buildRelShips objectAtIndex:cnt]; NSMutableArray *classProperties = [NSMutableArray new]; EORelationship *reverse = [rel reversedRelationShip]; EOEntity *entity = [rel destinationEntity]; NSArray *pkeys = [entity primaryKeyAttributes]; BOOL isToMany = [reverse isToMany]; EOAttribute *sa = [[[reverse joins] lastObject] sourceAttribute]; NSString *relName = nil; if ([pkeys containsObject:sa] || isToMany) relName = [@"to" stringByAppendingString: [(EOEntity *)[reverse destinationEntity] name]]; else { relName = [@"to" stringByAppendingString: [[[sa name] _sqlite3ModelMakeInstanceVarName] _sqlite3StringWithCapitalizedFirstChar]]; if ([relName hasSuffix:@"Id"]) { int cLength = [relName cStringLength]; relName = [relName substringToIndex:cLength - 2]; } } if ([entity relationshipNamed:relName]) { int cnt = 1; NSString *numName; numName = [NSString stringWithFormat:@"%s%d", [relName cString], cnt]; while ([entity relationshipNamed:numName]) { cnt++; numName = [NSString stringWithFormat:@"%s%d", [relName cString], cnt]; } relName = numName; } [reverse setName:relName]; [entity addRelationship:reverse]; [classProperties addObjectsFromArray:[entity classProperties]]; [classProperties addObject:reverse]; [entity setClassProperties:classProperties]; } } */ [model setAdaptorName:@"SQLite"]; [model setAdaptorClassName:@"SQLiteAdaptor"]; [model setConnectionDictionary: [[adaptorContext adaptor] connectionDictionary]]; return model; } - (NSArray *)describeTableNames { NSMutableArray *tableNames = nil; NSArray *resultDescription = nil; NSString *attributeName = nil; NSDictionary *row = nil; NSString *selectExpression = nil; selectExpression = @"SELECT name FROM sqlite_master WHERE type='table'"; if (![self evaluateExpression:selectExpression]) { fprintf(stderr, "Could not evaluate table-describe expression '%s'\n", [selectExpression cString]); return nil; } resultDescription = [self describeResults]; attributeName = [(EOAttribute *)[resultDescription objectAtIndex:0] name]; tableNames = [NSMutableArray arrayWithCapacity:16]; while ((row = [self fetchAttributes:resultDescription withZone:NULL])!=nil) [tableNames addObject:[row objectForKey:attributeName]]; return tableNames; } @end /* SQLiteChannel(ModelFetching) */ void __link_SQLiteChannelModel() { // used to force linking of object file __link_SQLiteChannelModel(); } SOPE/sope-gdl1/Version0000644000000000000000000000037612242733417013500 0ustar rootroot# # This file is included by library makefiles to set the version information # of the executable. MAJOR_VERSION=4 MINOR_VERSION=9 # the SUBMINOR_VERSION is set by the Version file inside of a library project SOPE_MAJOR_VERSION=4 SOPE_MINOR_VERSION=9 SOPE/GNUmakefile0000644000000000000000000000241612242733417012404 0ustar rootroot# GNUstep makefile include ./config.make ifeq ($(GNUSTEP_MAKEFILES),) $(warning Note: Your $(GNUSTEP_MAKEFILES) environment variable is empty!) $(warning Either use ./configure or source GNUstep.sh.) else include $(GNUSTEP_MAKEFILES)/common.make SUBPROJECTS += \ sope-xml \ sope-core \ sope-mime \ sope-appserver \ sope-gdl1 \ sope-json ifeq ($(HAS_LIBRARY_ldap),yes) SUBPROJECTS += sope-ldap endif ifeq ($(FOUNDATION_LIB),apple) ifeq ($(frameworks),yes) SUBPROJECTS += sopex endif endif -include $(GNUSTEP_MAKEFILES)/GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/aggregate.make -include $(GNUSTEP_MAKEFILES)/GNUmakefile.postamble endif distclean :: if test -f config.make; then rm config.make; fi if test -d .gsmake; then rm -r .gsmake; fi if test -f config-NGStreams.log; then rm config-NGStreams.log; fi if test -f config-gstepmake.log; then rm config-gstepmake.log; fi macosx-pkg :: for i in $(SUBPROJECTS); do \ (cd $$i; $(MAKE) macosx-pkg); \ done ./maintenance/make-osxmpkg.sh \ "SOPE-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBMINOR_VERSION)" macosx-dmg :: macosx-pkg ./maintenance/make-osxdmg.sh \ "SOPE-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBMINOR_VERSION)" \ osxpkgbuild \ "SOPE $(MAJOR_VERSION).$(MINOR_VERSION).$(SUBMINOR_VERSION)" SOPE/sope-core/0000755000000000000000000000000012242733417012223 5ustar rootrootSOPE/sope-core/README0000644000000000000000000000042112242733417013100 0ustar rootrootsope-core ========= This repository contains the core libraries of the SOPE application server, that is, extensions to the Foundation library (NGExtensions), streaming IO and network classes (NGStreams), libraries for datastore abstractions (EOControl). TODO: write more SOPE/sope-core/GNUmakefile0000644000000000000000000000111312242733417014271 0ustar rootroot# GNUstep makefile include ../config.make include $(GNUSTEP_MAKEFILES)/common.make PACKAGE_NAME=sope-core VERSION=4.5.0 SUBPROJECTS += \ EOControl \ NGExtensions \ NGStreams # compile EOCoreData if we are on Tiger ifeq ($(findstring darwin8, $(GNUSTEP_TARGET_OS)), darwin8) SUBPROJECTS += EOCoreData endif ifeq ($(frameworks),yes) include umbrella.make endif # project makefiles include $(GNUSTEP_MAKEFILES)/aggregate.make ifeq ($(frameworks),yes) include $(GNUSTEP_MAKEFILES)/framework.make endif # package macosx-pkg :: all ../maintenance/make-osxpkg.sh $(PACKAGE_NAME) SOPE/sope-core/COPYING0000644000000000000000000006130312242733417013261 0ustar rootroot GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 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. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] 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 Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, 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 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 a program 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. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, 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 companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. 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, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library 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 compile 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) 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. c) 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. d) 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 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. 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 to 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 Library 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 Appendix: 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 Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library 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! SOPE/sope-core/COPYRIGHT0000644000000000000000000000010512242733417013512 0ustar rootrootCopyright (C) 2000-2005 SKYRIX Software AG Contact: info@skyrix.com SOPE/sope-core/common.make0000644000000000000000000000111112242733417014344 0ustar rootroot# GNUstep makefile SKYROOT=.. include $(GNUSTEP_MAKEFILES)/common.make include $(SKYROOT)/Version -include ./Version ADDITIONAL_CPPFLAGS += -pipe -Wall -Wno-protocol ifeq ($(reentrant),yes) ADDITIONAL_CPPFLAGS += -D_REENTRANT=1 endif ADDITIONAL_INCLUDE_DIRS += \ -I.. -I../NGStreams/ \ -I../../sope-xml ADDITIONAL_LIB_DIRS += \ -L./$(GNUSTEP_OBJ_DIR) \ -L../../sope-xml/SaxObjC/$(GNUSTEP_OBJ_DIR) \ -L../../sope-xml/DOM/$(GNUSTEP_OBJ_DIR) \ -L../../sope-xml/XmlRpc/$(GNUSTEP_OBJ_DIR) ifeq ($(FOUNDATION_LIB),nx) ADDITIONAL_LDFLAGS += -framework Foundation endif SOPE/sope-core/ChangeLog0000644000000000000000000000650012242733417013776 0ustar rootroot2008-03-04 Marcus Mueller * README-OSX.txt: Updated 2005-08-26 Helge Hess * all makefiles: add common.h as the precompiled header file 2005-08-17 Helge Hess * added sope-core umbrella framework 2005-08-10 Helge Hess * all makefiles: added flags to build only frameworks on MacOSX 2005-08-08 Marcus Mueller * README-OSX.txt: updated prebinding info 2004-10-17 Helge Hess * all makefiles: include config.make if available 2004-09-22 Marcus Mueller * sope-core.xcode: Fixed wrong build order 2004-09-21 Marcus Mueller * sope-core.xcode: Fixed dependencies to resemble the make process more closely. Our aim should be to stick to the make process as closely as possible, so we shouldn't introduce dependencies in non-toplevel projects. 2004-08-29 Marcus Mueller * sope-core.xcode: fixed file encodings * SxCore*: removed old Xcode and related files 2004-08-23 Marcus Mueller * added new sope-core.xcode 2004-08-20 Helge Hess * common.make: updated for new SOPE 4.3 hierarchy * updated Version to 4.3 2004-08-16 Marcus Mueller * SxCore.xcode: added NGCalendarDateRange.[hm] 2004-07-21 Marcus Mueller * SxCore.xcode: fixed incorrect framework search paths. 2004-07-21 Marcus Mueller * README-OSX.txt: Major overhaul for build description, especially the Xcode section. 2004-07-16 Marcus Mueller * SxCore.xcode: added 'Wrapper' build style and 'Wrapper Contents' target. Use these to build the frameworks in an appropriate form to have them embedded in an applications app wrapper's 'Frameworks' folder. * SxCore.xcode: LDAP related targets link against new LDAP system framework now. 2004-06-11 Marcus Mueller * SxCore.xcode: removed NGCString from NGExtensions (deprecated) 2004-06-09 Helge Hess * common.make: removed local ADDITIONAL_LIB_DIRS since those might not yet be available during compilation, which in turn prints warnings with Apple gcc 2004-05-09 Helge Hess * SxCore.xcode: added subclassing test tool 2004-03-24 Marcus Mueller * SxCore.xcode: added NSString+German.[hm] in NGExtensions. Also, added -headerpad_max_install_names link option where appropriate. 2004-03-15 Helge Hess * SxCore.xcode: added new plist categories in NGExtensions to Xcode project 2004-03-08 Helge Hess * SxCore.xcode: added new source files in EOControl to Xcode project * README-OSX.txt: added some build notes 2004-02-10 Marcus Mueller * SxCore.xcode: Updated prebinding information according to README-OSX.txt. Also, added Foundation.framework explicitly to all subprojects. * README-OSX.txt: New README currently describing prebinding information for Mac OS X. * ChangeLog: created. SOPE/sope-core/EOControl/0000755000000000000000000000000012242733417014067 5ustar rootrootSOPE/sope-core/EOControl/fhs.make0000644000000000000000000000201712242733417015506 0ustar rootroot# postprocessing # FHS support (this is a hack and is going to be done by gstep-make!) ifneq ($(FHS_INSTALL_ROOT),) FHS_INCLUDE_DIR=$(FHS_INSTALL_ROOT)/include/ FHS_LIB_DIR=$(FHS_INSTALL_ROOT)/lib/ FHS_BIN_DIR=$(FHS_INSTALL_ROOT)/bin/ ifeq ($(findstring _64, $(GNUSTEP_TARGET_CPU)), _64) FHS_LIB_DIR=$(FHS_INSTALL_ROOT)/lib64/ else FHS_LIB_DIR=$(FHS_INSTALL_ROOT)/lib/ endif fhs-header-dirs :: $(MKDIRS) $(FHS_INCLUDE_DIR)$(libEOControl_HEADER_FILES_INSTALL_DIR) move-headers-to-fhs :: fhs-header-dirs @echo "moving headers to $(FHS_INCLUDE_DIR) .." mv -f $(GNUSTEP_HEADERS)$(libEOControl_HEADER_FILES_INSTALL_DIR)/*.h \ $(FHS_INCLUDE_DIR)$(libEOControl_HEADER_FILES_INSTALL_DIR)/ NONFHS_LIBDIR="$(GNUSTEP_LIBRARIES)/$(GNUSTEP_TARGET_LDIR)/" NONFHS_LIBNAME="$(LIBRARY_NAME)$(LIBRARY_NAME_SUFFIX)$(SHARED_LIBEXT)" move-libs-to-fhs :: @echo "moving libs to $(FHS_LIB_DIR) .." mv -f $(NONFHS_LIBDIR)/$(NONFHS_LIBNAME)* $(FHS_LIB_DIR)/ move-to-fhs :: move-headers-to-fhs move-libs-to-fhs after-install :: move-to-fhs endif SOPE/sope-core/EOControl/README0000644000000000000000000000030712242733417014747 0ustar rootrootEOControl ========= TODO: Intro Qualifiers / Sorting / Fetch-Spec ================================= TODO: explain Datasources =========== TODO: explain Primary Keys ============ TODO: explain SOPE/sope-core/EOControl/EOGlobalID.h0000644000000000000000000000235012242733417016101 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __EOControl_EOGlobalID_H__ #define __EOControl_EOGlobalID_H__ #import @class NSArray; @class EOFetchSpecification; #define EOUniqueBinaryKeyLength 12 @interface EOGlobalID : NSObject < NSCopying > { } - (BOOL)isTemporary; @end @interface EOTemporaryGlobalID : EOGlobalID { unsigned char idbuffer[EOUniqueBinaryKeyLength]; } + (void)assignGloballyUniqueBytes:(unsigned char *)_buffer; @end #endif /* __EOControl_EOGlobalID_H__ */ SOPE/sope-core/EOControl/GNUmakefile0000644000000000000000000000370112242733417016142 0ustar rootroot# GNUstep makefile include ../../config.make include ../common.make ifneq ($(frameworks),yes) LIBRARY_NAME = libEOControl else FRAMEWORK_NAME = EOControl endif libEOControl_PCH_FILE = common.h libEOControl_DLL_DEF = libEOControl.def libEOControl_INTERFACE_VERSION=$(MAJOR_VERSION).$(MINOR_VERSION) libEOControl_INSTALL_DIR=$(SOPE_SYSLIBDIR) libEOControl_VERSION=$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBMINOR_VERSION) libEOControl_HEADER_FILES_DIR = . libEOControl_HEADER_FILES_INSTALL_DIR = /EOControl libEOControl_HEADER_FILES = \ EOArrayDataSource.h \ EOClassDescription.h \ EOControl.h \ EOControlDecls.h \ EODataSource.h \ EODetailDataSource.h \ EOFetchSpecification.h \ EOGenericRecord.h \ EOGlobalID.h \ EOKeyGlobalID.h \ EOKeyValueArchiver.h \ EOKeyValueCoding.h \ EONull.h \ EOObserver.h \ EOQualifier.h \ EOSortOrdering.h \ EOSQLParser.h \ libEOControl_OBJC_FILES = \ EOAndQualifier.m \ EOArrayDataSource.m \ EOClassDescription.m \ EODataSource.m \ EODetailDataSource.m \ EOFetchSpecification.m \ EOGenericRecord.m \ EOGlobalID.m \ EOKeyComparisonQualifier.m \ EOKeyGlobalID.m \ EOKeyValueArchiver.m \ EOKeyValueCoding.m \ EOKeyValueQualifier.m \ EONotQualifier.m \ EONull.m \ EOObserver.m \ EOOrQualifier.m \ EOQualifier.m \ EOQualifierParser.m \ EOSortOrdering.m \ EOValidation.m \ NSArray+EOQualifier.m \ NSObject+EOQualifierOps.m \ EOSQLParser.m \ EOQualifierVariable.m \ NSObject+QualDesc.m \ # framework support EOControl_PCH_FILE = $(libEOControl_PCH_FILE) EOControl_HEADER_FILES = $(libEOControl_HEADER_FILES) EOControl_OBJC_FILES = $(libEOControl_OBJC_FILES) # building -include GNUmakefile.preamble ifneq ($(FHS_INSTALL_ROOT),) GNUSTEP_HEADERS=$(DESTDIR)$(FHS_INSTALL_ROOT)/include endif ifneq ($(frameworks),yes) include $(GNUSTEP_MAKEFILES)/library.make else include $(GNUSTEP_MAKEFILES)/framework.make endif -include GNUmakefile.postamble SOPE/sope-core/EOControl/EONotQualifier.m0000644000000000000000000001023312242733417017072 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include "common.h" @interface NSObject(QualifierDescription) - (NSString *)qualifierDescription; @end @interface EOQualifier(EvalContext) - (BOOL)evaluateWithObject:(id)_object inEvalContext:(id)_ctx; @end @implementation EONotQualifier - (id)initWithQualifier:(EOQualifier *)_qualifier { self->qualifier = [_qualifier retain]; return self; } - (void)dealloc { [self->qualifier release]; [super dealloc]; } /* accessors */ - (EOQualifier *)qualifier { return self->qualifier; } - (unsigned int)count { return self->qualifier ? 1 : 0; } - (NSArray *)subqualifiers { return self->qualifier ? [NSArray arrayWithObject:self->qualifier] : nil; } /* bindings */ - (EOQualifier *)qualifierWithBindings:(NSDictionary *)_bindings requiresAllVariables:(BOOL)_reqAll { EOQualifier *nq; nq = [self->qualifier qualifierWithBindings:_bindings requiresAllVariables:_reqAll]; if (nq == nil) return self; if (nq == self->qualifier) return self; return [[[[self class] alloc] initWithQualifier:nq] autorelease]; } - (NSArray *)bindingKeys { return [self->qualifier bindingKeys]; } /* keys */ - (void)addQualifierKeysToSet:(NSMutableSet *)_keys { /* new in WO 4.5 */ [self->qualifier addQualifierKeysToSet:_keys]; } /* evaluation */ - (BOOL)evaluateWithObject:(id)_object inEvalContext:(id)_ctx { return [self->qualifier evaluateWithObject:_object inEvalContext:_ctx] ? NO : YES; } - (BOOL)evaluateWithObject:(id)_object { return [self evaluateWithObject:_object inEvalContext:nil]; } /* NSCoding */ - (void)encodeWithCoder:(NSCoder *)_coder { [_coder encodeObject:self->qualifier]; } - (id)initWithCoder:(NSCoder *)_coder { self->qualifier = [[_coder decodeObject] retain]; return self; } /* Comparing */ - (BOOL)isEqualToQualifier:(EOQualifier *)_qual { return [self->qualifier isEqual:[(EONotQualifier *)_qual qualifier]]; } /* remapping keys */ - (EOQualifier *)qualifierByApplyingTransformer:(id)_transformer inContext:(id)_ctx { if ([_transformer respondsToSelector: @selector(transformNotQualifier:inContext:)]) { return [_transformer transformNotQualifier:self inContext:_ctx]; } else { EONotQualifier *nq; EOQualifier *q; q = [self->qualifier qualifierByApplyingTransformer:_transformer inContext:_ctx]; nq = [[EONotQualifier alloc] initWithQualifier:(q ? q : self->qualifier)]; return [nq autorelease]; } } - (EOQualifier *)qualifierByApplyingKeyMap:(NSDictionary *)_map { EONotQualifier *nq; EOQualifier *q; q = [self->qualifier qualifierByApplyingKeyMap:_map]; nq = [[EONotQualifier alloc] initWithQualifier:(q ? q : self->qualifier)]; return [nq autorelease]; } /* key/value archiving */ - (id)initWithKeyValueUnarchiver:(EOKeyValueUnarchiver *)_unarchiver { if ((self = [super initWithKeyValueUnarchiver:_unarchiver]) != nil) { self->qualifier = [[_unarchiver decodeObjectForKey:@"qualifier"] copy]; } return self; } - (void)encodeWithKeyValueArchiver:(EOKeyValueArchiver *)_archiver { [super encodeWithKeyValueArchiver:_archiver]; [_archiver encodeObject:[self qualifier] forKey:@"qualifier"]; } /* description */ - (NSString *)description { NSString *qd; qd = [self->qualifier qualifierDescription]; return [[@"NOT (" stringByAppendingString:qd] stringByAppendingString:@")"]; } @end /* EONotQualifier */ SOPE/sope-core/EOControl/EOSQLParser.m0000644000000000000000000005061112242733417016310 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "EOSQLParser.h" #include "EOQualifier.h" #include "EOFetchSpecification.h" #include "EOSortOrdering.h" #include "EOClassDescription.h" #include "common.h" // TODO: better error output @interface EOSQLParser(Logging) /* this is available in NGExtensions */ - (void)logWithFormat:(NSString *)_fmt,...; @end @implementation EOSQLParser + (id)sharedSQLParser { static EOSQLParser *sharedParser = nil; // THREAD if (sharedParser == nil) sharedParser = [[EOSQLParser alloc] init]; return sharedParser; } - (void)dealloc { [super dealloc]; } /* top level parsers */ - (EOFetchSpecification *)parseSQLSelectStatement:(NSString *)_sql { EOFetchSpecification *fs; unichar *us, *pos; unsigned len, remainingLen; if ((len = [_sql length]) == 0) return nil; us = calloc(len + 10, sizeof(unichar)); [_sql getCharacters:us]; us[len] = 0; pos = us; remainingLen = len; if (![self parseSQL:&fs from:&pos length:&remainingLen strict:NO]) [self logWithFormat:@"parsing of SQL failed."]; free(us); return [fs autorelease]; } - (EOQualifier *)parseSQLWhereExpression:(NSString *)_sql { // TODO: process %=>* and %%, and $ unichar *buf; unsigned i, len; BOOL didReplace; if ((len = [_sql length]) == 0) return nil; // TODO: improve, real parsing in qualifier parser ! buf = calloc(len + 3, sizeof(unichar)); NSAssert(buf, @"could not allocate char buffer"); [_sql getCharacters:buf]; for (i = 0, didReplace = NO; i < len; i++) { if (buf[i] != '%') { if (buf[i] == '*') { NSLog(@"WARNING(%s): SQL string contains a '*': %@", __PRETTY_FUNCTION__, _sql); } continue; } buf[i] = '%'; didReplace = YES; } if (didReplace) _sql = [NSString stringWithCharacters:buf length:len]; if (buf) free(buf); return [EOQualifier qualifierWithQualifierFormat:_sql]; } /* parsing parts (exported for overloading in subclasses) */ static inline BOOL uniIsCEq(unichar *haystack, const unsigned char *needle, unsigned len) { register unsigned idx; for (idx = 0; idx < len; idx++) { if (*needle == '\0') return YES; if (toupper(haystack[idx]) != needle[idx]) return NO; } return YES; } static inline void skipSpaces(unichar **pos, unsigned *len) { while (*len > 0) { if (!isspace(*pos[0])) return; (*len)--; (*pos)++; } } static void printUniStr(unichar *pos, unsigned len) __attribute__((unused)); static void printUniStr(unichar *pos, unsigned len) { unsigned i; for (i = 0; i < len && i < 80; i++) putchar(pos[i]); putchar('\n'); } static inline BOOL isTokStopChar(unichar c) { switch (c) { case 0: case ')': case '(': case '"': case '\'': return YES; default: if (isspace(c)) return YES; return NO; } } - (BOOL)parseToken:(const unsigned char *)tk from:(unichar **)pos length:(unsigned *)len consume:(BOOL)consume { /* ...[space] (strlen(tk)+1 chars) */ unichar *scur; unsigned slen, tlen; tlen = strlen((const char *)tk); scur=*pos; slen=*len; // begin transaction skipSpaces(&scur, &slen); if (slen < tlen) return NO; if (toupper(scur[0]) != tk[0]) return NO; if (tlen < slen) { /* if tok is not at the end */ if (!isTokStopChar(scur[tlen])) return NO; /* not followed by a token stopper */ } if (!uniIsCEq(scur, tk, tlen)) return NO; scur+=tlen; slen-=tlen; if (consume) { *pos = scur; *len = slen; } // end tx return YES; } - (BOOL)parseIdentifier:(NSString **)result from:(unichar **)pos length:(unsigned *)len consume:(BOOL)consume { /* "attr" or attr (at least 1 char or 2 for ") */ unichar *scur; unsigned slen; if (result) *result = nil; scur=*pos; slen=*len; // begin transaction skipSpaces(&scur, &slen); if (*scur == '"') { /* quoted attr */ unichar *start; //printf("try quoted attr\n"); if (slen < 2) return NO; scur++; slen--; /* skip quote */ if (*scur == '"') { /* empty name */ scur++; slen--; if (consume) { *pos = scur; *len = slen; } // end transaction *result = @""; //printf("is empty quoted\n"); return YES; } if (slen < 2) return NO; start = scur; while ((slen > 0) && (*scur != '"')) { if (*scur == '\\' && (slen > 1)) { /* quoted char */ scur++; slen--; // skip one more (still needs to be filtered in result } scur++; slen--; } if (slen > 0) { scur++; slen--; } /* skip quote */ // TODO: xhandle contained quoted chars ? *result = [[NSString alloc] initWithCharacters:start length:(scur-start-1)]; //NSLog(@"found qattr: %@", *result); } else { /* non-quoted attr */ unichar *start; if (slen < 1) return NO; if ([self parseToken:(const unsigned char *)"FROM" from:&scur length:&slen consume:NO]) { /* not an attribute, the from starts ... */ // printf("rejected unquoted attr, is a FROM\n"); return NO; } if ([self parseToken:(const unsigned char *)"WHERE" from:&scur length:&slen consume:NO]) { /* not an attribute, the where starts ... */ // printf("rejected unquoted attr, is a WHERE\n"); return NO; } start = scur; while ((slen > 0) && !isspace(*scur) && (*scur != ',')) { slen--; scur++; } *result = [[NSString alloc] initWithCharacters:start length:(scur-start)]; //NSLog(@"found attr: %@ (len=%i)", *result, (scur-start)); } if (consume && result) { *pos = scur; *len = slen; } // end transaction return *result ? YES : NO; } - (BOOL)parseColumnName:(NSString **)result from:(unichar **)pos length:(unsigned *)len consume:(BOOL)consume { return [self parseIdentifier:result from:pos length:len consume:consume]; } - (BOOL)parseTableName:(NSString **)result from:(unichar **)pos length:(unsigned *)len consume:(BOOL)consume { return [self parseIdentifier:result from:pos length:len consume:consume]; } - (BOOL)parseIdentifierList:(NSArray **)result from:(unichar **)pos length:(unsigned *)len selector:(SEL)_sel { /* attr[,attr] */ NSMutableArray *attrs = nil; unichar *scur; unsigned slen; id attr; BOOL (*parser)(id, SEL, NSString **, unichar **, unsigned *, BOOL); if (result) *result = nil; scur=*pos; slen=*len; // begin transaction skipSpaces(&scur, &slen); parser = (void *)[self methodForSelector:_sel]; if (slen < 1) return NO; // not enough chars if (*scur == '*') { /* a wildcard list, return 'nil' as result */ //printf("try wildcard\n"); scur++; slen--; // skip '*' if (!(slen == 0 || isspace(*scur))) { /* not followed by space or at end */ return NO; } *pos = scur; *len = slen; // end transaction *result = nil; return YES; } if (!parser(self, _sel, &attr,&scur,&slen,YES)) /* well, we need at least one attribute to make it a list */ return NO; attrs = [[NSMutableArray alloc] initWithCapacity:32]; [attrs addObject:attr]; [attr release]; /* all the remaining attributes must be prefixed with a "," */ while (slen > 1) { //printf("try next list attr comma\n"); skipSpaces(&scur, &slen); if (slen < 2) break; if (*scur != ',') break; scur++; slen--; // skip ',' //printf("try next list attr\n"); if (!parser(self, _sel, &attr,&scur,&slen,YES)) break; [attrs addObject:attr]; [attr release]; } *pos = scur; *len = slen; // end transaction *result = attrs; return YES; } - (BOOL)parseContainsQualifier:(EOQualifier **)q_ from:(unichar **)pos length:(unsigned *)len { /* contains('"hh@"') [12+ chars] */ unichar *scur; unsigned slen; NSString *s; if (q_) *q_ = nil; skipSpaces(&scur, &slen); if (slen < 12) return NO; // not enough chars if (![self parseToken:(const unsigned char *)"CONTAINS" from:pos length:len consume:YES]) return NO; skipSpaces(&scur, &slen); [self parseToken:(const unsigned char *)"('" from:&scur length:&slen consume:YES]; if (![self parseIdentifier:&s from:&scur length:&slen consume:YES]) return NO; skipSpaces(&scur, &slen); [self parseToken:(const unsigned char *)"')" from:&scur length:&slen consume:YES]; *q_ = [[EOQualifier qualifierWithQualifierFormat: @"contentAsString doesContain: %@", s] retain]; if (*q_) { *pos = scur; *len = slen; // end transaction return YES; } else return NO; } - (BOOL)parseQualifier:(EOQualifier **)result from:(unichar **)pos length:(unsigned *)len { unichar *scur; unsigned slen; if (result) *result = nil; scur=*pos; slen=*len; // begin transaction skipSpaces(&scur, &slen); if (slen < 3) return NO; // not enough chars // for now should scan till we find either ORDER BY order GROUP BY { unichar *start = scur; while (slen > 0) { if (*scur == 'O' || *scur == 'o') { if ([self parseToken:(const unsigned char *)"ORDER" from:&scur length:&slen consume:NO]) { //printf("FOUND ORDER TOKEN ...\n"); break; } } else if (*scur == 'G' || *scur == 'g') { if ([self parseToken:(const unsigned char *)"GROUP" from:&scur length:&slen consume:NO]) { //printf("FOUND GROUP TOKEN ...\n"); break; } } scur++; slen--; } { EOQualifier *q; NSString *s; s = [[NSString alloc] initWithCharacters:start length:(scur-start)]; if ([s length] == 0) { [s release]; return NO; } if ((q = [self parseSQLWhereExpression:s]) == nil) { [s release]; return NO; } *result = [q retain]; [s release]; } } *pos = scur; *len = slen; // end transaction return YES; } - (BOOL)parseScope:(NSString **)_scope:(NSString **)_entity from:(unichar **)pos length:(unsigned *)len { /* "('shallow traversal of "..."')" "('hierarchical traversal of "..."')" */ unichar *scur; unsigned slen; NSString *entityName; BOOL isShallow = NO; // BOOL isDeep = NO; if (_scope) *_scope = nil; if (_entity) *_entity = nil; scur=*pos; slen=*len; // begin transaction skipSpaces(&scur, &slen); if (slen < 14) return NO; // not enough chars if (*scur != '(') return NO; // does not start with '(' scur++; slen--; // skip '(' skipSpaces(&scur, &slen); if (*scur != '\'') return NO; // does not start with '('' scur++; slen--; // skip single quote /* next the depth */ if ([self parseToken:(const unsigned char *)"SHALLOW" from:&scur length:&slen consume:YES]) isShallow = YES; else if ([self parseToken:(const unsigned char *)"HIERARCHICAL" from:&scur length:&slen consume:YES]) ; // isDeep = YES; else if ([self parseToken:(const unsigned char *)"DEEP" from:&scur length:&slen consume:YES]) ; // isDeep = YES; else /* unknown traveral key */ return NO; /* some syntactic sugar (not strict about that ...) */ [self parseToken:(const unsigned char *)"TRAVERSAL" from:&scur length:&slen consume:YES]; [self parseToken:(const unsigned char *)"OF" from:&scur length:&slen consume:YES]; if (slen < 1) return NO; // not enough chars /* now the entity */ skipSpaces(&scur, &slen); if (![self parseTableName:&entityName from:&scur length:&slen consume:YES]) return NO; // failed to parse entity from scope /* trailer */ skipSpaces(&scur, &slen); if (slen > 0 && *scur == '\'') { scur++; slen--; // skip single quote } skipSpaces(&scur, &slen); if (slen > 0 && *scur == ')') { scur++; slen--; // skip ')' } if (_scope) *_scope = isShallow ? @"flat" : @"deep"; if (_entity) *_entity = entityName; *pos = scur; *len = slen; // end transaction return YES; } - (BOOL)parseSELECT:(EOFetchSpecification **)result from:(unichar **)pos length:(unsigned *)len strict:(BOOL)beStrict { EOFetchSpecification *fs; NSMutableDictionary *lHints; NSString *scope = nil; NSArray *attrs = nil; NSArray *fromList = nil; NSArray *orderList = nil; NSArray *lSortOrderings = nil; EOQualifier *q = nil; BOOL hasSelect = NO; BOOL hasFrom = NO; BOOL missingByOfOrder = NO; *result = nil; if (![self parseToken:(const unsigned char *)"SELECT" from:pos length:len consume:YES]) { /* must begin with SELECT */ if (beStrict) return NO; } else hasSelect = YES; if (![self parseIdentifierList:&attrs from:pos length:len selector:@selector(parseColumnName:from:length:consume:)]) { [self logWithFormat:@"missing ID list .."]; return NO; } //[self debugWithFormat:@"parsed attrs (%i): %@", [attrs count], attrs]; /* now a from is expected */ if ([self parseToken:(const unsigned char *)"FROM" from:pos length:len consume:YES]) hasFrom = YES; else { if (beStrict) return NO; } /* check whether it's followed by a scope */ if ([self parseToken:(const unsigned char *)"SCOPE" from:pos length:len consume:YES]) { NSString *scopeEntity = nil; if (![self parseScope:&scope:&scopeEntity from:pos length:len]) { if (beStrict) return NO; } #if DEBUG_PARSING else [self logWithFormat:@"FOUND SCOPE: '%@'", scope]; #endif if (scopeEntity) fromList = [[NSArray alloc] initWithObjects:scopeEntity, nil]; [scopeEntity release]; } else { if (![self parseIdentifierList:&fromList from:pos length:len selector:@selector(parseTableName:from:length:consume:)]) { [self logWithFormat:@"missing from list .."]; return NO; } #if DEBUG_PARSING [self logWithFormat:@"parsed FROM list (%i): %@", [fromList count], fromList]; #endif } /* check where */ if ([self parseToken:(const unsigned char *)"WHERE" from:pos length:len consume:YES]) { /* parse qualifier ... */ if ([self parseToken:(const unsigned char *)"CONTAINS" from:pos length:len consume:NO]) { if (![self parseContainsQualifier:&q from:pos length:len]) { if (beStrict) return NO; } } else if (![self parseQualifier:&q from:pos length:len]) { if (beStrict) return NO; } #if DEBUG_PARSING [self logWithFormat:@"FOUND Qualifier: '%@'", q]; #endif } /* check order-by */ if ([self parseToken:(const unsigned char *)"ORDER" from:pos length:len consume:YES]) { if (![self parseToken:(const unsigned char *)"BY" from:pos length:len consume:YES]) { if (beStrict) return NO; missingByOfOrder = YES; } if (![self parseIdentifierList:&orderList from:pos length:len selector:@selector(parseColumnName:from:length:consume:)]) return NO; #if DEBUG_PARSING [self logWithFormat:@"parsed ORDER list (%i): %@", [orderList count], orderList]; #endif } /* check group-by */ if ([self parseToken:(const unsigned char *)"GROUP" from:pos length:len consume:YES]) { if (![self parseToken:(const unsigned char *)"BY" from:pos length:len consume:YES]) { if (beStrict) return NO; } } //printUniStr(*pos, *len); // DEBUG if (!hasSelect) [self logWithFormat:@"missing SELECT !"]; if (!hasFrom) [self logWithFormat:@"missing FROM !"]; if (missingByOfOrder) [self logWithFormat:@"missing BY in ORDER BY !"]; /* build fetchspec */ lHints = [[NSMutableDictionary alloc] initWithCapacity:16]; if (scope) { [lHints setObject:scope forKey:@"scope"]; [scope release]; scope = nil; } if (attrs) { [lHints setObject:attrs forKey:@"attributes"]; [attrs release]; attrs = nil; } if (orderList) { NSMutableArray *ma; unsigned len; len = [orderList count]; ma = [[NSMutableArray alloc] initWithCapacity:len]; // for (i = 0; i < len; i++) { // EOSortOrdering *so; // so = [EOSortOrdering sortOrderingWithKey:[orderList objectAtIndex:i] // selector:EOCompareAscending]; // } lSortOrderings = [ma shallowCopy]; [ma release]; [orderList release]; orderList = nil; } fs = [[EOFetchSpecification alloc] initWithEntityName:[fromList componentsJoinedByString:@","] qualifier:q sortOrderings:lSortOrderings usesDistinct:NO isDeep:NO hints:lHints]; [lHints release]; [q release]; [fromList release]; *result = fs; return fs ? YES : NO; } - (BOOL)parseSQL:(id *)result from:(unichar **)pos length:(unsigned *)len strict:(BOOL)beStrict { if (*len < 1) return NO; if ([self parseToken:(const unsigned char *)"SELECT" from:pos length:len consume:NO]) return [self parseSELECT:result from:pos length:len strict:beStrict]; //if ([self parseToken:"UPDATE" from:pos length:len consume:NO]) //if ([self parseToken:"INSERT" from:pos length:len consume:NO]) //if ([self parseToken:"DELETE" from:pos length:len consume:NO]) [self logWithFormat:@"tried to parse an unsupported SQL statement."]; return NO; } @end /* EOSQLParser */ @implementation EOSQLParser(Tests) + (void)testDAVQuery { EOFetchSpecification *fs; NSString *sql; NSLog(@"testing: %@ --------------------", self); sql = @"\n" @"select \n" @" \"http://schemas.microsoft.com/mapi/proptag/x0e230003\", \n" @" \"urn:schemas:mailheader:subject\", \n" @" \"urn:schemas:mailheader:from\",\n" @" \"urn:schemas:mailheader:to\", \n" @" \"urn:schemas:mailheader:cc\", \n" @" \"urn:schemas:httpmail:read\", \n" @" \"urn:schemas:httpmail:hasattachment\", \n" @" \"DAV:getcontentlength\", \n" @" \"urn:schemas:mailheader:date\", \n" @" \"urn:schemas:httpmail:date\", \n" @" \"urn:schemas:mailheader:received\", \n" @" \"urn:schemas:mailheader:message-id\", \n" @" \"urn:schemas:mailheader:in-reply-to\", \n" @" \"urn:schemas:mailheader:references\" \n" @"from \n" @" scope('shallow traversal of \"http://127.0.0.1:9000/o/ol/helge/INBOX\"')\n" @"where \n" @" \"DAV:iscollection\" = False \n" @" and \n" @" \"http://schemas.microsoft.com/mapi/proptag/x0c1e001f\" != 'SMTP'\n" @" and \n" @" \"http://schemas.microsoft.com/mapi/proptag/x0e230003\" > 0 \n" @" \n"; fs = [[self sharedSQLParser] parseSQLSelectStatement:sql]; NSLog(@" FS: %@", fs); if (fs == nil) { NSLog(@" ERROR: could not parse SQL: %@", sql); } else { EOQualifier *q; NSString *scope; NSArray *props; if ((scope = [[fs hints] objectForKey:@"scope"]) == nil) NSLog(@" INVALID: got no scope !"); if (![scope isEqualToString:@"flat"]) NSLog(@" INVALID: got scope %@, expected flat !", scope); #if 0 if ([fs queryWebDAVPropertyNamesOnly]) NSLog(@" INVALID: name query only, but queried several attrs !"); #endif /* check qualifier */ if ((q = [fs qualifier]) == nil) NSLog(@" INVALID: got not qualifier (expected one) !"); else if (![q isKindOfClass:[EOAndQualifier class]]) { NSLog(@" INVALID: expected AND qualifier, got %@ !", NSStringFromClass([q class])); } else if ([[(EOAndQualifier *)q qualifiers] count] != 3) { NSLog(@" INVALID: expected 3 subqualifiers, got %i !", [[(EOAndQualifier *)q qualifiers] count]); } /* check sortordering */ if ([fs sortOrderings] != nil) { NSLog(@" INVALID: got sort orderings, specified none: %@ !", [fs sortOrderings]); } /* attributes */ if ((props = [[fs hints] objectForKey:@"attributes"]) == nil) NSLog(@" INVALID: got not attributes (expected some) !"); else if (![props isKindOfClass:[NSArray class]]) { NSLog(@" INVALID: attributes not delivered as array ?: %@", NSStringFromClass([props class])); } else if ([props count] != 14) { NSLog(@" INVALID: invalid attribute count, expected 14, got %i.", [props count]); } } NSLog(@"done test: %@ ------------------", self); } @end /* EOSQLParser(Tests) */ SOPE/sope-core/EOControl/NSArray+EOQualifier.m0000644000000000000000000000271512242733417017732 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include "common.h" @implementation NSArray(EOQualifier) - (NSArray *)filteredArrayUsingQualifier:(EOQualifier *)_qualifier { NSAutoreleasePool *pool; NSMutableArray *array = nil; NSArray *result; unsigned i, count; pool = [[NSAutoreleasePool alloc] init]; result = nil; count = [self count]; array = [NSMutableArray arrayWithCapacity:count]; for (i = 0, count; i < count; i++) { id o; o = [self objectAtIndex:i]; if ([(id)_qualifier evaluateWithObject:o]) [array addObject:o]; } result = [array copy]; [pool release]; return [result autorelease]; } @end /* NSArray(EOQualifier) */ SOPE/sope-core/EOControl/EOQualifierVariable.m0000644000000000000000000000461312242733417020064 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "EOQualifier.h" #include "common.h" @implementation EOQualifierVariable + (id)variableWithKey:(NSString *)_key { return [[[self alloc] initWithKey:_key] autorelease]; } - (id)initWithKey:(NSString *)_key { self->varKey = [_key copyWithZone:[self zone]]; return self; } - (id)init { return [self initWithKey:nil]; } - (void)dealloc { [self->varKey release]; [super dealloc]; } /* accessors */ - (NSString *)key { return self->varKey; } /* NSCoding */ - (void)encodeWithCoder:(NSCoder *)_coder { [_coder encodeObject:self->varKey]; } - (id)initWithCoder:(NSCoder *)_coder { self->varKey = [[_coder decodeObject] copyWithZone:[self zone]]; return self; } /* Comparing */ - (BOOL)isEqual:(id)_obj { if ([_obj isKindOfClass:[self class]]) return [self isEqualToQualifierVariable:(EOQualifierVariable *)_obj]; return NO; } - (BOOL)isEqualToQualifierVariable:(EOQualifierVariable *)_obj { return [self->varKey isEqual:[_obj key]]; } /* key/value archiving */ - (id)initWithKeyValueUnarchiver:(EOKeyValueUnarchiver *)_unarchiver { if ((self = [super init]) != nil) { self->varKey = [[_unarchiver decodeObjectForKey:@"key"] copy]; } return self; } - (void)encodeWithKeyValueArchiver:(EOKeyValueArchiver *)_archiver { [_archiver encodeObject:[self key] forKey:@"key"]; } /* description */ - (NSString *)qualifierDescription { return [@"$" stringByAppendingString:[self key]]; } - (NSString *)description { return [NSString stringWithFormat:@"<%@[0x%p]: variable=%@>", NSStringFromClass([self class]), self, [self key]]; } @end /* EOQualifierVariable */ SOPE/sope-core/EOControl/EOGenericRecord.m0000644000000000000000000002732012242733417017210 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "EOGenericRecord.h" #include "EONull.h" #include "EOClassDescription.h" #include "EOObserver.h" #include "EOKeyValueCoding.h" #include "common.h" #include @interface NSObject(MappedArray) - (NSArray *)mappedArrayUsingSelector:(SEL)_selector; @end @interface _EOConcreteEOGenericRecordKeyEnumerator : NSEnumerator { EOGenericRecord *dict; struct _NSMapNode *node; int bucket; } + (id)enumWithEO:(EOGenericRecord *)_eo; @end #if !LIB_FOUNDATION_LIBRARY struct _NSMapNode { void *key; void *value; struct _NSMapNode *next; }; #endif @implementation EOGenericRecord /* final methods */ static __inline__ unsigned _getHashSize(EOGenericRecord *self); static __inline__ struct _NSMapNode *_getNodeAt(EOGenericRecord *self, int idx); static BOOL is_prime(unsigned n); static unsigned nextPrime(unsigned old_value); static void eoMapGrow(EOGenericRecord *table, unsigned newSize); static void eoCheckMapTableFull(EOGenericRecord *table); static __inline__ void eoInsert(EOGenericRecord *table, id key, id value); static __inline__ id eoGet(EOGenericRecord *table, id key); static __inline__ void eoRemove(EOGenericRecord *table, id key); static EONull *null = nil; + (int)version { return 2; } + (void)initialize { if (null == nil) null = [[EONull null] retain]; } - (id)initWithEditingContext:(id)_ec classDescription:(EOClassDescription *)_classDesc globalID:(EOGlobalID *)_oid { unsigned capacity; #if DEBUG NSAssert(_classDesc, @"did not find class description for EOGenericRecord !"); #endif capacity = 16 * 4 / 3; capacity = capacity ? capacity : 13; if (!is_prime(capacity)) capacity = nextPrime(capacity); self->hashSize = capacity; self->nodes = NSZoneCalloc([self zone], capacity, sizeof(void *)); self->itemsCount = 0; self->classDescription = [_classDesc retain]; self->willChange = [self methodForSelector:@selector(willChange)]; return self; } - (id)init { EOClassDescription *c; c = (EOClassDescription *) [EOClassDescription classDescriptionForClass:[self class]]; return [self initWithEditingContext:nil classDescription:c globalID:nil]; } - (void)dealloc { if ([self respondsToSelector:@selector(_letDatabasesForget)]) [self performSelector:@selector(_letDatabasesForget)]; if (self->itemsCount > 0) { NSZone *z = [self zone]; unsigned i; for (i = 0; i < self->hashSize; i++) { struct _NSMapNode *next, *node; node = self->nodes[i]; self->nodes[i] = NULL; while (node) { [(id)node->key release]; [(id)node->value release]; next = node->next; NSZoneFree(z, node); node = next; } } self->itemsCount = 0; } if (self->nodes) NSZoneFree([self zone], self->nodes); [self->classDescription release]; [super dealloc]; } /* class description */ - (NSClassDescription *)classDescription { return self->classDescription; } static inline void _willChange(EOGenericRecord *self) { if (self->willChange) self->willChange(self, @selector(willChange:)); else [self willChange]; } #if GNUSTEP_BASE_LIBRARY - (void)setValue:(id)_value forKey:(NSString *)_key { [self takeValue:_value forKey:_key]; } #endif - (void)takeValue:(id)_value forKey:(NSString *)_key { id value; if (_value == nil) _value = null; #if DEBUG NSAssert1(_key, @"called -takeValue:0x%p forKey:nil !", _value); #endif value = eoGet(self, _key); if (value != _value) { _willChange(self); if (_value == nil) eoRemove(self, _key); else eoInsert(self, _key, _value); } } - (id)valueForKey:(NSString *)_key { id v; if ((v = eoGet(self, _key)) == nil) { #if DEBUG && 0 if ([_key isEqualToString:@"description"]) { NSLog(@"WARNING(%s): -valueForKey:%@ is nil, calling super", __PRETTY_FUNCTION__, _key); } #endif return [super valueForKey:_key]; } #if DEBUG NSAssert(null != nil, @"missing null .."); #endif return v == null ? nil : v; } - (void)takeValuesFromDictionary:(NSDictionary *)dictionary { _willChange(self); { NSEnumerator *e = [dictionary keyEnumerator]; NSString *key; while ((key = [e nextObject])) { id value = [dictionary objectForKey:key]; NSAssert(value, @"tried to set value .."); eoInsert(self, key, value); } } } - (NSDictionary *)valuesForKeys:(NSArray *)keys { // OPT - cache IMP for objectAtIndex, objectForKey, setObject:forKey: NSMutableDictionary *dict; IMP objAtIdx, setObjForKey; unsigned int i, n; if (keys == nil) return nil; n = [keys count]; dict = [NSMutableDictionary dictionaryWithCapacity:n]; objAtIdx = [keys methodForSelector:@selector(objectAtIndex:)]; setObjForKey = [dict methodForSelector:@selector(setObject:forKey:)]; for (i = 0; i < n; i++) { NSString *key; id value; key = objAtIdx(keys, @selector(objectAtIndex:), i); NSAssert(key, @"invalid key "); value = [self valueForKey:key]; if (value == nil) value = null; #if DEBUG NSAssert2(value, @"eo of type %@, missing value for attribute %@", self->classDescription, key); #endif setObjForKey(dict, @selector(setObject:forKey:), value, key); } return dict; } - (void)takeStoredValue:(id)_value forKey:(NSString *)_key { if (_value == nil) _value = null; [self takeValue:_value forKey:_key]; } - (id)storedValueForKey:(NSString *)_key { id v; v = [self valueForKey:_key]; #if DEBUG && 0 NSAssert(v != null, @"valueForKey: return NSNull !"); #endif //if (v == nil) return [super storedValueForKey:_key]; return v; } - (void)setObject:(id)object forKey:(id)key { if (object == nil) object = null; _willChange(self); eoInsert(self, key, object); } - (id)objectForKey:(id)key { return eoGet(self, key); } - (void)removeObjectForKey:(id)key { _willChange(self); eoRemove(self, key); } - (BOOL)kvcIsPreferredInKeyPath { return YES; } - (NSEnumerator *)keyEnumerator { return [_EOConcreteEOGenericRecordKeyEnumerator enumWithEO:self]; } /* copying */ - (id)copyWithZone:(NSZone *)_zone { return [self retain]; } /* description */ - (NSString *)description { return [NSString stringWithFormat: @"", [self entityName], [self valuesForKeys:[self attributeKeys]]]; } /* final methods */ static __inline__ unsigned _getHashSize(EOGenericRecord *self) { return self->hashSize; } static __inline__ struct _NSMapNode * _getNodeAt(EOGenericRecord *self, int idx) { return self->nodes[idx]; } static BOOL is_prime(unsigned n) { int i, n2 = sqrt(n); for (i = 2; i <= n2; i++) { if (n % i == 0) return NO; } return YES; } static unsigned nextPrime(unsigned old_value) { unsigned i, new_value = old_value | 1; for (i = new_value; i >= new_value; i += 2) { if (is_prime(i)) return i; } return old_value; } static void eoMapGrow(EOGenericRecord *table, unsigned newSize) { unsigned i; struct _NSMapNode **newNodeTable; newNodeTable = NSZoneCalloc([table zone], newSize, sizeof(struct _NSMapNode*)); for (i = 0; i < table->hashSize; i++) { struct _NSMapNode *next, *node; unsigned int h; node = table->nodes[i]; while (node) { next = node->next; h = [(id)node->key hash] % newSize; node->next = newNodeTable[h]; newNodeTable[h] = node; node = next; } } NSZoneFree([table zone], table->nodes); table->nodes = newNodeTable; table->hashSize = newSize; } static void eoCheckMapTableFull(EOGenericRecord *table) { if( ++(table->itemsCount) >= ((table->hashSize * 3) / 4)) { unsigned newSize; newSize = nextPrime((table->hashSize * 4) / 3); if(newSize != table->hashSize) eoMapGrow(table, newSize); } } static __inline__ void eoInsert(EOGenericRecord *table, id key, id value) { unsigned int h; struct _NSMapNode *node; h = [key hash] % table->hashSize; for (node = table->nodes[h]; node; node = node->next) { /* might cache the selector .. */ if ([key isEqual:node->key]) break; } /* Check if an entry for key exist in nodeTable. */ if (node) { /* key exist. Set for it new value and return the old value of it. */ if (key != node->key) { key = [key retain]; [(id)node->key release]; } if (value != node->value) { value = [value retain]; [(id)node->value release]; } node->key = key; node->value = value; return; } /* key not found. Allocate a new bucket and initialize it. */ node = NSZoneMalloc([table zone], sizeof(struct _NSMapNode)); key = [key retain]; value = [value retain]; node->key = (void*)key; node->value = (void*)value; node->next = table->nodes[h]; table->nodes[h] = node; eoCheckMapTableFull(table); } static __inline__ id eoGet(EOGenericRecord *table, id key) { struct _NSMapNode *node; node = table->nodes[[key hash] % table->hashSize]; for (; node; node = node->next) { /* could cache method .. */ if ([key isEqual:node->key]) return node->value; } return nil; } static __inline__ void eoRemove(EOGenericRecord *table, id key) { unsigned int h; struct _NSMapNode *node, *node1 = NULL; if (key == nil) return; h = [key hash] % table->hashSize; // node point to current bucket, and node1 to previous bucket or to NULL // if current node is the first node in the list for (node = table->nodes[h]; node; node1 = node, node = node->next) { /* could cache method .. */ if ([key isEqual:node->key]) { [(id)node->key release]; [(id)node->value release]; if (!node1) table->nodes[h] = node->next; else node1->next = node->next; NSZoneFree([table zone], node); (table->itemsCount)--; return; } } } @end /* EOGenericRecord */ @implementation _EOConcreteEOGenericRecordKeyEnumerator - (id)initWithEO:(EOGenericRecord *)_eo { self->dict = [_eo retain]; self->node = NULL; self->bucket = -1; return self; } - (void)dealloc { [self->dict release]; [super dealloc]; } + (id)enumWithEO:(EOGenericRecord *)_eo { return [[[self alloc] initWithEO:_eo] autorelease]; } - (id)nextObject { if (self->node) self->node = self->node->next; if (self->node == NULL) { for(self->bucket++; ((unsigned)self->bucket) < _getHashSize(self->dict); self->bucket++) { if (_getNodeAt(self->dict, self->bucket)) { self->node = _getNodeAt(self->dict, self->bucket); break; } } if (((unsigned)self->bucket) >= _getHashSize(self->dict)) { self->node = NULL; self->bucket = (_getHashSize(self->dict) - 1); return nil; } } return self->node->key; } @end /* _EOConcreteEOGenericRecordKeyEnumerator */ SOPE/sope-core/EOControl/NSObject+EOQualifierOps.m0000644000000000000000000001272512242733417020546 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "EOQualifier.h" #include "EONull.h" #include "common.h" static EONull *null = nil; /* values */ @interface NSObject(CompareIFace) - (NSComparisonResult)compare:(id)_object; @end @implementation NSObject(ImplementedQualifierComparisons) - (BOOL)isEqualTo:(id)_object { return [self isEqual:_object]; } - (BOOL)isNotEqualTo:(id)_object { return ![self isEqualTo:_object]; } - (BOOL)isLessThan:(id)_object { return [self compare:_object] < 0 ? YES : NO; } - (BOOL)isGreaterThan:(id)_object { return [self compare:_object] > 0 ? YES : NO; } - (BOOL)isLessThanOrEqualTo:(id)_object { return [self compare:_object] <= 0 ? YES : NO; } - (BOOL)isGreaterThanOrEqualTo:(id)_object { return [self compare:_object] >= 0 ? YES : NO; } - (BOOL)doesContain:(id)_object { return NO; } - (BOOL)isLike:(NSString *)_object { return NO; } - (BOOL)isCaseInsensitiveLike:(NSString *)_object { return NO; } @end /* NSObject(ImplementedQualifierComparisons) */ @implementation NSArray(ImplementedQualifierComparisons) - (BOOL)doesContain:(id)_object { return [self containsObject:_object]; } @end /* NSArray(ImplementedQualifierComparisons) */ @implementation NSString(ImplementedQualifierComparisons) - (BOOL)isLike:(NSString *)_pattern { NSArray *cs; unsigned count; #if 0 NSString *first, *last; #endif if (null == nil) null = [[EONull null] retain]; if ((id)_pattern == (id)null) return NO; if ([_pattern isEqual:@"*"]) /* all match */ return YES; cs = [_pattern componentsSeparatedByString:@"*"]; count = [cs count]; if (count == 0) return [self isEqual:_pattern]; if (count == 1) return [self isEqual:_pattern]; if (count == 2) { if ([_pattern hasPrefix:@"*"]) return [self hasSuffix:[cs objectAtIndex:1]]; if ([_pattern hasSuffix:@"*"]) return [self hasPrefix:[cs objectAtIndex:0]]; } if (count == 3) { if ([_pattern hasPrefix:@"*"] && [_pattern hasSuffix:@"*"]) return [self rangeOfString:[cs objectAtIndex:1]].length == 0 ? NO : YES; } #if 1 { NSEnumerator *enumerator; int idx; int len; NSString *str; idx = 0; len = [self length]; enumerator = [cs objectEnumerator]; while ((str = [enumerator nextObject]) && idx < len) { NSRange r; if ([str length] == 0) continue; r = NSMakeRange(idx, ([self length] - idx)); r = [self rangeOfString:str options:0 range:r]; if (r.length == 0) return NO; idx += r.length; } return [enumerator nextObject] ? NO : YES; } #else first = [cs objectAtIndex:0]; last = [cs lastObject]; if (![self hasPrefix:first]) return NO; if (![self hasSuffix:last]) return NO; /* to be completed (match interior stuff, match '?') */ return YES; #endif return NO; } - (BOOL)isCaseInsensitiveLike:(NSString *)_pattern { return [[self lowercaseString] isLike:[_pattern lowercaseString]]; } @end /* NSString(ImplementedQualifierComparisons) */ @implementation NSNumber(ImplementedQualifierComparisons) - (BOOL)isEqualTo:(id)_object { if (_object == nil) return NO; if (_object == self) return YES; return [self isEqual:_object]; } - (BOOL)isNotEqualTo:(id)_object { if (_object == nil) return YES; return ![self isEqualTo:_object]; } - (BOOL)isLessThan:(id)_object { if (_object == nil) return YES; if (_object == self) return NO; return [self compare:_object] < 0 ? YES : NO; } - (BOOL)isGreaterThan:(id)_object { if (_object == nil) return NO; if (_object == self) return NO; return [self compare:_object] > 0 ? YES : NO; } - (BOOL)isLessThanOrEqualTo:(id)_object { if (_object == nil) return YES; if (_object == self) return YES; return [self compare:_object] <= 0 ? YES : NO; } - (BOOL)isGreaterThanOrEqualTo:(id)_object { if (_object == nil) return NO; if (_object == self) return YES; return [self compare:_object] >= 0 ? YES : NO; } @end /* NSNumber(ImplementedQualifierComparisons) */ @implementation NSDate(ImplementedQualifierComparisons) #define CHECK_NULL(__VAL__, __RES__) \ {if (null == nil) null = [[EONull null] retain];} \ if (__VAL__ == nil || __VAL__ == null) return __RES__ - (BOOL)isLessThan:(id)_object { CHECK_NULL(_object, NO); return [self compare:_object] < 0 ? YES : NO; } - (BOOL)isGreaterThan:(id)_object { CHECK_NULL(_object, YES); return [self compare:_object] > 0 ? YES : NO; } - (BOOL)isLessThanOrEqualTo:(id)_object { CHECK_NULL(_object, NO); return [self compare:_object] <= 0 ? YES : NO; } - (BOOL)isGreaterThanOrEqualTo:(id)_object { CHECK_NULL(_object, YES); return [self compare:_object] >= 0 ? YES : NO; } @end /* NSDate(ImplementedQualifierComparisons) */ SOPE/sope-core/EOControl/COPYING0000644000000000000000000006130312242733417015125 0ustar rootroot GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 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. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] 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 Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, 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 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 a program 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. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, 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 companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. 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, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library 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 compile 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) 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. c) 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. d) 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 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. 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 to 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 Library 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 Appendix: 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 Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library 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! SOPE/sope-core/EOControl/EOValidation.m0000644000000000000000000001101012242733417016554 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "EOClassDescription.h" #include "EOKeyValueCoding.h" #include "EONull.h" #include "common.h" #if __GNU_LIBOBJC__ >= 20100911 # define sel_get_any_uid sel_getUid #endif #if !LIB_FOUNDATION_LIBRARY @interface NSException(UsedSetUI) /* does Jaguar allow -setUserInfo: ? */ - (void)setUserInfo:(NSDictionary *)_ui; @end #endif @implementation NSClassDescription(EOValidation) - (NSException *)validateObjectForDelete:(id)_object { return nil; } - (NSException *)validateObjectForSave:(id)_object { return nil; } - (NSException *)validateValue:(id *)_value forKey:(NSString *)_key { return nil; } @end /* NSClassDescription(EOValidation) */ @implementation NSObject(EOValidation) - (NSException *)validateForDelete { return [[self classDescription] validateObjectForDelete:self]; } - (NSException *)validateForInsert { return [self validateForSave]; } - (NSException *)validateForUpdate { return [self validateForSave]; } - (NSException *)validateForSave { NSException *e; NSMutableArray *exceptions; NSArray *properties; unsigned int i, count; id (*validate)(id, SEL, id *, NSString *); id (*objAtIdx)(id, SEL, unsigned int idx); id (*valForKey)(id, SEL, NSString *); exceptions = nil; /* first ask class description to validate object */ if ((e = [[self classDescription] validateObjectForSave:self])) { if (exceptions == nil) exceptions = [NSMutableArray array]; [exceptions addObject:e]; } /* then process all properties */ if ((properties = [self allPropertyKeys]) == nil) properties = [NSArray array]; validate = (void *)[self methodForSelector:@selector(validateValue:forKey:)]; valForKey = (void *)[self methodForSelector:@selector(valueForKey:)]; objAtIdx = (void *)[properties methodForSelector:@selector(objectAtIndex:)]; for (i = 0, count = [properties count]; i < count; i++) { NSString *key; id value, orgValue; key = objAtIdx(properties, @selector(objectAtIndex:), i); orgValue = value = valForKey(self, @selector(valueForKey:), key); if ((e = validate(self, @selector(validateValue:forKey:), &value, key))) { /* validation of property failed */ if (exceptions == nil) exceptions = [NSMutableArray array]; [exceptions addObject:e]; } else if (orgValue != value) { /* the value was changed during validation */ [self takeValue:value forKey:key]; } } if ((count = [exceptions count]) == 0) { return nil; } else if (count == 1) { return [exceptions objectAtIndex:0]; } else { NSException *master; NSMutableDictionary *ui; master = [exceptions objectAtIndex:0]; [exceptions removeObjectAtIndex:0]; ui = [[master userInfo] mutableCopy]; if (ui == nil) ui = [[NSMutableDictionary alloc] init]; [ui setObject:exceptions forKey:@"EOAdditionalExceptions"]; [master setUserInfo:ui]; [ui release]; ui = nil; return master; } } - (NSException *)validateValue:(id *)_value forKey:(NSString *)_key { NSException *e; if ((e = [[self classDescription] validateValue:_value forKey:_key])) return e; /* should invoke key-specific methods, eg -validateBlah: */ { /* construct 'validate'(8) + key + ':'(1) */ unsigned len; char *buf; SEL sel; len = [_key cStringLength]; buf = malloc(len + 14); strcpy(buf, "validate"); [_key getCString:&buf[8]]; strcat(buf, ":"); buf[8] = toupper(buf[8]); #if NeXT_RUNTIME sel = sel_getUid(buf); #else sel = sel_get_any_uid(buf); #endif if (sel) { if ([self respondsToSelector:sel]) { if (buf) free(buf); return [self performSelector:sel withObject:*_value]; } } if (buf) free(buf); } return nil; } @end /* NSObject(EOValidation) */ SOPE/sope-core/EOControl/EODetailDataSource.h0000644000000000000000000000324112242733417017641 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __EOControl_EODetailDataSource_H__ #define __EOControl_EODetailDataSource_H__ #include #include @class EOClassDescription; @interface EODetailDataSource : EODataSource < EOKeyValueArchiving > { EOClassDescription *masterClassDescription; EODataSource *masterDataSource; id masterObject; NSString *detailKey; } - (id)initWithMasterClassDescription:(EOClassDescription *)_cd detailKey:(NSString *)_relKey; // designated initializer - (id)initWithMasterDataSource:(EODataSource *)_ds detailKey:(NSString *)_relKey; /* reflection */ - (void)setMasterClassDescription:(EOClassDescription *)_cd; - (EOClassDescription *)masterClassDescription; - (EODataSource *)masterDataSource; /* master-detail */ - (id)masterObject; - (NSString *)detailKey; @end #endif /* __EOControl_EODetailDataSource_H__ */ SOPE/sope-core/EOControl/EOQualifierParser.m0000644000000000000000000010367012242733417017576 0ustar rootroot/* Copyright (C) 2000-2007 SKYRIX Software AG Copyright (C) 2007 Helge Hess This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include "EOQualifier.h" #include "EONull.h" #include "common.h" //#define USE_DESCRIPTION_FOR_AT 1 static int qDebug = 0; static NSMutableDictionary *EOQualifierParserTypeMappings = nil; /* The literals understood by the value parser. NOTE: Any literal used here can never be used as a key ! So add as little as possible. */ typedef struct { const unsigned char *token; id value; int scase; } EOQPTokEntry; static EOQPTokEntry toks[] = { { (const unsigned char *)"NULL", nil, 0 }, { (const unsigned char *)"nil", nil, 1 }, { (const unsigned char *)"YES", nil, 0 }, { (const unsigned char *)"NO", nil, 0 }, { (const unsigned char *)"TRUE", nil, 0 }, { (const unsigned char *)"FALSE", nil, 0 }, { (const unsigned char *)NULL, nil, 0 } }; static inline void _setupLiterals(void) { static BOOL didSetup = NO; if (didSetup) return; didSetup = YES; toks[0].value = [[NSNull null] retain]; toks[1].value = toks[0].value; toks[2].value = [[NSNumber numberWithBool:YES] retain]; toks[3].value = [[NSNumber numberWithBool:NO] retain]; toks[4].value = toks[2].value; toks[5].value = toks[3].value; } /* cache */ static Class StringClass = Nil; static Class NumberClass = Nil; static EONull *null = nil; /* parsing functions */ static EOQualifier *_parseCompoundQualifier(id _ctx, const char *_buf, unsigned _bufLen, unsigned *_qualLen); static EOQualifier *_testOperator(id _ctx, const char *_buf, unsigned _bufLen, unsigned *_opLen, BOOL *_testAnd); static EOQualifier *_parseQualifiers(id _ctx, const char *_buf, unsigned _bufLen, unsigned *_qualLen); static EOQualifier *_parseParenthesisQualifier(id _ctx, const char *_buf, unsigned _bufLen, unsigned *_qualLen); static EOQualifier *_parseNotQualifier(id _ctx, const char *_buf, unsigned _bufLen, unsigned *_qualLen); static EOQualifier *_parseKeyCompQualifier(id _ctx, const char *_buf, unsigned _bufLen, unsigned *_qualLen); static NSString *_parseKey(id _ctx, const char *_buf, unsigned _bufLen, unsigned *_keyLen); static id _parseValue(id _ctx, const char *_buf, unsigned _bufLen, unsigned *_keyLen); static inline unsigned _countWhiteSpaces(const char *_buf, unsigned _bufLen); static NSString *_parseOp(const char *_buf, unsigned _bufLen, unsigned *_opLen); @interface EOQualifierParserContext : NSObject { NSMapTable *qualifierCache; } - (NSDictionary *)resultForFunction:(NSString *)_fct atPos:(unsigned)_pos; - (void)setResult:(NSDictionary *)_dict forFunction:(NSString *)_fct atPos:(unsigned)_pos; - (id)getObjectFromStackFor:(char)_c; /* factory */ - (EOQualifier *)keyComparisonQualifierWithLeftKey:(NSString *)_leftKey operatorSelector:(SEL)_sel rightKey:(NSString *)_rightKey; - (EOQualifier *)keyValueQualifierWithKey:(NSString *)_key operatorSelector:(SEL)_sel value:(id)_value; - (EOQualifier *)andQualifierWithArray:(NSArray *)_qualifiers; - (EOQualifier *)orQualifierWithArray:(NSArray *)_qualifiers; - (EOQualifier *)notQualifierWithQualifier:(EOQualifier *)_qualifier; @end @interface EOQualifierVAParserContext : EOQualifierParserContext { va_list *va; } + (id)contextWithVaList:(va_list *)_va; - (id)initWithVaList:(va_list *)_va; @end @interface EOQualifierEnumeratorParserContext : EOQualifierParserContext { NSEnumerator *enumerator; } + (id)contextWithEnumerator:(NSEnumerator *)_enumerator; - (id)initWithEnumerator:(NSEnumerator *)_enumerator; @end @implementation EOQualifierVAParserContext + (id)contextWithVaList:(va_list *)_va { return [[[EOQualifierVAParserContext alloc] initWithVaList:_va] autorelease]; } - (id)initWithVaList:(va_list *)_va { if ((self = [super init])) { self->va = _va; } return self; } - (id)getObjectFromStackFor:(char)_c { id obj = nil; if (StringClass == Nil) StringClass = [NSString class]; if (NumberClass == Nil) NumberClass = [NSNumber class]; if (null == nil) null = [EONull null]; if (_c == 's') { char *str = va_arg(*self->va, char*); obj = [StringClass stringWithCString:str]; } else if (_c == 'd') { int i= va_arg(*self->va, int); obj = [NumberClass numberWithInt:i]; } else if (_c == 'f') { double d = va_arg(*self->va, double); obj = [NumberClass numberWithDouble:d]; } else if (_c == '@') { id o = va_arg(*self->va, id); #if USE_DESCRIPTION_FOR_AT obj = (o == nil) ? (id)null : (id)[o description]; #else obj = (o == nil) ? (id)null : (id)o; #endif } else { [NSException raise:@"NSInvalidArgumentException" format:@"unknown conversation char %c", _c]; } return obj; } @end /* EOQualifierVAParserContext */ @implementation EOQualifierEnumeratorParserContext + (id)contextWithEnumerator:(NSEnumerator *)_enumerator { return [[[EOQualifierEnumeratorParserContext alloc] initWithEnumerator:_enumerator] autorelease]; } - (id)initWithEnumerator:(NSEnumerator *)_enumerator { if ((self = [super init])) { ASSIGN(self->enumerator, _enumerator); } return self; } - (void)dealloc { [self->enumerator release]; [super dealloc];; } - (id)getObjectFromStackFor:(char)_c { static Class NumberClass = Nil; id o; if (NumberClass == Nil) NumberClass = [NSNumber class]; o = [self->enumerator nextObject]; switch (_c) { case '@': #if USE_DESCRIPTION_FOR_AT return [o description]; #else return o; #endif case 'f': return [NumberClass numberWithDouble:[o doubleValue]]; case 'd': return [NumberClass numberWithInt:[o intValue]]; case 's': // return [NSString stringWithCString:[o cString]]; return [[o copy] autorelease]; default: [NSException raise:@"NSInvalidArgumentException" format:@"unknown or not allowed conversation char %c", _c]; } return nil; } @end /* EOQualifierEnumeratorParserContext */ @implementation EOQualifierParserContext - (id)init { if (StringClass == Nil) StringClass = [NSString class]; if ((self = [super init])) { self->qualifierCache = NSCreateMapTable(NSObjectMapKeyCallBacks, NSObjectMapValueCallBacks, 200); } return self; } - (void)dealloc { if (self->qualifierCache) NSFreeMapTable(self->qualifierCache); [super dealloc]; } - (NSDictionary *)resultForFunction:(NSString *)_fct atPos:(unsigned)_pos { return NSMapGet(self->qualifierCache, [StringClass stringWithFormat:@"%@_%d", _fct, _pos]); } - (void)setResult:(NSDictionary *)_dict forFunction:(NSString *)_fct atPos:(unsigned)_pos { NSMapInsert(self->qualifierCache, [StringClass stringWithFormat:@"%@_%d", _fct, _pos], _dict); } - (id)getObjectFromStackFor:(char)_c { [self doesNotRecognizeSelector:_cmd]; return nil; } /* factory */ - (EOQualifier *)keyComparisonQualifierWithLeftKey:(NSString *)_leftKey operatorSelector:(SEL)_sel rightKey:(NSString *)_rightKey { static Class clazz = Nil; if (clazz == Nil) clazz = [EOKeyComparisonQualifier class]; return [[[clazz alloc] initWithLeftKey:_leftKey operatorSelector:_sel rightKey:_rightKey] autorelease]; } - (EOQualifier *)keyValueQualifierWithKey:(NSString *)_key operatorSelector:(SEL)_sel value:(id)_value { static Class clazz = Nil; if (clazz == Nil) clazz = [EOKeyValueQualifier class]; return [[[clazz alloc] initWithKey:_key operatorSelector:_sel value:_value] autorelease]; } - (EOQualifier *)andQualifierWithArray:(NSArray *)_qualifiers { static Class clazz = Nil; if (clazz == Nil) clazz = [EOAndQualifier class]; return [[[clazz alloc] initWithQualifierArray:_qualifiers] autorelease]; } - (EOQualifier *)orQualifierWithArray:(NSArray *)_qualifiers { static Class clazz = Nil; if (clazz == Nil) clazz = [EOOrQualifier class]; return [[[clazz alloc] initWithQualifierArray:_qualifiers] autorelease]; } - (EOQualifier *)notQualifierWithQualifier:(EOQualifier *)_qualifier { static Class clazz = Nil; if (clazz == Nil) clazz = [EONotQualifier class]; return [[[clazz alloc] initWithQualifier:_qualifier] autorelease]; } - (EOQualifierVariable *)variableWithKey:(NSString *)_key { static Class clazz = Nil; if (clazz == Nil) clazz = [EOQualifierVariable class]; return [clazz variableWithKey:_key]; } @end /* EOQualifierParserContext */ @implementation EOQualifier(Parsing) + (void)registerValueClass:(Class)_valueClass forTypeName:(NSString *)_type { if (EOQualifierParserTypeMappings == nil) EOQualifierParserTypeMappings = [[NSMutableDictionary alloc] init]; if (_type == nil) { NSLog(@"ERROR(%s): got passed no type name!", __PRETTY_FUNCTION__); return; } if (_valueClass == nil) { NSLog(@"ERROR(%s): got passed no value-class for type '%@'!", __PRETTY_FUNCTION__, _type); return; } [EOQualifierParserTypeMappings setObject:_valueClass forKey:_type]; } + (EOQualifier *)qualifierWithQualifierFormat:(NSString *)_qualifierFormat,... { va_list va; EOQualifier *qualifier; unsigned length = 0; const char *buf; unsigned bufLen; _setupLiterals(); if (StringClass == Nil) StringClass = [NSString class]; buf = [_qualifierFormat cStringUsingEncoding: NSUTF8StringEncoding]; bufLen = strlen(buf); va_start(va, _qualifierFormat); qualifier = _parseQualifiers([EOQualifierVAParserContext contextWithVaList:&va], buf, bufLen, &length); va_end(va); if (qualifier != nil) { /* check whether the rest of the string is OK */ if (length < bufLen) length += _countWhiteSpaces(buf + length, bufLen - length); if (length < bufLen) { NSLog(@"WARNING(%s): unexpected chars at the end of the " @"string(class=%@,len=%i) '%@'", __PRETTY_FUNCTION__, [_qualifierFormat class], [_qualifierFormat length], _qualifierFormat); NSLog(@" buf-length: %i", bufLen); NSLog(@" length: %i", length); NSLog(@" char[length]: '%c' (%i) '%s'", buf[length], buf[length], (buf+length)); qualifier = nil; } else if (length > bufLen) { NSLog(@"WARNING(%s): length should never be longer than bufLen ?, " @"internal parsing error !", __PRETTY_FUNCTION__); } } return qualifier; } + (EOQualifier *)qualifierWithQualifierFormat:(NSString *)_qualifierFormat arguments:(NSArray *)_arguments { EOQualifier *qual = nil; unsigned length = 0; const char *buf = NULL; unsigned bufLen = 0; EOQualifierEnumeratorParserContext *ctx; _setupLiterals(); if (StringClass == Nil) StringClass = [NSString class]; ctx = [EOQualifierEnumeratorParserContext contextWithEnumerator: [_arguments objectEnumerator]]; //NSLog(@"qclass: %@", [_qualifierFormat class]); buf = [_qualifierFormat cString]; bufLen = [_qualifierFormat cStringLength]; qual = _parseQualifiers(ctx, buf, bufLen, &length); if (qual != nil) { /* check whether the rest of the string is OK */ if (length < bufLen) { length += _countWhiteSpaces(buf + length, bufLen - length); } if (length != bufLen) { NSLog(@"WARNING(%s): unexpected chars at the end of the string '%@'", __PRETTY_FUNCTION__, _qualifierFormat); qual = nil; } } return qual; } @end /* EOQualifier(Parsing) */ static EOQualifier *_parseSingleQualifier(id _ctx, const char *_buf, unsigned _bufLen, unsigned *_qualLen) { EOQualifier *res = nil; if ((res = _parseParenthesisQualifier(_ctx, _buf, _bufLen, _qualLen)) != nil) { if (qDebug) NSLog(@"_parseSingleQualifier return <%@> for <%s> ", res, _buf); return res; } if ((res = _parseNotQualifier(_ctx, _buf, _bufLen, _qualLen)) != nil) { if (qDebug) NSLog(@"_parseSingleQualifier return <%@> for <%s> ", res, _buf); return res; } if ((res = _parseKeyCompQualifier(_ctx, _buf, _bufLen, _qualLen)) != nil) { if (qDebug) { NSLog(@"_parseSingleQualifier return <%@> for <%s> length %d", res, _buf, *_qualLen); } return res; } return nil; } static EOQualifier *_parseQualifiers(id _ctx, const char *_buf, unsigned _bufLen, unsigned *_qualLen) { EOQualifier *res = nil; if ((res = _parseCompoundQualifier(_ctx, _buf, _bufLen, _qualLen))) { if (qDebug) NSLog(@"_parseQualifiers return <%@> for <%s> ", res, _buf); return res; } if ((res = _parseSingleQualifier(_ctx, _buf, _bufLen, _qualLen))) { if (qDebug) NSLog(@"_parseQualifiers return <%@> for <%s> ", res, _buf); return res; } if (qDebug) NSLog(@"_parseQualifiers return nil for <%s> ", _buf); return nil; } static EOQualifier *_parseParenthesisQualifier(id _ctx, const char *_buf, unsigned _bufLen, unsigned *_qualLen) { unsigned pos = 0; unsigned qualLen = 0; EOQualifier *qual = nil; pos = _countWhiteSpaces(_buf, _bufLen); if (_bufLen <= pos + 2) /* at least open and close parenthesis */ { if (qDebug) NSLog(@"1_parseParenthesisQualifier return nil for <%s> ", _buf); return nil; } if (_buf[pos] != '(') { if (qDebug) NSLog(@"2_parseParenthesisQualifier return nil for <%s> ", _buf); return nil; } pos++; if (!(qual = _parseQualifiers(_ctx, _buf + pos, _bufLen - pos, &qualLen))) { if (qDebug) NSLog(@"3_parseParenthesisQualifier return nil for <%s> ", _buf); return nil; } pos += qualLen; if (_bufLen <= pos) { if (qDebug) NSLog(@"4_parseParenthesisQualifier return nil for <%s> qual[%@] %@ bufLen %d " @"pos %d", _buf, [qual class], qual, _bufLen, pos); return nil; } pos += _countWhiteSpaces(_buf + pos, _bufLen - pos); if (_buf[pos] != ')') { if (qDebug) NSLog(@"5_parseParenthesisQualifier return nil for <%s> [%s] ", _buf, _buf+pos); return nil; } if (qDebug) NSLog(@"6_parseParenthesisQualifier return <%@> for <%s> ", qual, _buf); *_qualLen = pos + 1; /* one step after the parenthesis */ return qual; } static EOQualifier *_parseNotQualifier(id _ctx, const char *_buf, unsigned _bufLen, unsigned *_qualLen) { unsigned pos, len = 0; char c0, c1, c2 = 0; EOQualifier *qual = nil; pos = _countWhiteSpaces(_buf, _bufLen); if (_bufLen - pos < 4) { /* at least 3 chars for 'NOT' */ if (qDebug) NSLog(@"_parseNotQualifier return nil for <%s> ", _buf); return nil; } c0 = _buf[pos]; c1 = _buf[pos + 1]; c2 = _buf[pos + 2]; if (!(((c0 == 'n') || (c0 == 'N')) && ((c1 == 'o') || (c1 == 'O')) && ((c2 == 't') || (c2 == 'T')))) { if (qDebug) NSLog(@"_parseNotQualifier return nil for <%s> ", _buf); return nil; } pos += 3; qual = _parseSingleQualifier(_ctx, _buf + pos, _bufLen - pos, &len); if (qual == nil) { if (qDebug) NSLog(@"_parseNotQualifier return nil for <%s> ", _buf); return nil; } *_qualLen = pos +len; if (qDebug) NSLog(@"_parseNotQualifier return %@ for <%s> ", qual, _buf); return [_ctx notQualifierWithQualifier:qual]; } static EOQualifier *_parseKeyCompQualifier(id _ctx, const char *_buf, unsigned _bufLen, unsigned *_qualLen) { NSString *key = nil; NSString *op = nil; NSString *value = nil; EOQualifier *qual = nil; NSDictionary *dict = nil; SEL sel = NULL; unsigned length = 0; unsigned pos = 0; BOOL valueIsKey = NO; dict = [_ctx resultForFunction:@"parseKeyCompQualifier" atPos:(unsigned long)_buf]; if (dict != nil) { if (qDebug) NSLog(@"_parseKeyCompQual return <%@> [cached] for <%s> ", dict, _buf); *_qualLen = [[dict objectForKey:@"length"] unsignedIntValue]; return [dict objectForKey:@"object"]; } pos = _countWhiteSpaces(_buf, _bufLen); if ((key = _parseKey(_ctx , _buf + pos, _bufLen - pos, &length)) == nil) { if (qDebug) NSLog(@"_parseKeyCompQualifier return nil for <%s> ", _buf); return nil; } pos += length; pos += _countWhiteSpaces(_buf + pos, _bufLen - pos); if (!(op = _parseOp(_buf + pos, _bufLen - pos, &length))) { if (qDebug) NSLog(@"_parseKeyCompQualifier return nil for <%s> ", _buf); return nil; } sel = [EOQualifier operatorSelectorForString:op]; if (sel == NULL) { NSLog(@"WARNING(%s): possible unknown operator <%@>", __PRETTY_FUNCTION__, op); if (qDebug) NSLog(@"_parseKeyCompQualifier return nil for <%s> ", _buf); return nil; } pos +=length; pos += _countWhiteSpaces(_buf + pos, _bufLen - pos); valueIsKey = NO; value = _parseValue(_ctx, _buf + pos, _bufLen - pos, &length); if (value == nil) { value = _parseKey(_ctx, _buf + pos, _bufLen - pos, &length); if (value == nil) { if (qDebug) NSLog(@"_parseKeyCompQualifier return nil for <%s> ", _buf); return nil; } else valueIsKey = YES; } pos +=length; *_qualLen = pos; qual = (valueIsKey) ? [_ctx keyComparisonQualifierWithLeftKey:key operatorSelector:sel rightKey:value] : [_ctx keyValueQualifierWithKey:key operatorSelector:sel value:value]; if (qDebug) NSLog(@"_parseKeyCompQualifier return <%@> for <%s> ", qual, _buf); if (qual != nil) { id keys[2], values[2]; keys[0] = @"length"; values[0] = [NSNumber numberWithUnsignedInt:pos]; keys[1] = @"object"; values[1] = qual; [_ctx setResult: [NSDictionary dictionaryWithObjects:values forKeys:keys count:2] forFunction:@"parseKeyCompQualifier" atPos:(unsigned long)_buf]; *_qualLen = pos; } return qual; } static NSString *_parseOp(const char *_buf, unsigned _bufLen, unsigned *_opLen) { unsigned pos = 0; char c0 = 0; char c1 = 0; if (_bufLen == 0) { if (qDebug) NSLog(@"_parseOp _bufLen == 0 --> return nil"); return nil; } pos = _countWhiteSpaces(_buf, _bufLen); if (_bufLen - pos > 1) {/* at least an operation and a value */ c0 = _buf[pos]; c1 = _buf[pos+1]; if (((c0 >= '<') && (c0 <= '>')) || (c0 == '!')) { NSString *result; if ((c1 >= '<') && (c1 <= '>')) { *_opLen = 2; result = [StringClass stringWithCString:_buf + pos length:2]; if (qDebug) NSLog(@"_parseOp return <%@> for <%s> ", result, _buf); } else { *_opLen = 1; result = [StringClass stringWithCString:&c0 length:1]; if (qDebug) NSLog(@"_parseOp return <%@> for <%s> ", result, _buf); } return result; } else { /* string designator operator */ unsigned opStart = pos; while (pos < _bufLen) { if (_buf[pos] == ' ') break; pos++; } if (pos >= _bufLen) { NSLog(@"WARNING(%s): found end of string during operator parsing", __PRETTY_FUNCTION__); } if (qDebug) { NSLog(@"%s: _parseOp return <%@> for <%s> ", __PRETTY_FUNCTION__, [StringClass stringWithCString:_buf + opStart length:pos - opStart], _buf); } *_opLen = pos; return [StringClass stringWithCString:_buf + opStart length:pos - opStart]; } } if (qDebug) NSLog(@"_parseOp return nil for <%s> ", _buf); return nil; } static NSString *_parseKey(id _ctx, const char *_buf, unsigned _bufLen, unsigned *_keyLen) { id result = nil; NSDictionary *dict = nil; unsigned pos = 0; unsigned startKey = 0; char c = 0; if (_bufLen == 0) { if (qDebug) NSLog(@"%s: _bufLen == 0 --> return nil", __PRETTY_FUNCTION__); return nil; } dict = [_ctx resultForFunction:@"parseKey" atPos:(unsigned long)_buf]; if (dict != nil) { if (qDebug) { NSLog(@"%s: return <%@> [cached] for <%s> ", __PRETTY_FUNCTION__, dict, _buf); } *_keyLen = [[dict objectForKey:@"length"] unsignedIntValue]; return [dict objectForKey:@"object"]; } pos = _countWhiteSpaces(_buf, _bufLen); startKey = pos; c = _buf[pos]; if (c == '%') { if (_bufLen - pos < 2) { if (qDebug) { NSLog(@"%s: [c==%%,bufLen-pos<2]: _parseValue return nil for <%s> ", __PRETTY_FUNCTION__, _buf); } return nil; } pos++; result = [_ctx getObjectFromStackFor:_buf[pos]]; pos++; } else { /* '{' for namspaces */ register BOOL isQuotedKey = NO; if (c == '"') isQuotedKey = YES; else if (!(((c >= 'A') && (c <= 'Z')) || ((c >= 'a') && (c <= 'z')) || c == '{')) { if (qDebug) { NSLog(@"%s: [c!=AZaz{]: _parseKey return nil for <%s> ", __PRETTY_FUNCTION__, _buf); } return nil; } pos++; while (pos < _bufLen) { c = _buf[pos]; if (isQuotedKey && c == '"') break; else if ((c == ' ') || (c == '<') || (c == '>') || (c == '=') || (c == '!') || c == ')' || c == '(') break; pos++; } if (isQuotedKey) { pos++; // skip quote result = [StringClass stringWithCString:(_buf + startKey + 1) length:(pos - startKey - 2)]; } else { result = [StringClass stringWithCString:(_buf + startKey) length:(pos - startKey)]; } } *_keyLen = pos; if (qDebug) NSLog(@"%s: return <%@> for <%s> ", __PRETTY_FUNCTION__, result, _buf); if (result != nil) { id keys[2], values[2]; keys[0] = @"length"; values[0] = [NSNumber numberWithUnsignedInt:pos]; keys[1] = @"object"; values[1] = result; [_ctx setResult: [NSDictionary dictionaryWithObjects:values forKeys:keys count:2] forFunction:@"parseKey" atPos:(unsigned long)_buf]; *_keyLen = pos; } return result; } static id _parseValue(id _ctx, const char *_buf, unsigned _bufLen, unsigned *_keyLen) { NSString *cast = nil; NSDictionary *dict = nil; id obj = nil; unsigned pos = 0; char c = 0; if (NumberClass == Nil) NumberClass = [NSNumber class]; if (null == nil) null = [[NSNull null] retain]; if (_bufLen == 0) { if (qDebug) NSLog(@"_parseValue _bufLen == 0 --> return nil"); return nil; } dict = [_ctx resultForFunction:@"parseValue" atPos:(unsigned long)_buf]; if (dict != nil) { if (qDebug) { NSLog(@"_parseKeyCompQualifier return <%@> [cached] for <%s> ", dict, _buf); } *_keyLen = [[dict objectForKey:@"length"] unsignedIntValue]; return [dict objectForKey:@"object"]; } pos = _countWhiteSpaces(_buf, _bufLen); c = _buf[pos]; if (c == '$') { /* found EOQualifierVariable */ unsigned startVar = 0; NSString *varKey; pos++; startVar = pos; while (pos < _bufLen) { if ((_buf[pos] == ' ') || (_buf[pos] == ')')) break; pos++; } varKey = [StringClass stringWithCString:(_buf + startVar) length:pos - startVar]; obj = [_ctx variableWithKey:varKey]; } else { /* first, check for CAST */ BOOL parseComplexCast = NO; if (c == 'c' && _bufLen > 14) { if (strstr(_buf, "cast") == _buf && (isspace(_buf[4]) || _buf[4]=='(')) { /* for example: cast("1970-01-01T00:00:00Z" as 'dateTime') [min 15 #]*/ pos += 4; /* skip 'cast' */ while (isspace(_buf[pos])) /* skip spaces */ pos++; if (_buf[pos] != '(') { NSLog(@"WARNING(%s): got unexpected cast string: '%s'", __PRETTY_FUNCTION__, _buf); } else pos++; /* skip opening bracket '(' */ parseComplexCast = YES; c = _buf[pos]; } } else if (c == '(') { /* starting with a cast */ /* for example: (NSCalendarDate)"1999-12-12" [min 5 chars] */ unsigned startCast = 0; pos++; startCast = pos; while (pos < _bufLen) { if (_buf[pos] == ')') break; pos++; } pos++; if (pos >= _bufLen) { NSLog(@"WARNING(%s): found end of string while reading a cast", __PRETTY_FUNCTION__); return nil; } c = _buf[pos]; cast = [StringClass stringWithCString:(_buf + startCast) length:(pos - 1 - startCast)]; if (qDebug) NSLog(@"%s: got cast %@", __PRETTY_FUNCTION__, cast); } /* next, check for FORMAT SPECIFIER */ if (c == '%') { if (_bufLen - pos < 2) { if (qDebug) NSLog(@"_parseValue return nil for <%s> ", _buf); return nil; } pos++; obj = [_ctx getObjectFromStackFor:_buf[pos]]; pos++; } /* next, check for A NUMBER */ else if (((c >= '0') && (c <= '9')) || (c == '-')) { /* got a number */ unsigned startNumber; startNumber = pos; pos++; while (pos < _bufLen) { c = _buf[pos]; if (!((c >= '0') && (c <= '9'))) break; pos++; } obj = [NumberClass numberWithInt:atoi(_buf + startNumber)]; } /* check for some text literals */ if ((obj == nil) && ((_bufLen - pos) > 1)) { unsigned char i; for (i = 0; i < 20 && (toks[i].token != NULL) && (obj == nil); i++) { const unsigned char *tok; unsigned char toklen; int rc; tok = toks[i].token; toklen = strlen((const char *)tok); if ((_bufLen - pos) < toklen) /* remaining string not long enough */ continue; rc = toks[i].scase ? strncmp(&(_buf[pos]), (const char *)tok, toklen) : strncasecmp(&(_buf[pos]), (const char *)tok, toklen); if (rc != 0) /* does not match */ continue; if (!(_buf[pos + toklen] == '\0' || isspace(_buf[pos + toklen]) || _buf[pos + toklen] == ')')) { /* Not at the string end or followed by a space or a right parenthesis. The latter is required to correctly parse this: (not (attribute = nil) and attribute.className = 'com.webobjects.foundation.NSTimestamp') */ continue; } /* wow, found the token */ pos += toklen; /* skip it */ obj = toks[i].value; } } /* next, check for STRING */ if (obj == nil) { if ((c == '\'') || (c == '"')) { NSString *res = nil; char string[_bufLen - pos]; unsigned cnt = 0; pos++; while (pos < _bufLen) { char ch = _buf[pos]; if (ch == c) break; if ((ch == '\\') && (_bufLen > (pos + 1))) { if (_buf[pos + 1] == c) { pos += 1; ch = c; } } string[cnt++] = ch; pos++; } if (pos >= _bufLen) { NSLog(@"WARNING(%s): found end of string before end of quoted text", __PRETTY_FUNCTION__); return nil; } res = [StringClass stringWithCString:string length:cnt]; pos++; /* don`t forget quotations */ if (qDebug) NSLog(@"_parseValue return <%@> for <%s> ", res, _buf); obj = res; } } /* complete parsing of cast */ if (parseComplexCast && (pos + 6) < _bufLen) { /* now we need " as 'dateTime'" [min 7 #] */ /* skip spaces */ while (isspace(_buf[pos]) && pos < _bufLen) pos++; //printf("POS: '%s'\n", &(_buf[pos])); /* parse 'as' */ if (_buf[pos] != 'a' && _buf[pos] != 'A') NSLog(@"%s: expecting 'AS' of complex cast ...", __PRETTY_FUNCTION__); else if (_buf[pos + 1] != 's' && _buf[pos + 1] != 'S') NSLog(@"%s: expecting 'AS' of complex cast ...", __PRETTY_FUNCTION__); else { /* skip AS */ pos += 2; /* skip spaces */ while (isspace(_buf[pos]) && pos < _bufLen) pos++; /* read cast type */ if (_buf[pos] != '\'') { NSLog(@"%s: expected type of complex cast ...", __PRETTY_FUNCTION__); } else { const unsigned char *cs, *ce; //printf("POS: '%s'\n", &(_buf[pos])); pos++; cs = (const unsigned char *)&(_buf[pos]); ce = (const unsigned char *)index((const char *)cs, '\''); cast = [NSString stringWithCString:(const char*)cs length:(ce - cs)]; if (qDebug) { NSLog(@"%s: parsed complex cast: '%@' to '%@'", __PRETTY_FUNCTION__, obj, cast); } pos += (ce - cs); pos++; // skip ' pos++; // skip ) //printf("POS: '%s'\n", &(_buf[pos])); } } } } if (cast != nil && obj != nil) { Class class = Nil; id orig = obj; if ((class = [EOQualifierParserTypeMappings objectForKey:cast]) == nil) { /* no value explicitly mapped to class, try to construct class name... */ NSString *className; className = cast; if ((class = NSClassFromString(className)) == Nil) { /* check some default cast types ... */ className = [cast lowercaseString]; if ([className isEqualToString:@"datetime"]) class = [NSCalendarDate class]; else if ([className isEqualToString:@"datetime.tz"]) class = [NSCalendarDate class]; } } if (class) { obj = [[[class alloc] initWithString:[orig description]] autorelease]; if (obj == nil) { NSLog(@"%s: could not init object '%@' of cast class %@(%@) !", __PRETTY_FUNCTION__, orig, class, cast); obj = null; } } else { NSLog(@"WARNING(%s): could not map cast '%@' to a class " @"(returning null) !", __PRETTY_FUNCTION__, cast); obj = null; } } if (qDebug) { NSLog(@"%s: return <%@> for <%s> ", __PRETTY_FUNCTION__, obj != nil ? obj : (id)@"", _buf); } if (obj != nil) { NSDictionary *d; id keys[2], values[2]; keys[0] = @"length"; values[0] = [NSNumber numberWithUnsignedInt:pos]; keys[1] = @"object"; values[1] = obj; d = [[NSDictionary alloc] initWithObjects:values forKeys:keys count:2]; [_ctx setResult:d forFunction:@"parseValue" atPos:(unsigned long)_buf]; [d release]; *_keyLen = pos; } return obj; } static EOQualifier *_testOperator(id _ctx, const char *_buf, unsigned _bufLen, unsigned *_opLen, BOOL *isAnd) { EOQualifier *qual = nil; char c0, c1, c2 = 0; unsigned pos, len = 0; pos = _countWhiteSpaces(_buf, _bufLen); if (_bufLen < 4) {/* at least OR or AND and somethink more */ if (qDebug) NSLog(@"_testOperator return nil for <%s> ", _buf); return nil; } c0 = _buf[pos + 0]; c1 = _buf[pos + 1]; c2 = _buf[pos + 2]; if (((c0 == 'a') || (c0 == 'A')) && ((c1 == 'n') || (c1 == 'N')) && ((c2 == 'd') || (c2 == 'D'))) { pos += 3; *isAnd = YES; } else if (((c0 == 'o') || (c0 == 'O')) && ((c1 == 'r') || (c1 == 'R'))) { pos += 2; *isAnd = NO; } pos += _countWhiteSpaces(_buf + pos, _bufLen - pos); qual = _parseSingleQualifier(_ctx, _buf + pos, _bufLen - pos, &len); *_opLen = pos + len; if (qDebug) NSLog(@"_testOperator return %@ for <%s> ", qual, _buf); return qual; } static EOQualifier *_parseCompoundQualifier(id _ctx, const char *_buf, unsigned _bufLen, unsigned *_qualLen) { EOQualifier *q0, *q1 = nil; NSMutableArray *array = nil; unsigned pos, len = 0; EOQualifier *result; BOOL isAnd; isAnd = YES; if ((q0 = _parseSingleQualifier(_ctx, _buf, _bufLen, &len)) == nil) { if (qDebug) NSLog(@"_parseAndOrQualifier return nil for <%s> ", _buf); return nil; } pos = len; if (!(q1 = _testOperator(_ctx, _buf + pos, _bufLen - pos, &len, &isAnd))) { if (qDebug) NSLog(@"_parseAndOrQualifier return nil for <%s> ", _buf); return nil; } pos += len; array = [NSMutableArray arrayWithObjects:q0, q1, nil]; while (YES) { BOOL newIsAnd; newIsAnd = YES; q0 = _testOperator(_ctx, _buf + pos, _bufLen - pos, &len, &newIsAnd); if (!q0) break; if (newIsAnd != isAnd) { NSArray *a; a = [[array copy] autorelease]; q1 = (isAnd) ? [_ctx andQualifierWithArray:a] : [_ctx orQualifierWithArray:a]; [array removeAllObjects]; [array addObject:q1]; isAnd = newIsAnd; } [array addObject:q0]; pos += len; } *_qualLen = pos; result = (isAnd) ? [_ctx andQualifierWithArray:array] : [_ctx orQualifierWithArray:array]; if (qDebug) NSLog(@"_parseAndOrQualifier return <%@> for <%s> ", result, _buf); return result; } static inline unsigned _countWhiteSpaces(const char *_buf, unsigned _bufLen) { unsigned cnt = 0; if (_bufLen == 0) { if (qDebug) NSLog(@"_parseString _bufLen == 0 --> return nil"); return 0; } while (_buf[cnt] == ' ' || _buf[cnt] == '\t' || _buf[cnt] == '\n' || _buf[cnt] == '\r') { cnt++; if (cnt == _bufLen) break; } return cnt; } SOPE/sope-core/EOControl/EOGenericRecord.h0000644000000000000000000000371212242733417017202 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __EOControl_EOGenericRecord_h__ #define __EOControl_EOGenericRecord_h__ #import #import #include @class NSDictionary, NSArray, NSString, NSEnumerator; @class EOClassDescription; /* * EOGeneric record class, used for enterprise objects * that do not have special data handling */ @interface EOGenericRecord : NSObject < NSCopying > { EOClassDescription *classDescription; IMP willChange; /* hash-table */ struct _NSMapNode **nodes; unsigned int hashSize; unsigned int itemsCount; } - (id)initWithEditingContext:(id)_ec classDescription:(EOClassDescription *)_classDesc globalID:(EOGlobalID *)_oid; // Key-value coding methods - (void)takeValuesFromDictionary:(NSDictionary *)dictionary; - (NSDictionary *)valuesForKeys:(NSArray *)keys; // Shortcuts to key-value coding methods - (void)setObject:(id)anObject forKey:(id)aKey; - (id)objectForKey:(id)aKey; - (void)removeObjectForKey:(id)aKey; @end /* EOGenericRecord */ @class NSEnumerator; @interface EOGenericRecord(EOMOF2Extensions) - (NSEnumerator *)keyEnumerator; @end #endif /* __EOControl_EOGenericRecord_h__ */ SOPE/sope-core/EOControl/EOKeyComparisonQualifier.m0000644000000000000000000001714612242733417021127 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include "common.h" @implementation EOKeyComparisonQualifier static EONull *null = nil; + (void)initialize { if (null == nil) null = [[EONull null] retain]; } - (id)initWithLeftKey:(NSString *)_leftKey operatorSelector:(SEL)_selector rightKey:(NSString *)_rightKey; { self->leftKey = [_leftKey copyWithZone:NULL]; self->rightKey = [_rightKey copyWithZone:NULL]; self->operator = _selector; return self; } - (void)dealloc { [self->leftKey release]; [self->rightKey release]; [super dealloc]; } /* accessors */ - (NSString *)leftKey { return self->leftKey; } - (NSString *)rightKey { return self->rightKey; } - (SEL)selector { return self->operator; } /* bindings */ - (EOQualifier *)qualifierWithBindings:(NSDictionary *)_bindings requiresAllVariables:(BOOL)_reqAll { static Class VarClass = Nil; NSString *newLeftKey; id newRightKey; BOOL needNew; if (VarClass == Nil) VarClass = [EOQualifierVariable class]; needNew = NO; if ([self->leftKey class] == VarClass) { newLeftKey = [_bindings objectForKey:[(EOQualifierVariable *)self->leftKey key]]; if (newLeftKey == nil) { if (_reqAll) // throw exception ; else newLeftKey = self->leftKey; } else needNew = YES; } else newLeftKey = self->leftKey; if ([self->rightKey class] == VarClass) { newRightKey = [_bindings objectForKey:[(EOQualifierVariable *)self->rightKey key]]; if (newRightKey == nil) { if (_reqAll) // throw exception ; else newRightKey = self->rightKey; } else needNew = YES; } else newRightKey = self->rightKey; if (!needNew) return self; return [[[[self class] alloc] initWithLeftKey:newLeftKey operatorSelector:self->operator rightKey:newRightKey] autorelease]; } - (NSArray *)bindingKeys { static Class VarClass = Nil; Class lkClass, rkClass; if (VarClass == Nil) VarClass = [EOQualifierVariable class]; lkClass = [self->leftKey class]; rkClass = [self->rightKey class]; if ((lkClass == VarClass) && (rkClass == VarClass)) { id o[2]; o[0] = [(EOQualifierVariable *)self->leftKey key]; o[1] = [(EOQualifierVariable *)self->rightKey key]; return [NSArray arrayWithObjects:o count:2]; } if (lkClass == VarClass) return [NSArray arrayWithObject:[(EOQualifierVariable *)self->leftKey key]]; if (rkClass == VarClass) { return [NSArray arrayWithObject: [(EOQualifierVariable *)self->rightKey key]]; } return [NSArray array]; } /* keys */ - (void)addQualifierKeysToSet:(NSMutableSet *)_keys { /* new in WO 4.5 */ [_keys addObject:self->leftKey]; [_keys addObject:self->rightKey]; } /* evaluation */ - (BOOL)evaluateWithObject:(id)_object inEvalContext:(id)_ctx { id lv, rv; BOOL (*m)(id, SEL, id); if (_ctx == nil) _ctx = [NSMutableDictionary dictionaryWithCapacity:16]; if ((lv = [(NSDictionary *)_ctx objectForKey:self->leftKey]) == nil) { lv = [_object valueForKeyPath:self->leftKey]; if (lv == nil) lv = null; [(NSMutableDictionary *)_ctx setObject:lv forKey:self->leftKey]; } if ((rv = [(NSDictionary *)_ctx objectForKey:self->rightKey]) == nil) { rv = [_object valueForKeyPath:self->rightKey]; if (rv == nil) rv = null; [(NSMutableDictionary *)_ctx setObject:rv forKey:self->rightKey]; } if ((m = (void *)[lv methodForSelector:self->operator]) == NULL) { /* no such operator method ! */ [lv doesNotRecognizeSelector:self->operator]; return NO; } return m(lv, self->operator, rv); } - (BOOL)evaluateWithObject:(id)_object { return [self evaluateWithObject:_object inEvalContext:nil]; } /* NSCoding */ - (void)encodeWithCoder:(NSCoder *)_coder { [_coder encodeObject:self->leftKey]; [_coder encodeObject:self->rightKey]; [_coder encodeValueOfObjCType:@encode(SEL) at:&(self->operator)]; } - (id)initWithCoder:(NSCoder *)_coder { self->leftKey = [[_coder decodeObject] copyWithZone:[self zone]]; self->rightKey = [[_coder decodeObject] copyWithZone:[self zone]]; [_coder decodeValueOfObjCType:@encode(SEL) at:&(self->operator)]; return self; } /* Comparing */ - (BOOL)isEqualToQualifier:(EOQualifier *)_qual { if (![self->leftKey isEqual:[(EOKeyComparisonQualifier *)_qual leftKey]]) return NO; if (![self->rightKey isEqual:[(EOKeyComparisonQualifier *)_qual rightKey]]) return NO; if (sel_eq(self->operator, [(EOKeyComparisonQualifier *)_qual selector])) return YES; return NO; } /* remapping keys */ - (EOQualifier *)qualifierByApplyingTransformer:(id)_transformer inContext:(id)_ctx { if ([_transformer respondsToSelector: @selector(transformKeyComparisonQualifier:inContext:)]) { return [_transformer transformKeyComparisonQualifier:self inContext:_ctx]; } else return [[self retain] autorelease]; } - (EOQualifier *)qualifierByApplyingKeyMap:(NSDictionary *)_map { EOKeyComparisonQualifier *kcq; NSString *l, *r; l = [_map objectForKey:self->leftKey]; if (l == nil) l = self->leftKey; r = [_map objectForKey:self->rightKey]; if (r == nil) r = self->rightKey; kcq = [[EOKeyComparisonQualifier alloc] initWithLeftKey:l operatorSelector:self->operator rightKey:r]; return [kcq autorelease]; } /* key/value archiving */ - (id)initWithKeyValueUnarchiver:(EOKeyValueUnarchiver *)_unarchiver { if ((self = [super initWithKeyValueUnarchiver:_unarchiver]) != nil) { NSString *s; self->leftKey = [[_unarchiver decodeObjectForKey:@"leftKey"] retain]; self->rightKey = [[_unarchiver decodeObjectForKey:@"rightKey"] retain]; if ((s = [_unarchiver decodeObjectForKey:@"selectorName"]) != nil) { if (![s hasSuffix:@":"]) s = [s stringByAppendingString:@":"]; self->operator = NSSelectorFromString(s); } else if ((s = [_unarchiver decodeObjectForKey:@"selector"]) != nil) self->operator = NSSelectorFromString(s); } return self; } - (void)encodeWithKeyValueArchiver:(EOKeyValueArchiver *)_archiver { NSString *s; [super encodeWithKeyValueArchiver:_archiver]; [_archiver encodeObject:[self leftKey] forKey:@"leftKey"]; [_archiver encodeObject:[self rightKey] forKey:@"rightKey"]; s = NSStringFromSelector([self selector]); if ([s hasSuffix:@":"]) s = [s substringToIndex:[s length] - 1]; [_archiver encodeObject:s forKey:@"selectorName"]; } /* description */ - (NSString *)description { NSMutableString *s; s = [NSMutableString stringWithCapacity:64]; [s appendString:self->leftKey]; [s appendString:@" "]; [s appendString:[EOQualifier stringForOperatorSelector:self->operator]]; [s appendString:@" "]; [s appendString:self->rightKey]; return s; } @end /* EOKeyComparisonQualifier */ SOPE/sope-core/EOControl/EOKeyGlobalID.m0000644000000000000000000001003712242733417016560 0ustar rootroot/* Copyright (C) 2000-2006 SKYRIX Software AG Copyright (C) 2006 Helge Hess This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "EOKeyGlobalID.h" #include "common.h" @implementation EOKeyGlobalID + (id)globalIDWithEntityName:(NSString *)_name keys:(id *)_keyValues keyCount:(unsigned int)_count zone:(NSZone *)_zone { EOKeyGlobalID *kid; NSAssert1(_count > 0, @"missing key-values (count is 0, entity is %@", _name); if ((kid = (id)NSAllocateObject(self, sizeof(id) * _count, _zone))) { unsigned int i; kid->entityName = [_name copyWithZone:_zone]; kid->count = _count; for (i = 0; i < _count; i++) { #if DEBUG if (_keyValues[i] == nil) { NSLog(@"WARN(%s): got 'nil' as a EOKeyGlobalID value (entity=%@)!", __PRETTY_FUNCTION__, _name); } #endif kid->values[i] = [_keyValues[i] retain]; } return [kid autorelease]; } return nil; } - (void)dealloc { unsigned int i; for (i = 0; i < self->count; i++) { [self->values[i] release]; self->values[i] = nil; } [self->entityName release]; [super dealloc]; } /* accessors */ - (NSString *)entityName { return self->entityName; } - (unsigned int)keyCount { return self->count; } - (id *)keyValues { return &(self->values[0]); } - (NSArray *)keyValuesArray { return [NSArray arrayWithObjects:&(self->values[0]) count:self->count]; } /* Equality */ - (NSUInteger)hash { return [self->entityName hash] - [self->values[0] hash]; } - (BOOL)isEqual:(id)_other { EOKeyGlobalID *otherKey; unsigned int i; if (_other == nil) return NO; if (_other == self) return YES; otherKey = _other; if (otherKey->isa != self->isa) return NO; if (otherKey->count != self->count) return NO; if (![otherKey->entityName isEqualToString:self->entityName]) return NO; for (i = 0; i < self->count; i++) { if (self->values[i] != otherKey->values[i]) { if (![self->values[i] isEqual:otherKey->values[i]]) return NO; } } return YES; } /* NSCopying */ - (id)copyWithZone:(NSZone *)_zone { return [self retain]; } /* NSCoding */ - (void)encodeWithCoder:(NSCoder *)_coder { [self doesNotRecognizeSelector:_cmd]; } - (id)initWithCoder:(NSCoder *)_coder { [self doesNotRecognizeSelector:_cmd]; return nil; #if 0 NSString *entityName; NSZone *z; unsigned int count; z = [self zone]; [self release]; entityName = [_coder decodeObject]; self = [EOKeyGlobalID globalIDWithEntityName:entityName keys:NULL keyCount:0 zone:z]; return [self retain]; #endif } /* description */ - (NSString *)description { NSMutableString *s; NSString *d; unsigned int i; s = [[NSMutableString alloc] init]; [s appendFormat:@"<0x%p[%@]: %@", self, NSStringFromClass([self class]), [self entityName]]; if (self->count == 0) { [s appendString:@" no-key-values"]; } else { for (i = 0; i < self->count; i++) { if (i == 0) [s appendString:@" "]; else [s appendString:@"/"]; if (self->values[i] == nil) [s appendString:@""]; else if (self->values[i] == nil) [s appendString:@""]; else [s appendString:[self->values[i] stringValue]]; } } [s appendString:@">"]; d = [s copy]; [s release]; return [d autorelease]; } @end /* EOKeyGlobalID */ SOPE/sope-core/EOControl/EOControl-Info.plist0000644000000000000000000000134412242733417017703 0ustar rootroot CFBundleDevelopmentRegion English CFBundleExecutable EOControl CFBundleGetInfoString CFBundleIdentifier org.OpenGroupware.SOPE.core.EOControl CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType FMWK CFBundleShortVersionString CFBundleSignature ???? CFBundleVersion 4.5 SOPE/sope-core/EOControl/COPYRIGHT0000644000000000000000000000010612242733417015357 0ustar rootrootCopyright (C) 2000-2005 SKYRIX Software AG Contact: info@skyrix.com SOPE/sope-core/EOControl/EODataSource.h0000644000000000000000000000263512242733417016524 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __EOControl_EODataSource_H__ #define __EOControl_EODataSource_H__ #import @class NSArray, NSEnumerator; @class EOClassDescription; @interface EODataSource : NSObject /* reflection */ - (EOClassDescription *)classDescriptionForObjects; /* master-detail */ - (EODataSource *)dataSourceQualifiedByKey:(NSString *)_relKey; - (void)qualifyWithRelationshipKey:(NSString *)_relKey ofObject:(id)_object; /* operations */ - (NSArray *)fetchObjects; - (void)deleteObject:(id)_object; - (void)insertObject:(id)_object; - (id)createObject; - (NSEnumerator *)fetchEnumerator; @end #endif /* __EOControl_EODataSource_H__ */ SOPE/sope-core/EOControl/EONull.h0000644000000000000000000000230212242733417015373 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __EOControl_EONull_h__ #define __EOControl_EONull_h__ #import #ifndef HAVE_NSNull # define HAVE_NSNull 1 #endif #if HAVE_NSNull #import #define EONull NSNull #else /* !HAVE_NSNull | NeXT Foundation */ #import @interface EONull : NSObject + (id)null; @end /* EONull */ #endif /* !HAVE_NSNull */ #endif /* __EOControl_EONull_h__ */ SOPE/sope-core/EOControl/EOAndQualifier.m0000644000000000000000000001734312242733417017045 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include "common.h" @interface EOQualifier(EvalContext) - (BOOL)evaluateWithObject:(id)_object inEvalContext:(id)_ctx; @end @implementation EOAndQualifier static BOOL debugEval = NO; static BOOL debugTransform = NO; + (void)initialize { debugEval = [EOQualifier isEvaluationDebuggingEnabled]; } - (id)initWithQualifierArray:(NSArray *)_qualifiers { self->count = [_qualifiers count]; self->qualifiers = [_qualifiers copyWithZone:[self zone]]; return self; } - (id)initWithQualifiers:(EOQualifier *)_qual1, ... { va_list va; EOQualifier *q; id *qs; unsigned c; NSArray *a; va_start(va, _qual1); for (c = 0, q = _qual1; q != nil; q = va_arg(va, id), c++) ; va_end(va); if (c == 0) return [self initWithQualifierArray:nil]; qs = calloc(c, sizeof(id)); va_start(va, _qual1); for (c = 0, q = _qual1; q != nil; q = va_arg(va, id), c++) { qs[c] = q; } va_end(va); a = [NSArray arrayWithObjects:qs count:c]; if (qs) free(qs); return [self initWithQualifierArray:a]; } - (void)dealloc { [self->qualifiers release]; [super dealloc]; } - (NSArray *)qualifiers { return self->qualifiers; } - (NSArray *)subqualifiers { return [self qualifiers]; } /* bindings */ - (EOQualifier *)qualifierWithBindings:(NSDictionary *)_bindings requiresAllVariables:(BOOL)_reqAll { NSArray *array; id objects[self->count + 1]; unsigned i; id (*objAtIdx)(id,SEL,unsigned); objAtIdx = (void *) [self->qualifiers methodForSelector:@selector(objectAtIndex:)]; for (i = 0; i < self->count; i++) { id q, newq; q = objAtIdx(self->qualifiers, @selector(objectAtIndex:), i); newq = [q qualifierWithBindings:_bindings requiresAllVariables:_reqAll]; if (newq == nil) newq = q; objects[i] = newq; } array = [NSArray arrayWithObjects:objects count:self->count]; return [[[[self class] alloc] initWithQualifierArray:array] autorelease]; } - (NSArray *)bindingKeys { NSMutableSet *keys = nil; unsigned i; IMP objAtIdx; objAtIdx = [self->qualifiers methodForSelector:@selector(objectAtIndex:)]; for (i = 0; i < self->count; i++) { NSArray *qb; id q; q = objAtIdx(self->qualifiers, @selector(objectAtIndex:), i); qb = [q bindingKeys]; if ([qb count] > 0) { if (keys == nil) keys = [NSMutableSet setWithCapacity:16]; [keys addObjectsFromArray:qb]; } } return keys ? [keys allObjects] : (NSArray *)[NSArray array]; } /* keys */ - (void)addQualifierKeysToSet:(NSMutableSet *)_keys { /* new in WO 4.5 */ [self->qualifiers makeObjectsPerformSelector:_cmd withObject:_keys]; } /* evaluation */ - (BOOL)evaluateWithObject:(id)_object inEvalContext:(id)_ctx { unsigned i; IMP objAtIdx; if ((_ctx == nil) && (self->count > 1)) _ctx = [NSMutableDictionary dictionaryWithCapacity:16]; objAtIdx = [self->qualifiers methodForSelector:@selector(objectAtIndex:)]; for (i = 0; i < self->count; i++) { id q; q = objAtIdx(self->qualifiers, @selector(objectAtIndex:), i); if (![q evaluateWithObject:_object inEvalContext:_ctx]) { if (debugEval) { NSLog(@"Eval: EOAndQualifier '%@':\n qualifier[%i]: '%@'\n" @" failed on object '%@'", self, i+1, q, _object); } return NO; } } if (debugEval) { NSLog(@"Eval: EOAndQualifier '%@':\n true on object '%@'", self, _object); } return YES; } - (BOOL)evaluateWithObject:(id)_object { return [self evaluateWithObject:_object inEvalContext:nil]; } /* NSCoding */ - (void)encodeWithCoder:(NSCoder *)_coder { [_coder encodeObject:self->qualifiers]; } - (id)initWithCoder:(NSCoder *)_coder { self->qualifiers = [[_coder decodeObject] retain]; return self; } /* Comparing */ - (BOOL)isEqualToQualifier:(EOQualifier *)_qual { return [self->qualifiers isEqualToArray:[(EOAndQualifier *)_qual qualifiers]]; } /* remapping keys */ - (EOQualifier *)qualifierByApplyingTransformer:(id)_transformer inContext:(id)_ctx { if ([_transformer respondsToSelector: @selector(transformAndQualifier:inContext:)]) { if (debugTransform) NSLog(@"transformer: %@\n transform: %@", _transformer, self); return [_transformer transformAndQualifier:self inContext:_ctx]; } else { EOAndQualifier *aq; NSArray *a; id *qs; unsigned i; BOOL didTransform = NO; if (debugTransform) { NSLog(@"EOAndQualifier: transform %i using %@ ...", self->count, _transformer); } qs = calloc(self->count + 1, sizeof(id)); for (i = 0; i < self->count; i++) { EOQualifier *q; q = [self->qualifiers objectAtIndex:i]; qs[i] = [q qualifierByApplyingTransformer:_transformer inContext:_ctx]; if (qs[i] == nil) qs[i] = q; else if (qs[i] != q) { if (debugTransform) NSLog(@"EOAndQualifier: subqualifier %i did transform", i); didTransform = YES; } else if (debugTransform) NSLog(@"EOAndQualifier: subqualifier %i did not transform", i); } if (didTransform) { a = [[NSArray alloc] initWithObjects:qs count:self->count]; if (qs) free(qs); aq = [[EOAndQualifier alloc] initWithQualifierArray:a]; [a release]; return [aq autorelease]; } else { if (qs) free(qs); return [[self retain] autorelease]; } } } - (EOQualifier *)qualifierByApplyingKeyMap:(NSDictionary *)_map { EOAndQualifier *aq; NSArray *a; id *qs; unsigned i; qs = calloc(self->count + 1, sizeof(id)); for (i = 0; i < self->count; i++) { EOQualifier *q; q = [self->qualifiers objectAtIndex:i]; qs[i] = [q qualifierByApplyingKeyMap:_map]; if (qs[i] == nil) qs[i] = q; } a = [[NSArray alloc] initWithObjects:qs count:self->count]; if (qs) free(qs); aq = [[EOAndQualifier alloc] initWithQualifierArray:a]; [a release]; return [aq autorelease]; } /* key/value archiving */ - (id)initWithKeyValueUnarchiver:(EOKeyValueUnarchiver *)_unarchiver { if ((self = [super initWithKeyValueUnarchiver:_unarchiver]) != nil) { self->qualifiers = [[_unarchiver decodeObjectForKey:@"qualifiers"] copy]; self->count = [self->qualifiers count]; } return self; } - (void)encodeWithKeyValueArchiver:(EOKeyValueArchiver *)_archiver { [super encodeWithKeyValueArchiver:_archiver]; [_archiver encodeObject:[self qualifiers] forKey:@"qualifiers"]; } /* description */ - (NSString *)description { NSMutableString *ms; NSArray *sd; unsigned i, len; sd = [self->qualifiers valueForKey:@"qualifierDescription"]; if ((len = [sd count]) == 0) return nil; if (len == 1) return [sd objectAtIndex:0]; ms = [NSMutableString stringWithCapacity:(len * 16)]; [ms appendString:@"("]; for (i = 0; i < len; i++) { if (i != 0) [ms appendString:@" AND "]; [ms appendString:[sd objectAtIndex:i]]; } [ms appendString:@")"]; return ms; } @end /* EOAndQualifier */ SOPE/sope-core/EOControl/ChangeLog0000644000000000000000000002073312242733417015646 0ustar rootroot2009-03-24 Wolfgang Sourdeau * EOGenericRecord.m: special support for gstep-base (v4.7.74) 2007-04-17 Helge Hess * EOKeyValueCoding.m: fixed a gcc4 warning (v4.7.73) 2007-01-15 Stephane Corthesy * EOQualifierParser.m (_parseValue): fixed a bug in the qualifier parser (v4.5.72) 2006-12-17 Marcus Mueller * EOKeyValueCoding.m: fixed a runtime portability issue - removed +initialize on NSArray category (v4.5.71) 2006-12-02 Marcus Mueller * EOKeyValueCoding.m: fixed numerous bugs in the computeXXX: methods and provided proper implementations according to the WO4.5 specs for gnustep-base and Apple Foundation (v4.5.70) 2006-12-02 Helge Hess * EOKeyValueCoding.m: added NSDecimalNumber implementation for -computeSumForKey: (TBD: implementations for the other methods) (v4.5.69) 2006-09-30 Helge Hess * EOKeyGlobalID.m: print a warning if a key-gid is created with a nil value, improved -description (v4.5.68) 2006-08-18 Helge Hess * EOKeyValueCoding.m: -valueForKey: now returns mutable arrays when being called on mutable arrays (WO 4.5 compatibility) (v4.5.67) 2006-07-04 Helge Hess * 64bit fixes (v4.5.66) 2006-07-03 Helge Hess * v4.5.65 * EOKeyValueCoding.m: reduced autorelease usage in KVC key creation * use %p for pointer formats, fixed gcc 4.1 warnings 2006-05-02 Marcus Mueller * EOSortOrdering.m: use keyPaths instead of just keys in keyOrderComparator() function - this is feature compatible with Apple's EOF 4.5 (v4.5.64) 2006-02-20 Helge Hess * EOKeyValueCoding.m: do not use EOKeyValueCoding with gstep-base (KVC implemented directly in base) (v4.5.63) 2005-11-17 Helge Hess * v4.5.62 * EOKeyValueQualifier.m: fixed some SEL related warnings * common.h: properly include string.h 2005-10-03 Helge Hess * EOKeyValueQualifier.m: improved -description in edge conditions, added warnings if the qualifier is initialized with insufficient values (v4.5.61) 2005-08-23 Helge Hess * EOQualifier.m: added NSCopying (v4.5.60) 2005-08-06 Helge Hess * EOKeyValueArchiver.m: improved decoding of bools (v4.5.59) 2005-08-05 Helge Hess * v4.5.58 * EODetailDataSource.m: added EOKeyValueArchiving * EOSortOrdering.m: use 'selectorName' instead of 'selector' for kv archiving * EOKeyValueArchiver.m: fixed decoding of arrays 2005-08-04 Helge Hess * EOKeyValueArchiver.m: fixed a bug with decoding references (v4.5.57) * EOKeyValueArchiver.m: print a warning if a class specified in the archive could not be found (v4.5.56) 2005-08-04 Helge Hess * v4.5.55 * EOSortOrdering.m, EOFetchSpecification.m: added EOKeyValueArchiving * EO*Qualifier.m: added EOKeyValueArchiving to EOQualifier classes * NSObject+EOQualifierOps.m: fixed gcc 4.0 warnings 2005-08-04 Helge Hess * EOKeyValueArchiver.m: process class names containing a dot by first looking up the class using the last dot-component and then by trying to map some known prefixes (eg D2W) (v4.5.54) 2005-05-03 Helge Hess * EOQualifier.h: fixed prototypes of -isLike/-isCaseInsensitiveLike: (v4.5.53) * NSObject+EOQualifierOps.m: fixed signature of -isLike: and -isCaseInsensitiveLike: to match Tiger (v4.5.52) 2005-04-24 Helge Hess * fixed gcc 4.0 signed/unsigned warnings (v4.5.51) 2005-01-14 Helge Hess * EOFetchSpecification.m: minor code cleanups (v4.5.50) 2004-12-14 Marcus Mueller * EOControl.xcode: minor changes and updated 2004-12-05 Helge Hess * EOKeyGlobalID.m: minor code cleanup (v4.5.49) 2004-08-29 Helge Hess * added hack to install the project in FHS locations - the library, its headers, the tools and the resources will be installed in FHS_INSTALL_ROOT if specified (eg make FHS_INSTALL_ROOT=/usr/local) (v4.3.48) 2004-08-29 Marcus Mueller * EOControl.xcode: various fixes for project settings 2004-08-23 Marcus Mueller * added new Xcode project 2004-08-20 Helge Hess * moved to SOPE 4.3 (v4.3.47) 2004-07-22 Helge Hess * EOKeyComparisonQualifier.m, EOKeyValueQualifier.m, EOKeyValueArchiver.m, EOFetchSpecification.m: fixed gcc 3.4 warnings (v4.2.46) 2004-06-09 Helge Hess * v4.2.45 * GNUmakefile.preamble: added prebinding * GNUmakefile: minor cleanups 2004-05-16 Helge Hess * EOKeyComparisonQualifier.m, EOKeyValueQualifier.m, EOQualifier.m, EOQualifierVariable.m: minor code cleanups, fixed some "== YES" comparisons (v4.2.44) 2004-04-07 Helge Hess * EOQualifierParser.m: minor code cleanups (==YES) (v4.2.43) 2004-03-15 Helge Hess * EOFetchSpecification, EOQualifier, EOSortOrdering: moved property list initializer methods to NGExtensions to improve GDL2 compatibility (v4.2.42) 2004-03-11 Helge Hess * EOFetchSpecification, EOQualifier, EOSortOrdering: deprecated -initWithPropertyList: method, added new -initWithPropertyList:owner: method (like in EOPropertyListEncoding) (v4.2.41) 2004-03-09 Helge Hess * EOFetchSpecification.m: subminor improvement in -copyWithZone: method (v4.2.40) 2004-03-03 Helge Hess * EOFetchSpecification.m: fixed a recursion introduced in v4.2.38 (v4.2.39) 2004-03-02 Helge Hess * v4.2.38 * EOQualifier.m: added -qualifierByApplyingBindings: to improve GDL2 compatibility (should not be used) * EOFetchSpecification.m: added -fetchSpecificationByApplyingBindings: to improve GDL2 compatibility (should not be used) * EOQualifier.m: moved EOQualifierVariable to separate file, moved qualifier-description categories to separate files * EOFetchSpecification.m, EOSQLParser.m: improved GDL2/EOF 3 compatibility (different -init method, deprecated old) 2003-12-29 Helge Hess * EOKeyValueCoding.m: do not invoke NSDictionary -objectForKey: with 'nil' key (v4.2.37) 2003-11-25 Helge Hess * removed unused source files (v4.2.36) [what was v4.2.35?, missing] 2003-11-14 Helge Hess * EOSortOrdering.m: added an assertion to prevent index overflows (v4.2.34) Tue Nov 11 12:01:10 2003 Jan Reichmann * common.h: fixed Free marcro declaration (introduced in 4.2.33) (v4.2.34) 2003-11-09 Helge Hess * v4.2.33 * common.h: always use malloc/free for allocating instead of objc_malloc/objc_free to clean up the code * EOAndQualifier.m: some minor tweaks for Xcode * EOFault.m: removed support for Boehm GC to clean up the code 2003-09-06 Helge Hess * EOGenericRecord.m: fixed a warning on MacOSX (used return in dealloc ...) (v4.2.32) * v4.2.31 * EOSQLParser.m: do not use stringByReplacingString:withString: * EOClassDescription.m: fixed some warning on OSX 2003-09-06 Marcus Mueller * EOFault.m/EOFaultHandler.m: ported to NeXT runtime (v4.2.30) 2003-09-01 Helge Hess * changed not to require FoundationExt on MacOSX (v4.2.29) 2003-08-07 Helge Hess * EOQualifierParser.m: added facility to register own classes for complex cast expressions (eg "cast(xxxx as myValue)"), required for Evolution 1.4.4. Also less restrictive about whitespace between "cast" and the "(" (v4.2.28) Fri Jul 4 17:00:54 2003 Helge Hess * added to OpenGroupware.org * stripped out old ChangeLogs, unimportant for OGo Wed Dec 8 18:35:40 1999 Helge Hess * created ChangeLog SOPE/sope-core/EOControl/EOArrayDataSource.m0000644000000000000000000000544512242733417017532 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include "common.h" @interface EODataSource(PostChange) - (void)postDataSourceChangedNotification; @end @implementation EOArrayDataSource - (id)init { if ((self = [super init])) { self->objects = [[NSMutableArray alloc] init]; } return self; } - (void)dealloc { [self->fetchSpecification release]; [self->objects release]; [super dealloc]; } /* accessors */ - (void)setFetchSpecification:(EOFetchSpecification *)_fspec { if ([self->fetchSpecification isEqual:_fspec]) return; [self->fetchSpecification autorelease]; self->fetchSpecification = [_fspec copy]; [self postDataSourceChangedNotification]; } - (EOFetchSpecification *)fetchSpecification { return self->fetchSpecification; } - (void)setArray:(NSArray *)_array { [self->objects removeAllObjects]; [self->objects addObjectsFromArray:_array]; } /* fetching */ - (NSArray *)fetchObjects { NSArray *result; if (self->fetchSpecification == nil) { result = [[self->objects copy] autorelease]; } else { EOQualifier *q; NSArray *sort; q = [self->fetchSpecification qualifier]; sort = [self->fetchSpecification sortOrderings]; if (q == nil) { if (sort) result = [self->objects sortedArrayUsingKeyOrderArray:sort]; else result = [[self->objects copy] autorelease]; } else { result = [self->objects filteredArrayUsingQualifier:q]; if (sort) result = [result sortedArrayUsingKeyOrderArray:sort]; } } return result; } /* operations */ - (void)deleteObject:(id)_object { [self->objects removeObjectIdenticalTo:_object]; [self postDataSourceChangedNotification]; } - (void)insertObject:(id)_object { [self->objects addObject:_object]; [self postDataSourceChangedNotification]; } - (id)createObject { return [NSMutableDictionary dictionaryWithCapacity:16]; } @end /* EOArrayDataSource */ SOPE/sope-core/EOControl/EODataSource.m0000644000000000000000000000433212242733417016525 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include "common.h" @implementation EODataSource /* reflection */ - (EOClassDescription *)classDescriptionForObjects { return nil; } /* master-detail */ - (EODataSource *)dataSourceQualifiedByKey:(NSString *)_relKey { [NSException raise:@"NSInvalidArgumentException" format:@"datasource %@ can't return a ds qualified by key '%@'", self, _relKey]; return nil; } - (void)qualifyWithRelationshipKey:(NSString *)_relKey ofObject:(id)_object { [NSException raise:@"NSInvalidArgumentException" format:@"datasource %@ can't qualify by key '%@' of object %@", self, _relKey, _object]; } /* operations */ - (NSArray *)fetchObjects { return nil; } - (NSEnumerator *)fetchEnumerator { return [[self fetchObjects] objectEnumerator]; } - (void)deleteObject:(id)_object { [NSException raise:@"NSInvalidArgumentException" format:@"datasource %@ can't delete object %@", self, _object]; } - (void)insertObject:(id)_object { [NSException raise:@"NSInvalidArgumentException" format:@"datasource %@ can't insert object %@", self, _object]; } - (id)createObject { EOClassDescription *cd; if ((cd = [self classDescriptionForObjects]) == nil) return nil; return [cd createInstanceWithEditingContext:nil globalID:nil zone:NULL]; } @end /* EODataSource */ SOPE/sope-core/EOControl/EOClassDescription.m0000644000000000000000000003130412242733417017743 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "EOClassDescription.h" #include "EOKeyValueCoding.h" #include "EONull.h" #include "common.h" @implementation NSClassDescription(EOClassDescription) /* model */ - (NSString *)entityName { return nil; } - (NSString *)inverseForRelationshipKey:(NSString *)_key { return nil; } - (NSClassDescription *)classDescriptionForDestinationKey:(NSString *)_key { return nil; } /* object initialization */ - (id)createInstanceWithEditingContext:(id)_ec globalID:(EOGlobalID *)_oid zone:(NSZone *)_zone { return nil; } - (void)awakeObject:(id)_object fromFetchInEditingContext:(id)_ec { } - (void)awakeObject:(id)_object fromInsertionInEditingContext:(id)_ec { } /* formatting */ - (NSFormatter *)defaultFormatterForKey:(NSString *)_key { return nil; } - (NSFormatter *)defaultFormatterForKeyPath:(NSString *)_keyPath { return nil; } /* delete */ - (void)propagateDeleteForObject:(id)_object editingContext:(id)_ec { } @end /* NSClassDescription(EOClassDescription) */ @implementation EOClassDescription // THREAD static NSMapTable *entityToDesc = NULL; static NSMapTable *classToDesc = NULL; + (void)initialize { if (entityToDesc == NULL) { entityToDesc = NSCreateMapTable(NSObjectMapKeyCallBacks, NSObjectMapValueCallBacks, 32); } if (classToDesc == NULL) { classToDesc = NSCreateMapTable(NSObjectMapKeyCallBacks, NSObjectMapValueCallBacks, 32); } } + (NSClassDescription *)classDescriptionForClass:(Class)_class { EOClassDescription *d; #if DEBUG NSAssert(_class != [EOGlobalID class], @"classDescriptionForClass:EOGlobalID ???"); #endif if ((d = NSMapGet(classToDesc, _class))) return d; [[NSNotificationCenter defaultCenter] postNotificationName: @"EOClassDescriptionNeededForClass" object:_class]; return NSMapGet(classToDesc, _class); } + (NSClassDescription *)classDescriptionForEntityName:(NSString *)_entityName { NSClassDescription *d; if ((d = NSMapGet(entityToDesc, _entityName))) return d; [[NSNotificationCenter defaultCenter] postNotificationName: @"EOClassDescriptionNeededForEntityName" object:_entityName]; return NSMapGet(entityToDesc, _entityName); } + (void)invalidateClassDescriptionCache { NSResetMapTable(entityToDesc); NSResetMapTable(classToDesc); } + (void)registerClassDescription:(NSClassDescription *)_clazzDesc forClass:(Class)_class { NSString *entityName; if (_clazzDesc == nil) return; if (_class) NSMapInsert(classToDesc, _class, _clazzDesc); if ((entityName = [_clazzDesc entityName])) NSMapInsert(entityToDesc, entityName, _clazzDesc); } /* description */ - (NSString *)description { return [NSString stringWithFormat:@"<%@[0x%p]: entity=%@>", NSStringFromClass([self class]), self, [self entityName]]; } @end /* EOClassDescription */ @implementation NSObject(EOClassDescription) - (NSClassDescription *)classDescriptionForDestinationKey:(NSString *)_key { return [[self classDescription] classDescriptionForDestinationKey:_key]; } /* object initialization */ - (id)initWithEditingContext:(id)_ec classDescription:(NSClassDescription *)_classDesc globalID:(EOGlobalID *)_oid { return [self init]; } - (void)awakeFromFetchInEditingContext:(id)_ec { [[self classDescription] awakeObject:self fromFetchInEditingContext:_ec]; } - (void)awakeFromInsertionInEditingContext:(id)_ec { [[self classDescription] awakeObject:self fromInsertionInEditingContext:_ec]; } /* model */ - (NSString *)entityName { return [[self classDescription] entityName]; } - (NSString *)inverseForRelationshipKey:(NSString *)_key { return [[self classDescription] inverseForRelationshipKey:_key]; } - (NSArray *)attributeKeys { return [[self classDescription] attributeKeys]; } - (BOOL)isToManyKey:(NSString *)_key { return [[self toManyRelationshipKeys] containsObject:_key]; } - (NSArray *)allPropertyKeys { NSArray *attrs; attrs = [self attributeKeys]; attrs = attrs ? [attrs arrayByAddingObjectsFromArray:[self toOneRelationshipKeys]] : [self toOneRelationshipKeys]; attrs = attrs ? [attrs arrayByAddingObjectsFromArray:[self toManyRelationshipKeys]] : [self toManyRelationshipKeys]; return attrs; } /* delete */ - (void)propagateDeleteWithEditingContext:(id)_ec { [[self classDescription] propagateDeleteForObject:self editingContext:_ec]; } @end /* NSObject(EOClassDescription) */ @implementation NSException(EOValidation) + (NSException *)aggregateExceptionWithExceptions:(NSArray *)_exceptions { NSException *e; e = [[self alloc] initWithName:@"EOAggregateException" reason:@"several exceptions occured" userInfo: [NSDictionary dictionaryWithObject:_exceptions forKey:@"exceptions"]]; return [e autorelease]; } @end /* NSException(EOValidation) */ /* snapshots */ @implementation NSObject(EOSnapshots) - (NSDictionary *)snapshot { static NSNull *null = nil; NSMutableDictionary *d; NSDictionary *r; NSEnumerator *e; NSString *key; if (null == nil) null = [NSNull null]; d = [[NSMutableDictionary alloc] initWithCapacity:64]; e = [[self attributeKeys] objectEnumerator]; while ((key = [e nextObject])) { id value; value = [self valueForKey:key]; value = (value == nil) ? (id)[null retain] : (id)[value copy]; [d setObject:value forKey:key]; [value release]; value = nil; } e = [[self toOneRelationshipKeys] objectEnumerator]; while ((key = [e nextObject])) { id value; value = [self valueForKey:key]; if (value == nil) value = [NSNull null]; [d setObject:value forKey:key]; } e = [[self toManyRelationshipKeys] objectEnumerator]; while ((key = [e nextObject])) { id value; value = [self valueForKey:key]; if (value == nil) { value = [[NSNull null] retain]; } else { value = [value shallowCopy]; } [d setObject:value forKey:key]; [value release]; value = nil; } r = [d copy]; [d release]; d = nil; return [r autorelease]; } - (void)updateFromSnapshot:(NSDictionary *)_snapshot { [self takeValuesFromDictionary:_snapshot]; } - (NSDictionary *)changesFromSnapshot:(NSDictionary *)_snapshot { /* not really correct, need to work on relationships */ static NSNull *null = nil; NSMutableDictionary *diff; NSEnumerator *props; NSString *key; if (null == nil) null = [NSNull null]; diff = [NSMutableDictionary dictionaryWithCapacity:32]; props = [[self allPropertyKeys] objectEnumerator]; while ((key = [props nextObject])) { id value; id svalue; value = [self valueForKey:key]; svalue = [_snapshot objectForKey:key]; if (value == nil) value = null; if (svalue == nil) svalue = null; if (svalue != value) { /* difference */ if ([self isToManyKey:key]) { id adiff[2]; adiff[0] = [NSArray array]; adiff[1] = [NSArray array]; /* to be completed: calc real diff */ [diff setObject:[NSArray arrayWithObjects:adiff count:2] forKey:key]; } else [diff setObject:value forKey:key]; } } return diff; } - (void)reapplyChangesFromDictionary:(NSDictionary *)_changes { /* not really correct, need to work on relationships */ NSEnumerator *keys; NSString *key; keys = [_changes keyEnumerator]; while ((key = [keys nextObject])) { id value; value = [_changes objectForKey:key]; if ([self isToManyKey:key]) { NSArray *added; NSArray *deleted; NSMutableArray *current; added = [value objectAtIndex:0]; deleted = [value objectAtIndex:1]; current = [[self valueForKey:key] mutableCopy]; if (added) [current addObjectsFromArray:added]; if (deleted) [current removeObjectsInArray:deleted]; [current release]; current = nil; } else [self takeValue:value forKey:key]; [self takeValuesFromDictionary:_changes]; } } @end /* NSObject(EOSnapshots) */ /* relationships */ @implementation NSObject(EORelationshipManipulation) - (void)addObject:(id)_o toBothSidesOfRelationshipWithKey:(NSString *)_key { NSString *revKey; BOOL isToMany; revKey = [self inverseForRelationshipKey:_key]; isToMany = [self isToManyKey:_key]; self = [[self retain] autorelease]; _o = [[_o retain] autorelease]; if (isToMany) { /* watch out, likely to be buggy ! */ [self addObject:_o toPropertyWithKey:_key]; } else [self takeValue:_o forKey:_key]; if (revKey) { /* add to the reverse object */ BOOL revIsToMany; revIsToMany = [_o isToManyKey:revKey]; if (revIsToMany) [_o addObject:self toPropertyWithKey:revKey]; else [_o takeValue:self forKey:revKey]; } } - (void)removeObject:(id)_o fromBothSidesOfRelationshipWithKey:(NSString *)_key { NSString *revKey; BOOL isToMany; revKey = [self inverseForRelationshipKey:_key]; isToMany = [self isToManyKey:_key]; self = [[self retain] autorelease]; _o = [[_o retain] autorelease]; /* remove from this object */ if (isToMany) [self removeObject:_o fromPropertyWithKey:_key]; else [self takeValue:nil forKey:_key]; if (revKey) { /* remove from reverse object */ BOOL revIsToMany; revIsToMany = [_o isToManyKey:revKey]; if (revIsToMany) [_o removeObject:self fromPropertyWithKey:revKey]; else [_o takeValue:nil forKey:revKey]; } } - (void)addObject:(id)_object toPropertyWithKey:(NSString *)_key { NSString *selname; SEL sel; selname = [@"addTo" stringByAppendingString:[_key capitalizedString]]; sel = NSSelectorFromString(selname); if ([self respondsToSelector:sel]) [self performSelector:sel withObject:_object]; else { id v; v = [self valueForKey:_key]; if ([self isToManyKey:_key]) { /* to-many relationship */ if (v == nil) { [self takeValue:[NSArray arrayWithObject:_object] forKey:_key]; } else if (![v containsObject:_object]) { if ([v respondsToSelector:@selector(addObject:)]) [v addObject:_object]; else { v = [v arrayByAddingObject:_object]; [self takeValue:v forKey:_key]; } } } else { /* to-one relationship */ if (v != _object) [self takeValue:v forKey:_key]; } } } - (void)removeObject:(id)_object fromPropertyWithKey:(NSString *)_key { NSString *selname; SEL sel; selname = [@"removeFrom" stringByAppendingString:[_key capitalizedString]]; sel = NSSelectorFromString(selname); if ([self respondsToSelector:sel]) [self performSelector:sel withObject:_object]; else { id v; v = [self valueForKey:_key]; if ([self isToManyKey:_key]) { /* to-many relationship */ if (v == nil) { /* do nothing */ } else if (![v containsObject:_object]) { if ([v respondsToSelector:@selector(addObject:)]) [v removeObject:_object]; else { v = [v mutableCopy]; [v removeObject:_object]; [self takeValue:v forKey:_key]; [v release]; v = nil; } } } else { /* to-one relationship */ [self takeValue:nil forKey:_key]; } } } @end /* NSObject(EORelationshipManipulation) */ /* shallow array copying */ @implementation NSArray(ShallowCopy) - (id)shallowCopy { NSArray *a; unsigned i, cc; id *objects; cc = [self count]; objects = calloc(cc + 1, sizeof(id)); for (i = 0; i < cc; i++) objects[i] = [self objectAtIndex:i]; a = [[NSArray alloc] initWithObjects:objects count:cc]; if (objects) free(objects); return a; } @end /* NSArray(ShallowCopy) */ SOPE/sope-core/EOControl/EOControlDecls.h0000644000000000000000000000234212242733417017060 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __EOControl_EOControlDecls_H__ #define __EOControl_EOControlDecls_H__ #if BUILD_libEOControl_DLL # define EOControl_EXPORT __declspec(dllexport) # define EOControl_DECLARE __declspec(dllexport) #elif libEOControl_ISDLL # define EOControl_EXPORT extern __declspec(dllimport) # define EOControl_DECLARE extern __declspec(dllimport) #else # define EOControl_EXPORT extern # define EOControl_DECLARE #endif #endif /* __EOControl_EOControlDecls_H__ */ SOPE/sope-core/EOControl/EOSortOrdering.h0000644000000000000000000000430612242733417017110 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __EOControl_EOSortOrdering_H__ #define __EOControl_EOSortOrdering_H__ #import #include #include @class NSDictionary, NSString; #define EOCompareAscending @selector(compareAscending:) #define EOCompareDescending @selector(compareDescending:) #define EOCompareCaseInsensitiveAscending @selector(compareCaseInsensitiveAscending:) #define EOCompareCaseInsensitiveDescending @selector(compareCaseInsensitiveDescending:) @interface EOSortOrdering : NSObject < EOKeyValueArchiving > { NSString *key; SEL selector; } + (EOSortOrdering *)sortOrderingWithKey:(NSString *)_key selector:(SEL)_selector; - (id)initWithKey:(NSString *)_key selector:(SEL)_selector; /* accessors */ - (NSString *)key; - (SEL)selector; /* remapping keys */ - (EOSortOrdering *)sortOrderingByApplyingKeyMap:(NSDictionary *)_map; @end #import @interface NSArray(EOSortOrdering) - (NSArray *)sortedArrayUsingKeyOrderArray:(NSArray *)_orderings; @end @interface NSMutableArray(EOSortOrdering) - (void)sortUsingKeyOrderArray:(NSArray *)_orderings; @end #import @interface NSString(EOSortOrdering) - (int)compareAscending:(id)_object; - (int)compareDescending:(id)_object; - (int)compareCaseInsensitiveAscending:(id)_object; - (int)compareCaseInsensitiveDescending:(id)_object; @end #endif /* __EOControl_EOSortOrdering_H__ */ SOPE/sope-core/EOControl/EOKeyValueCoding.h0000644000000000000000000000505412242733417017341 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __EOControl_EOKeyValueCoding_H__ #define __EOControl_EOKeyValueCoding_H__ #import #import #if NeXT_Foundation_LIBRARY #import #else @interface NSObject(EOKeyValueCoding) + (BOOL)accessInstanceVariablesDirectly; + (void)flushAllKeyBindings; - (void)handleTakeValue:(id)_value forUnboundKey:(NSString *)_key; - (id)handleQueryWithUnboundKey:(NSString *)_key; - (void)unableToSetNullForKey:(NSString *)_key; - (void)takeValuesFromDictionary:(NSDictionary *)_dictionary; - (NSDictionary *)valuesForKeys:(NSArray *)_keys; - (void)takeValue:(id)_value forKey:(NSString *)_key; - (id)valueForKey:(NSString *)_key; /* stored values */ + (BOOL)useStoredAccessor; - (void)takeStoredValue:(id)_value forKey:(NSString *)_key; - (id)storedValueForKey:(NSString *)_key; @end /* key-path stuff */ @interface NSObject(EOKeyPathValueCoding) - (void)takeValue:(id)_value forKeyPath:(NSString *)_keyPath; - (id)valueForKeyPath:(NSString *)_keyPath; @end /* array stuff */ @interface NSArray(EOKeyValueCoding) /* Special functions for computed values. Computed keys start with '@', seg '@sum'. Yoy can define own computed keys by following the method naming 'compute' + Func + 'ForKey:'. */ - (id)computeSumForKey:(NSString *)_key; - (id)computeAvgForKey:(NSString *)_key; - (id)computeCountForKey:(NSString *)_key; - (id)computeMaxForKey:(NSString *)_key; - (id)computeMinForKey:(NSString *)_key; /* Attention: NSArray's 'valueForKey:' is special in that it does not return properties of the array but an array of the properties of it's elements. That is, it is similiar to a map function. */ - (id)valueForKey:(NSString *)_key; @end #endif /* !NeXT_Foundation_LIBRARY */ #endif /* __EOControl_EOKeyValueCoding_H__ */ SOPE/sope-core/EOControl/NSObject+QualDesc.m0000644000000000000000000000243612242733417017416 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "EONull.h" #include "common.h" @implementation NSObject(QualifierDescription) - (NSString *)qualifierDescription { return [self description]; } @end /* NSObject(QualifierDescription) */ @implementation NSString(QualifierDescription) - (NSString *)qualifierDescription { return [NSString stringWithFormat:@"'%@'", self]; } @end /* NSString(QualifierDescription) */ @implementation EONull(QualifierDescription) - (NSString *)qualifierDescription { return @"nil"; } @end /* EONull(QualifierDescription) */ SOPE/sope-core/EOControl/GNUmakefile.preamble0000644000000000000000000000114412242733417017727 0ustar rootroot# GNUstep Makefile libEOControl_INCLUDE_DIRS += -I.. ADDITIONAL_CPPFLAGS += -Wall -funsigned-char ifeq ($(findstring _64, $(GNUSTEP_TARGET_CPU)), _64) SYSTEM_LIB_DIR += -L/usr/local/lib64 -L/usr/lib64 else SYSTEM_LIB_DIR += -L/usr/local/lib -L/usr/lib endif # libFoundation, gstep-base ifeq ($(FOUNDATION_LIB),fd) libEOControl_LIBRARIES_DEPEND_UPON += -lFoundation endif ifeq ($(FOUNDATION_LIB),gnu) libEOControl_LIBRARIES_DEPEND_UPON += $(BASE_LIBS) endif # Apple ifeq ($(FOUNDATION_LIB),apple) libEOControl_PREBIND_ADDR="0xC1000000" libEOControl_LDFLAGS += -seg1addr $(libEOControl_PREBIND_ADDR) endif SOPE/sope-core/EOControl/EOOrQualifier.m0000644000000000000000000001647412242733417016727 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include "common.h" @interface EOQualifier(EvalContext) - (BOOL)evaluateWithObject:(id)_object inEvalContext:(id)_ctx; @end @implementation EOOrQualifier //static BOOL debugEval = NO; static BOOL debugTransform = NO; - (id)initWithQualifierArray:(NSArray *)_qualifiers { self->count = [_qualifiers count]; self->qualifiers = [_qualifiers copyWithZone:[self zone]]; return self; } - (id)initWithQualifiers:(EOQualifier *)_qual1, ... { va_list va; EOQualifier *q; id *qs; unsigned c; NSArray *a; va_start(va, _qual1); for (c = 0, q = _qual1; q != nil; q = va_arg(va, id), c++) ; va_end(va); if (c == 0) return [self initWithQualifierArray:nil]; qs = objc_calloc(c, sizeof(id)); va_start(va, _qual1); for (c = 0, q = _qual1; q != nil; q = va_arg(va, id), c++) { qs[c] = q; } va_end(va); a = [NSArray arrayWithObjects:qs count:c]; objc_free(qs); return [self initWithQualifierArray:a]; } - (void)dealloc { [self->qualifiers release]; [super dealloc]; } /* accessors */ - (NSArray *)qualifiers { return self->qualifiers; } - (NSArray *)subqualifiers { return [self qualifiers]; } /* bindings */ - (EOQualifier *)qualifierWithBindings:(NSDictionary *)_bindings requiresAllVariables:(BOOL)_reqAll { NSArray *array; id objects[self->count + 1]; unsigned i; IMP objAtIdx; objAtIdx = [self->qualifiers methodForSelector:@selector(objectAtIndex:)]; for (i = 0; i < self->count; i++) { id q, newq; q = objAtIdx(self->qualifiers, @selector(objectAtIndex:), i); newq = [q qualifierWithBindings:_bindings requiresAllVariables:_reqAll]; if (newq == nil) newq = q; objects[i] = newq; } array = [NSArray arrayWithObjects:objects count:self->count]; return [[[[self class] alloc] initWithQualifierArray:array] autorelease]; } - (NSArray *)bindingKeys { NSMutableSet *keys = nil; unsigned i; IMP objAtIdx; objAtIdx = [self->qualifiers methodForSelector:@selector(objectAtIndex:)]; for (i = 0; i < self->count; i++) { NSArray *qb; id q; q = objAtIdx(self->qualifiers, @selector(objectAtIndex:), i); qb = [q bindingKeys]; if ([qb count] > 0) { if (keys == nil) keys = [NSMutableSet setWithCapacity:16]; [keys addObjectsFromArray:qb]; } } return keys ? [keys allObjects] : (NSArray *)[NSArray array]; } /* keys */ - (void)addQualifierKeysToSet:(NSMutableSet *)_keys { /* new in WO 4.5 */ [self->qualifiers makeObjectsPerformSelector:_cmd withObject:_keys]; } /* evaluation */ - (BOOL)evaluateWithObject:(id)_object inEvalContext:(id)_ctx { unsigned i; IMP objAtIdx; if ((_ctx == nil) && (self->count > 1)) _ctx = [NSMutableDictionary dictionaryWithCapacity:16]; objAtIdx = [self->qualifiers methodForSelector:@selector(objectAtIndex:)]; for (i = 0; i < self->count; i++) { id q; q = objAtIdx(self->qualifiers, @selector(objectAtIndex:), i); if ([q evaluateWithObject:_object inEvalContext:_ctx]) return YES; } return NO; } - (BOOL)evaluateWithObject:(id)_object { return [self evaluateWithObject:_object inEvalContext:nil]; } /* NSCoding */ - (void)encodeWithCoder:(NSCoder *)_coder { [_coder encodeObject:self->qualifiers]; } - (id)initWithCoder:(NSCoder *)_coder { self->qualifiers = [[_coder decodeObject] retain]; return self; } /* Comparing */ - (BOOL)isEqualToQualifier:(EOQualifier *)_qual { return [self->qualifiers isEqualToArray:[(EOOrQualifier *)_qual qualifiers]]; } /* remapping keys */ - (EOQualifier *)qualifierByApplyingTransformer:(id)_transformer inContext:(id)_ctx { if ([_transformer respondsToSelector: @selector(transformOrQualifier:inContext:)]) { if (debugTransform) NSLog(@"transformer: %@\n transform: %@", _transformer, self); return [_transformer transformOrQualifier:self inContext:_ctx]; } else { EOOrQualifier *aq; NSArray *a; id *qs; unsigned i; BOOL didTransform = NO; if (debugTransform) { NSLog(@"EOOrQualifier: transform %i using %@ ...", self->count, _transformer); } qs = calloc(self->count + 1, sizeof(id)); for (i = 0; i < self->count; i++) { EOQualifier *q; q = [self->qualifiers objectAtIndex:i]; qs[i] = [q qualifierByApplyingTransformer:_transformer inContext:_ctx]; if (qs[i] == nil) qs[i] = q; else if (qs[i] != q) { if (debugTransform) NSLog(@"EOOrQualifier: subqualifier %i did transform", i); didTransform = YES; } else if (debugTransform) NSLog(@"EOOrQualifier: subqualifier %i did not transform", i); } if (didTransform) { a = [[NSArray alloc] initWithObjects:qs count:self->count]; if (qs) free(qs); aq = [[EOOrQualifier alloc] initWithQualifierArray:a]; [a release]; return [aq autorelease]; } else { if (qs) free(qs); return [[self retain] autorelease]; } } } - (EOQualifier *)qualifierByApplyingKeyMap:(NSDictionary *)_map { EOOrQualifier *aq; NSArray *a; id *qs; unsigned i; qs = calloc(self->count + 1, sizeof(id)); for (i = 0; i < self->count; i++) { EOQualifier *q; q = [self->qualifiers objectAtIndex:i]; qs[i] = [q qualifierByApplyingKeyMap:_map]; if (qs[i] == nil) qs[i] = q; } a = [[NSArray alloc] initWithObjects:qs count:self->count]; if (qs) free(qs); aq = [[EOOrQualifier alloc] initWithQualifierArray:a]; [a release]; return [aq autorelease]; } /* key/value archiving */ - (id)initWithKeyValueUnarchiver:(EOKeyValueUnarchiver *)_unarchiver { if ((self = [super initWithKeyValueUnarchiver:_unarchiver]) != nil) { self->qualifiers = [[_unarchiver decodeObjectForKey:@"qualifiers"] copy]; self->count = [self->qualifiers count]; } return self; } - (void)encodeWithKeyValueArchiver:(EOKeyValueArchiver *)_archiver { [super encodeWithKeyValueArchiver:_archiver]; [_archiver encodeObject:[self qualifiers] forKey:@"qualifiers"]; } /* description */ - (NSString *)description { NSMutableString *ms; NSArray *sd; unsigned i, len; sd = [self->qualifiers valueForKey:@"qualifierDescription"]; if ((len = [sd count]) == 0) return nil; if (len == 1) return [sd objectAtIndex:0]; ms = [NSMutableString stringWithCapacity:(len * 16)]; [ms appendString:@"("]; for (i = 0; i < len; i++) { if (i != 0) [ms appendString:@" OR "]; [ms appendString:[sd objectAtIndex:i]]; } [ms appendString:@")"]; return ms; } @end /* EOOrQualifier */ SOPE/sope-core/EOControl/EOClassDescription.h0000644000000000000000000000734512242733417017746 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __EOControl_EOClassDescription_H__ #define __EOControl_EOClassDescription_H__ #import #include @class NSException, NSString, NSFormatter; @interface EOClassDescription : NSClassDescription @end @interface NSClassDescription(EOClassDescription) /* model */ - (NSString *)entityName; - (NSString *)inverseForRelationshipKey:(NSString *)_key; - (NSClassDescription *)classDescriptionForDestinationKey:(NSString *)_key; /* object initialization */ - (id)createInstanceWithEditingContext:(id)_ec globalID:(EOGlobalID *)_oid zone:(NSZone *)_zone; - (void)awakeObject:(id)_object fromFetchInEditingContext:(id)_ec; - (void)awakeObject:(id)_object fromInsertionInEditingContext:(id)_ec; /* delete */ - (void)propagateDeleteForObject:(id)_object editingContext:(id)_ec; /* entity names */ #if 0 // used by: EOGenericRecord.m + (NSClassDescription *)classDescriptionForEntityName:(NSString *)_entityName; #endif /* formatting */ - (NSFormatter *)defaultFormatterForKey:(NSString *)_key; - (NSFormatter *)defaultFormatterForKeyPath:(NSString *)_keyPath; @end @interface NSClassDescription(EOValidation) - (NSException *)validateObjectForDelete:(id)_object; - (NSException *)validateObjectForSave:(id)_object; - (NSException *)validateValue:(id *)_value forKey:(NSString *)_key; @end @interface NSObject(EOClassDescriptionInit) /* object initialization */ - (id)initWithEditingContext:(id)_ec classDescription:(NSClassDescription *)_classDesc globalID:(EOGlobalID *)_oid; - (void)awakeFromFetchInEditingContext:(id)_ec; - (void)awakeFromInsertionInEditingContext:(id)_ec; /* model */ - (NSString *)entityName; - (NSString *)inverseForRelationshipKey:(NSString *)_key; - (NSArray *)attributeKeys; - (NSArray *)toManyRelationshipKeys; - (NSArray *)toOneRelationshipKeys; - (BOOL)isToManyKey:(NSString *)_key; - (NSArray *)allPropertyKeys; /* delete */ - (void)propagateDeleteWithEditingContext:(id)_ec; @end /* validation */ @interface NSObject(EOValidation) - (NSException *)validateForDelete; - (NSException *)validateForInsert; - (NSException *)validateForUpdate; - (NSException *)validateForSave; @end @interface NSException(EOValidation) + (NSException *)aggregateExceptionWithExceptions:(NSArray *)_exceptions; @end /* snapshots */ @interface NSObject(EOSnapshots) - (NSDictionary *)snapshot; - (void)updateFromSnapshot:(NSDictionary *)_snapshot; - (NSDictionary *)changesFromSnapshot:(NSDictionary *)_snapshot; @end /* relationships */ @interface NSObject(EORelationshipManipulation) - (void)addObject:(id)_o toBothSidesOfRelationshipWithKey:(NSString *)_key; - (void)removeObject:(id)_o fromBothSidesOfRelationshipWithKey:(NSString *)_key; - (void)addObject:(id)_object toPropertyWithKey:(NSString *)_key; - (void)removeObject:(id)_object fromPropertyWithKey:(NSString *)_key; @end /* shallow array copying */ @interface NSArray(ShallowCopy) - (id)shallowCopy; @end #endif /* __EOControl_EOClassDescription_H__ */ SOPE/sope-core/EOControl/EOKeyValueCoding.m0000644000000000000000000013331012242733417017343 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "EOKeyValueCoding.h" #include "EONull.h" #include "common.h" #if GNU_RUNTIME #if __GNU_LIBOBJC__ >= 20100911 # define sel_get_any_uid sel_getUid # include #else # include # include #endif #endif static EONull *null = nil; #if LIB_FOUNDATION_LIBRARY static id idMethodGetFunc(void* info1, void* info2, id self); static id idIvarGetFunc(void* info1, void* info2, id self); static void idMethodSetFunc(void* info1, void* info2, id self, id val); static void idIvarSetFunc(void* info1, void* info2, id self, id val); static id charMethodGetFunc(void* info1, void* info2, id self); static id charIvarGetFunc(void* info1, void* info2, id self); static void charMethodSetFunc(void* info1, void* info2, id self, id val); static void charIvarSetFunc(void* info1, void* info2, id self, id val); static id unsignedCharMethodGetFunc(void* info1, void* info2, id self); static id unsignedCharIvarGetFunc(void* info1, void* info2, id self); static void unsignedCharMethodSetFunc(void* info1, void* info2, id self, id val); static void unsignedCharIvarSetFunc(void* info1, void* info2, id self, id val); static id shortMethodGetFunc(void* info1, void* info2, id self); static id shortIvarGetFunc(void* info1, void* info2, id self); static void shortMethodSetFunc(void* info1, void* info2, id self, id val); static void shortIvarSetFunc(void* info1, void* info2, id self, id val); static id unsignedShortMethodGetFunc(void* info1, void* info2, id self); static id unsignedShortIvarGetFunc(void* info1, void* info2, id self); static void unsignedShortMethodSetFunc(void* info1, void* info2, id self, id val); static void unsignedShortIvarSetFunc(void* info1, void* info2, id self, id val); static id intMethodGetFunc(void* info1, void* info2, id self); static id intIvarGetFunc(void* info1, void* info2, id self); static void intMethodSetFunc(void* info1, void* info2, id self, id val); static void intIvarSetFunc(void* info1, void* info2, id self, id val); static id unsignedIntMethodGetFunc(void* info1, void* info2, id self); static id unsignedIntIvarGetFunc(void* info1, void* info2, id self); static void unsignedIntMethodSetFunc(void* info1, void* info2, id self, id val); static void unsignedIntIvarSetFunc(void* info1, void* info2, id self, id val); static id longMethodGetFunc(void* info1, void* info2, id self); static id longIvarGetFunc(void* info1, void* info2, id self); static void longMethodSetFunc(void* info1, void* info2, id self, id val); static void longIvarSetFunc(void* info1, void* info2, id self, id val); static id unsignedLongMethodGetFunc(void* info1, void* info2, id self); static id unsignedLongIvarGetFunc(void* info1, void* info2, id self); static void unsignedLongMethodSetFunc(void* info1, void* info2, id self, id val); static void unsignedLongIvarSetFunc(void* info1, void* info2, id self, id val); static id longLongMethodGetFunc(void* info1, void* info2, id self); static id longLongIvarGetFunc(void* info1, void* info2, id self); static void longLongMethodSetFunc(void* info1, void* info2, id self, id val); static void longLongIvarSetFunc(void* info1, void* info2, id self, id val); static id unsignedLongLongMethodGetFunc(void* info1, void* info2, id self); static id unsignedLongLongIvarGetFunc(void* info1, void* info2, id self); static void unsignedLongLongMethodSetFunc(void* info1, void* info2, id self, id val); static void unsignedLongLongIvarSetFunc(void* info1, void* info2, id self, id val); static id floatMethodGetFunc(void* info1, void* info2, id self); static id floatIvarGetFunc(void* info1, void* info2, id self); static void floatMethodSetFunc(void* info1, void* info2, id self, id val); static void floatIvarSetFunc(void* info1, void* info2, id self, id val); static id doubleMethodGetFunc(void* info1, void* info2, id self); static id doubleIvarGetFunc(void* info1, void* info2, id self); static void doubleMethodSetFunc(void* info1, void* info2, id self, id val); static void doubleIvarSetFunc(void* info1, void* info2, id self, id val); static Class NumberClass = Nil; static Class StringClass = Nil; @implementation NSObject(EOKeyValueCoding) /* * Types */ typedef struct _KeyValueMethod { NSString* key; Class class; } KeyValueMethod; typedef struct _GetKeyValueBinding { /* info1, info2, self */ id (*access)(void *, void *, id); void *info1; void *info2; } GetKeyValueBinding; typedef struct _SetKeyValueBinding { /* info1, info2, self, val */ void (*access)(void *, void *, id, id); void *info1; void *info2; } SetKeyValueBinding; /* * Globals */ static NSMapTable* getValueBindings = NULL; static NSMapTable* setValueBindings = NULL; static BOOL keyValueDebug = NO; static BOOL keyValueInit = NO; /* * KeyValueMapping */ static GetKeyValueBinding* newGetBinding(NSString* key, id instance) { GetKeyValueBinding *ret = NULL; void *info1 = NULL; void *info2 = NULL; id (*fptr)(void*, void*, id) = NULL; // Lookup method name [-(type)key] { Class class = [instance class]; unsigned clen = [key cStringLength]; char *cbuf; const char *ckey; SEL sel; struct objc_method* mth; cbuf = malloc(clen + 1); [key getCString:cbuf]; cbuf[clen] = '\0'; ckey = cbuf; sel = sel_get_any_uid(ckey); if (sel && (mth = class_get_instance_method(class, sel)) && method_get_number_of_arguments(mth) == 2) { switch(*objc_skip_type_qualifiers(mth->method_types)) { case _C_ID: fptr = (id (*)(void*, void*, id))idMethodGetFunc; break; case _C_CHR: fptr = (id (*)(void*, void*, id))charMethodGetFunc; break; case _C_UCHR: fptr = (id (*)(void*, void*, id))unsignedCharMethodGetFunc; break; case _C_SHT: fptr = (id (*)(void*, void*, id))shortMethodGetFunc; break; case _C_USHT: fptr = (id (*)(void*, void*, id))unsignedShortMethodGetFunc; break; case _C_INT: fptr = (id (*)(void*, void*, id))intMethodGetFunc; break; case _C_UINT: fptr = (id (*)(void*, void*, id))unsignedIntMethodGetFunc; break; case _C_LNG: fptr = (id (*)(void*, void*, id))longMethodGetFunc; break; case _C_ULNG: fptr = (id (*)(void*, void*, id))unsignedLongMethodGetFunc; break; case 'q': fptr = (id (*)(void*, void*, id))longLongMethodGetFunc; break; case 'Q': fptr = (id (*)(void*, void*, id))unsignedLongLongMethodGetFunc; break; case _C_FLT: fptr = (id (*)(void*, void*, id))floatMethodGetFunc; break; case _C_DBL: fptr = (id (*)(void*, void*, id))doubleMethodGetFunc; break; } if (fptr) { info1 = (void*)(mth->method_imp); info2 = (void*)(mth->method_name); } } if (cbuf != NULL) free(cbuf); } // Lookup ivar name if (fptr == NULL) { Class class = [instance class]; unsigned clen; char *cbuf; const char *ckey; int i; clen = [key cStringLength]; cbuf = malloc(clen + 1); [key getCString:cbuf]; cbuf[clen] = '\0'; ckey = cbuf; while (class != Nil) { for (i = 0; class->ivars && i < class->ivars->ivar_count; i++) { if (!Strcmp(ckey, class->ivars->ivar_list[i].ivar_name)) { switch(*objc_skip_type_qualifiers(class->ivars->ivar_list[i].ivar_type)) { case _C_ID: fptr = (id (*)(void*, void*, id))idIvarGetFunc; break; case _C_CHR: fptr = (id (*)(void*, void*, id))charIvarGetFunc; break; case _C_UCHR: fptr = (id (*)(void*, void*, id))unsignedCharIvarGetFunc; break; case _C_SHT: fptr = (id (*)(void*, void*, id))shortIvarGetFunc; break; case _C_USHT: fptr = (id (*)(void*, void*, id))unsignedShortIvarGetFunc; break; case _C_INT: fptr = (id (*)(void*, void*, id))intIvarGetFunc; break; case _C_UINT: fptr = (id (*)(void*, void*, id))unsignedIntIvarGetFunc; break; case _C_LNG: fptr = (id (*)(void*, void*, id))longIvarGetFunc; break; case _C_ULNG: fptr = (id (*)(void*, void*, id))unsignedLongIvarGetFunc; break; case 'q': fptr = (id (*)(void*, void*, id))longLongIvarGetFunc; break; case 'Q': fptr = (id (*)(void*, void*, id))unsignedLongLongIvarGetFunc; break; case _C_FLT: fptr = (id (*)(void*, void*, id))floatIvarGetFunc; break; case _C_DBL: fptr = (id (*)(void*, void*, id))doubleIvarGetFunc; break; } if (fptr) { info2 = (void *)(unsigned long) (class->ivars->ivar_list[i].ivar_offset); break; } } } class = class->super_class; } if (cbuf != NULL) free(cbuf); } // Make binding and insert into map if (fptr) { KeyValueMethod *mkey; GetKeyValueBinding *bin; mkey = Malloc(sizeof(KeyValueMethod)); bin = Malloc(sizeof(GetKeyValueBinding)); mkey->key = [key copy]; mkey->class = [instance class]; bin->access = fptr; bin->info1 = info1; bin->info2 = info2; NSMapInsert(getValueBindings, mkey, bin); ret = bin; } // If no way to access value warn if (!ret && keyValueDebug) NSLog(@"cannnot get key `%@' for instance of class `%@'", key, NSStringFromClass([instance class])); return ret; } static SetKeyValueBinding* newSetBinding(NSString* key, id instance) { SetKeyValueBinding *ret = NULL; void *info1 = NULL; void *info2 = NULL; void (*fptr)(void*, void*, id, id) = NULL; // Lookup method name [-(void)setKey:(type)arg] { Class class = [instance class]; unsigned clen = [key cStringLength]; char *cbuf; const char *ckey; SEL sel; struct objc_method* mth; char sname[clen + 7]; cbuf = malloc(clen + 1); [key getCString:cbuf]; cbuf[clen] = '\0'; ckey = cbuf; // Make sel from name Strcpy(sname, "set"); Strcat(sname, ckey); Strcat(sname, ":"); sname[3] = islower((int)sname[3]) ? toupper((int)sname[3]) : sname[3]; sel = sel_get_any_uid(sname); if (sel && (mth = class_get_instance_method(class, sel)) && method_get_number_of_arguments(mth) == 3 && *objc_skip_type_qualifiers(mth->method_types) == _C_VOID) { char* argType = (char*)(mth->method_types); argType = (char*)objc_skip_argspec(argType); // skip return argType = (char*)objc_skip_argspec(argType); // skip self argType = (char*)objc_skip_argspec(argType); // skip SEL switch(*objc_skip_type_qualifiers(argType)) { case _C_ID: fptr = (void (*)(void*, void*, id, id))idMethodSetFunc; break; case _C_CHR: fptr = (void (*)(void*, void*, id, id))charMethodSetFunc; break; case _C_UCHR: fptr = (void (*)(void*, void*, id, id))unsignedCharMethodSetFunc; break; case _C_SHT: fptr = (void (*)(void*, void*, id, id))shortMethodSetFunc; break; case _C_USHT: fptr = (void (*)(void*, void*, id, id))unsignedShortMethodSetFunc; break; case _C_INT: fptr = (void (*)(void*, void*, id, id))intMethodSetFunc; break; case _C_UINT: fptr = (void (*)(void*, void*, id, id))unsignedIntMethodSetFunc; break; case _C_LNG: fptr = (void (*)(void*, void*, id, id))longMethodSetFunc; break; case _C_ULNG: fptr = (void (*)(void*, void*, id, id))unsignedLongMethodSetFunc; break; case 'q': fptr = (void (*)(void*, void*, id, id))longLongMethodSetFunc; break; case 'Q': fptr = (void (*)(void*, void*, id, id))unsignedLongLongMethodSetFunc; break; case _C_FLT: fptr = (void (*)(void*, void*, id, id))floatMethodSetFunc; break; case _C_DBL: fptr = (void (*)(void*, void*, id, id))doubleMethodSetFunc; break; } if (fptr) { info1 = (void*)(mth->method_imp); info2 = (void*)(mth->method_name); } } if (cbuf) free(cbuf); } // Lookup ivar name if (!fptr) { Class class = [instance class]; unsigned clen = [key cStringLength]; char *cbuf; const char *ckey; int i; cbuf = malloc(clen + 1); [key getCString:cbuf]; cbuf[clen] = '\0'; ckey = cbuf; while (class) { for (i = 0; class->ivars && i < class->ivars->ivar_count; i++) { if (!Strcmp(ckey, class->ivars->ivar_list[i].ivar_name)) { switch(*objc_skip_type_qualifiers(class->ivars->ivar_list[i].ivar_type)) { case _C_ID: fptr = (void (*)(void*, void*, id, id))idIvarSetFunc; break; case _C_CHR: fptr = (void (*)(void*, void*, id, id))charIvarSetFunc; break; case _C_UCHR: fptr = (void (*)(void*, void*, id, id))unsignedCharIvarSetFunc; break; case _C_SHT: fptr = (void (*)(void*, void*, id, id))shortIvarSetFunc; break; case _C_USHT: fptr = (void (*)(void*, void*, id, id))unsignedShortIvarSetFunc; break; case _C_INT: fptr = (void (*)(void*, void*, id, id))intIvarSetFunc; break; case _C_UINT: fptr = (void (*)(void*, void*, id, id))unsignedIntIvarSetFunc; break; case _C_LNG: fptr = (void (*)(void*, void*, id, id))longIvarSetFunc; break; case _C_ULNG: fptr = (void (*)(void*, void*, id, id))unsignedLongIvarSetFunc; break; case 'q': fptr = (void (*)(void*, void*, id, id))longLongIvarSetFunc; break; case 'Q': fptr = (void (*)(void*, void*, id, id))unsignedLongLongIvarSetFunc; break; case _C_FLT: fptr = (void (*)(void*, void*, id, id))floatIvarSetFunc; break; case _C_DBL: fptr = (void (*)(void*, void*, id, id))doubleIvarSetFunc; break; } if (fptr != NULL) { info2 = (void *)(unsigned long) (class->ivars->ivar_list[i].ivar_offset); break; } } } class = class->super_class; } if (cbuf) free(cbuf); } // Make binding and insert into map if (fptr) { KeyValueMethod *mkey; SetKeyValueBinding *bin; mkey = Malloc(sizeof(KeyValueMethod)); bin = Malloc(sizeof(SetKeyValueBinding)); mkey->key = [key copy]; mkey->class = [instance class]; bin->access = fptr; bin->info1 = info1; bin->info2 = info2; NSMapInsert(setValueBindings, mkey, bin); ret = bin; } // If no way to access value warn if (!ret && keyValueDebug) NSLog(@"cannnot set key `%@' for instance of class `%@'", key, NSStringFromClass([instance class])); return ret; } /* * MapTable initialization */ static unsigned keyValueMapHash(NSMapTable* table, KeyValueMethod* map) { return [map->key hash] + (((unsigned long)(map->class)) >> 4L); } static BOOL keyValueMapCompare(NSMapTable* table, KeyValueMethod* map1, KeyValueMethod* map2) { return (map1->class == map2->class) && [map1->key isEqual:map2->key]; } static void mapRetainNothing(NSMapTable* table, KeyValueMethod* map) { } static void keyValueMapKeyRelease(NSMapTable* table, KeyValueMethod* map) { [map->key release]; Free(map); } static void keyValueMapValRelease(NSMapTable* table, void* map) { Free(map); } static NSString* keyValueMapDescribe(NSMapTable* table, KeyValueMethod* map) { if (StringClass == Nil) StringClass = [NSString class]; return [StringClass stringWithFormat:@"%@:%@", NSStringFromClass(map->class), map->key]; } static NSString* describeBinding(NSMapTable* table, GetKeyValueBinding* bin) { if (StringClass == Nil) StringClass = [NSString class]; return [StringClass stringWithFormat:@"%08x:%08x", bin->info1, bin->info2]; } static NSMapTableKeyCallBacks keyValueKeyCallbacks = { (unsigned(*)(NSMapTable *, const void *))keyValueMapHash, (BOOL(*)(NSMapTable *, const void *, const void *))keyValueMapCompare, (void (*)(NSMapTable *, const void *anObject))mapRetainNothing, (void (*)(NSMapTable *, void *anObject))keyValueMapKeyRelease, (NSString *(*)(NSMapTable *, const void *))keyValueMapDescribe, (const void *)NULL }; const NSMapTableValueCallBacks keyValueValueCallbacks = { (void (*)(NSMapTable *, const void *))mapRetainNothing, (void (*)(NSMapTable *, void *))keyValueMapValRelease, (NSString *(*)(NSMapTable *, const void *))describeBinding }; static void initKeyValueBindings(void) { getValueBindings = NSCreateMapTable(keyValueKeyCallbacks, keyValueValueCallbacks, 31); setValueBindings = NSCreateMapTable(keyValueKeyCallbacks, keyValueValueCallbacks, 31); keyValueInit = YES; } /* * Access Methods */ static inline void removeAllBindings(void) { NSResetMapTable(getValueBindings); NSResetMapTable(setValueBindings); } static inline id getValue(NSString* key, id instance) { KeyValueMethod mkey = { key, [instance class] }; GetKeyValueBinding *bin; id value = nil; if (NumberClass == Nil) NumberClass = [NSNumber class]; // Check Init if (!keyValueInit) initKeyValueBindings(); // Get existing binding bin = (GetKeyValueBinding *)NSMapGet(getValueBindings, &mkey); // Create new binding if (bin == NULL) bin = newGetBinding(key, instance); // Get value if binding is ok if (bin) value = bin->access(bin->info1, bin->info2, instance); return value; } static inline BOOL setValue(NSString* key, id instance, id value) { KeyValueMethod mkey = {key, [instance class]}; SetKeyValueBinding* bin; if (NumberClass == Nil) NumberClass = [NSNumber class]; // Check Init if (!keyValueInit) initKeyValueBindings(); // Get existing binding bin = (SetKeyValueBinding *)NSMapGet(setValueBindings, &mkey); // Create new binding if (bin == NULL) bin = newSetBinding(key, instance); // Get value if binding is ok if (bin) bin->access(bin->info1, bin->info2, instance, value); return (bin != NULL); } + (BOOL)accessInstanceVariablesDirectly { return NO; } - (void)handleTakeValue:(id)_value forUnboundKey:(NSString *)_key { NSDictionary *ui; ui = [NSDictionary dictionaryWithObjectsAndKeys: self, @"EOTargetObjectUserInfoKey", [self class], @"EOTargetObjectClassUserInfoKey", _key, @"EOUnknownUserInfoKey", nil]; [[NSException exceptionWithName:@"EOUnknownKeyException" reason:@"called -takeValue:forKey: with unknown key" userInfo:ui] raise]; } - (id)handleQueryWithUnboundKey:(NSString *)_key { NSDictionary *ui; ui = [NSDictionary dictionaryWithObjectsAndKeys: self, @"EOTargetObjectUserInfoKey", _key, @"EOUnknownUserInfoKey", nil]; [[NSException exceptionWithName:@"EOUnknownKeyException" reason:@"called -valueForKey: with unknown key" userInfo:ui] raise]; return nil; } - (void)unableToSetNullForKey:(NSString *)_key { [NSException raise:@"NSInvalidArgumentException" format: @"EOKeyValueCoding cannot set EONull value for key %@," @"in instance of %@ class.", _key, NSStringFromClass([self class])]; } + (void)flushAllKeyBindings { removeAllBindings(); } - (void)flushKeyBindings { // EOF 1.1 method removeAllBindings(); } - (void)setKeyValueCodingWarnings:(BOOL)aFlag { keyValueDebug = aFlag; } - (void)takeValuesFromDictionary:(NSDictionary *)dictionary { NSEnumerator *keyEnum; id key; if (null == nil) null = [EONull null]; keyEnum = [dictionary keyEnumerator]; while ((key = [keyEnum nextObject])) { id value; value = [dictionary objectForKey:key]; /* automagically convert EONull to nil */ if (value == null) value = nil; [self takeValue:value forKey:key]; #if 0 // this doesn't support overridden methods ... if (!setValue(key, self, value)) { [self handleTakeValue:value forUnboundKey:key]; } #endif } } - (NSDictionary *)valuesForKeys:(NSArray *)keys { static Class NSDictionaryClass = Nil; int n = [keys count]; if (NSDictionaryClass == Nil) NSDictionaryClass = [NSDictionary class]; if (null == nil) null = [EONull null]; if (n == 0) return [NSDictionaryClass dictionary]; else if (n == 1) { NSString *key; id value; key = [keys objectAtIndex:0]; //value = getValue(key, self); value = [self valueForKey:key]; /* automagically convert 'nil' to EONull */ if (value == nil) value = null; return [NSDictionaryClass dictionaryWithObject:value forKey:key]; } else { id newKeys[n]; id newVals[n]; int i; for (i = 0; i < n; i++) { id key; id val; key = [keys objectAtIndex:i]; //val = getValue(key, self); val = [self valueForKey:key]; /* automagically convert 'nil' to EONull */ if (val == nil) val = null; newKeys[i] = key; newVals[i] = val; } return [NSDictionaryClass dictionaryWithObjects:newVals forKeys:newKeys count:n]; } } - (void)takeValue:(id)_value forKey:(NSString *)_key { if (!setValue(_key, self, _value)) { //NSLog(@"ERROR(%s): couldn't take value for key %@", key); [self handleTakeValue:_value forUnboundKey:_key]; } } - (id)valueForKey:(NSString *)key { id val; if ((val = getValue(key, self)) != nil) return val; return nil; } /* stored values */ + (BOOL)useStoredAccessor { return YES; } - (void)takeStoredValue:(id)_value forKey:(NSString *)_key { if ([[self class] useStoredAccessor]) { BOOL ok = YES; /* this should be different */ ok = setValue(_key, self, _value); if (!ok) [self handleTakeValue:_value forUnboundKey:_key]; } else [self takeValue:_value forKey:_key]; } - (id)storedValueForKey:(NSString *)_key { if ([[self class] useStoredAccessor]) { id val; /* this should be different */ if ((val = getValue(_key, self))) return val; /* val = [self handleQueryWithUnboundKey:_key] */ return nil; } else return [self valueForKey:_key]; } @end /* NSObject(EOKeyValueCoding) */ @implementation NSObject(EOKeyPathValueCoding) - (void)takeValue:(id)_value forKeyPath:(NSString *)_keyPath { NSArray *keyPath; unsigned i, count; id target; keyPath = [_keyPath componentsSeparatedByString:@"."]; count = [keyPath count]; if (count < 2) [self takeValue:_value forKey:_keyPath]; else { target = self; for (i = 0; i < (count - 1) ; i++) { if ((target = [target valueForKey:[keyPath objectAtIndex:i]]) == nil) /* nil component */ return; } [target takeValue:_value forKey:[keyPath lastObject]]; } } - (id)valueForKeyPath:(NSString *)_keyPath { #if 1 const unsigned char *buf; unsigned int i, start, len; id value; if ((len = [_keyPath cStringLength]) == 0) return [self valueForKey:_keyPath]; if (StringClass == Nil) StringClass = [NSString class]; value = self; buf = (const unsigned char *)[_keyPath cString]; if (index((const char *)buf, '.') == NULL) /* no point contained .. */ return [self valueForKey:_keyPath]; for (i = start = 0; i < len; i++) { if (buf[i] == '.') { /* found a pt */ NSString *key; key = (start < i) ? [[StringClass alloc] initWithCString:(const char *)&(buf[start]) length:(i - start)] : (id)@""; value = [value valueForKey:key]; [key release]; key = nil; if (value == nil) return nil; start = (i + 1); /* next part is after the pt */ } } /* check last part */ { NSString *key; id v; key = (start < i) ? [[StringClass alloc] initWithCString:(const char *)&(buf[start]) length:(i - start)] : (id)@""; v = [value valueForKey:key]; [key release]; key = nil; return v; } #else /* naive implementation */ NSEnumerator *keyPath; NSString *key; id value; value = self; keyPath = [[_keyPath componentsSeparatedByString:@"."] objectEnumerator]; while ((key = [keyPath nextObject]) && (value != nil)) value = [value valueForKey:key]; return value; #endif } @end /* NSObject(EOKeyPathValueCoding) */ @implementation NSArray(EOKeyValueCoding) - (id)computeSumForKey:(NSString *)_key { unsigned i, cc = [self count]; id (*objAtIdx)(id, SEL, unsigned int); double sum; if (cc == 0) return [NSNumber numberWithDouble:0.0]; objAtIdx = (void*)[self methodForSelector:@selector(objectAtIndex:)]; for (i = 0, sum = 0.0; i < cc; i++) { register id o; o = objAtIdx(self, @selector(objectAtIndex:), i); o = [o valueForKey:_key]; sum += [o doubleValue]; } return [NSNumber numberWithDouble:sum]; } - (id)computeAvgForKey:(NSString *)_key { unsigned cc = [self count]; NSNumber *sum; if (cc == 0) return nil; sum = [self computeSumForKey:_key]; return [NSNumber numberWithDouble:([sum doubleValue] / (double)cc)]; } - (id)computeCountForKey:(NSString *)_key { return [NSNumber numberWithUnsignedInt:[self count]]; } - (id)computeMaxForKey:(NSString *)_key { unsigned i, cc = [self count]; id (*objAtIdx)(id, SEL, unsigned int); double max; if (cc == 0) return nil; objAtIdx = (void *)[self methodForSelector:@selector(objectAtIndex:)]; max = [[objAtIdx(self, @selector(objectAtIndex:), 0) valueForKey:_key] doubleValue]; for (i = 1; i < cc; i++) { register double ov; ov = [[objAtIdx(self, @selector(objectAtIndex:), i) valueForKey:_key] doubleValue]; if (ov > max) max = ov; } return [NSNumber numberWithDouble:max]; } - (id)computeMinForKey:(NSString *)_key { unsigned i, cc = [self count]; id (*objAtIdx)(id, SEL, unsigned int); double min; if (cc == 0) return nil; objAtIdx = (void *)[self methodForSelector:@selector(objectAtIndex:)]; min = [[objAtIdx(self, @selector(objectAtIndex:), 0) valueForKey:_key] doubleValue]; for (i = 1; i < cc; i++) { register double ov; ov = [[objAtIdx(self, @selector(objectAtIndex:), i) valueForKey:_key] doubleValue]; if (ov < min) min = ov; } return [NSNumber numberWithDouble:min]; } - (id)valueForKey:(NSString *)_key { if ([_key hasPrefix:@"@"]) { /* process a computed function */ const char *keyStr; char *bufPtr; unsigned keyLen = [_key cStringLength]; char *kbuf, *buf; SEL sel; kbuf = malloc(keyLen + 4); buf = malloc(keyLen + 20); [_key getCString:kbuf]; keyStr = kbuf; bufPtr = buf; strcpy(buf, "compute"); bufPtr += 7; *bufPtr = toupper(keyStr[1]); bufPtr++; strncpy(&(buf[8]), &(keyStr[2]), keyLen - 2); bufPtr += (keyLen - 2); strcpy(bufPtr, "ForKey:"); if (kbuf) free(kbuf); sel = sel_get_any_uid(buf); if (buf) free(buf); return sel != NULL ? [self performSelector:sel withObject:_key] : nil; } else { /* process the _key in a map function */ unsigned i, cc = [self count]; id objects[cc]; id (*objAtIdx)(id, SEL, unsigned int); #if DEBUG if ([_key isEqualToString:@"count"]) { NSLog(@"WARNING(%s): USED -valueForKey(@\"count\") ON NSArray, YOU" @"PROBABLY WANT TO USE @count INSTEAD !", __PRETTY_FUNCTION__); return [self valueForKey:@"@count"]; } #endif objAtIdx = (void *)[self methodForSelector:@selector(objectAtIndex:)]; for (i = 0; i < cc; i++) { register id o; o = [objAtIdx(self, @selector(objectAtIndex:), i) valueForKey:_key]; if (o) objects[i] = o; else { if (null == nil) null = [EONull null]; objects[i] = null; } } // TODO: possibly this checks fails on OSX return [self isKindOfClass:[NSMutableArray class]] ? [NSMutableArray arrayWithObjects:objects count:cc] : [NSArray arrayWithObjects:objects count:cc]; } } @end /* NSArray(EOKeyValueCoding) */ @implementation NSDictionary(EOKeyValueCoding) - (NSDictionary *)valuesForKeys:(NSArray *)keys { int n = [keys count]; if (n == 0) return [NSDictionary dictionary]; else if (n == 1) { NSString *key = [keys objectAtIndex:0]; return [NSDictionary dictionaryWithObject:[self objectForKey:key] forKey:key]; } else { NSMutableArray *newKeys, *newVals; int i; newKeys = [NSMutableArray arrayWithCapacity:n]; newVals = [NSMutableArray arrayWithCapacity:n]; for (i = 0; i < n; i++) { id key = [keys objectAtIndex:i]; id val = [self objectForKey:key]; if (val) { [newKeys addObject:key]; [newVals addObject:val]; } } return [NSDictionary dictionaryWithObjects:newVals forKeys:newKeys]; } } - (void)takeValue:(id)_value forKey:(NSString *)_key { //#warning takeValue:forKey: is ignored in NSDictionaries ! // ignore //[self handleTakeValue:_value forUnboundKey:_key]; } - (id)valueForKey:(NSString *)_key { id obj; if (_key == nil) // TODO: warn about nil key? return nil; if ((obj = [self objectForKey:_key]) == nil) return nil; if (null == nil) null = [[NSNull null] retain]; if (obj == null) return nil; return obj; } @end /* NSDictionary(EOKeyValueCoding) */ @implementation NSMutableDictionary(EOKeyValueCoding) - (void)takeValuesFromDictionary:(NSDictionary*)dictionary { [self addEntriesFromDictionary:dictionary]; } - (void)takeValue:(id)_value forKey:(NSString *)_key { if (_value == nil) _value = [NSNull null]; [self setObject:_value forKey:_key]; } @end /* NSMutableDictionary(EOKeyValueCoding) */ /* * Accessor functions */ /* ACCESS to keys of id type. */ static id idMethodGetFunc(void *info1, void *info2, id self) { id (*fptr)(id, SEL) = (id(*)(id, SEL))info1; id val = fptr(self, (SEL)info2); return val; } static id idIvarGetFunc(void *info1, void *info2, id self) { id *ptr = (id *)((char *)self + (unsigned long)info2); return *ptr; } static void idMethodSetFunc(void* info1, void* info2, id self, id val) { void (*fptr)(id, SEL, id) = (void(*)(id, SEL, id))info1; fptr(self, (SEL)info2, val); } static void idIvarSetFunc(void* info1, void* info2, id self, id val) { id *ptr = (id *)((char*)self + (unsigned long)info2); ASSIGN(*ptr, val); } /* ACCESS to keys of char type. */ static id charMethodGetFunc(void* info1, void* info2, id self) { char (*fptr)(id, SEL) = (char(*)(id, SEL))info1; char val = fptr(self, (SEL)info2); return [NumberClass numberWithChar:val]; } static id charIvarGetFunc(void* info1, void* info2, id self) { char *ptr = (char *)((char *)self + (unsigned long)info2); return [NumberClass numberWithChar:*ptr]; } static void charMethodSetFunc(void *info1, void *info2, id self, id val) { void (*fptr)(id, SEL, char) = (void(*)(id, SEL, char))info1; fptr(self, (SEL)info2, [val charValue]); } static void charIvarSetFunc(void *info1, void *info2, id self, id val) { char *ptr = (char *)((char *)self + (unsigned long)info2); *ptr = [val charValue]; } /* ACCESS to keys of unsigned char type. */ static id unsignedCharMethodGetFunc(void* info1, void* info2, id self) { unsigned char (*fptr)(id, SEL) = (unsigned char(*)(id, SEL))info1; unsigned char val = fptr(self, (SEL)info2); return [NumberClass numberWithUnsignedChar:val]; } static id unsignedCharIvarGetFunc(void* info1, void* info2, id self) { unsigned char *ptr = (unsigned char *)((char *)self + (unsigned long)info2); return [NumberClass numberWithUnsignedChar:*ptr]; } static void unsignedCharMethodSetFunc(void* info1, void* info2, id self, id val) { void (*fptr)(id, SEL, unsigned char) = (void(*)(id, SEL, unsigned char))info1; fptr(self, (SEL)info2, [val unsignedCharValue]); } static void unsignedCharIvarSetFunc(void* info1, void* info2, id self, id val) { unsigned char *ptr = (unsigned char *)((char *)self + (unsigned long)info2); *ptr = [val unsignedCharValue]; } /* ACCESS to keys of short type. */ static id shortMethodGetFunc(void* info1, void* info2, id self) { short (*fptr)(id, SEL) = (short(*)(id, SEL))info1; short val = fptr(self, (SEL)info2); return [NumberClass numberWithShort:val]; } static id shortIvarGetFunc(void* info1, void* info2, id self) { short *ptr = (short *)((char *)self + (unsigned long)info2); return [NumberClass numberWithShort:*ptr]; } static void shortMethodSetFunc(void* info1, void* info2, id self, id val) { void (*fptr)(id, SEL, short) = (void(*)(id, SEL, short))info1; fptr(self, (SEL)info2, [val shortValue]); } static void shortIvarSetFunc(void* info1, void* info2, id self, id val) { short *ptr = (short *)((char *)self + (unsigned long)info2); *ptr = [val shortValue]; } /* ACCESS to keys of unsigned short type. */ static id unsignedShortMethodGetFunc(void* info1, void* info2, id self) { unsigned short (*fptr)(id, SEL) = (unsigned short(*)(id, SEL))info1; unsigned short val = fptr(self, (SEL)info2); return [NumberClass numberWithUnsignedShort:val]; } static id unsignedShortIvarGetFunc(void* info1, void* info2, id self) { unsigned short *ptr = (unsigned short*)((char *)self + (unsigned long)info2); return [NumberClass numberWithUnsignedShort:*ptr]; } static void unsignedShortMethodSetFunc(void* info1, void* info2, id self, id val) { void (*fptr)(id, SEL, unsigned short) = (void(*)(id, SEL, unsigned short))info1; fptr(self, (SEL)info2, [val unsignedShortValue]); } static void unsignedShortIvarSetFunc(void* info1, void* info2, id self, id val) { unsigned short *ptr = (unsigned short*)((char *)self + (unsigned long)info2); *ptr = [val unsignedShortValue]; } /* ACCESS to keys of int type. */ static id intMethodGetFunc(void* info1, void* info2, id self) { int (*fptr)(id, SEL) = (int(*)(id, SEL))info1; int val = fptr(self, (SEL)info2); return [NumberClass numberWithInt:val]; } static id intIvarGetFunc(void *info1, void *info2, id self) { int *ptr = (int *)((char *)self + (unsigned long)info2); return [NumberClass numberWithInt:*ptr]; } static void intMethodSetFunc(void* info1, void* info2, id self, id val) { void (*fptr)(id, SEL, int) = (void(*)(id, SEL, int))info1; fptr(self, (SEL)info2, [val intValue]); } static void intIvarSetFunc(void* info1, void* info2, id self, id val) { int *ptr = (int *)((char *)self + (unsigned long)info2); *ptr = [val intValue]; } /* ACCESS to keys of unsigned int type. */ static id unsignedIntMethodGetFunc(void* info1, void* info2, id self) { unsigned int (*fptr)(id, SEL) = (unsigned int(*)(id, SEL))info1; unsigned int val = fptr(self, (SEL)info2); return [NumberClass numberWithUnsignedInt:val]; } static id unsignedIntIvarGetFunc(void* info1, void* info2, id self) { unsigned int* ptr = (unsigned int*)((char*)self + (unsigned long)info2); return [NumberClass numberWithUnsignedInt:*ptr]; } static void unsignedIntMethodSetFunc(void* info1, void* info2, id self, id val) { void (*fptr)(id, SEL, unsigned int) = (void(*)(id, SEL, unsigned int))info1; fptr(self, (SEL)info2, [val unsignedIntValue]); } static void unsignedIntIvarSetFunc(void* info1, void* info2, id self, id val) { unsigned int* ptr = (unsigned int*)((char*)self + (unsigned long)info2); *ptr = [val unsignedIntValue]; } /* ACCESS to keys of long type. */ static id longMethodGetFunc(void* info1, void* info2, id self) { long (*fptr)(id, SEL) = (long(*)(id, SEL))info1; long val = fptr(self, (SEL)info2); return [NumberClass numberWithLong:val]; } static id longIvarGetFunc(void* info1, void* info2, id self) { long* ptr = (long*)((char*)self + (unsigned long)info2); return [NumberClass numberWithLong:*ptr]; } static void longMethodSetFunc(void* info1, void* info2, id self, id val) { void (*fptr)(id, SEL, long) = (void(*)(id, SEL, long))info1; fptr(self, (SEL)info2, [val longValue]); } static void longIvarSetFunc(void* info1, void* info2, id self, id val) { long* ptr = (long*)((char*)self + (unsigned long)info2); *ptr = [val longValue]; } /* unsigned long type */ static id unsignedLongMethodGetFunc(void* info1, void* info2, id self) { unsigned long (*fptr)(id, SEL) = (unsigned long(*)(id, SEL))info1; unsigned long val = fptr(self, (SEL)info2); return [NumberClass numberWithUnsignedLong:val]; } static id unsignedLongIvarGetFunc(void* info1, void* info2, id self) { unsigned long* ptr = (unsigned long*)((char*)self + (unsigned long)info2); return [NumberClass numberWithUnsignedLong:*ptr]; } static void unsignedLongMethodSetFunc(void* info1, void* info2, id self, id val) { void (*fptr)(id, SEL, unsigned long) = (void(*)(id, SEL, unsigned long))info1; fptr(self, (SEL)info2, [val unsignedLongValue]); } static void unsignedLongIvarSetFunc(void* info1, void* info2, id self, id val) { unsigned long* ptr = (unsigned long*)((char*)self + (unsigned long)info2); *ptr = [val unsignedLongValue]; } /* long long type */ static id longLongMethodGetFunc(void* info1, void* info2, id self) { long long (*fptr)(id, SEL) = (long long(*)(id, SEL))info1; long long val = fptr(self, (SEL)info2); return [NumberClass numberWithLongLong:val]; } static id longLongIvarGetFunc(void* info1, void* info2, id self) { long long* ptr = (long long*)((char*)self + (unsigned long)info2); return [NumberClass numberWithLongLong:*ptr]; } static void longLongMethodSetFunc(void* info1, void* info2, id self, id val) { void (*fptr)(id, SEL, long long) = (void(*)(id, SEL, long long))info1; fptr(self, (SEL)info2, [val longLongValue]); } static void longLongIvarSetFunc(void* info1, void* info2, id self, id val) { long long* ptr = (long long*)((char*)self + (unsigned long)info2); *ptr = [val longLongValue]; } /* unsigned long long type */ static id unsignedLongLongMethodGetFunc(void* info1, void* info2, id self) { unsigned long long (*fptr)(id, SEL) = (unsigned long long(*)(id, SEL))info1; unsigned long long val = fptr(self, (SEL)info2); return [NumberClass numberWithUnsignedLongLong:val]; } static id unsignedLongLongIvarGetFunc(void* info1, void* info2, id self) { unsigned long long* ptr = (unsigned long long*)((char*)self + (unsigned long)info2); return [NumberClass numberWithUnsignedLongLong:*ptr]; } static void unsignedLongLongMethodSetFunc(void* info1, void* info2, id self, id val) { void (*fptr)(id, SEL, unsigned long long) = (void(*)(id, SEL, unsigned long long))info1; fptr(self, (SEL)info2, [val unsignedLongLongValue]); } static void unsignedLongLongIvarSetFunc(void* info1, void* info2, id self, id val) { unsigned long long* ptr = (unsigned long long*)((char*)self + (unsigned long)info2); *ptr = [val unsignedLongLongValue]; } /* float */ static id floatMethodGetFunc(void* info1, void* info2, id self) { float (*fptr)(id, SEL) = (float(*)(id, SEL))info1; float val = fptr(self, (SEL)info2); return [NumberClass numberWithFloat:val]; } static id floatIvarGetFunc(void* info1, void* info2, id self) { float* ptr = (float*)((char*)self + (unsigned long)info2); return [NumberClass numberWithFloat:*ptr]; } static void floatMethodSetFunc(void* info1, void* info2, id self, id val) { void (*fptr)(id, SEL, float) = (void(*)(id, SEL, float))info1; fptr(self, (SEL)info2, [val floatValue]); } static void floatIvarSetFunc(void* info1, void* info2, id self, id val) { float* ptr = (float*)((char*)self + (unsigned long)info2); *ptr = [val floatValue]; } /* double */ static id doubleMethodGetFunc(void* info1, void* info2, id self) { double (*fptr)(id, SEL) = (double(*)(id, SEL))info1; double val = fptr(self, (SEL)info2); return [NumberClass numberWithDouble:val]; } static id doubleIvarGetFunc(void* info1, void* info2, id self) { double* ptr = (double*)((char*)self + (unsigned long)info2); return [NumberClass numberWithDouble:*ptr]; } static void doubleMethodSetFunc(void* info1, void* info2, id self, id val) { void (*fptr)(id, SEL, double) = (void(*)(id, SEL, double))info1; fptr(self, (SEL)info2, [val doubleValue]); } static void doubleIvarSetFunc(void* info1, void* info2, id self, id val) { double* ptr = (double*)((char*)self + (unsigned long)info2); *ptr = [val doubleValue]; } #else /* NeXT_Foundation_LIBRARY */ @implementation NSArray(EOKeyValueCoding) - (id)computeSumForKey:(NSString *)_key { static Class NSDecimalNumberClass; id (*objAtIdx)(id, SEL, unsigned int); unsigned i, cc = [self count]; NSDecimalNumber *sum; if (NSDecimalNumberClass == Nil) NSDecimalNumberClass = [NSDecimalNumber class]; sum = [NSDecimalNumber zero]; if (cc == 0) return sum; objAtIdx = (void*)[self methodForSelector:@selector(objectAtIndex:)]; for (i = 0; i < cc; i++) { register id o; o = objAtIdx(self, @selector(objectAtIndex:), i); o = [o valueForKey:_key]; if (![o isKindOfClass:NSDecimalNumberClass]) o = (NSDecimalNumber *)[NSDecimalNumber numberWithDouble:[o doubleValue]]; sum = [sum decimalNumberByAdding:o]; } return sum; } - (id)computeAvgForKey:(NSString *)_key { unsigned cc = [self count]; NSDecimalNumber *sum, *div; if (cc == 0) return nil; sum = [self computeSumForKey:_key]; div = (NSDecimalNumber *)[NSDecimalNumber numberWithUnsignedInt:cc]; return [sum decimalNumberByDividingBy:div]; } - (id)computeCountForKey:(NSString *)_key { return [NSNumber numberWithUnsignedInt:[self count]]; } - (id)computeMaxForKey:(NSString *)_key { id (*objAtIdx)(id, SEL, unsigned int); unsigned i, cc = [self count]; NSDecimalNumber *max; if (cc == 0) return nil; objAtIdx = (void*)[self methodForSelector:@selector(objectAtIndex:)]; max = [objAtIdx(self, @selector(objectAtIndex:), 0) valueForKey:_key]; for (i = 1; i < cc; i++) { register id o; o = [objAtIdx(self, @selector(objectAtIndex:), i) valueForKey:_key]; if ([max compare:o] == NSOrderedAscending) max = o; } return max; } - (id)computeMinForKey:(NSString *)_key { id (*objAtIdx)(id, SEL, unsigned int); unsigned i, cc = [self count]; NSDecimalNumber *min; if (cc == 0) return nil; objAtIdx = (void*)[self methodForSelector:@selector(objectAtIndex:)]; min = [objAtIdx(self, @selector(objectAtIndex:), 0) valueForKey:_key]; for (i = 1; i < cc; i++) { register id o; o = [objAtIdx(self, @selector(objectAtIndex:), i) valueForKey:_key]; if ([min compare:o] == NSOrderedDescending) min = o; } return min; } - (id)valueForKey:(NSString *)_key { if (null == nil) null = [[EONull null] retain]; if ([_key hasPrefix:@"@"]) { /* process a computed function */ const char *keyStr; char *bufPtr; unsigned keyLen = [_key cStringLength]; char *kbuf, *buf; SEL sel; kbuf = malloc(keyLen + 1); buf = malloc(keyLen + 16); [_key getCString:kbuf]; keyStr = kbuf; bufPtr = buf; strcpy(buf, "compute"); bufPtr += 7; *bufPtr = toupper(keyStr[1]); bufPtr++; strncpy(&(buf[8]), &(keyStr[2]), keyLen - 2); bufPtr += (keyLen - 2); strcpy(bufPtr, "ForKey:"); if (kbuf) free(kbuf); #if NeXT_RUNTIME sel = sel_getUid(buf); #else sel = sel_get_any_uid(buf); #endif if (buf) free(buf); return sel != NULL ? [self performSelector:sel withObject:_key] : nil; } else { /* process the _key in a map function */ unsigned i, cc = [self count]; NSArray *result; id *objects; id (*objAtIdx)(id, SEL, unsigned int); #if DEBUG if ([_key isEqualToString:@"count"]) { NSLog(@"WARNING(%s): USED -valueForKey(@\"count\") ON NSArray, YOU" @"PROBABLY WANT TO USE @count INSTEAD !", __PRETTY_FUNCTION__); return [self valueForKey:@"@count"]; } #endif if (cc == 0) return [NSArray array]; objects = calloc(cc + 2, sizeof(id)); objAtIdx = (void *)[self methodForSelector:@selector(objectAtIndex:)]; for (i = 0; i < cc; i++) { register id o; o = [objAtIdx(self, @selector(objectAtIndex:), i) valueForKey:_key]; objects[i] = o ? o : (id)null; } result = [NSArray arrayWithObjects:objects count:cc]; if (objects) free(objects); return result; } } @end /* NSArray(EOKeyValueCoding) */ #endif /* !NeXT_Foundation_LIBRARY */ SOPE/sope-core/EOControl/EOObserver.h0000644000000000000000000000617212242733417016261 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __EOControl_EOObserver_H__ #define __EOControl_EOObserver_H__ #import @class NSArray; @protocol EOObserving < NSObject > - (void)objectWillChange:(id)_object; @end @interface NSObject(EOObserver) - (void)willChange; @end /* Note that -addObserver/-removeObserver methods do *not* nest ! Suppression methods do nest. */ @interface EOObserverCenter : NSObject + (void)notifyObserversObjectWillChange:(id)_object; + (void)addObserver:(id)_observer forObject:(id)_object; + (void)removeObserver:(id)_observer forObject:(id)_object; + (void)addOmniscientObserver:(id)_observer; + (void)removeOmniscientObserver:(id)_observer; + (NSArray *)observersForObject:(id)_object; + (id)observerForObject:(id)_object ofClass:(Class)_targetClass; /* suppressing notifications */ + (void)suppressObserverNotification; + (void)enableObserverNotification; + (unsigned)observerNotificationSuppressCount; @end /* asynchronous observing */ typedef enum { EOObserverPriorityImmediate, EOObserverPriorityFirst, EOObserverPrioritySecond, EOObserverPriorityThird, EOObserverPriorityFourth, EOObserverPriorityFifth, EOObserverPrioritySixth, EOObserverPriorityLater } EOObserverPriority; @class EODelayedObserver; @interface EODelayedObserverQueue : NSObject { @protected EODelayedObserver *queues[8]; NSArray *runLoopModes; BOOL hasObservers; } + (EODelayedObserverQueue *)defaultObserverQueue; /* accessors */ - (void)setRunLoopModes:(NSArray *)_modes; - (NSArray *)runLoopModes; /* managing queue */ - (void)enqueueObserver:(EODelayedObserver *)_observer; - (void)dequeueObserver:(EODelayedObserver *)_observer; /* notification */ - (void)notifyObserversUpToPriority:(EOObserverPriority)_lastPriority; @end @interface EODelayedObserver : NSObject < EOObserving > { @public EODelayedObserver *next; /* for access by queue */ } /* accessors */ - (EOObserverPriority)priority; - (EODelayedObserverQueue *)observerQueue; /* notifications */ - (void)subjectChanged; - (void)discardPendingNotification; @end @interface EOObserverProxy : EODelayedObserver { @protected EOObserverPriority priority; id target; SEL action; } - (id)initWithTarget:(id)_target action:(SEL)_action priority:(EOObserverPriority)_priority; @end #endif /* __EOControl_EOObserver_H__ */ SOPE/sope-core/EOControl/TODO0000644000000000000000000000014212242733417014554 0ustar rootrootTODOs: EOSQLParser.m - remove usage of stringByReplacingString: which is not available on MacOSX SOPE/sope-core/EOControl/EOQualifier.m0000644000000000000000000001736712242733417016430 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include "EOQualifier.h" #include "EOKeyValueCoding.h" #include "common.h" #include "EONull.h" #import @interface NSObject(QualifierDescription) - (NSString *)qualifierDescription; @end @implementation EOQualifier static NSMapTable *operatorToSelector = NULL; static NSMapTable *selectorToOperator = NULL; static EONull *null = nil; + (void)initialize { if (null == nil) null = [EONull null]; if (operatorToSelector == NULL) { operatorToSelector = NSCreateMapTable(NSObjectMapKeyCallBacks, NSIntMapValueCallBacks, 10); NSMapInsert(operatorToSelector, @"=", EOQualifierOperatorEqual); NSMapInsert(operatorToSelector, @"==", EOQualifierOperatorEqual); NSMapInsert(operatorToSelector, @"!=", EOQualifierOperatorNotEqual); NSMapInsert(operatorToSelector, @"<>", EOQualifierOperatorNotEqual); NSMapInsert(operatorToSelector, @"<", EOQualifierOperatorLessThan); NSMapInsert(operatorToSelector, @">", EOQualifierOperatorGreaterThan); NSMapInsert(operatorToSelector, @"<=", EOQualifierOperatorLessThanOrEqualTo); NSMapInsert(operatorToSelector, @"like",EOQualifierOperatorLike); NSMapInsert(operatorToSelector, @"LIKE",EOQualifierOperatorLike); NSMapInsert(operatorToSelector, @">=", EOQualifierOperatorGreaterThanOrEqualTo); NSMapInsert(operatorToSelector, @"caseInsensitiveLike", EOQualifierOperatorCaseInsensitiveLike); } if (selectorToOperator == NULL) { selectorToOperator = NSCreateMapTable(NSObjectMapKeyCallBacks, NSObjectMapValueCallBacks, 10); NSMapInsert(selectorToOperator, NSStringFromSelector(EOQualifierOperatorEqual), @"="); NSMapInsert(selectorToOperator, NSStringFromSelector(EOQualifierOperatorNotEqual), @"<>"); NSMapInsert(selectorToOperator, NSStringFromSelector(EOQualifierOperatorLessThan), @"<"); NSMapInsert(selectorToOperator, NSStringFromSelector(EOQualifierOperatorGreaterThan), @">"); NSMapInsert(selectorToOperator, NSStringFromSelector(EOQualifierOperatorLessThanOrEqualTo), @"<="); NSMapInsert(selectorToOperator, NSStringFromSelector(EOQualifierOperatorLike), @"like"); NSMapInsert(selectorToOperator, NSStringFromSelector(EOQualifierOperatorGreaterThanOrEqualTo), @">="); NSMapInsert(selectorToOperator, NSStringFromSelector(EOQualifierOperatorCaseInsensitiveLike), @"caseInsensitiveLike"); } } + (EOQualifier *)qualifierToMatchAnyValue:(NSDictionary *)_values { /* OR qualifier */ NSEnumerator *keys; NSString *key; NSArray *array; unsigned i; id qualifiers[[_values count] + 1]; keys = [_values keyEnumerator]; for (i = 0; (key = [keys nextObject]); i++) { id value; value = [_values objectForKey:key]; qualifiers[i] = [[EOKeyValueQualifier alloc] initWithKey:key operatorSelector:EOQualifierOperatorEqual value:value]; qualifiers[i] = [qualifiers[i] autorelease]; } array = [NSArray arrayWithObjects:qualifiers count:i]; return [[[EOOrQualifier alloc] initWithQualifierArray:array] autorelease]; } + (EOQualifier *)qualifierToMatchAllValues:(NSDictionary *)_values { /* AND qualifier */ NSEnumerator *keys; NSString *key; NSArray *array; unsigned i; id qualifiers[[_values count] + 1]; keys = [_values keyEnumerator]; for (i = 0; (key = [keys nextObject]); i++) { id value; value = [_values objectForKey:key]; qualifiers[i] = [[EOKeyValueQualifier alloc] initWithKey:key operatorSelector:EOQualifierOperatorEqual value:value]; qualifiers[i] = [qualifiers[i] autorelease]; } array = [NSArray arrayWithObjects:qualifiers count:i]; return [[[EOAndQualifier alloc] initWithQualifierArray:array] autorelease]; } + (SEL)operatorSelectorForString:(NSString *)_str { SEL s; if ((s = NSMapGet(operatorToSelector, _str))) return s; else return NSSelectorFromString(_str); } + (NSString *)stringForOperatorSelector:(SEL)_sel { NSString *s, *ss; if ((s = NSStringFromSelector(_sel)) == nil) return nil; if ((ss = NSMapGet(selectorToOperator, s))) return ss; return s; } /* bindings */ - (EOQualifier *)qualifierWithBindings:(NSDictionary *)_bindings requiresAllVariables:(BOOL)_reqAll { return self; } - (NSArray *)bindingKeys { return nil; } - (BOOL)requiresAllQualifierBindingVariables { return YES; } /* keys */ - (NSSet *)allQualifierKeys { /* new in WO 4.5 */ id set; set = [NSMutableSet setWithCapacity:64]; [self addQualifierKeysToSet:set]; return [[set copy] autorelease]; } - (void)addQualifierKeysToSet:(NSMutableSet *)_keys { /* new in WO 4.5 */ } /* Comparing */ - (BOOL)isEqual:(id)_obj { if ([_obj isKindOfClass:[self class]]) return [self isEqualToQualifier:(EOQualifier *)_obj]; return NO; } - (BOOL)isEqualToQualifier:(EOQualifier *)_qual { [self doesNotRecognizeSelector:_cmd]; return NO; } /* remapping keys */ - (EOQualifier *)qualifierByApplyingTransformer:(id)_t inContext:(id)_ctx { if ([_t respondsToSelector:@selector(transformQualifier:inContext:)]) return [_t transformQualifier:self inContext:_ctx]; else return [[self retain] autorelease]; } - (EOQualifier *)qualifierByApplyingKeyMap:(NSDictionary *)_key { return [[self copy] autorelease]; } /* GDL2 compatibility */ - (EOQualifier *)qualifierByApplyingBindings:(NSDictionary *)_bindings { return [self qualifierWithBindings:_bindings requiresAllVariables: [self requiresAllQualifierBindingVariables]]; } /* BDControl additions */ - (NSUInteger)count { return [[self subqualifiers] count]; } - (NSArray *)subqualifiers { return nil; } /* debugging */ + (BOOL)isEvaluationDebuggingEnabled { static int evalDebug = -1; if (evalDebug == -1) { evalDebug = [[NSUserDefaults standardUserDefaults] boolForKey:@"EOQualifierDebugEvaluation"] ? 1 : 0; if (evalDebug) NSLog(@"WARNING: qualifier evaluation debugging is enabled !"); } return evalDebug ? YES : NO; } /* QuickEval */ - (BOOL)evaluateWithObject:(id)_object inEvalContext:(id)_ctx { return [(id)self evaluateWithObject:_object]; } /* key/value archiving */ - (id)initWithKeyValueUnarchiver:(EOKeyValueUnarchiver *)_unarchiver { return [super init]; } - (void)encodeWithKeyValueArchiver:(EOKeyValueArchiver *)_archiver { } /* NSCopying */ - (id)copyWithZone:(NSZone *)_zone { /* EOQualifiers are supposed to be immutable */ return [self retain]; } @end /* EOQualifier */ SOPE/sope-core/EOControl/EOFetchSpecification.h0000644000000000000000000000456212242733417020225 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __EOFetchSpecification_h__ #define __EOFetchSpecification_h__ #import @class NSArray, NSString, NSDictionary; @class EOQualifier; @interface EOFetchSpecification : NSObject < NSCopying > { NSString *entityName; EOQualifier *qualifier; NSArray *sortOrderings; unsigned fetchLimit; NSDictionary *hints; struct { int usesDistinct:1; int locksObjects:1; int deep:1; int reserved:29; } fsFlags; } + (EOFetchSpecification *)fetchSpecificationWithEntityName:(NSString *)_ename qualifier:(EOQualifier *)_qualifier sortOrderings:(NSArray *)sortOrderings; - (id)initWithEntityName:(NSString *)_name qualifier:(EOQualifier *)_qualifier sortOrderings:(NSArray *)_sortOrderings usesDistinct:(BOOL)_dflag isDeep:(BOOL)_isDeep hints:(NSDictionary *)_hints; /* accessors */ - (void)setEntityName:(NSString *)_name; - (NSString *)entityName; - (void)setQualifier:(EOQualifier *)_qualifier; - (EOQualifier *)qualifier; - (void)setSortOrderings:(NSArray *)_orderings; - (NSArray *)sortOrderings; - (void)setUsesDistinct:(BOOL)_flag; - (BOOL)usesDistinct; - (void)setIsDeep:(BOOL)_flag; - (BOOL)isDeep; - (void)setLocksObjects:(BOOL)_flag; - (BOOL)locksObjects; - (void)setFetchLimit:(unsigned)_limit; - (unsigned)fetchLimit; - (void)setHints:(NSDictionary *)_hints; - (NSDictionary *)hints; /* bindings */ - (EOFetchSpecification *)fetchSpecificationWithQualifierBindings:(NSDictionary *)_bindings; /* remapping keys */ - (EOFetchSpecification *)fetchSpecificationByApplyingKeyMap:(NSDictionary *)_m; @end #endif /* __EOFetchSpecification_h__ */ SOPE/sope-core/EOControl/EOKeyValueQualifier.m0000644000000000000000000002147512242733417020071 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include "common.h" @interface NSObject(QualifierDescription) - (NSString *)qualifierDescription; @end @implementation EOKeyValueQualifier static BOOL debugEval = NO; static BOOL debugTransform = NO; static EONull *null = nil; + (void)initialize { if (null == nil) null = [[EONull null] retain]; debugEval = [EOQualifier isEvaluationDebuggingEnabled]; } - (id)initWithKey:(NSString *)_key operatorSelector:(SEL)_selector value:(id)_value { self->key = [_key copyWithZone:NULL]; self->value = [_value retain]; self->operator = _selector; if (_selector == NULL) { NSLog(@"WARNING(%s): got no selector for kv qualifier (key=%@)", __PRETTY_FUNCTION__, _key); } return self; } - (id)init { return [self initWithKey:nil operatorSelector:NULL value:nil]; } - (void)dealloc { [self->key release]; [self->value release]; [super dealloc]; } /* accessors */ - (NSString *)key { return self->key; } - (SEL)selector { return self->operator; } - (id)value { return self->value; } /* bindings */ - (EOQualifier *)qualifierWithBindings:(NSDictionary *)_bindings requiresAllVariables:(BOOL)_reqAll { static Class VarClass = Nil; NSString *newKey; id newValue; BOOL needNew; if (VarClass == Nil) VarClass = [EOQualifierVariable class]; needNew = NO; if ([self->key class] == VarClass) { newKey = [_bindings objectForKey:[(EOQualifierVariable *)self->key key]]; if (newKey == nil) { if (_reqAll) // throw exception ; else newKey = self->key; } else needNew = YES; } else newKey = self->key; if ([self->value class] == VarClass) { newValue = [_bindings objectForKey:[self->value key]]; if (newValue == nil) { if (_reqAll) // throw exception ; else newValue = self->value; } else needNew = YES; } else newValue = self->value; if (!needNew) return self; return [[[[self class] alloc] initWithKey:newKey operatorSelector:self->operator value:newValue] autorelease]; } - (NSArray *)bindingKeys { static Class VarClass = Nil; Class keyClass, vClass; if (VarClass == Nil) VarClass = [EOQualifierVariable class]; keyClass = [self->key class]; vClass = [self->value class]; if ((keyClass == VarClass) && (vClass == VarClass)) { id o[2]; o[0] = [(EOQualifierVariable *)self->key key]; o[1] = [(EOQualifierVariable *)self->value key]; return [NSArray arrayWithObjects:o count:2]; } if (keyClass == VarClass) return [NSArray arrayWithObject:[(EOQualifierVariable *)self->key key]]; if (vClass == VarClass) return [NSArray arrayWithObject:[(EOQualifierVariable *)self->value key]]; return [NSArray array]; } /* keys */ - (void)addQualifierKeysToSet:(NSMutableSet *)_keys { /* new in WO 4.5 */ [_keys addObject:self->key]; } /* evaluation */ - (BOOL)evaluateWithObject:(id)_object inEvalContext:(id)_ctx { id lv, rv; BOOL (*m)(id, SEL, id); BOOL result; if (_ctx == nil) _ctx = [NSMutableDictionary dictionaryWithCapacity:16]; if ((lv = [(NSDictionary *)_ctx objectForKey:self->key]) == nil) { lv = [_object valueForKeyPath:self->key]; if (lv == nil) lv = null; [(NSMutableDictionary *)_ctx setObject:lv forKey:self->key]; } rv = self->value != nil ? self->value : (id)null; if (debugEval) { NSLog(@"Eval: EOKeyValueQualifier:(%@ %@)\n" @" compare %@<%@>\n with %@<%@>", self->key, NSStringFromSelector(self->operator), lv, NSStringFromClass([lv class]), rv, NSStringFromClass([rv class])); } if ((m = (void *)[lv methodForSelector:self->operator]) == NULL) { /* no such operator method ! */ [lv doesNotRecognizeSelector:self->operator]; return NO; } result = m(lv, self->operator, rv); if (debugEval) NSLog(@" %@", result ? @"MATCHES" : @"DOES NOT MATCH"); return result; } - (BOOL)evaluateWithObject:(id)_object { return [self evaluateWithObject:_object inEvalContext:nil]; } /* NSCoding */ - (void)encodeWithCoder:(NSCoder *)_coder { [_coder encodeObject:self->key]; [_coder encodeObject:self->value]; [_coder encodeValueOfObjCType:@encode(SEL) at:&(self->operator)]; } - (id)initWithCoder:(NSCoder *)_coder { self->key = [[_coder decodeObject] copyWithZone:[self zone]]; self->value = [[_coder decodeObject] retain]; [_coder decodeValueOfObjCType:@encode(SEL) at:&(self->operator)]; if (self->operator == NULL) { NSLog(@"WARNING(%s): decoded no selector for kv qualifier (key=%@)", __PRETTY_FUNCTION__, self->key); } return self; } /* Comparing */ - (BOOL)isEqualToQualifier:(EOQualifier *)_qual { if (![self->key isEqual:[(EOKeyValueQualifier *)_qual key]]) return NO; if (![self->value isEqual:[(EOKeyValueQualifier *)_qual value]]) return NO; if (sel_eq(self->operator, [(EOKeyValueQualifier *)_qual selector])) return YES; return NO; } /* remapping keys */ - (EOQualifier *)qualifierByApplyingTransformer:(id)_transformer inContext:(id)_ctx { if ([_transformer respondsToSelector: @selector(transformKeyValueQualifier:inContext:)]) { if (debugTransform) NSLog(@"transformer: %@\n transform: %@", _transformer, self); return [_transformer transformKeyValueQualifier:self inContext:_ctx]; } else { if (debugTransform) NSLog(@"EOKeyValueQualifier: not transforming using %@", _transformer); return [[self retain] autorelease]; } } - (EOQualifier *)qualifierByApplyingKeyMap:(NSDictionary *)_map { EOKeyValueQualifier *kvq; NSString *k; k = [_map objectForKey:self->key]; if (k == nil) k = self->key; kvq = [[EOKeyValueQualifier alloc] initWithKey:k operatorSelector:self->operator value:self->value]; return [kvq autorelease]; } /* key/value archiving */ - (id)initWithKeyValueUnarchiver:(EOKeyValueUnarchiver *)_unarchiver { if ((self = [super initWithKeyValueUnarchiver:_unarchiver]) != nil) { NSString *s; self->key = [[_unarchiver decodeObjectForKey:@"key"] copy]; self->value = [[_unarchiver decodeObjectForKey:@"value"] retain]; if ((s = [_unarchiver decodeObjectForKey:@"selectorName"]) != nil) { if (![s hasSuffix:@":"]) s = [s stringByAppendingString:@":"]; self->operator = NSSelectorFromString(s); } else if ((s = [_unarchiver decodeObjectForKey:@"selector"]) != nil) self->operator = NSSelectorFromString(s); else { NSLog(@"WARNING(%s): decoded no selector/selectorName for kv qualifier " @"(key=%@)", __PRETTY_FUNCTION__, self->key); self->operator = EOQualifierOperatorEqual; } if (self->operator == NULL) { NSLog(@"WARNING(%s): decoded no selector for kv qualifier (key=%@)", __PRETTY_FUNCTION__, self->key); self->operator = EOQualifierOperatorEqual; } } return self; } - (void)encodeWithKeyValueArchiver:(EOKeyValueArchiver *)_archiver { NSString *s; [super encodeWithKeyValueArchiver:_archiver]; [_archiver encodeObject:[self key] forKey:@"key"]; [_archiver encodeObject:[self value] forKey:@"value"]; s = NSStringFromSelector([self selector]); if ([s hasSuffix:@":"]) s = [s substringToIndex:[s length] - 1]; [_archiver encodeObject:s forKey:@"selectorName"]; } /* description */ - (NSString *)description { NSMutableString *s; NSString *tmp; s = [NSMutableString stringWithCapacity:64]; if (self->key != nil) [s appendString:self->key]; else [s appendString:@"[NO KEY]"]; [s appendString:@" "]; if ((tmp = [EOQualifier stringForOperatorSelector:self->operator]) != nil) [s appendString:tmp]; else if (self->operator != NULL) [s appendString:@"[NO STR OPERATOR]"]; else [s appendString:@"[NO OPERATOR]"]; [s appendString:@" "]; if ((tmp = [self->value qualifierDescription]) != nil) [s appendString:tmp]; else [s appendString:@"nil"]; return s; } @end /* EOKeyValueQualifier */ SOPE/sope-core/EOControl/EOKeyGlobalID.h0000644000000000000000000000277012242733417016560 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __EOControl_EOKeyGlobalID_H__ #define __EOControl_EOKeyGlobalID_H__ #include @class NSArray; /* An immutable global id based on primary key values. The values must be passed in the alphabetical order of the attribute named. This class cannot be subclassed !!! */ @interface EOKeyGlobalID : EOGlobalID < NSCoding > { @protected NSString *entityName; unsigned int count; id values[1]; } + (id)globalIDWithEntityName:(NSString *)_name keys:(id *)_keyValues keyCount:(unsigned int)_count zone:(NSZone *)_zone; /* accessors */ - (NSString *)entityName; - (unsigned int)keyCount; - (id *)keyValues; - (NSArray *)keyValuesArray; @end #endif /* __EOControl_EOKeyGlobalID_H__ */ SOPE/sope-core/EOControl/EOGlobalID.m0000644000000000000000000000535312242733417016114 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "EOGlobalID.h" #include "common.h" #include #include #if !defined(__MINGW32__) # include #endif @implementation EOGlobalID - (BOOL)isTemporary { return NO; } - (id)copyWithZone:(NSZone *)_zone { [self doesNotRecognizeSelector:_cmd]; return nil; } @end /* EOGlobalID */ @implementation EOTemporaryGlobalID static unsigned short sequence = 0; static unsigned int ip; + (void)initialize { static BOOL isInitialized = NO; if (!isInitialized) { char buf[1024]; struct hostent *hostEntry; isInitialized = YES; gethostname(buf, 1024); // THREADING if ((hostEntry = gethostbyname(buf))) { char **ptr; ptr = hostEntry->h_addr_list; if (*ptr) { NSAssert((unsigned)hostEntry->h_length >= sizeof(ip), @"invalid host address !"); memcpy(&ip, *ptr, sizeof(ip)); } else { NSLog(@"WARNING: set IP address for EO key generation to 0.0.0.0 !"); ip = 0; } } else { NSLog(@"WARNING: set IP address for EO key generation to 0.0.0.0 !"); ip = 0; } } } + (void)assignGloballyUniqueBytes:(unsigned char *)_buffer { struct { unsigned short sequence; unsigned short pid; unsigned int time; unsigned int ip; } *bufPtr; bufPtr = (void *)_buffer; bufPtr->sequence = sequence++; #if defined(__WIN32__) bufPtr->pid = (unsigned short)GetCurrentProcessId(); #else bufPtr->pid = getpid(); #endif bufPtr->time = time(NULL); bufPtr->ip = ip; } - (id)init { [self->isa assignGloballyUniqueBytes:&(self->idbuffer[0])]; return self; } - (BOOL)isTemporary { return YES; } - (BOOL)isEqual:(id)_other { return _other == self ? YES : NO; #if 0 EOTemporaryGlobalID *otherKey; if (_other == nil) return NO; if (_other == self) return YES; otherKey = _other; if (otherKey->isa != self->isa) return NO; // compare bytes return NO; #endif } @end /* EOTemporaryGlobalID */ SOPE/sope-core/EOControl/EOKeyValueArchiver.h0000644000000000000000000000557512242733417017711 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __EOControl_EOKeyValueArchiver_H__ #define __EOControl_EOKeyValueArchiver_H__ #import @class NSString, NSDictionary, NSMutableArray, NSMutableDictionary; @class NSMutableSet; @interface EOKeyValueArchiver : NSObject { NSMutableDictionary *plist; id delegate; // non-retained } /* coding */ - (void)encodeObject:(id)_obj forKey:(NSString *)_key; - (void)encodeReferenceToObject:(id)_obj forKey:(NSString *)_key; - (void)encodeBool:(BOOL)_flag forKey:(NSString *)_key; - (void)encodeInt:(int)_value forKey:(NSString *)_key; - (NSDictionary *)dictionary; /* delegate */ - (void)setDelegate:(id)_delegate; - (id)delegate; @end @interface EOKeyValueUnarchiver : NSObject { NSDictionary *plist; NSMutableArray *unarchivedObjects; NSMutableSet *awakeObjects; id parent; id delegate; // non-retained (eg a WOComponent) } - (id)initWithDictionary:(NSDictionary *)_dict; /* decoding */ - (id)decodeObjectForKey:(NSString *)_key; - (id)decodeObjectReferenceForKey:(NSString *)_key; /* ask delegate for obj */ - (BOOL)decodeBoolForKey:(NSString *)_key; - (int)decodeIntForKey:(NSString *)_key; - (id)decodeObjectAtIndex:(unsigned)_idx; /* operations */ - (void)ensureObjectAwake:(id)_object; - (void)finishInitializationOfObjects; - (void)awakeObjects; - (id)parent; /* delegate */ - (void)setDelegate:(id)_delegate; - (id)delegate; @end @protocol EOKeyValueArchiving - (id)initWithKeyValueUnarchiver:(EOKeyValueUnarchiver *)_unarchiver; - (void)encodeWithKeyValueArchiver:(EOKeyValueArchiver *)_archiver; @end @interface NSObject(EOKeyValueArchivingAwakeMethods) - (void)finishInitializationWithKeyValueUnarchiver:(EOKeyValueUnarchiver *)_un; - (void)awakeFromKeyValueUnarchiver:(EOKeyValueUnarchiver *)_unarchiver; @end /* delegates */ @interface NSObject(KVCArchiverDelegates) - (id)archiver:(EOKeyValueArchiver *)_archiver referenceToEncodeForObject:(id)_obj; @end @interface NSObject(KVCUnarchiverDelegates) - (id)unarchiver:(EOKeyValueUnarchiver *)_unarchiver objectForReference:(id)_obj; @end #endif /* __EOControl_EOKeyValueArchiver_H__ */ SOPE/sope-core/EOControl/EOControl.h0000644000000000000000000000256412242733417016113 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __EOControl_H__ #define __EOControl_H__ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #endif /* __EOControl_H__ */ SOPE/sope-core/EOControl/EOKeyValueArchiver.m0000644000000000000000000002136112242733417017705 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "EOKeyValueArchiver.h" #include "common.h" @implementation EOKeyValueArchiver - (id)init { if ((self = [super init])) { self->plist = [[NSMutableDictionary alloc] init]; } return self; } - (void)dealloc { [self->plist release]; [super dealloc]; } /* coding */ static BOOL isPListObject(id _obj) { if ([_obj isKindOfClass:[NSString class]]) return YES; if ([_obj isKindOfClass:[NSData class]]) return YES; if ([_obj isKindOfClass:[NSArray class]]) return YES; return NO; } - (void)encodeObject:(id)_obj forKey:(NSString *)_key { NSMutableDictionary *oldPlist; if (isPListObject(_obj)) { id c; c = [_obj copy]; [self->plist setObject:c forKey:_key]; [c release]; return; } oldPlist = self->plist; self->plist = [[NSMutableDictionary alloc] init]; if (_obj) { /* store class name */ [self->plist setObject:NSStringFromClass([_obj class]) forKey:@"class"]; /* let object store itself */ [_obj encodeWithKeyValueArchiver:self]; } else { /* nil ??? */ } [oldPlist setObject:self->plist forKey:_key]; [self->plist release]; self->plist = oldPlist; } - (void)encodeReferenceToObject:(id)_obj forKey:(NSString *)_key { if ([self->delegate respondsToSelector: @selector(archiver:referenceToEncodeForObject:)]) _obj = [self->delegate archiver:self referenceToEncodeForObject:_obj]; /* if _obj wasn't replaced by the delegate, encode the object in place .. */ [self encodeObject:_obj forKey:_key]; } - (void)encodeBool:(BOOL)_flag forKey:(NSString *)_key { /* NO values are not archived .. */ if (_flag) { [self->plist setObject:@"YES" forKey:_key]; } } - (void)encodeInt:(int)_value forKey:(NSString *)_key { [self->plist setObject:[NSString stringWithFormat:@"%i", _value] forKey:_key]; } - (NSDictionary *)dictionary { return [[self->plist copy] autorelease]; } /* delegate */ - (void)setDelegate:(id)_delegate { self->delegate = _delegate; } - (id)delegate { return self->delegate; } @end /* EOKeyValueArchiver */ @implementation EOKeyValueUnarchiver - (id)initWithDictionary:(NSDictionary *)_dict { self->plist = [_dict copy]; self->unarchivedObjects = [[NSMutableArray alloc] initWithCapacity:16]; // should be a hashtable self->awakeObjects = [[NSMutableSet alloc] initWithCapacity:16]; return self; } - (id)init { [self release]; return nil; } - (void)dealloc { [self->awakeObjects release]; [self->unarchivedObjects release]; [self->plist release]; [super dealloc]; } /* class handling */ - (Class)classForName:(NSString *)_name { /* This method maps class names. It is intended for archives which are written by the Java bridge and therefore use fully qualified Java package names. The mapping is hardcoded for now, this could be extended to use a dictionary if considered necessary. */ NSString *lastComponent = nil; Class clazz; NSRange r; if (_name == nil) return nil; if ((clazz = NSClassFromString(_name)) != Nil) return clazz; /* check for Java like . names (eg com.webobjects.directtoweb.Assignment) */ r = [_name rangeOfString:@"." options:NSBackwardsSearch]; if (r.length > 0) { lastComponent = [_name substringFromIndex:(r.location + r.length)]; /* first check whether the last name directly matches a class */ if ((clazz = NSClassFromString(lastComponent)) != Nil) return clazz; /* then check some hardcoded prefixes */ if ([_name hasPrefix:@"com.webobjects.directtoweb"]) { if ((clazz = NSClassFromString(lastComponent)) != Nil) return clazz; } NSLog(@"WARNING(%s): could not map Java class in unarchiver: '%@'", __PRETTY_FUNCTION__, _name); } return Nil; } /* decoding */ - (id)_decodeCurrentPlist { NSString *className; Class clazz; id obj; if ([self->plist isKindOfClass:[NSArray class]]) { unsigned count; if ((count = [self->plist count]) == 0) obj = [[self->plist copy] autorelease]; else { unsigned i; id *objs; objs = calloc(count + 1, sizeof(id)); for (i = 0; i < count; i++) objs[i] = [self decodeObjectAtIndex:i]; obj = [NSArray arrayWithObjects:objs count:count]; if (objs != NULL) free(objs); } return obj; } if (![self->plist isKindOfClass:[NSDictionary class]]) return [[self->plist copy] autorelease]; /* handle dictionary */ if ((className = [self->plist objectForKey:@"class"]) == nil) return [[self->plist copy] autorelease]; /* treat as plain dictionary */ if ((clazz = [self classForName:className]) == nil) { NSLog(@"WARNING(%s): did not find class specified in archive '%@': %@", __PRETTY_FUNCTION__, className, self->plist); return nil; } /* create custom object */ obj = [clazz alloc]; obj = [obj initWithKeyValueUnarchiver:self]; if (obj != nil) [self->unarchivedObjects addObject:obj]; else { NSLog(@"WARNING(%s): could not unarchive object %@", __PRETTY_FUNCTION__, self->plist); } if (self->unarchivedObjects != nil) [obj release]; else [obj autorelease]; return obj; } - (id)decodeObjectAtIndex:(unsigned)_idx { NSDictionary *lastParent; id obj; /* push */ lastParent = self->parent; self->parent = self->plist; self->plist = [(NSArray *)self->parent objectAtIndex:_idx]; obj = [self _decodeCurrentPlist]; /* pop */ self->plist = self->parent; self->parent = lastParent; return obj != nil ? obj : (id)[NSNull null]; } - (id)decodeObjectForKey:(NSString *)_key { NSDictionary *lastParent; id obj; /* push */ lastParent = self->parent; self->parent = self->plist; self->plist = [(NSDictionary *)self->parent objectForKey:_key]; obj = [self _decodeCurrentPlist]; /* pop */ self->plist = self->parent; self->parent = lastParent; return obj; } - (id)decodeObjectReferenceForKey:(NSString *)_key { id refObj, obj; refObj = [self decodeObjectForKey:_key]; if ([self->delegate respondsToSelector: @selector(unarchiver:objectForReference:)]) { obj = [self->delegate unarchiver:self objectForReference:refObj]; if (obj != nil) [self->unarchivedObjects addObject:obj]; } else { /* if delegate does not dereference, pass back the reference object */ obj = refObj; } return obj; } - (BOOL)decodeBoolForKey:(NSString *)_key { id v; if ((v = [self->plist objectForKey:_key]) == nil) return NO; if ([v isKindOfClass:[NSString class]]) { unsigned l = [v length]; if (l == 4 && [v isEqualToString:@"true"]) return YES; if (l == 5 && [v isEqualToString:@"false"]) return NO; if (l == 3 && [v isEqualToString:@"YES"]) return YES; if (l == 2 && [v isEqualToString:@"NO"]) return NO; if (l == 1 && [v characterAtIndex:0] == '1') return YES; if (l == 1 && [v characterAtIndex:0] == '0') return NO; } return [v boolValue]; } - (int)decodeIntForKey:(NSString *)_key { return [[self->plist objectForKey:_key] intValue]; } /* operations */ - (void)ensureObjectAwake:(id)_object { if (![self->awakeObjects containsObject:_object]) { if ([_object respondsToSelector:@selector(awakeFromKeyValueUnarchiver:)]) { [_object awakeFromKeyValueUnarchiver:self]; } [self->awakeObjects addObject:_object]; } } - (void)awakeObjects { NSEnumerator *e; id obj; e = [self->unarchivedObjects objectEnumerator]; while ((obj = [e nextObject]) != nil) [self ensureObjectAwake:obj]; } - (void)finishInitializationOfObjects { NSEnumerator *e; id obj; e = [self->unarchivedObjects objectEnumerator]; while ((obj = [e nextObject]) != nil) { if ([obj respondsToSelector: @selector(finishInitializationWithKeyValueUnarchiver:)]) [obj finishInitializationWithKeyValueUnarchiver:self]; } } - (id)parent { return self->parent; } /* delegate */ - (void)setDelegate:(id)_delegate { self->delegate = _delegate; } - (id)delegate { return self->delegate; } @end /* EOKeyValueUnarchiver */ SOPE/sope-core/EOControl/common.h0000644000000000000000000001141612242733417015533 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __EOControl_COMMON_H__ #define __EOControl_COMMON_H__ #include #include #include #import #import #if NeXT_RUNTIME || APPLE_RUNTIME # define objc_free(__mem__) free(__mem__) # define objc_malloc(__size__) malloc(__size__) # define objc_calloc(__cnt__, __size__) calloc(__cnt__, __size__) # define objc_realloc(__ptr__, __size__) realloc(__ptr__, __size__) # ifndef sel_eq # define sel_eq(sela,selb) (sela==selb?YES:NO) # endif #endif #if __GNU_LIBOBJC__ >= 20100911 # ifndef sel_eq # define sel_eq(__A__,__B__) sel_isEqual(__A__,__B__) # endif #endif #ifndef ASSIGN # define ASSIGN(object, value) \ ({id __object = (id)object; \ id __value = (id)value; \ if (__value != __object) { if (__value) [__value retain]; \ if (__object) [__object release]; \ object = __value;}}) #endif #ifndef ASSIGNCOPY # define ASSIGNCOPY(object, value) \ ({id __object = (id)object; \ id __value = (id)value; \ if (__value != __object) { if (__value) __value = [__value copy]; \ if (__object) [__object release]; \ object = __value;}}) #endif // ******************** common functions ******************** static inline char* Strdup(const char*) __attribute__((unused)); static inline char* Strcpy (char*, const char*) __attribute__((unused)); static inline char* Strncpy (char*, const char*, unsigned) __attribute__((unused)); static inline char* Strcat (char*, const char*) __attribute__((unused)); static inline char* Strncat (char*, const char*, unsigned) __attribute__((unused)); static inline int Strcmp(const char*, const char*) __attribute__((unused)); static inline int Strncmp(const char*, const char*, unsigned) __attribute__((unused)); static inline int Atoi(const char*) __attribute__((unused)); static inline long Atol(const char*) __attribute__((unused)); #define Malloc malloc #define Calloc calloc #define Realloc realloc #define Free(__p__) if(__p__) { free(__p__); __p__ = NULL; } #define Strlen(__s__) (__s__?strlen(__s__):0) static inline char *Strdup(const char *s) { return s ? strcpy(Malloc(strlen(s) + 1), s) : NULL; } static inline char* Strcpy (char *d, const char *s) { return s && d ? strcpy(d, s) : d; } static inline char* Strncpy (char* d, const char* s, unsigned size) { return s && d ? strncpy(d, s, size) : d; } static inline char* Strcat (char* d, const char* s) { return s && d ? strcat(d, s) : d; } static inline char* Strncat (char* d, const char* s , unsigned size) { return s && d ? strncat(d, s , size) : d; } static inline int Strcmp(const char* p, const char* q) { if(p == NULL) { if(!q) return 0; else return -1; } else { if(!q) return 1; else return strcmp(p, q); } } static inline int Strncmp(const char* p, const char* q, unsigned size) { if(!p) { if(!q) return 0; else return -1; } else { if(!q) return 1; else return strncmp(p, q, size); } } static inline int Atoi(const char* str) { return str ? atoi(str) : 0; } static inline long Atol(const char *str) { return str ? atol(str) : 0; } #ifndef MAX #define MAX(a, b) \ ({typedef _ta = (a), _tb = (b); \ _ta _a = (a); _tb _b = (b); \ _a > _b ? _a : _b; }) #endif #ifndef MIN #define MIN(a, b) \ ({typedef _ta = (a), _tb = (b); \ _ta _a = (a); _tb _b = (b); \ _a < _b ? _a : _b; }) #endif static inline char *Ltoa(long nr, char *str, int base) { char buff[34], rest, is_negative; int ptr; ptr = 32; buff[33] = '\0'; if (nr < 0) { is_negative = 1; nr = -nr; } else is_negative = 0; while (nr != 0) { rest = nr % base; if (rest > 9) rest += 'A' - 10; else rest += '0'; buff[ptr--] = rest; nr /= base; } if (ptr == 32) buff[ptr--] = '0'; if (is_negative) buff[ptr--] = '-'; Strcpy(str, &buff[ptr+1]); return(str); } #endif /* __EOControl_COMMON_H__ */ SOPE/sope-core/EOControl/EOSortOrdering.m0000644000000000000000000002222112242733417017111 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "EOSortOrdering.h" #include "EOKeyValueCoding.h" #include #include "common.h" #if GNU_RUNTIME # include #endif #ifndef SEL_EQ # if GNU_RUNTIME # define SEL_EQ(sel1,sel2) sel_eq(sel1,sel2) # else # define SEL_EQ(sel1,sel2) (sel1 == sel2) # endif #endif @implementation EOSortOrdering /*" This class specifies a sort-ordering as used with EOFetchSpecification. It takes a key and a sort selector which is used for comparision. "*/ /*" Create a sort-ordering object with the specified key and sort selector "*/ + (EOSortOrdering *)sortOrderingWithKey:(NSString *)_key selector:(SEL)_sel { return [[[self alloc] initWithKey:_key selector:_sel] autorelease]; } /*" Initialize a sort-ordering object with the specified key and sort selector "*/ - (id)initWithKey:(NSString *)_key selector:(SEL)_selector { if ((self = [super init])) { self->key = [_key copyWithZone:[self zone]]; self->selector = _selector; } return self; } - (void)dealloc { [self->key release]; [super dealloc]; } /* accessors */ /*" Returns the key the ordering sorts with. "*/ - (NSString *)key { return self->key; } /*" Returns the selector the ordering sorts with. "*/ - (SEL)selector { return self->selector; } /* equality */ - (BOOL)isEqualToSortOrdering:(EOSortOrdering *)_sortOrdering { if (!SEL_EQ([_sortOrdering selector], [self selector])) return NO; if (![[_sortOrdering key] isEqualToString:[self key]]) return NO; return YES; } - (BOOL)isEqual:(id)_other { if ([_other isKindOfClass:[EOSortOrdering class]]) return [self isEqualToSortOrdering:_other]; return NO; } /* remapping keys */ - (EOSortOrdering *)sortOrderingByApplyingKeyMap:(NSDictionary *)_map { NSString *k; k = [_map objectForKey:self->key]; return [EOSortOrdering sortOrderingWithKey:(k ? k : self->key) selector:self->selector]; } /* key/value archiving */ - (id)initWithKeyValueUnarchiver:(EOKeyValueUnarchiver *)_unarchiver { if ((self = [super init]) != nil) { NSString *s; self->key = [[_unarchiver decodeObjectForKey:@"key"] copy]; if ((s = [_unarchiver decodeObjectForKey:@"selector"]) != nil) self->selector = NSSelectorFromString(s); else if ((s = [_unarchiver decodeObjectForKey:@"selectorName"]) != nil) { if (![s hasSuffix:@":"]) s = [s stringByAppendingString:@":"]; self->selector = NSSelectorFromString(s); } } return self; } - (void)encodeWithKeyValueArchiver:(EOKeyValueArchiver *)_archiver { [_archiver encodeObject:[self key] forKey:@"key"]; [_archiver encodeObject:NSStringFromSelector([self selector]) forKey:@"selectorName"]; } /* description */ - (NSString *)description { return [NSString stringWithFormat: @"<0x%p[%@]: key=%@ selector=%@>", self, NSStringFromClass([self class]), [self key], NSStringFromSelector([self selector])]; } @end /* EOSortOrdering */ @implementation NSArray(EOSortOrdering) /*" Sort the array using the sort-orderings contained in the argument. If no orderings are given, a copy of self is returned. "*/ - (NSArray *)sortedArrayUsingKeyOrderArray:(NSArray *)_orderings { NSMutableArray *m = nil; NSArray *result = nil; if ([_orderings count] == 0) return [[self copy] autorelease]; m = [self mutableCopy]; [m sortUsingKeyOrderArray:_orderings]; result = [m copy]; [m release]; m = nil; return [result autorelease]; } @end /* NSArray(EOSortOrdering) */ @implementation NSMutableArray(EOSortOrdering) typedef struct { EOSortOrdering *orderings[10]; /* max depth 10 */ short count; } EOSortOrderingContext; static EONull *null = nil; static int keyOrderComparator(id o1, id o2, EOSortOrderingContext *context) { short i; for (i = 0; i < context->count; i++) { NSString *key; SEL sel; id v1, v2; int (*ccmp)(id, SEL, id); int result; key = [context->orderings[i] key]; sel = [context->orderings[i] selector]; v1 = [o1 valueForKeyPath:key]; v2 = [o2 valueForKeyPath:key]; if (v1 == v2) result = NSOrderedSame; else if ((v1 == nil) || (v1 == null)) result = (sel == EOCompareAscending) ? NSOrderedAscending : NSOrderedDescending; else if ((v2 == nil) || (v2 == null)) result = (sel == EOCompareAscending) ? NSOrderedDescending : NSOrderedAscending; else if ((ccmp = (void *)[v1 methodForSelector:sel])) result = ccmp(v1, sel, v2); else result = (unsigned long)[v1 performSelector:sel withObject:v2]; if (result != NSOrderedSame) return result; } return NSOrderedSame; } /*" Sort the array using the sort-orderings contained in the argument. "*/ - (void)sortUsingKeyOrderArray:(NSArray *)_orderings { NSEnumerator *e = nil; EOSortOrdering *ordering = nil; EOSortOrderingContext ctx; int i; NSAssert([_orderings count] < 10, @"max sort descriptor count is 10!"); e = [_orderings objectEnumerator]; for (i = 0; (ordering = [e nextObject]) && (i < 10); i++) ctx.orderings[i] = ordering; ctx.count = i; if (null == nil) null = [EONull null]; [self sortUsingFunction:(void *)keyOrderComparator context:&ctx]; } @end /* NSMutableArray(EOSortOrdering) */ @implementation EONull(EOSortOrdering) /*" Compares the null object, "nil" and "self" are considered of the same order, otherwise null is considered of lower order. "*/ - (int)compareAscending:(id)_object { if (_object == self) return NSOrderedSame; if (_object == nil) return NSOrderedSame; return NSOrderedDescending; } /*" Compares the null object, "nil" and "self" are considered of the same order, otherwise null is considered of higher order. "*/ - (int)compareDescending:(id)_object { if (_object == self) return NSOrderedSame; if (_object == nil) return NSOrderedSame; return NSOrderedAscending; } @end /* EONull(EOSortOrdering) */ @implementation NSNumber(EOSortOrdering) static Class NumClass = Nil; - (int)compareAscending:(id)_object { if (_object == self) return NSOrderedSame; if (NumClass == Nil) NumClass = [NSNumber class]; if ([_object isKindOfClass:NumClass]) return [self compare:_object]; else return [_object compareDescending:self]; } - (int)compareDescending:(id)_object { int result; result = [self compareAscending:_object]; if (result == NSOrderedAscending) return NSOrderedDescending; else if (result == NSOrderedDescending) return NSOrderedAscending; else return NSOrderedSame; } @end /* NSNumber(EOSortOrdering) */ @implementation NSString(EOSortOrdering) - (int)compareAscending:(id)_object { if (_object == self) return NSOrderedSame; return [self compare:[_object stringValue]]; } - (int)compareCaseInsensitiveAscending:(id)_object { if (_object == self) return NSOrderedSame; return [self caseInsensitiveCompare:[_object stringValue]]; } - (int)compareDescending:(id)_object { int result; if (_object == self) return NSOrderedSame; result = [self compareAscending:_object]; if (result == NSOrderedAscending) return NSOrderedDescending; else if (result == NSOrderedDescending) return NSOrderedAscending; else return NSOrderedSame; } - (int)compareCaseInsensitiveDescending:(id)_object { int result; if (_object == self) return NSOrderedSame; result = [self compareCaseInsensitiveAscending:_object]; if (result == NSOrderedAscending) return NSOrderedDescending; else if (result == NSOrderedDescending) return NSOrderedAscending; else return NSOrderedSame; } @end /* NSString(EOSortOrdering) */ @implementation NSDate(EOSortOrdering) static Class DateClass = Nil; - (int)compareAscending:(id)_object { if (_object == self) return NSOrderedSame; if (DateClass == Nil) DateClass = [NSDate class]; if (![_object isKindOfClass:DateClass]) return NSOrderedAscending; return [self compare:_object]; } - (int)compareDescending:(id)_object { int result; if (_object == self) return NSOrderedSame; if (DateClass == Nil) DateClass = [NSDate class]; if (![_object isKindOfClass:DateClass]) return NSOrderedDescending; result = [self compare:_object]; if (result == NSOrderedAscending) return NSOrderedDescending; else if (result == NSOrderedDescending) return NSOrderedAscending; else return NSOrderedSame; } @end /* NSDate(EOSortOrdering) */ SOPE/sope-core/EOControl/Version0000644000000000000000000000004512242733417015436 0ustar rootroot# version file SUBMINOR_VERSION:=74 SOPE/sope-core/EOControl/SxCore-EOControl.graffle0000644000000000000000000011232112242733417020464 0ustar rootroot CanvasColor w 1.000000e+00 ColumnAlign 0 ColumnSpacing 5.400000e+01 GraphDocumentVersion 2 GraphicsList Bounds {{45, 414}, {162, 18}} Class ShapedGraphic ID 2788 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/EOControl/EOQualifier.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 EOQualifierVariable} Bounds {{45, 351}, {162, 18}} Class ShapedGraphic ID 2787 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/EOControl/EOGenericRecord.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 EOGenericRecord} Class Group Graphics Bounds {{243, 270}, {135, 18}} Class ShapedGraphic ID 2782 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/EOControl/EOKeyGlobalID.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 EOKeyGlobalID} Bounds {{387, 270}, {135, 18}} Class ShapedGraphic ID 2783 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/EOControl/EOGlobalID.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 EOTemporaryGlobalID} Bounds {{315, 234}, {135, 18}} Class ShapedGraphic ID 2784 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/EOControl/EOGlobalID.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 EOGlobalID} Class LineGraphic Head ID 2782 ID 2785 Points {364.5, 252} {328.5, 270} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 2784 Class LineGraphic Head ID 2783 ID 2786 Points {400.5, 252} {436.5, 270} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 2784 ID 2781 Bounds {{45, 315}, {162, 18}} Class ShapedGraphic ID 2780 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/EOControl/EOSortOrdering.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 EOSortOrdering} Bounds {{45, 162}, {162, 18}} Class ShapedGraphic ID 2779 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/EOControl/EOObserver.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 EOObserverCenter} Class Group Graphics Bounds {{99, 585}, {126, 18}} Class ShapedGraphic ID 2762 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/EOControl/EOQualifier.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 EONotQualifier} Bounds {{297, 630}, {126, 18}} Class ShapedGraphic ID 2763 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/EOControl/EOQualifier.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 EOAndQualifier} Bounds {{315, 594}, {126, 18}} Class ShapedGraphic ID 2764 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/EOControl/EOQualifier.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 EOKeyValueQualifier} Bounds {{333, 558}, {126, 18}} Class ShapedGraphic ID 2765 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/EOControl/EOQualifier.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 EOOrQualifier} Bounds {{99, 504}, {135, 18}} Class ShapedGraphic ID 2766 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/EOControl/EOQualifier.h Shape Rectangle Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica-Oblique;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\i\fs24 \cf0 EOQualifierEvaluation} Bounds {{279, 504}, {126, 18}} Class ShapedGraphic ID 2767 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/EOControl/EOQualifier.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 EOQualifier} Bounds {{99, 630}, {171, 18}} Class ShapedGraphic ID 2768 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/EOControl/EOQualifier.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 EOKeyComparisonQualifier} Class LineGraphic Head ID 2762 ID 2769 Points {166, 522} {162.5, 585} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 2766 Class LineGraphic Head ID 2762 ID 2770 Points {322, 522} {182, 585} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 2767 Class LineGraphic Head ID 2763 ID 2771 Points {180.321, 522} {346.179, 630} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 2766 Class LineGraphic Head ID 2763 ID 2772 Points {343.286, 522} {358.714, 630} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 2767 Class LineGraphic Head ID 2764 ID 2773 Points {187.65, 522} {356.85, 594} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 2766 Class LineGraphic Head ID 2764 ID 2774 Points {345.6, 522} {374.4, 594} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 2767 Class LineGraphic Head ID 2765 ID 2775 Points {204.75, 522} {357.75, 558} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 2766 Class LineGraphic Head ID 2765 ID 2776 Points {351, 522} {387, 558} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 2767 Class LineGraphic Head ID 2768 ID 2777 Points {167.786, 522} {183.214, 630} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 2766 Class LineGraphic Head ID 2768 ID 2778 Points {330.75, 522} {195.75, 630} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 2767 ID 2761 Class Group Graphics Bounds {{243, 342}, {126, 18}} Class ShapedGraphic ID 2759 Shape RoundedRectangle Style fill Color b 5.000000e-01 g 1.000000e+00 r 1.000000e+00 Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NSClassDescription} Bounds {{243, 378}, {126, 18}} Class ShapedGraphic ID 2760 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/EOControl/EOClassDescription.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 EOClassDescription} ID 2758 Class Group Graphics Bounds {{387, 342}, {126, 18}} Class ShapedGraphic ID 2755 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/EOControl/EOObserver.h Shape Rectangle Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica-Oblique;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\i\fs24 \cf0 EOObserving} Bounds {{387, 378}, {126, 18}} Class ShapedGraphic ID 2756 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/EOControl/EOObserver.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 EODelayedObserver} Bounds {{387, 414}, {126, 18}} Class ShapedGraphic ID 2757 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/EOControl/EOObserver.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 EOObserverProxy} ID 2754 Class Group Graphics Bounds {{252, 153}, {126, 18}} Class ShapedGraphic ID 2749 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/EOControl/EODetailDataSource.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 EODetailDataSource} Bounds {{387, 153}, {126, 18}} Class ShapedGraphic ID 2750 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/EOControl/EOArrayDataSource.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 EOArrayDataSource} Bounds {{324, 117}, {126, 18}} Class ShapedGraphic ID 2751 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/EOControl/EODataSource.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 EODataSource} Class LineGraphic Head ID 2749 ID 2752 Points {369, 135} {333, 153} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 2751 Class LineGraphic Head ID 2750 ID 2753 Points {402.75, 135} {434.25, 153} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 2751 ID 2748 Bounds {{45, 126}, {162, 18}} Class ShapedGraphic ID 2747 Link Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 } Bounds {{45, 99}, {162, 18}} Class ShapedGraphic ID 2746 Link Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 } Bounds {{45, 288}, {162, 18}} Class ShapedGraphic ID 2745 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/EOControl/EOFetchSpecification.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 EOFetchSpecification} Bounds {{45, 189}, {162, 18}} Class ShapedGraphic ID 2744 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/EOControl/EOObserver.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 EODelayedObserverQueue} Bounds {{45, 378}, {162, 18}} Class ShapedGraphic ID 2743 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/EOControl/EONull.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 EONull} Bounds {{45, 252}, {162, 18}} Class ShapedGraphic ID 2742 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/EOControl/EOKeyValueArchiver.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 EOKeyValueUnarchiver} Bounds {{45, 225}, {162, 18}} Class ShapedGraphic ID 2741 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/EOControl/EOKeyValueArchiver.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 EOKeyValueArchiver} Class LineGraphic Head ID 2760 ID 2740 Points {306, 360} {306, 378} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 2759 Class LineGraphic Head ID 2756 ID 2739 Points {450, 360} {450, 378} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 2755 Class LineGraphic Head ID 2757 ID 2738 Points {450, 396} {450, 414} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 2756 GridInfo HPages 1 ImageCounter 1 IsPalette NO Layers Lock NO Name Layer 1 Print YES View YES LayoutInfo AutoAdjust YES HierarchicalOrientation 0 MagneticFieldCenter {0, 0} MagnetsEnabled YES PageBreakColor w 3.333333e-01 PageBreaks YES PageSetup BAt0eXBlZHN0cmVhbYED6IQBQISEhAtOU1ByaW50SW5mbwGEhAhOU09iamVjdACFkoSE hBNOU011dGFibGVEaWN0aW9uYXJ5AISEDE5TRGljdGlvbmFyeQCUhAFpEpKEhIQITlNT dHJpbmcBlIQBKxBOU0pvYkRpc3Bvc2l0aW9uhpKEmZkPTlNQcmludFNwb29sSm9ihpKE mZkOTlNCb3R0b21NYXJnaW6GkoSEhAhOU051bWJlcgCEhAdOU1ZhbHVlAJSEASqEhAFm nSSGkoSZmQtOU1BhcGVyTmFtZYaShJmZBkxldHRlcoaShJmZD05TUHJpbnRBbGxQYWdl c4aShJ2chIQBc54AhpKEmZkNTlNSaWdodE1hcmdpboaShJ2cn50khpKEmZkITlNDb3Bp ZXOGkoSdnISEAVOfAYaShJmZD05TU2NhbGluZ0ZhY3RvcoaShJ2chIQBZKABhpKEmZkL TlNGaXJzdFBhZ2WGkoSdnKmfAYaShJmZFE5TVmVydGljYWxQYWdpbmF0aW9uhpKEnZyk ngCGkoSZmRVOU0hvcml6b25hbFBhZ2luYXRpb26GkoSdnKSeAIaShJmZFk5TSG9yaXpv bnRhbGx5Q2VudGVyZWSGkoSdnKSeAYaShJmZDE5TTGVmdE1hcmdpboaShJ2cn50khpKE mZkNTlNPcmllbnRhdGlvboaShJ2cpJ4AhpKEmZkZTlNQcmludFJldmVyc2VPcmllbnRh dGlvboaSo5KEmZkKTlNMYXN0UGFnZYaShJ2chJeXgn////+GkoSZmQtOU1RvcE1hcmdp boaShJ2cn50khpKEmZkUTlNWZXJ0aWNhbGx5Q2VudGVyZWSGkrSShJmZC05TUGFwZXJT aXplhpKEnpyEhAx7X05TU2l6ZT1mZn2hgQJkgQMYhoaG RowAlign 0 RowSpacing 8.999991e+00 VPages 1 WindowInfo Frame {{67, 21}, {821, 897}} VisibleRegion {{-133, -50}, {806, 820}} Zoom 1 SOPE/sope-core/EOControl/EOFetchSpecification.m0000644000000000000000000002512112242733417020224 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "EOFetchSpecification.h" #include "EOQualifier.h" #include "EOSortOrdering.h" #include "common.h" @implementation EOFetchSpecification + (EOFetchSpecification *)fetchSpecificationWithEntityName:(NSString *)_ename qualifier:(EOQualifier *)_qualifier sortOrderings:(NSArray *)_sortOrderings { EOFetchSpecification *fs = nil; fs = [[self alloc] initWithEntityName:_ename qualifier:_qualifier sortOrderings:_sortOrderings usesDistinct:NO isDeep:NO hints:nil]; return [fs autorelease]; } - (id)initWithEntityName:(NSString *)_name qualifier:(EOQualifier *)_qualifier sortOrderings:(NSArray *)_sortOrderings usesDistinct:(BOOL)_dflag isDeep:(BOOL)_isDeep hints:(NSDictionary *)_hints { if ((self = [super init])) { self->entityName = [_name copyWithZone:[self zone]]; self->qualifier = [_qualifier retain]; self->sortOrderings = [_sortOrderings retain]; self->fetchLimit = 0; self->hints = [_hints retain]; self->fsFlags.usesDistinct = _dflag ? 1 : 0; self->fsFlags.deep = _isDeep ? 1 : 0; } return self; } - (id)initWithEntityName:(NSString *)_name qualifier:(EOQualifier *)_qualifier sortOrderings:(NSArray *)_sortOrderings usesDistinct:(BOOL)_dflag { // DEPRECATED // Note: this does not work with GDL2! (and probably not with EOF 4) return [self initWithEntityName:_name qualifier:_qualifier sortOrderings:_sortOrderings usesDistinct:_dflag isDeep:NO hints:nil]; } - (id)init { if ((self = [super init])) { } return self; } - (void)dealloc { [self->hints release]; [self->entityName release]; [self->qualifier release]; [self->sortOrderings release]; [super dealloc]; } /* accessors */ - (void)setEntityName:(NSString *)_name { id tmp; if (_name == self->entityName) return; tmp = self->entityName; self->entityName = [_name copyWithZone:[self zone]]; [tmp release]; } - (NSString *)entityName { return self->entityName; } - (void)setQualifier:(EOQualifier *)_qualifier { ASSIGN(self->qualifier, _qualifier); } - (EOQualifier *)qualifier { return self->qualifier; } - (void)setSortOrderings:(NSArray *)_orderings { ASSIGN(self->sortOrderings, _orderings); } - (NSArray *)sortOrderings { return self->sortOrderings; } - (void)setUsesDistinct:(BOOL)_flag { self->fsFlags.usesDistinct = _flag ? 1 : 0; } - (BOOL)usesDistinct { return self->fsFlags.usesDistinct ? YES : NO; } - (void)setLocksObjects:(BOOL)_flag { self->fsFlags.locksObjects = _flag ? 1 : 0; } - (BOOL)locksObjects { return self->fsFlags.locksObjects ? YES : NO; } - (void)setIsDeep:(BOOL)_flag { self->fsFlags.deep = _flag ? 1 : 0; } - (BOOL)isDeep { return self->fsFlags.deep ? YES : NO; } - (void)setFetchLimit:(unsigned)_limit { self->fetchLimit = _limit; } - (unsigned)fetchLimit { return self->fetchLimit; } - (void)setHints:(NSDictionary *)_hints { ASSIGN(self->hints, _hints); } - (NSDictionary *)hints { return self->hints; } /* bindings */ - (EOFetchSpecification *) fetchSpecificationWithQualifierBindings:(NSDictionary *)_bindings { EOQualifier *q = nil; EOFetchSpecification *newfs = nil; q = [[self qualifier] qualifierWithBindings:_bindings requiresAllVariables:NO]; newfs = [[[self class] alloc] initWithEntityName:[self entityName] qualifier:q sortOrderings:[self sortOrderings] usesDistinct:[self usesDistinct]]; [newfs setLocksObjects:[self locksObjects]]; [newfs setFetchLimit:[self fetchLimit]]; return [newfs autorelease]; } /* GDL2 compatibility */ - (EOFetchSpecification *) fetchSpecificationByApplyingBindings:(NSDictionary *)_bindings { return [self fetchSpecificationWithQualifierBindings:_bindings]; } /* NSCopying */ - (id)copyWithZone:(NSZone *)_zone { EOFetchSpecification *fspec; NSDictionary *hdict; hdict = [[self hints] copy]; fspec = [[[self class] alloc] initWithEntityName:[self entityName] qualifier:[self qualifier] sortOrderings:[self sortOrderings] usesDistinct:[self usesDistinct] isDeep:[self isDeep] hints:hdict]; [fspec setLocksObjects:[self locksObjects]]; [fspec setFetchLimit:[self fetchLimit]]; [hdict release]; return fspec; } /* Equality */ - (BOOL)isEqualToFetchSpecification:(EOFetchSpecification *)_fspec { id t1, t2; if (_fspec == self) return YES; t1 = [self entityName]; t2 = [_fspec entityName]; if (t1 != t2) { if (![t1 isEqualToString:t2]) return NO; } t1 = [self sortOrderings]; t2 = [_fspec sortOrderings]; if (t1 != t2) { if (![t1 isEqual:t2]) return NO; } t1 = [self qualifier]; t2 = [_fspec qualifier]; if (t1 != t2) { if (![t1 isEqual:t2]) return NO; } if ([self usesDistinct] != [_fspec usesDistinct]) return NO; if ([self locksObjects] != [_fspec locksObjects]) return NO; if ([self fetchLimit] != [_fspec fetchLimit]) return NO; t1 = [self hints]; t2 = [_fspec hints]; if (t1 != t2) { if (![t1 isEqual:t2]) return NO; } return YES; } - (BOOL)isEqual:(id)_other { if ([_other isKindOfClass:[EOFetchSpecification class]]) return [self isEqualToFetchSpecification:_other]; return NO; } /* remapping keys */ - (EOFetchSpecification *)fetchSpecificationByApplyingKeyMap:(NSDictionary *)_m { NSAutoreleasePool *pool; EOFetchSpecification *fs; NSMutableDictionary *lHints; EOQualifier *q = nil; NSMutableArray *o = nil; pool = [[NSAutoreleasePool alloc] init]; /* process qualifier */ q = [self->qualifier qualifierByApplyingKeyMap:_m]; /* process attributes */ if (self->hints) { NSArray *a; unsigned len; a = [self->hints objectForKey:@"attributes"]; if ((len = [a count]) > 0) { NSMutableArray *ma; unsigned i; ma = [[NSMutableArray alloc] initWithCapacity:(len + 1)]; for (i = 0; i < len; i++) { NSString *key, *tkey; key = [a objectAtIndex:i]; tkey = [_m objectForKey:key]; [ma addObject:(tkey ? tkey : key)]; } lHints = [self->hints mutableCopy]; [lHints setObject:ma forKey:@"attributes"]; [ma release]; } else lHints = [self->hints retain]; } else lHints = nil; /* process orderings */ if (self->sortOrderings) { unsigned i, len; len = [self->sortOrderings count]; o = [[NSMutableArray alloc] initWithCapacity:len]; for (i = 0; i < len; i++) { EOSortOrdering *so, *tso; so = [self->sortOrderings objectAtIndex:i]; tso = [so sortOrderingByApplyingKeyMap:_m]; [o addObject:tso ? tso : so]; } } else o = nil; /* construct result */ fs = [[EOFetchSpecification alloc] initWithEntityName:self->entityName qualifier:q sortOrderings:o usesDistinct:[self usesDistinct] isDeep:[self isDeep] hints:[self hints]]; [fs setLocksObjects:[self locksObjects]]; [fs setFetchLimit:self->fetchLimit]; if (lHints) { [fs setHints:lHints]; [lHints release]; } [o release]; [pool release]; return [fs autorelease]; } /* key/value archiving */ - (id)initWithKeyValueUnarchiver:(EOKeyValueUnarchiver *)_unarchiver { if ((self = [super init]) != nil) { self->entityName = [[_unarchiver decodeObjectForKey:@"entityName"] copy]; self->qualifier = [[_unarchiver decodeObjectForKey:@"qualifier"] retain]; self->hints = [[_unarchiver decodeObjectForKey:@"hints"] copy]; self->sortOrderings = [[_unarchiver decodeObjectForKey:@"sortOrderings"] retain]; self->fetchLimit = [_unarchiver decodeIntForKey:@"fetchLimit"]; self->fsFlags.usesDistinct = [_unarchiver decodeBoolForKey:@"usesDistinct"] ? 1 : 0; self->fsFlags.locksObjects = [_unarchiver decodeBoolForKey:@"locksObjects"] ? 1 : 0; self->fsFlags.deep = [_unarchiver decodeBoolForKey:@"deep"] ? 1 : 0; } return self; } - (void)encodeWithKeyValueArchiver:(EOKeyValueArchiver *)_archiver { [_archiver encodeObject:[self entityName] forKey:@"entityName"]; [_archiver encodeObject:[self qualifier] forKey:@"qualifier"]; [_archiver encodeObject:[self hints] forKey:@"hints"]; [_archiver encodeObject:[self sortOrderings] forKey:@"sortOrderings"]; [_archiver encodeInt:[self fetchLimit] forKey:@"fetchLimit"]; [_archiver encodeBool:self->fsFlags.usesDistinct forKey:@"usesDistinct"]; [_archiver encodeBool:self->fsFlags.locksObjects forKey:@"locksObjects"]; [_archiver encodeBool:self->fsFlags.deep forKey:@"deep"]; } /* description */ - (NSString *)description { NSMutableString *ms; id tmp; ms = [NSMutableString stringWithCapacity:128]; [ms appendFormat:@"<%@[0x%p]:", NSStringFromClass([self class]), self]; if ((tmp = [self entityName])) [ms appendFormat:@" entity=%@", tmp]; if ((tmp = [self qualifier])) [ms appendFormat:@" qualifier=%@", tmp]; if ((tmp = [self sortOrderings])) [ms appendFormat:@" orderings=%@", tmp]; if ([self locksObjects]) [ms appendString:@" locks"]; if ([self usesDistinct]) [ms appendString:@" distinct"]; if ([self fetchLimit] > 0) [ms appendFormat:@" limit=%i", [self fetchLimit]]; if ((tmp = [self hints])) { NSEnumerator *e; NSString *hint; BOOL isFirst = YES; [ms appendString:@" hints:"]; e = [tmp keyEnumerator]; while ((hint = [e nextObject])) { if (isFirst) isFirst = NO; else [ms appendString:@","]; [ms appendString:hint]; [ms appendString:@"="]; [ms appendString:[[(NSDictionary *)tmp objectForKey:hint] stringValue]]; } } [ms appendString:@">"]; return ms; } @end /* EOFetchSpecification */ SOPE/sope-core/EOControl/EODetailDataSource.m0000644000000000000000000001164012242733417017650 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include "common.h" @implementation EODetailDataSource - (id)initWithMasterClassDescription:(EOClassDescription *)_cd detailKey:(NSString *)_relKey { if ((self = [super init])) { self->masterClassDescription = [_cd retain]; [self qualifyWithRelationshipKey:_relKey ofObject:nil]; } return self; } - (id)initWithMasterDataSource:(EODataSource *)_ds detailKey:(NSString *)_relKey { if ((self = [self initWithMasterClassDescription:nil detailKey:_relKey])) { self->masterDataSource = [_ds retain]; } return self; } - (id)init { return [self initWithMasterClassDescription:nil detailKey:nil]; } - (void)dealloc { [self->detailKey release]; [self->masterObject release]; [self->masterClassDescription release]; [self->masterDataSource release]; [super dealloc]; } /* reflection */ - (void)setMasterClassDescription:(EOClassDescription *)_cd { ASSIGN(self->masterClassDescription, _cd); } - (EOClassDescription *)masterClassDescription { return self->masterClassDescription; } - (EODataSource *)masterDataSource { return self->masterDataSource; } /* editing context */ - (id)editingContext { return [[self masterObject] editingContext]; } /* master-detail */ - (id)masterObject { return self->masterObject; } - (NSString *)detailKey { return self->detailKey; } - (void)qualifyWithRelationshipKey:(NSString *)_relKey ofObject:(id)_object { id tmp; tmp = self->detailKey; self->detailKey = [_relKey copy]; [tmp release]; ASSIGN(self->masterObject, _object); } /* operations */ - (NSArray *)fetchObjects { id eo; NSString *dk; if ((eo = [self masterObject]) == nil) return [NSArray array]; if ((dk = [self detailKey]) == nil) return [NSArray arrayWithObject:eo]; return [eo valueForKey:dk]; } - (void)insertObject:(id)_object { id eo; NSString *dk; if ((eo = [self masterObject]) == nil) { [NSException raise:@"NSInternalInconsistencyException" format: @"detail datasource %@ has no master object set " @"for insertion of object %@", self, _object]; } if ((dk = [self detailKey]) == nil) { [NSException raise:@"NSInternalInconsistencyException" format: @"detail datasource %@ has no detail key set " @"for insertion of object %@ into master %@", self, _object, eo]; } [eo addObject:_object toBothSidesOfRelationshipWithKey:dk]; } - (void)deleteObject:(id)_object { id eo; NSString *dk; if ((eo = [self masterObject]) == nil) { [NSException raise:@"NSInternalInconsistencyException" format: @"detail datasource %@ has no master object set " @"for deletion of object %@", self, _object]; } if ((dk = [self detailKey]) == nil) { [NSException raise:@"NSInternalInconsistencyException" format: @"detail datasource %@ has no detail key set " @"for deletion of object %@ from master %@", self, _object, eo]; } [eo removeObject:_object fromPropertyWithKey:dk]; } /* key/value archiving */ - (id)initWithKeyValueUnarchiver:(EOKeyValueUnarchiver *)_unarchiver { /* dataSource = { class = EODetailDataSource; detailKey = roles; masterClassDescription = Movie; }; */ if ((self = [super init])) { NSString *ename; self->detailKey = [[_unarchiver decodeObjectForKey:@"detailKey"] copy]; ename = [_unarchiver decodeObjectForKey:@"masterClassDescription"]; NSLog(@"TODO(%s): set class description: %@", __PRETTY_FUNCTION__, ename); } return self; } - (void)encodeWithKeyValueArchiver:(EOKeyValueArchiver *)_archiver { [_archiver encodeObject:[self detailKey] forKey:@"detailKey"]; [_archiver encodeObject:[[self masterClassDescription] entityName] forKey:@"masterClassDescription"]; } @end /* EODetailDataSource */ SOPE/sope-core/EOControl/libEOControl.def0000644000000000000000000000017412242733417017104 0ustar rootrootEXPORTS EOCompareAscending; EOCompareDescending; EOCompareCaseInsensitiveAscending; EOCompareCaseInsensitiveDescending; SOPE/sope-core/EOControl/EOQualifier.h0000644000000000000000000001573412242733417016417 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __EOQualifier_h__ #define __EOQualifier_h__ #import #include /* EOQualifier EOQualifier is the superclass of all the concrete qualifier classes which are used to build up a qualification object hierarchy (aka a SQL where statement). Subclasses: EOAndQualifier EOOrQualifier EONotQualifier EOKeyValueQualifier EOKeyComparisonQualifier EOQualifierVariable EOQualifierVariable defers the evaluation of some qualification value to runtime. It's comparable to SQL late-binding variables (aka "a=$value"). Also provided are some categories on NSObject and NSArray to filter an in-memory object tree. */ @class NSDictionary, NSArray, NSSet, NSMutableSet; @protocol EOQualifierEvaluation - (BOOL)evaluateWithObject:(id)_object; @end @interface EOQualifier : NSObject < NSCopying, EOKeyValueArchiving > + (EOQualifier *)qualifierToMatchAnyValue:(NSDictionary *)_values; + (EOQualifier *)qualifierToMatchAllValues:(NSDictionary *)_values; + (SEL)operatorSelectorForString:(NSString *)_str; + (NSString *)stringForOperatorSelector:(SEL)_sel; /* bindings */ - (EOQualifier *)qualifierWithBindings:(NSDictionary *)_bindings requiresAllVariables:(BOOL)_reqAll; - (NSArray *)bindingKeys; /* keys (new in WO 4.5) */ - (NSSet *)allQualifierKeys; - (void)addQualifierKeysToSet:(NSMutableSet *)_keys; /* comparing */ - (BOOL)isEqual:(id)_obj; - (BOOL)isEqualToQualifier:(EOQualifier *)_qual; /* remapping keys */ - (EOQualifier *)qualifierByApplyingTransformer:(id)_t inContext:(id)_ctx; - (EOQualifier *)qualifierByApplyingKeyMap:(NSDictionary *)_map; /* BDControl additions */ - (NSUInteger)count; - (NSArray *)subqualifiers; /* debugging */ + (BOOL)isEvaluationDebuggingEnabled; @end /* EOQualifier */ @interface EOQualifier(Parsing) + (EOQualifier *)qualifierWithQualifierFormat:(NSString *)_qualifierFormat, ...; + (EOQualifier *)qualifierWithQualifierFormat:(NSString *)_qualifierFormat arguments:(NSArray *)_arguments; /* this is used in "cast (xxx as mytypename)" expressions */ + (void)registerValueClass:(Class)_valueClass forTypeName:(NSString *)_type; @end @interface EOAndQualifier : EOQualifier < EOQualifierEvaluation, NSCoding > { NSArray *qualifiers; unsigned count; } - (id)initWithQualifierArray:(NSArray *)_qualifiers; - (id)initWithQualifiers:(EOQualifier *)_qual1, ...; - (NSArray *)qualifiers; @end /* EOAndQualifier */ @interface EOOrQualifier : EOQualifier < EOQualifierEvaluation, NSCoding > { NSArray *qualifiers; unsigned count; } - (id)initWithQualifierArray:(NSArray *)_qualifiers; /* designated init */ - (id)initWithQualifiers:(EOQualifier *)_qual1, ...; - (NSArray *)qualifiers; @end /* EOOrQualifier */ @interface EONotQualifier : EOQualifier < EOQualifierEvaluation, NSCoding > { EOQualifier *qualifier; } - (id)initWithQualifier:(EOQualifier *)_qualifier; /* designated init */ - (EOQualifier *)qualifier; @end /* EONotQualifier */ extern SEL EOQualifierOperatorEqual; extern SEL EOQualifierOperatorNotEqual; extern SEL EOQualifierOperatorLessThan; extern SEL EOQualifierOperatorGreaterThan; extern SEL EOQualifierOperatorLessThanOrEqualTo; extern SEL EOQualifierOperatorGreaterThanOrEqualTo; extern SEL EOQualifierOperatorContains; extern SEL EOQualifierOperatorLike; extern SEL EOQualifierOperatorCaseInsensitiveLike; @interface EOKeyValueQualifier : EOQualifier < EOQualifierEvaluation, NSCoding > { /* this is a '%A selector %@' qualifier */ NSString *key; id value; SEL operator; } - (id)initWithKey:(NSString *)_key operatorSelector:(SEL)_selector value:(id)_value; - (NSString *)key; - (SEL)selector; - (id)value; @end @interface EOKeyComparisonQualifier : EOQualifier < EOQualifierEvaluation, NSCoding > { /* this is a '%A selector %A' qualifier */ NSString *leftKey; NSString *rightKey; SEL operator; } - (id)initWithLeftKey:(NSString *)_leftKey operatorSelector:(SEL)_selector rightKey:(NSString *)_rightKey; - (NSString *)leftKey; - (NSString *)rightKey; - (SEL)selector; @end /* operators */ #define EOQualifierOperatorEqual @selector(isEqualTo:) #define EOQualifierOperatorNotEqual @selector(isNotEqualTo:) #define EOQualifierOperatorLessThan @selector(isLessThan:) #define EOQualifierOperatorGreaterThan @selector(isGreaterThan:) #define EOQualifierOperatorLessThanOrEqualTo @selector(isLessThanOrEqualTo:) #define EOQualifierOperatorGreaterThanOrEqualTo @selector(isGreaterThanOrEqualTo:) #define EOQualifierOperatorContains @selector(doesContain:) #define EOQualifierOperatorLike @selector(isLike:) #define EOQualifierOperatorCaseInsensitiveLike @selector(isCaseInsensitiveLike:) /* variable qualifier content */ @interface EOQualifierVariable : NSObject < NSCoding, EOKeyValueArchiving > { NSString *varKey; } + (id)variableWithKey:(NSString *)_key; - (id)initWithKey:(NSString *)_key; - (NSString *)key; /* Comparing */ - (BOOL)isEqual:(id)_obj; - (BOOL)isEqualToQualifierVariable:(EOQualifierVariable *)_obj; @end /* define the appropriate selectors */ @interface NSObject(QualifierComparisions) - (BOOL)isEqualTo:(id)_object; - (BOOL)isNotEqualTo:(id)_object; - (BOOL)isLessThan:(id)_object; - (BOOL)isGreaterThan:(id)_object; - (BOOL)isLessThanOrEqualTo:(id)_object; - (BOOL)isGreaterThanOrEqualTo:(id)_object; - (BOOL)doesContain:(id)_object; - (BOOL)isLike:(NSString *)_object; - (BOOL)isCaseInsensitiveLike:(NSString *)_object; @end @interface NSObject(EOQualifierTransformer) - (EOQualifier *)transformQualifier:(EOQualifier *)_q inContext:(id)_ctx; - (EOQualifier *)transformAndQualifier:(EOAndQualifier *)_q inContext:(id)_ctx; - (EOQualifier *)transformOrQualifier:(EOOrQualifier *)_q inContext:(id)_ctx; - (EOQualifier *)transformNotQualifier:(EONotQualifier *)_q inContext:(id)_ctx; - (EOQualifier *)transformKeyValueQualifier:(EOKeyValueQualifier *)_q inContext:(id)_ctx; - (EOQualifier *)transformKeyComparisonQualifier:(EOKeyComparisonQualifier *)q inContext:(id)_ctx; @end /* array qualification */ #import @interface NSArray(Qualification) - (NSArray *)filteredArrayUsingQualifier:(EOQualifier *)_qualifier; @end #endif /* __EOQualifier_h__ */ SOPE/sope-core/EOControl/EOObserver.m0000644000000000000000000002734012242733417016266 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "EOObserver.h" #include "common.h" // THREAD, MT typedef struct _EOObserverList { struct _EOObserverList *next; id observer; void (*notify)(id, SEL, id); } EOObserverList; static void mapValRetain(NSMapTable *self, const void *_value); static void mapValRelease(NSMapTable *self, void *_value); static NSString *mapDescribe(NSMapTable *self, const void *_value); const NSMapTableValueCallBacks EOObserverListMapValueCallBacks = { (void (*)(NSMapTable *, const void *))mapValRetain, (void (*)(NSMapTable *, void *))mapValRelease, (NSString *(*)(NSMapTable *, const void *))mapDescribe }; @implementation NSObject(EOObserver) - (void)willChange { static Class EOObserverCenterClass = Nil; if (EOObserverCenterClass == Nil) EOObserverCenterClass = [EOObserverCenter class]; [EOObserverCenterClass notifyObserversObjectWillChange:self]; } @end /* NSObject(EOObserver) */ @implementation EOObserverCenter static unsigned observerNotificationSuppressCount = 0; static EOObserverList *omniscientObservers = NULL; static NSMapTable *objectToObservers = NULL; + (void)initialize { if (objectToObservers == NULL) { objectToObservers = NSCreateMapTable(NSNonOwnedPointerMapKeyCallBacks, EOObserverListMapValueCallBacks, 256); } } + (void)notifyObserversObjectWillChange:(id)_object { static id lastObject = nil; register EOObserverList *l; /* check if notifications are suppressed */ if (observerNotificationSuppressCount > 0) return; /* compress notifications for the same object */ if (_object == lastObject) return; /* notify usual observers */ for (l = NSMapGet(objectToObservers, _object); l != NULL; l = l->next) { if (l->notify) l->notify(l->observer, @selector(objectWillChange:), _object); else [l->observer objectWillChange:_object]; } /* notify omniscient observers */ for (l = omniscientObservers; l != NULL; l = l->next) { if (l->notify) l->notify(l->observer, @selector(objectWillChange:), _object); else [l->observer objectWillChange:_object]; } } + (void)addObserver:(id)_observer forObject:(id)_object { register EOObserverList *l, *nl; if ((l = NSMapGet(objectToObservers, _object))) { /* check whether the observer is already registered */ for (nl = l; nl != NULL; nl = nl->next) { if (nl->observer == _object) return; } } #if NeXT_RUNTIME nl = malloc(sizeof(EOObserverList)); #else nl = objc_malloc(sizeof(EOObserverList)); #endif nl->observer = [_observer retain]; nl->notify = (void*) [(id)_observer methodForSelector:@selector(objectWillChange:)]; if (l == NULL) { /* this is the first observer defined */ nl->next = NULL; NSMapInsert(objectToObservers, _object, nl); } else { /* insert at second position (so that we don't need to remove/add the new entry in table or traverse the list to the end) */ nl->next = l->next; l->next = nl; } } + (void)removeObserver:(id)_observer forObject:(id)_object { register EOObserverList *l, *ll, *first; if ((first = NSMapGet(objectToObservers, _object)) == NULL) /* no observers registered for object */ return; l = first; ll = NULL; while (l) { if (l->observer == _observer) { /* found matching list entry */ if (l != first) { /* entry is not the first entry */ ll->next = l->next; [l->observer release]; #if NeXT_RUNTIME free(l); #else objc_free(l); #endif break; } else if (l->next) { /* entry is the first entry, but there are more than one entries. In this case we copy the second to the first and remove the second, this way we save removing/inserting in the hash table. */ [l->observer release]; ll = l->next; l->observer = ll->observer; l->notify = ll->notify; l->next = ll->next; #if NeXT_RUNTIME free(ll); #else objc_free(ll); #endif break; } else { /* entry is the lone entry */ NSMapRemove(objectToObservers, _object); [l->observer release]; #if NeXT_RUNTIME free(l); #else objc_free(l); #endif break; } } ll = l; l = ll->next; } } + (NSArray *)observersForObject:(id)_object { EOObserverList *observers; NSMutableArray *result; if ((observers = NSMapGet(objectToObservers, _object)) == NULL) return [NSArray array]; result = [NSMutableArray arrayWithCapacity:16]; while ((observers)) { if (observers->observer) [result addObject:observers->observer]; observers = observers->next; } return [[result copy] autorelease]; } + (id)observerForObject:(id)_object ofClass:(Class)_targetClass { register EOObserverList *observers; if ((observers = NSMapGet(objectToObservers, _object)) == NULL) return nil; while ((observers)) { if ([observers->observer class] == _targetClass) return observers->observer; observers = observers->next; } return nil; } + (void)addOmniscientObserver:(id)_observer { EOObserverList *l; /* first check whether we already added this observer to the list */ for (l = omniscientObservers; l != NULL; l = l->next) { if (l->observer == _observer) return; } #if NeXT_RUNTIME l = malloc(sizeof(EOObserverList)); #else l = objc_malloc(sizeof(EOObserverList)); #endif l->next = omniscientObservers; l->observer = [_observer retain]; l->notify = (void*)[(id)_observer methodForSelector:@selector(willChange:)]; omniscientObservers = l; } + (void)removeOmniscientObserver:(id)_observer { EOObserverList *l, *ll; /* first check whether we already added this observer to the list */ for (l = omniscientObservers, ll = NULL; l != NULL; ) { if (l->observer == _observer) { /* matched */ if (ll == NULL) omniscientObservers = l->next; else ll->next = l->next; [l->observer release]; objc_free(l); return; } ll = l; l = ll->next; } } /* suppressing notifications */ + (void)suppressObserverNotification { observerNotificationSuppressCount++; } + (void)enableObserverNotification { observerNotificationSuppressCount--; } + (unsigned)observerNotificationSuppressCount { return observerNotificationSuppressCount; } @end /* EOObserverCenter */ @implementation EODelayedObserverQueue static EODelayedObserverQueue *defaultQueue = nil; + (EODelayedObserverQueue *)defaultObserverQueue { if (defaultQueue == nil) defaultQueue = [[EODelayedObserverQueue alloc] init]; return defaultQueue; } - (id)init { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_notify:) name:@"EODelayedNotify" object:self]; return self; } - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; [self->runLoopModes release]; [super dealloc]; } /* accessors */ - (void)setRunLoopModes:(NSArray *)_modes { ASSIGN(self->runLoopModes, _modes); } - (NSArray *)runLoopModes { return self->runLoopModes; } /* single queue */ static inline void _enqueue(EODelayedObserverQueue *self, EODelayedObserver **list, EODelayedObserver *newEntry) { if (*list == nil) { /* first entry in this list */ *list = [newEntry retain]; } else { EODelayedObserver *e, *le; for (e = *list, le = NULL; e != NULL; e = e->next) { if (e == newEntry) { /* already in queue */ return; } le = e; } le->next = [e retain]; e->next = NULL; } } static inline void _dequeue(EODelayedObserverQueue *self, EODelayedObserver **list, EODelayedObserver *entry) { EODelayedObserver *e, *le; for (e = *list, le = NULL; e != NULL; e = e->next) { if (e == entry) { /* found entry */ le->next = e->next; [e release]; return; } le = e; } } static inline void _notify(EODelayedObserverQueue *self, EODelayedObserver *list) { while (list) { [list subjectChanged]; list = list->next; } } /* managing queue */ - (void)enqueueObserver:(EODelayedObserver *)_observer { if (_observer == nil) return; _enqueue(self, &(self->queues[[_observer priority]]), _observer); if (!self->hasObservers) { /* register for ASAP notification */ NSNotification *notification; notification = [NSNotification notificationWithName:@"EODelayedNotify" object:self]; [[NSNotificationQueue defaultQueue] enqueueNotification:notification postingStyle:NSPostASAP coalesceMask:NSNotificationCoalescingOnSender forModes:[self runLoopModes]]; self->hasObservers = YES; } } - (void)dequeueObserver:(EODelayedObserver *)_observer { if (_observer == nil) return; _dequeue(self, &(self->queues[[_observer priority]]), _observer); } /* notification */ - (void)notifyObserversUpToPriority:(EOObserverPriority)_lastPriority { unsigned i; for (i = 0; i < _lastPriority; i++) _notify(self, self->queues[i]); } - (void)_notify:(NSNotification *)_notification { [self notifyObserversUpToPriority:EOObserverPrioritySixth]; } @end /* EODelayedObserverQueue */ @implementation EODelayedObserver /* accessors */ - (EOObserverPriority)priority { return EOObserverPriorityThird; } - (EODelayedObserverQueue *)observerQueue { return [EODelayedObserverQueue defaultObserverQueue]; } /* notifications */ - (void)subjectChanged { [self doesNotRecognizeSelector:_cmd]; } - (void)objectWillChange:(id)_object { [[self observerQueue] enqueueObserver:self]; } - (void)discardPendingNotification { [[self observerQueue] dequeueObserver:self]; } @end /* EODelayedObserver */ @implementation EOObserverProxy - (id)initWithTarget:(id)_target action:(SEL)_action priority:(EOObserverPriority)_priority { if ((self = [super init])) { self->target = [_target retain]; self->action = _action; self->priority = _priority; } return self; } - (id)init { return [self initWithTarget:nil action:NULL priority:EOObserverPriorityThird]; } - (void)dealloc { [self->target release]; [super dealloc]; } /* accessors */ - (EOObserverPriority)priority { return self->priority; } /* notifications */ - (void)subjectChanged { [self->target performSelector:self->action withObject:self]; } @end /* EOObserverProxy */ /* value functions for mapping table */ static void mapValRetain(NSMapTable *self, const void *_value) { /* do nothing */ } static void mapValRelease(NSMapTable *self, void *_value) { /* do nothing */ } static NSString *mapDescribe(NSMapTable *self, const void *_value) { return @""; } SOPE/sope-core/EOControl/EONull.m0000644000000000000000000000244112242733417015404 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "EONull.h" #include "common.h" #ifdef EONull # undef EONull #endif @interface EONull : NSNull @end @implementation EONull + (id)allocWithZone:(NSZone *)_zone { return [NSNull allocWithZone:_zone]; } + (NSNull *)null { return [NSNull null]; } - (id)self { return [NSNull null]; } @end @implementation NSNull(ExprValue) - (BOOL)boolValue { return NO; } - (NSString *)expressionValueForContext:(id)context { /* context is really EOExpressionArray .. */ return @"NULL"; } @end /* EONull(ExprValue) */ SOPE/sope-core/EOControl/EOArrayDataSource.h0000644000000000000000000000235612242733417017523 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __EOArrayDataSource_H__ #define __EOArrayDataSource_H__ #include @class NSArray, NSMutableArray; @class EOFetchSpecification; @interface EOArrayDataSource : EODataSource { NSMutableArray *objects; EOFetchSpecification *fetchSpecification; } - (void)setFetchSpecification:(EOFetchSpecification *)_fspec; - (EOFetchSpecification *)fetchSpecification; - (void)setArray:(NSArray *)_array; @end #endif /* __EOArrayDataSource_H__ */ SOPE/sope-core/EOControl/EOSQLParser.h0000644000000000000000000000525112242733417016303 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __EOControl_EOSQLParser_H__ #define __EOControl_EOSQLParser_H__ #import #import /* This is parser can be used to parse simple SQL statements. It's not a full SQL implementation, but should be sufficient for simple applications. Additional hints: - the selected attributes are added to the 'attributes' hint, if a wildcard select is used (*), the hint is not set - the depth of WebDAV scope from-queries are set in the depth-hint, valid values are "deep", "flat", "flat+self", "self" - if multiple entities are queried in the FROM, they are joined using "," and set as the entityName of the fetch spec */ @class EOFetchSpecification, EOQualifier; @interface EOSQLParser : NSObject { } + (id)sharedSQLParser; /* top level parser entry points */ - (EOFetchSpecification *)parseSQLSelectStatement:(NSString *)_sql; - (EOQualifier *)parseSQLWhereExpression:(NSString *)_sql; /* parsing parts (exported for overloading in subclasses) */ - (BOOL)parseSQL:(id *)result from:(unichar **)pos length:(unsigned *)len strict:(BOOL)beStrict; - (BOOL)parseToken:(const unsigned char *)tk from:(unichar **)pos length:(unsigned *)len consume:(BOOL)consume; - (BOOL)parseIdentifier:(NSString **)result from:(unichar **)pos length:(unsigned *)len consume:(BOOL)consume; - (BOOL)parseQualifier:(EOQualifier **)result from:(unichar **)pos length:(unsigned *)len; - (BOOL)parseScope:(NSString **)_scope:(NSString **)_entity from:(unichar **)pos length:(unsigned *)len; - (BOOL)parseColumnName:(NSString **)result from:(unichar **)pos length:(unsigned *)len consume:(BOOL)consume; - (BOOL)parseTableName:(NSString **)result from:(unichar **)pos length:(unsigned *)len consume:(BOOL)consume; - (BOOL)parseIdentifierList:(NSArray **)result from:(unichar **)pos length:(unsigned *)len selector:(SEL)_sel; @end #endif /* __EOControl_EOSQLParser_H__ */ SOPE/sope-core/umbrella.make0000644000000000000000000000162012242733417014664 0ustar rootroot# build umbrella framework for this subproject ifeq ($(frameworks),yes) FRAMEWORK_NAME = sope-core sope-core_C_FILES = dummy.c sope-core_UMBRELLA_FRAMEWORKS = \ SaxObjC DOM \ EOControl \ EOCoreData \ NGExtensions \ NGStreams \ sope-core_PREBIND_ADDR = # TODO # generic (consolidate in gstep-make) $(FRAMEWORK_NAME)_LDFLAGS += \ $(foreach fwname,$($(FRAMEWORK_NAME)_UMBRELLA_FRAMEWORKS),\ -framework $(fwname)) \ $(foreach fwname,$($(FRAMEWORK_NAME)_UMBRELLA_FRAMEWORKS),\ -sub_umbrella $(fwname)) \ -headerpad_max_install_names ifneq ($($(FRAMEWORK_NAME)_PREBIND_ADDR),) $(FRAMEWORK_NAME)_LDFLAGS += -seg1addr $($(FRAMEWORK_NAME)_PREBIND_ADDR) endif # library/framework search pathes DEP_DIRS += \ EOControl EOCoreData NGExtensions NGStreams \ ../sope-xml/SaxObjC ../sope-xml/DOM ADDITIONAL_LIB_DIRS += \ $(foreach dir,$(DEP_DIRS),-F$(GNUSTEP_BUILD_DIR)/$(dir)) endif SOPE/sope-core/NGStreams/0000755000000000000000000000000012242733417014066 5ustar rootrootSOPE/sope-core/NGStreams/fhs.make0000644000000000000000000000174412242733417015513 0ustar rootroot# postprocessing # FHS support (this is a hack and is going to be done by gstep-make!) ifneq ($(FHS_INSTALL_ROOT),) FHS_INCLUDE_DIR=$(FHS_INSTALL_ROOT)/include/ FHS_BIN_DIR=$(FHS_INSTALL_ROOT)/bin/ ifeq ($(findstring _64, $(GNUSTEP_TARGET_CPU)), _64) FHS_LIB_DIR=$(FHS_INSTALL_ROOT)/lib64/ else FHS_LIB_DIR=$(FHS_INSTALL_ROOT)/lib/ endif fhs-header-dirs :: $(MKDIRS) $(FHS_INCLUDE_DIR)$(libNGStreams_HEADER_FILES_INSTALL_DIR) move-headers-to-fhs :: fhs-header-dirs @echo "moving headers to $(FHS_INCLUDE_DIR) .." mv $(GNUSTEP_HEADERS)$(libNGStreams_HEADER_FILES_INSTALL_DIR)/*.h \ $(FHS_INCLUDE_DIR)$(libNGStreams_HEADER_FILES_INSTALL_DIR)/ NONFHS_LIBDIR="$(GNUSTEP_LIBRARIES)/$(GNUSTEP_TARGET_LDIR)/" NONFHS_LIBNAME="$(LIBRARY_NAME)$(LIBRARY_NAME_SUFFIX)$(SHARED_LIBEXT)" move-libs-to-fhs :: @echo "moving libs to $(FHS_LIB_DIR) .." mv $(NONFHS_LIBDIR)/$(NONFHS_LIBNAME)* $(FHS_LIB_DIR)/ move-to-fhs :: move-headers-to-fhs move-libs-to-fhs after-install :: move-to-fhs endif SOPE/sope-core/NGStreams/README0000644000000000000000000000666212242733417014760 0ustar rootrootSKYRiX IO Streaming Library =========================== Introduction ============ This library contains Objective-C classes to access files and network sockets using a java.io like streaming mechanism. It also abstracts the Unix socket API (that is, we have extensible classes for socket domains, addresses etc) TODO ==== Should we remove serialization ? It's not available with Jaguar (MacOSX 10.2) anymore. Currently is turned off on Jaguar. Removed functionality ===================== Removed in 4.1, available in MOF3: NGUrl related things ... idn't make much sense anymore, now that Foundation has NSURL Defaults: ========= ProfileByteBufferEnabled = NO; Protocols ========= NGSerializer NGActiveSocket NGPositionableStream NGDatagramPacket NGSocketAddress NGSocketDomain Class Hierachy ============== NSObject NGStream < NGStream, NGByteSequenceStream > (serialization) NGFileStream < NGPositionableStream > NGDataStream < NGPositionableStream > NGTaskStream NGFilterStream NGBase64Stream NGBufferedStream NGByteBuffer NGByteCountStream NGLockingStream NGSocket < NGSocket > NGActiveSocket < NGActiveSocket > (serialization) < NGSerializer > NGPassiveSocket < NGPassiveSocket > NGDatagramSocket NGTextStream < NGExtendedTextStream > NGStringTextStream NGCTextStream NGFilterTextStream NGCharBuffer NGDatagramPacket < NGDatagramPacket > NGInternetSocketAddress < NSCopying, NSCoding, NGSocketAddress > NGInternetSocketDomain < NSCoding, NSCopying, NGSocketDomain > NGLocalSocketAddress < NSCopying, NGSocketAddress > NGLocalSocketDomain < NSCopying, NSCoding, NGSocketDomain > NSFileHandle NGConcreteStreamFileHandle NSCoder NGStreamCoder < NSObjCTypeSerializationCallBack > NSPipe NGStreamPipe < NGStream, NGByteSequenceStream > Exceptions ========== NSException NGIOException NGStreamException NGEndOfStreamException NGSocketShutdownException NGSocketShutdownDuringReadException NGSocketShutdownDuringWriteException NGSocketTimedOutException NGSocketConnectionResetException NGCouldNotOpenStreamException NGCouldNotCloseStreamException NGStreamNotOpenException NGStreamErrorException NGStreamReadErrorException NGStreamWriteErrorException NGStreamSeekErrorException NGStreamModeException NGUnknownStreamModeException NGReadOnlyStreamException NGWriteOnlyStreamException NGIOAccessException NGIOSearchAccessException NGSocketException NGCouldNotResolveHostNameException NGDidNotFindServiceException NGInvalidSocketDomainException NGCouldNotCreateSocketException NGSocketBindException NGSocketAlreadyBoundException NGCouldNotBindSocketException NGSocketConnectException NGSocketNotConnectedException NGSocketAlreadyConnectedException NGCouldNotConnectException NGSocketIsAlreadyListeningException NGCouldNotListenException NGCouldNotAcceptException NGSocketOptionException NGCouldNotSetSocketOptionException NGCouldNotGetSocketOptionException SOPE/sope-core/NGStreams/NGTaskStream.m0000644000000000000000000000422312242733417016550 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "config.h" #include "common.h" #include "NGTaskStream.h" @implementation NGTaskStream - (id)initWithPath:(NSString *)_executable arguments:(NSArray *)_args environment:(NSDictionary *)_env { return nil; } - (void)dealloc { [super dealloc]; } /* state */ - (BOOL)isOpen { return [self->task isRunning]; } /* primitives */ - (unsigned)readBytes:(void *)_buf count:(unsigned)_len { return NGStreamError; } - (unsigned)writeBytes:(const void *)_buf count:(unsigned)_len { return NGStreamError; } - (BOOL)close { if (![self isOpen]) { NSLog(@"tried to close already closed stream %@", self); return NO; } [self->task terminate]; return YES; } - (NGStreamMode)mode { return NGStreamMode_readWrite; } - (BOOL)isRootStream { return YES; } /* marking */ - (BOOL)mark { NSLog(@"WARNING: called mark on a stream which doesn't support marking !"); return NO; } - (BOOL)rewind { [[[NGStreamException alloc] initWithStream:self reason:@"marking not supported"] raise]; return NO; } - (BOOL)markSupported { return -1; } /* description */ - (NSString *)description { return [NSString stringWithFormat: @"<%@[0x%p] task=%@ mode=%@>", NSStringFromClass([self class]), (unsigned)self, self->task, [self modeDescription]]; } @end /* NGTaskStream */ SOPE/sope-core/NGStreams/NGActiveSocket.m0000644000000000000000000007662112242733417017071 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include "config.h" #if defined(HAVE_UNISTD_H) || defined(__APPLE__) # include #endif #ifdef HAVE_SYS_SELECT_H # include #endif #ifdef HAVE_SYS_FILIO_H # include #endif #if defined(HAVE_SYS_IOCTL_H) # include #endif #if defined(HAVE_TIME_H) || defined(__APPLE__) # include #endif #if defined(HAVE_SYS_TIME_H) || defined(__APPLE__) # include #endif #if defined(HAVE_FCNTL_H) || defined(__APPLE__) # include #endif #if defined(__APPLE__) # include # include # include #endif #if HAVE_WINDOWS_H && !defined(__CYGWIN32__) # include #endif #if defined(WIN32) && !defined(__CYGWIN32__) # include # define ioctl ioctlsocket #endif #include "common.h" #include #include #include #include "NGActiveSocket.h" #include "NGSocketExceptions.h" #include "NGSocket+private.h" #include "common.h" #if !defined(POLLRDNORM) # define POLLRDNORM POLLIN #endif @interface NGActiveSocket(PrivateMethods) - (id)_initWithDescriptor:(int)_fd localAddress:(id)_local remoteAddress:(id)_remote; @end @implementation NGActiveSocket #if !defined(WIN32) || defined(__CYGWIN32__) + (BOOL)socketPair:(id[2])_pair { int fds[2]; NGLocalSocketDomain *domain; _pair[0] = nil; _pair[1] = nil; domain = [NGLocalSocketDomain domain]; if (socketpair([domain socketDomain], SOCK_STREAM, [domain protocol], fds) == 0) { NGActiveSocket *s1 = nil; NGActiveSocket *s2 = nil; NGLocalSocketAddress *address; s1 = [[self alloc] _initWithDomain:domain descriptor:fds[0]]; s2 = [[self alloc] _initWithDomain:domain descriptor:fds[1]]; s1 = [s1 autorelease]; s2 = [s2 autorelease]; address = [NGLocalSocketAddress address]; if ((s1 != nil) && (s2 != nil)) { s1->mode = NGStreamMode_readWrite; s1->receiveTimeout = 0.0; s1->sendTimeout = 0.0; ASSIGN(s1->remoteAddress, address); s2->mode = NGStreamMode_readWrite; s2->receiveTimeout = 0.0; s2->sendTimeout = 0.0; ASSIGN(s2->remoteAddress, address); _pair[0] = s1; _pair[1] = s2; return YES; } else return NO; } else { int e = errno; NSString *reason = nil; switch (e) { case EACCES: reason = @"Not allowed to create socket of this type"; break; case ENOMEM: reason = @"Could not create socket: Insufficient user memory available"; break; case EPROTONOSUPPORT: reason = @"The protocol is not supported by the address family or " @"implementation"; break; case EPROTOTYPE: reason = @"The socket type is not supported by the protocol"; break; case EMFILE: reason = @"Could not create socket: descriptor table is full"; break; case EOPNOTSUPP: reason = @"The specified protocol does not permit creation of socket " @"pairs"; break; #if DEBUG case 0: NSLog(@"WARNING(%s): socketpair() call failed, but errno=0", __PRETTY_FUNCTION__); #endif default: reason = [NSString stringWithFormat:@"Could not create socketpair: %s", strerror(e)]; break; } [[[NGCouldNotCreateSocketException alloc] initWithReason:reason domain:domain] raise]; return NO; } } #endif + (id)socketConnectedToAddress:(id)_address { volatile id sock = [[self alloc] initWithDomain:[_address domain]]; if (sock != nil) { if (![sock connectToAddress:_address]) { NSException *e; #if 0 NSLog(@"WARNING(%s): Couldn't connect to address %@: %@", __PRETTY_FUNCTION__, _address, [sock lastException]); #endif /* this method needs to raise the exception, since no object is returned in which we could check the -lastException ... */ e = [[sock lastException] retain]; [self release]; e = [e autorelease]; [e raise]; return nil; } sock = [sock autorelease]; } return sock; } - (id)initWithDomain:(id)_domain { // designated initializer if ((self = [super initWithDomain:_domain])) { self->mode = NGStreamMode_readWrite; self->receiveTimeout = 0.0; self->sendTimeout = 0.0; } return self; } - (id)_initWithDescriptor:(int)_fd localAddress:(id)_local remoteAddress:(id)_remote { if ((self = [self _initWithDomain:[_local domain] descriptor:_fd])) { ASSIGN(self->localAddress, _local); ASSIGN(self->remoteAddress, _remote); self->mode = NGStreamMode_readWrite; #if !defined(WIN32) || defined(__CYGWIN32__) NGAddDescriptorFlag(self->fd, O_NONBLOCK); #endif } return self; } - (void)dealloc { [self->remoteAddress release]; [super dealloc]; } /* operations */ - (NSException *)lastException { return [super lastException]; } - (void)raise:(NSString *)_name reason:(NSString *)_reason { Class clazz; NSException *e; clazz = NSClassFromString(_name); NSAssert1(clazz, @"did not find exception class %@", _name); e = [clazz alloc]; if (_reason) { if ([clazz instancesRespondToSelector:@selector(initWithReason:socket:)]) e = [(id)e initWithReason:_reason socket:self]; else if ([clazz instancesRespondToSelector:@selector(initWithStream:reason:)]) e = [(id)e initWithStream:self reason:_reason]; else if ([clazz instancesRespondToSelector:@selector(initWithSocket:)]) e = [(id)e initWithSocket:self]; else if ([clazz instancesRespondToSelector:@selector(initWithStream:)]) e = [(id)e initWithStream:self]; else e = [e initWithReason:_reason]; } else { if ([clazz instancesRespondToSelector:@selector(initWithSocket:)]) e = [(id)e initWithSocket:self]; else if ([clazz instancesRespondToSelector:@selector(initWithStream:)]) e = [(id)e initWithStream:self]; else e = [e init]; } [self setLastException:e]; [e release]; } - (void)raise:(NSString *)_name { [self raise:_name reason:nil]; } - (BOOL)markNonblockingAfterConnect { #if !defined(WIN32) || defined(__CYGWIN32__) // mark socket as non-blocking return YES; #else // on Win we only support blocking sockets right now ... return NO; #endif } - (BOOL)primaryConnectToAddress:(id)_address { // throws // NGCouldNotConnectException if the the connect() call fails [self resetLastException]; if (connect(fd, (struct sockaddr *)[_address internalAddressRepresentation], [_address addressRepresentationSize]) != 0) { NSString *reason = nil; int errorCode = errno; NSException *e; switch (errorCode) { case EACCES: reason = @"search permission denied for element in path"; break; #if defined(WIN32) && !defined(__CYGWIN32__) case WSAEADDRINUSE: reason = @"address already in use"; break; case WSAEADDRNOTAVAIL: reason = @"address is not available on remote machine"; break; case WSAEAFNOSUPPORT: reason = @"addresses in the specified family cannot be used with the socket"; break; case WSAEALREADY: reason = @"a previous non-blocking attempt has not yet been completed"; break; case WSAEBADF: reason = @"descriptor is invalid"; break; case WSAECONNREFUSED: reason = @"connection refused"; break; case WSAEINTR: reason = @"connect was interrupted"; break; case WSAEINVAL: reason = @"the address length is invalid"; break; case WSAEISCONN: reason = @"socket is already connected"; break; case WSAENETUNREACH: reason = @"network is unreachable"; break; case WSAETIMEDOUT: reason = @"timeout occured"; break; #else case EADDRINUSE: reason = @"address already in use"; break; case EADDRNOTAVAIL: reason = @"address is not available on remote machine"; break; case EAFNOSUPPORT: reason = @"addresses in the specified family cannot be used with the socket"; break; case EALREADY: reason = @"a previous non-blocking attempt has not yet been completed"; break; case EBADF: reason = @"descriptor is invalid"; break; case ECONNREFUSED: reason = @"connection refused"; break; case EINTR: reason = @"connect was interrupted"; break; case EINVAL: reason = @"the address length is invalid"; break; case EIO: reason = @"an IO error occured"; break; case EISCONN: reason = @"socket is already connected"; break; case ENETUNREACH: reason = @"network is unreachable"; break; case ETIMEDOUT: reason = @"timeout occured"; break; #endif #if DEBUG case 0: NSLog(@"WARNING(%s): connect() call failed, but errno=0", __PRETTY_FUNCTION__); #endif default: reason = [NSString stringWithCString:strerror(errorCode)]; break; } reason = [NSString stringWithFormat:@"Could not connect to address %@: %@", _address, reason]; e = [[NGCouldNotConnectException alloc] initWithReason:reason socket:self address:_address]; [self setLastException:e]; [e release]; return NO; } /* connect was successful */ ASSIGN(self->remoteAddress, _address); if ([self markNonblockingAfterConnect]) { /* mark socket as non-blocking */ NGAddDescriptorFlag(self->fd, O_NONBLOCK); NSAssert((NGGetDescriptorFlags(self->fd) & O_NONBLOCK), @"could not enable non-blocking mode .."); } return YES; } - (BOOL)connectToAddress:(id)_address { // throws // NGSocketAlreadyConnectedException if the socket is already connected // NGInvalidSocketDomainException if the remote domain != local domain // NGCouldNotCreateSocketException if the socket creation failed if ([self isConnected]) { [[[NGSocketAlreadyConnectedException alloc] initWithReason:@"Could not connected: socket is already connected" socket:self address:self->remoteAddress] raise]; return NO; } // check whether the remote address is in the same domain like the bound one if (flags.isBound) { if (![[localAddress domain] isEqual:[_address domain]]) { [[[NGInvalidSocketDomainException alloc] initWithReason:@"local and remote socket domains are different" socket:self domain:[_address domain]] raise]; return NO; } } // connect, remote-address is non-nil if this returns if (![self primaryConnectToAddress:_address]) return NO; // if the socket wasn't bound before (normal case), bind it now if (!flags.isBound) if (![self kernelBoundAddress]) return NO; return YES; } - (void)_shutdownDuringOperation { [self shutdown]; } - (BOOL)shutdown { if (self->fd != NGInvalidSocketDescriptor) { if (self->mode != NGStreamMode_undefined) { if (shutdown(self->fd, SHUT_RDWR) == 0) self->mode = NGStreamMode_undefined; } #if defined(WIN32) && !defined(__CYGWIN32__) if (closesocket(self->fd) == 0) { #else if (close(self->fd) == 0) { #endif self->fd = NGInvalidSocketDescriptor; } else { NSLog(@"ERROR(%s): close of socket %@ (fd=%i) alive=%s failed: %s", __PRETTY_FUNCTION__, self, self->fd, [self isAlive] ? "YES" : "NO", strerror(errno)); } ASSIGN(self->remoteAddress, (id)nil); } return YES; } - (BOOL)shutdownSendChannel { if (NGCanWriteInStreamMode(self->mode)) { shutdown(self->fd, SHUT_WR); if (self->mode == NGStreamMode_readWrite) self->mode = NGStreamMode_readOnly; else { self->mode = NGStreamMode_undefined; #if defined(WIN32) && !defined(__CYGWIN32__) closesocket(self->fd); #else close(self->fd); #endif self->fd = NGInvalidSocketDescriptor; } } return YES; } - (BOOL)shutdownReceiveChannel { if (NGCanReadInStreamMode(self->mode)) { shutdown(self->fd, SHUT_RD); if (self->mode == NGStreamMode_readWrite) self->mode = NGStreamMode_writeOnly; else { self->mode = NGStreamMode_undefined; #if defined(WIN32) && !defined(__CYGWIN32__) closesocket(self->fd); #else close(self->fd); #endif self->fd = NGInvalidSocketDescriptor; } } return YES; } // ******************** accessors ****************** - (id)remoteAddress { return self->remoteAddress; } - (BOOL)isConnected { return (self->remoteAddress != nil); } - (BOOL)isOpen { return [self isConnected]; } - (int)socketType { return SOCK_STREAM; } - (void)disableNagle:(BOOL)_disable { int on; if ([self isConnected]) { on = _disable ? 1 : 0; setsockopt(self->fd, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on)); } } - (void)setSendTimeout:(NSTimeInterval)_timeout { struct timeval tv; if ([self isConnected]) { tv.tv_sec = (int) _timeout; tv.tv_usec = 0; setsockopt(self->fd, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof (struct timeval)); } self->sendTimeout = _timeout; } - (NSTimeInterval)sendTimeout { return self->sendTimeout; } - (void)setReceiveTimeout:(NSTimeInterval)_timeout { struct timeval tv; if ([self isConnected]) { tv.tv_sec = (int) _timeout; tv.tv_usec = 0; setsockopt(self->fd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof (struct timeval)); } self->receiveTimeout = _timeout; } - (NSTimeInterval)receiveTimeout { return self->receiveTimeout; } - (BOOL)wouldBlockInMode:(NGStreamMode)_mode { short events = 0; if ((![self isConnected]) || (fd == NGInvalidSocketDescriptor)) return NO; if (NGCanReadInStreamMode(_mode)) events |= POLLRDNORM; if (NGCanWriteInStreamMode(_mode)) events |= POLLWRNORM; // timeout of 0 means return immediatly return (NGPollDescriptor([self fileDescriptor], events, 0) == 1 ? NO : YES); } - (int)waitForMode:(NGStreamMode)_mode timeout:(NSTimeInterval)_timeout { short events = 0; if (NGCanReadInStreamMode(_mode)) events |= POLLRDNORM; if (NGCanWriteInStreamMode(_mode)) events |= POLLWRNORM; // timeout of 0 means return immediatly return NGPollDescriptor([self fileDescriptor], events, (int)(_timeout * 1000.0)); } - (unsigned)numberOfAvailableBytesForReading { int len; // need to check whether socket is connected if (self->remoteAddress == nil) { [self raise:@"NGSocketNotConnectedException" reason:@"socket is not connected"]; return NGStreamError; } if (!NGCanReadInStreamMode(self->mode)) { [self raise:@"NGWriteOnlyStreamException"]; return NGStreamError; } #if !defined(WIN32) && !defined(__CYGWIN32__) while (ioctl(self->fd, FIONREAD, &len) == -1) { if (errno == EINTR) continue; [self raise:@"NGSocketException" reason:@"could not get number of available bytes"]; return NGStreamError; } #else // PeekNamedPipe() on Win ... len = 0; #endif return len; } - (BOOL)isAlive { if (self->fd == NGInvalidSocketDescriptor) return NO; /* poll socket for input */ { struct timeval to; fd_set readMask; while (YES) { FD_ZERO(&readMask); FD_SET(self->fd, &readMask); to.tv_sec = to.tv_usec = 0; if (select(self->fd + 1, &readMask, NULL, NULL, &to) >= 0) break; switch (errno) { case EINTR: continue; case EBADF: goto notAlive; default: NSLog(@"socket select() failed: %s", strerror(errno)); goto notAlive; } } /* no input is pending, connection is alive */ if (!FD_ISSET(self->fd, &readMask)) return YES; } /* input is pending: If select() indicates pending input, but ioctl() indicates zero bytes of pending input, the connection is broken */ { #if defined(WIN32) && !defined(__CYGWIN32__) u_long len; #else int len; #endif while (ioctl(self->fd, FIONREAD, &len) == -1) { if (errno == EINTR) continue; goto notAlive; } if (len > 0) return YES; } notAlive: /* valid descriptor, but not alive .. so we close the socket */ #if defined(WIN32) && !defined(__CYGWIN32__) closesocket(self->fd); #else close(self->fd); #endif self->fd = NGInvalidSocketDescriptor; RELEASE(self->remoteAddress); self->remoteAddress = nil; return NO; } // ******************** NGStream ******************** - (unsigned)readBytes:(void *)_buf count:(unsigned)_len { // throws // NGStreamReadErrorException when the read call failed // NGSocketNotConnectedException when the socket is not connected // NGEndOfStreamException when the end of the stream is reached // NGWriteOnlyStreamException when the receive channel was shutdown NSException *e = nil; if (self->fd == NGInvalidSocketDescriptor) { [self raise:@"NGSocketException" reason:@"NGActiveSocket is not open"]; return NGStreamError; } // need to check whether socket is connected if (self->remoteAddress == nil) { [self raise:@"NGSocketNotConnectedException" reason:@"socket is not connected"]; return NGStreamError; } if (!NGCanReadInStreamMode(self->mode)) { [self raise:@"NGWriteOnlyStreamException"]; return NGStreamError; } if (_len == 0) return 0; { #if defined(WIN32) && !defined(__CYGWIN32__) int readResult; readResult = recv(self->fd, _buf, _len, 0); if (readResult == 0) { [self _shutdownDuringOperation]; [self raise:@"NGSocketShutdownDuringReadException"]; return NGStreamError; } else if (readResult < 0) { int errorCode = WSAGetLastError(); switch (errorCode) { case WSAECONNRESET: e = [[NGSocketConnectionResetException alloc] initWithStream:self]; break; case WSAETIMEDOUT: e = [[NGSocketTimedOutException alloc] initWithStream:self]; break; case WSAEWOULDBLOCK: NSLog(@"WARNING: descriptor would block .."); default: e = [[NGStreamReadErrorException alloc] initWithStream:self errorCode:errorCode]; break; } if (e) { [self setLastException:e]; [e release]; return NGStreamError; } } #else /* !WIN32 */ int readResult; NSAssert(_buf, @"invalid buffer"); NSAssert1(_len > 0, @"invalid length: %i", _len); retry: readResult = NGDescriptorRecv(self->fd, _buf, _len, 0, (self->receiveTimeout == 0.0) ? -1 // block until data : (int)(self->receiveTimeout * 1000.0)); #if DEBUG if ((readResult < 0) && (errno == EINVAL)) { NSLog(@"%s: invalid argument in NGDescriptorRecv(%i, 0x%p, %i, %i)", __PRETTY_FUNCTION__, self->fd, _buf, _len, 0, (self->receiveTimeout == 0.0) ? -1 // block until data : (int)(self->receiveTimeout * 1000.0)); } #endif if (readResult == 0) { [self _shutdownDuringOperation]; [self raise:@"NGSocketShutdownDuringReadException"]; return NGStreamError; } else if (readResult == -2) { [self raise:@"NGSocketTimedOutException"]; return NGStreamError; } else if (readResult < 0) { int errorCode = errno; e = nil; switch (errorCode) { case 0: #if DEBUG /* this happens with the Oracle7 adaptor !!! */ NSLog(@"WARNING(%s): readResult<0 (%i), but errno=0 - retry", __PRETTY_FUNCTION__, readResult); #endif goto retry; break; case ECONNRESET: e = [[NGSocketConnectionResetException alloc] initWithStream:self]; break; case ETIMEDOUT: e = [[NGSocketTimedOutException alloc] initWithStream:self]; break; case EWOULDBLOCK: NSLog(@"WARNING: descriptor would block .."); default: e = [[NGStreamReadErrorException alloc] initWithStream:self errorCode:errorCode]; break; } if (e) { [self setLastException:e]; [e release]; return NGStreamError; } } #endif /* !WIN32 */ return readResult; } } #if defined(WIN32) && !defined(__CYGWIN32__) #warning fix exception handling - (unsigned)_winWriteBytes:(const void *)_buf count:(unsigned)_len { NSException *e = nil; int writeResult; writeResult = send(self->fd, _buf, _len, 0); if (writeResult == 0) { [self _shutdownDuringOperation]; [self raise:@"NGSocketShutdownDuringWriteException"]; return NGStreamError; } else if (writeResult < 0) { int errorCode = WSAGetLastError(); switch (errorCode) { case WSAECONNRESET: e = [[NGSocketConnectionResetException alloc] initWithStream:self]; break; case WSAETIMEDOUT: e = [[NGSocketTimedOutException alloc] initWithStream:self]; break; case WSAEWOULDBLOCK: NSLog(@"WARNING: descriptor would block .."); default: e = [[NGStreamWriteErrorException alloc] initWithStream:self errorCode:errno]; break; } if (e) { [self setLastException:e]; [e release]; return NGStreamError; } } return writeResult; } #else - (unsigned)_unixWriteBytes:(const void *)_buf count:(unsigned)_len { int writeResult; int timeOut; int retryCount; retryCount = 0; timeOut = (self->sendTimeout == 0.0) ? -1 // block until data : (int)(self->sendTimeout * 1000.0); wretry: writeResult = NGDescriptorSend(self->fd, _buf, _len, MSG_NOSIGNAL, timeOut); if (writeResult == 0) { [self _shutdownDuringOperation]; [self raise:@"NGSocketShutdownDuringWriteException"]; return NGStreamError; } else if (writeResult == -2) { [self raise:@"NGSocketTimedOutException"]; return NGStreamError; } else if (writeResult < 0) { int errorCode = errno; switch (errorCode) { case 0: #if DEBUG /* this happens with the Oracle7 (on SuSE < 7.1??) adaptor !!! */ NSLog(@"WARNING(%s): writeResult<0 (%i), but errno=0 - retry", __PRETTY_FUNCTION__, writeResult); #endif retryCount++; if (retryCount > 200000) { NSLog(@"WARNING(%s): writeResult<0 (%i), but errno=0 - cancel retry " @"(already tried %i times !!!)", __PRETTY_FUNCTION__, writeResult, retryCount); [self _shutdownDuringOperation]; [self raise:@"NGSocketShutdownDuringWriteException"]; return NGStreamError; break; } sleep(retryCount); goto wretry; break; case ECONNRESET: [self raise:@"NGSocketConnectionResetException"]; return NGStreamError; case ETIMEDOUT: [self raise:@"NGSocketTimedOutException"]; return NGStreamError; case EPIPE: [self _shutdownDuringOperation]; [self raise:@"NGSocketShutdownDuringWriteException"]; return NGStreamError; case EWOULDBLOCK: NSLog(@"WARNING: descriptor would block .."); default: { NSException *e; e = [[NGStreamWriteErrorException alloc] initWithStream:self errorCode:errno]; [self setLastException:e]; [e release]; return NGStreamError; } } } return writeResult; } #endif - (unsigned)writeBytes:(const void *)_buf count:(unsigned)_len { // throws // NGStreamWriteErrorException when the write call failed // NGSocketNotConnectedException when the socket is not connected // NGReadOnlyStreamException when the send channel was shutdown if (_len == NGStreamError) { NSLog(@"ERROR(%s): got NGStreamError passed in as length ...", __PRETTY_FUNCTION__); return NGStreamError; } #if DEBUG if (_len > (1024 * 1024 * 100 /* 100MB */)) { NSLog(@"WARNING(%s): got passed in length %uMB (%u bytes, errcode=%u) ...", __PRETTY_FUNCTION__, (_len / 1024 / 1024), _len, NGStreamError); } #endif if (self->fd == NGInvalidSocketDescriptor) { [self raise:@"NGSocketException" reason:@"NGActiveSocket is not open"]; return NGStreamError; } // need to check whether socket is connected if (self->remoteAddress == nil) { [self raise:@"NGSocketNotConnectedException" reason:@"socket is not connected"]; return NGStreamError; } if (!NGCanWriteInStreamMode(self->mode)) { [self raise:@"NGReadOnlyStreamException"]; return NGStreamError; } //NSLog(@"writeBytes: count:%u", _len); #if defined(WIN32) && !defined(__CYGWIN32__) return [self _winWriteBytes:_buf count:_len]; #else return [self _unixWriteBytes:_buf count:_len]; #endif } - (BOOL)flush { return YES; } #if 0 - (BOOL)close { return [self shutdown]; } #endif - (NGStreamMode)mode { return self->mode; } /* methods method which write exactly _len bytes or fail */ - (BOOL)safeReadBytes:(void *)_buf count:(unsigned)_len { volatile int toBeRead; int readResult; void *pos; unsigned (*readBytes)(id, SEL, void *, unsigned); *(&readBytes) = (void *)[self methodForSelector:@selector(readBytes:count:)]; *(&toBeRead) = _len; *(&readResult) = 0; *(&pos) = _buf; while (YES) { *(&readResult) = readBytes(self, @selector(readBytes:count:), pos, toBeRead); if (readResult == NGStreamError) { NSException *localException; NSData *data; data = [NSData dataWithBytes:_buf length:(_len - toBeRead)]; localException = [[NGEndOfStreamException alloc] initWithStream:self readCount:(_len - toBeRead) safeCount:_len data:data]; [self setLastException:localException]; RELEASE(localException); } NSAssert(readResult != 0, @"ERROR: readBytes may not return '0' .."); if (readResult == toBeRead) { // all bytes were read successfully, return break; } if (readResult < 1) { [NSException raise:NSInternalInconsistencyException format:@"readBytes:count: returned a value < 1"]; } toBeRead -= readResult; pos += readResult; } return YES; } - (BOOL)safeWriteBytes:(const void *)_buf count:(unsigned)_len { int toBeWritten = _len; int writeResult; void *pos = (void *)_buf; /* method cache (THREAD, reentrant) */ static Class lastClass = Nil; static int (*writeBytes)(id,SEL,const void*,unsigned) = NULL; if (lastClass == *(Class *)self) { if (writeBytes == NULL) writeBytes = (void *)[self methodForSelector:@selector(writeBytes:count:)]; } else { lastClass = *(Class *)self; writeBytes = (void *)[self methodForSelector:@selector(writeBytes:count:)]; } while (YES) { writeResult = (int)writeBytes(self, @selector(writeBytes:count:), pos, toBeWritten); if (writeResult == NGStreamError) { /* remember number of written bytes ??? */ return NO; } else if (writeResult == toBeWritten) { // all bytes were written successfully, return break; } if (writeResult < 1) { [NSException raise:NSInternalInconsistencyException format:@"writeBytes:count: returned a value < 1 in stream %@", self]; return NO; } toBeWritten -= writeResult; pos += writeResult; } return YES; } - (BOOL)mark { return NO; } - (BOOL)rewind { [self raise:@"NGStreamException" reason:@"stream doesn't support a mark"]; return NO; } - (BOOL)markSupported { return NO; } // convenience methods - (int)readByte { // java semantics (-1 returned on EOF) int result; unsigned char c; result = [self readBytes:&c count:sizeof(unsigned char)]; if (result != 1) { static Class EOFExcClass = Nil; if (EOFExcClass == Nil) EOFExcClass = [NGEndOfStreamException class]; if ([[self lastException] isKindOfClass:EOFExcClass]) [self resetLastException]; return -1; } return (int)c; } /* description */ - (NSString *)modeDescription { NSString *result = @""; switch ([self mode]) { case NGStreamMode_undefined: result = @""; break; case NGStreamMode_readOnly: result = @"r"; break; case NGStreamMode_writeOnly: result = @"w"; break; case NGStreamMode_readWrite: result = @"rw"; break; default: [[[NGUnknownStreamModeException alloc] initWithStream:self] raise]; break; } return result; } - (NSString *)description { NSMutableString *d = [NSMutableString stringWithCapacity:64]; [d appendFormat:@"<%@[0x%p]: mode=%@ address=%@", NSStringFromClass([self class]), self, [self modeDescription], [self localAddress]]; if ([self isConnected]) [d appendFormat:@" connectedTo=%@", [self remoteAddress]]; if ([self sendTimeout] != 0.0) [d appendFormat:@" send-timeout=%4.3fs", [self sendTimeout]]; if ([self receiveTimeout] != 0.0) [d appendFormat:@" receive-timeout=%4.3fs", [self receiveTimeout]]; [d appendString:@">"]; return d; } @end /* NGActiveSocket */ @implementation NGActiveSocket(DataMethods) - (NSData *)readDataOfLength:(unsigned int)_length { unsigned readCount; char buf[_length]; if (_length == 0) return [NSData data]; readCount = [self readBytes:buf count:_length]; return [NSData dataWithBytes:buf length:readCount]; } - (NSData *)safeReadDataOfLength:(unsigned int)_length { char buf[_length]; if (_length == 0) return [NSData data]; [self safeReadBytes:buf count:_length]; return [NSData dataWithBytes:buf length:_length]; } - (unsigned int)writeData:(NSData *)_data { return [self writeBytes:[_data bytes] count:[_data length]]; } - (BOOL)safeWriteData:(NSData *)_data { return [self safeWriteBytes:[_data bytes] count:[_data length]]; } @end /* NGActiveSocket(DataMethods) */ #include @implementation NGBufferedStream(FastSocketForwarders) - (BOOL)isConnected { return [(id)self->source isConnected]; } - (int)fileDescriptor { return [(NSFileHandle *)self->source fileDescriptor]; } @end /* NGBufferedStream(FastSocketForwarders) */ SOPE/sope-core/NGStreams/NGLockingStream.m0000644000000000000000000000627512242733417017245 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include "common.h" @implementation NGLockingStream + (id)filterWithSource:(id)_source lock:(id)_lock { return [[[self alloc] initWithSource:_source lock:_lock] autorelease]; } - (id)initWithSource:(id)_source lock:(id)_lock { if ((self = [super initWithSource:_source])) { if (_lock == nil) { readLock = [[NSRecursiveLock allocWithZone:[self zone]] init]; writeLock = [readLock retain]; } else { readLock = [_lock retain]; writeLock = [readLock retain]; } } return self; } - (id)initWithSource:(id)_source { return [self initWithSource:_source lock:nil]; } - (void)dealloc { [self->readLock release]; [self->writeLock release]; [super dealloc]; } // primitives - (unsigned)readBytes:(void *)_buf count:(unsigned)_len { volatile unsigned result = 0; [readLock lock]; NS_DURING { result = (readBytes != NULL) ? (unsigned)readBytes(source, _cmd, _buf, _len) : [source readBytes:_buf count:_len]; } NS_HANDLER { [readLock unlock]; [localException raise]; } NS_ENDHANDLER; [readLock unlock]; return result; } - (unsigned)writeBytes:(const void *)_buf count:(unsigned)_len { volatile unsigned result = 0; [writeLock lock]; NS_DURING { result = (writeBytes != NULL) ? (unsigned)writeBytes(source, _cmd, _buf, _len) : [source writeBytes:_buf count:_len]; } NS_HANDLER { [writeLock unlock]; [localException raise]; } NS_ENDHANDLER; [writeLock unlock]; return result; } - (BOOL)flush { BOOL res = NO; [writeLock lock]; NS_DURING { res = [super flush]; } NS_HANDLER { [writeLock unlock]; [localException raise]; } NS_ENDHANDLER; [writeLock unlock]; return res; } - (BOOL)safeReadBytes:(void *)_buf count:(unsigned)_len { BOOL res = NO; [readLock lock]; NS_DURING { res = [super safeReadBytes:_buf count:_len]; } NS_HANDLER { [readLock unlock]; [localException raise]; } NS_ENDHANDLER; [readLock unlock]; return res; } - (BOOL)safeWriteBytes:(const void *)_buf count:(unsigned)_len { BOOL res = NO; [writeLock lock]; NS_DURING { res = [super safeWriteBytes:_buf count:_len]; } NS_HANDLER { [writeLock unlock]; [localException raise]; } NS_ENDHANDLER; [writeLock unlock]; return res; } @end /* NGLockingStream */ SOPE/sope-core/NGStreams/NGStreams.m0000644000000000000000000000164112242733417016111 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include @implementation NGStreams - (void)_staticLinkClasses { } - (void)_staticLinkModules { } @end /* NGStreams */ SOPE/sope-core/NGStreams/GNUmakefile0000644000000000000000000000531312242733417016142 0ustar rootroot# GNUstep makefile include ../../config.make include ../common.make include ./Version ifneq ($(frameworks),yes) LIBRARY_NAME = libNGStreams else FRAMEWORK_NAME = NGStreams endif libNGStreams_PCH_FILE = common.h libNGStreams_DLL_DEF = libNGStreams.def libNGStreams_INTERFACE_VERSION=$(MAJOR_VERSION).$(MINOR_VERSION) libNGStreams_INSTALL_DIR=$(SOPE_SYSLIBDIR) libNGStreams_VERSION=$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBMINOR_VERSION) libNGStreams_HEADER_FILES_DIR = NGStreams libNGStreams_HEADER_FILES_INSTALL_DIR = /NGStreams libNGStreams_HEADER_FILES = \ NGStreamsDecls.h \ NGStreams.h \ NGStreamProtocols.h \ NGTextStreamProtocols.h \ NGBase64Stream.h \ NGBufferedStream.h \ NGByteCountStream.h \ NGCTextStream.h \ NGConcreteStreamFileHandle.h \ NGDataStream.h \ NGFileStream.h \ NGFilterStream.h \ NGFilterTextStream.h \ NGLockingStream.h \ NGStream.h \ NGStreamExceptions.h \ NGStringTextStream.h \ NGTextStream.h \ NGDescriptorFunctions.h \ NGStreamPipe.h \ NGByteBuffer.h \ NGCharBuffer.h \ NGTerminalSupport.h \ \ NGActiveSocket.h \ NGDatagramPacket.h \ NGDatagramSocket.h \ NGInternetSocketAddress.h \ NGInternetSocketDomain.h \ NGLocalSocketAddress.h \ NGLocalSocketDomain.h \ NGNet.h \ NGNetDecls.h \ NGNetUtilities.h \ NGPassiveSocket.h \ NGSocket.h \ NGSocketExceptions.h \ NGSocketProtocols.h \ \ NGGZipStream.h \ libNGStreams_OBJC_FILES = \ NGStreams.m \ NGBase64Stream.m \ NGBufferedStream.m \ NGByteCountStream.m \ NGCTextStream.m \ NGConcreteStreamFileHandle.m \ NGDataStream.m \ NGFileStream.m \ NGFilterStream.m \ NGFilterTextStream.m \ NGLockingStream.m \ NGStream.m \ NGStreamExceptions.m \ NGStringTextStream.m \ NGTextStream.m \ NGDescriptorFunctions.m \ NGStreamPipe.m \ NGByteBuffer.m \ NGCharBuffer.m \ NGTerminalSupport.m \ \ NGActiveSocket.m \ NGDatagramPacket.m \ NGDatagramSocket.m \ NGInternetSocketAddress.m \ NGInternetSocketDomain.m \ NGLocalSocketAddress.m \ NGLocalSocketDomain.m \ NGNetUtilities.m \ NGPassiveSocket.m \ NGSocket.m \ NGSocketExceptions.m \ \ NGGZipStream.m \ # framework support NGStreams_PCH_FILE = $(libNGStreams_PCH_FILE) NGStreams_HEADER_FILES_DIR = $(libNGStreams_HEADER_FILES_DIR) NGStreams_HEADER_FILES = $(libNGStreams_HEADER_FILES) NGStreams_OBJC_FILES = $(libNGStreams_OBJC_FILES) # building -include GNUmakefile.preamble ifneq ($(FHS_INSTALL_ROOT),) GNUSTEP_HEADERS=$(DESTDIR)$(FHS_INSTALL_ROOT)/include endif ifneq ($(frameworks),yes) include $(GNUSTEP_MAKEFILES)/library.make else include $(GNUSTEP_MAKEFILES)/framework.make endif -include GNUmakefile.postamble SOPE/sope-core/NGStreams/GNUmakefile.postamble0000644000000000000000000000062012242733417020123 0ustar rootroot# compilation settings before-all :: config.status after-distclean:: rm -f config.cache config.log config.status config.h config.mak config.h config.status : config.h.in configure ./configure ifneq ($(GNUSTEP_TARGET_OS),cygwin32) configure : configure.in #autoconf configure.in > configure echo "configure.in seems to have changed, you might want to rerun autoconf" chmod +x configure endif SOPE/sope-core/NGStreams/NGDataStream.m0000644000000000000000000001740412242733417016524 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include "common.h" // TODO: cache -bytes and -length of NSData for immutable data! @implementation NGDataStream + (id)dataStream { return [self streamWithData:[NSMutableData dataWithCapacity:1024]]; } + (id)dataStreamWithCapacity:(int)_capacity { return [self streamWithData:[NSMutableData dataWithCapacity:_capacity]]; } + (id)streamWithData:(NSData *)_data { return [[[self alloc] initWithData:_data] autorelease]; } - (id)initWithData:(NSData *)_data mode:(NGStreamMode)_mode { if ((self = [super init])) { self->data = [_data retain]; self->position = 0; if ([self->data respondsToSelector:@selector(methodForSelector:)] == YES) { self->dataLength = (unsigned int(*)(id, SEL)) [self->data methodForSelector:@selector(length)]; self->dataBytes = (const void*(*)(id, SEL)) [self->data methodForSelector:@selector(bytes)]; } else { self->dataLength = NULL; self->dataBytes = NULL; } self->streamMode = _mode; /* for read-only streams */ if (self->streamMode == NGStreamMode_readOnly) { self->bytes = [self->data bytes]; self->length = [self->data length]; } } return self; } - (id)initWithData:(NSData *)_data { NGStreamMode smode; smode = [data isKindOfClass:[NSMutableData class]] ? NGStreamMode_readWrite : NGStreamMode_readOnly; return [self initWithData:_data mode:smode]; } - (void)dealloc { [self->data release]; [self->lastException release]; [super dealloc]; } /* accessors */ /* NGTextInputStream */ - (NSException *)lastException { return self->lastException; } - (void)setLastException:(NSException *)_exception { ASSIGN(self->lastException, _exception); } - (void)resetLastException { [self->lastException release]; self->lastException = nil; } - (NSData *)data { return self->data; } - (unsigned)availableBytes { // returns number of available bytes register unsigned currentLength = 0; if (self->bytes == NULL) { currentLength = (self->dataLength == NULL) ? [self->data length] : self->dataLength(self->data, @selector(length)); } else currentLength = self->length; return (currentLength == position) ? 0 : (currentLength - position); } /* primitives */ - (unsigned)readBytes:(void *)_buf count:(unsigned)_len { // throws // NGStreamNotOpenException when the stream is not open // NGEndOfStreamException when the end of the stream is reached register unsigned currentLength = 0; if (self->bytes == NULL) { currentLength = (self->dataLength == NULL) ? [self->data length] : self->dataLength(self->data, @selector(length)); } else currentLength = self->length; if (self->data == nil) { NSException *e; e = [NGStreamNotOpenException exceptionWithStream:self reason: @"tried to read from a data stream " @"which was closed"]; [self setLastException:e]; return NGStreamError; } if (currentLength == position) { [self setLastException: [NGEndOfStreamException exceptionWithStream:self]]; return NGStreamError; } { NSRange range; range.location = position; if ((position + _len) > currentLength) range.length = currentLength - position; else range.length = _len; [self->data getBytes:_buf range:range]; position += range.length; return range.length; } } - (int)readByte { register const unsigned char *p; register unsigned int currentLength = 0; int result = 0; if (self->bytes == NULL) { currentLength = (self->dataLength == NULL) ? [self->data length] : self->dataLength(self->data, @selector(length)); } else currentLength = self->length; if (currentLength == position) return -1; if (self->bytes == NULL) { p = (self->dataBytes == NULL) ? [self->data bytes] : self->dataBytes(self->data, @selector(bytes)); } else p = self->bytes; result = p[self->position]; self->position++; return result; } - (unsigned)writeBytes:(const void *)_buf count:(unsigned)_len { // throws // NGReadOnlyStreamException when the stream is not writeable // NGStreamNotOpenException when the stream is not open if (self->data == nil) { NSException *e; e = [NGStreamNotOpenException exceptionWithStream:self reason: @"tried to write to a data stream " @"which was closed"]; [self setLastException:e]; return NGStreamError; } if (!NGCanWriteInStreamMode(streamMode)) { NSException *e; e = [NGReadOnlyStreamException exceptionWithStream:self]; [self setLastException:e]; return NGStreamError; } [(NSMutableData *)self->data appendBytes:_buf length:_len]; return _len; } - (BOOL)close { ASSIGN(self->lastException, (id)nil); [self->data release]; self->data = nil; position = 0; streamMode = NGStreamMode_undefined; return YES; } - (NGStreamMode)mode { return streamMode; } - (BOOL)isRootStream { return YES; } // NGPositionableStream - (BOOL)moveToLocation:(unsigned)_location { position = _location; return YES; } - (BOOL)moveByOffset:(int)_delta { position += _delta; return YES; } /* blocking .. */ - (BOOL)wouldBlockInMode:(NGStreamMode)_mode { return NO; } - (id)retain { return [super retain]; } /* bytebuffer / lookahead API */ - (int)la:(unsigned)_la { register unsigned int currentLength, newpos; register const unsigned char *p; int result = 0; if (self->bytes == NULL) { currentLength = (self->dataLength == NULL) ? [self->data length] : self->dataLength(self->data, @selector(length)); } else currentLength = self->length; if (currentLength == self->position) // already at EOF return -1; newpos = (self->position + _la); if (newpos >= currentLength) return -1; /* a look into EOF */ if (self->bytes == NULL) { p = (self->dataBytes == NULL) ? [self->data bytes] : self->dataBytes(self->data, @selector(bytes)); } else p = self->bytes; result = p[newpos]; return result; } - (void)consume { // consume one byte register unsigned int currentLength = 0; if (self->bytes == NULL) { currentLength = (self->dataLength == NULL) ? [self->data length] : self->dataLength(self->data, @selector(length)); } else currentLength = self->length; if (currentLength == self->position) return; self->position++; // consume } - (void)consume:(unsigned)_cnt { // consume _cnt bytes register unsigned int currentLength = 0; if (self->bytes == NULL) { currentLength = (self->dataLength == NULL) ? [self->data length] : self->dataLength(self->data, @selector(length)); } else currentLength = self->length; if (currentLength == self->position) return; self->position += _cnt; // consume if (self->position > currentLength) self->position = currentLength; } @end /* NGDataStream */ SOPE/sope-core/NGStreams/NGStreamPipe.m0000644000000000000000000001164312242733417016547 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "config.h" #include "common.h" #include "NGStreamPipe.h" #include "NGFileStream.h" #include "NGBufferedStream.h" #if defined(WIN32) @implementation NGStreamPipe @end #else static const int NGInvalidUnixDescriptor = -1; @interface _NGConcretePipeFileHandle : NSFileHandle { @public int *fd; } - (id)initWithDescriptor:(int *)_fd; @end @interface NGFileStream(PrivateMethods) - (id)__initWithDescriptor:(int)_fd mode:(NGStreamMode)_mode; @end @implementation NGStreamPipe + (id)pipe { return [[[self alloc] init] autorelease]; } - (id)init { if (pipe(self->fildes) == -1) { NSLog (@"pipe() system call failed: %s", strerror (errno)); self = [self autorelease]; return nil; } return self; } - (void)gcFinalize { [self close]; } - (void)dealloc { [self gcFinalize]; [self->fhIn release]; [self->fhOut release]; [super dealloc]; } - (NSFileHandle *)fileHandleForReading { if (self->fhIn == nil) { self->fhIn = [[_NGConcretePipeFileHandle alloc] initWithDescriptor:&(self->fildes[0])]; } return self->fhIn; } - (NSFileHandle *)fileHandleForWriting { if (self->fhOut == nil) { self->fhOut = [[_NGConcretePipeFileHandle alloc] initWithDescriptor:&(self->fildes[1])]; } return self->fhOut; } - (id)streamForReading { return self; } - (id)streamForWriting { return self; } - (NSException *)lastException { return nil; } /* NGInputStream */ - (unsigned)readBytes:(void *)_buf count:(unsigned)_len { int readResult; if (self->fildes[0] == NGInvalidUnixDescriptor) { [NGStreamReadErrorException raiseWithStream:self reason:@"read end of pipe is closed"]; } readResult = read(self->fildes[0], _buf, _len); if (readResult == 0) [NGEndOfStreamException raiseWithStream:self]; else if (readResult == -1) [NGStreamReadErrorException raiseWithStream:self errorCode:errno]; return readResult; } - (BOOL)safeReadBytes:(void *)_buf count:(unsigned)_len { return NGSafeReadBytesFromStream(self, _buf, _len); } /* marks */ - (BOOL)mark { NSLog(@"WARNING: called mark on a stream which doesn't support marking !"); return NO; } - (BOOL)rewind { [NGStreamException raiseWithStream:self reason:@"marking not supported"]; return NO; } - (BOOL)markSupported { return NO; } /* NGOutputStream */ - (unsigned)writeBytes:(const void *)_buf count:(unsigned)_len { int writeResult; if (self->fildes[1] == NGInvalidUnixDescriptor) { [NGStreamWriteErrorException raiseWithStream:self reason:@"write end of pipe is closed"]; } writeResult = write(self->fildes[1], _buf, _len); if (writeResult == -1) [NGStreamWriteErrorException raiseWithStream:self errorCode:errno]; return writeResult; } - (BOOL)safeWriteBytes:(const void *)_buf count:(unsigned)_len { return NGSafeWriteBytesToStream(self, _buf, _len); } - (BOOL)flush { return YES; } /* NGStream */ - (BOOL)close { if (self->fildes[0] != NGInvalidUnixDescriptor) close(self->fildes[0]); if (self->fildes[1] != NGInvalidUnixDescriptor) close(self->fildes[1]); return YES; } - (NGStreamMode)mode { NGStreamMode mode = NGStreamMode_undefined; if (self->fildes[0] != NGInvalidUnixDescriptor) mode |= NGStreamMode_readOnly; if (self->fildes[1] != NGInvalidUnixDescriptor) mode |= NGStreamMode_writeOnly; return mode; } // NGByteSequenceStream - (int)readByte { return NGReadByteFromStream(self); } // Extensions - (BOOL)isOpen { return (self->fildes[0] == NGInvalidUnixDescriptor) && (self->fildes[1] == NGInvalidUnixDescriptor) ? NO : YES; } /* description */ - (NSString *)description { return [NSString stringWithFormat:@"<0x%p[%@]: in=%i out=%i>", self, NSStringFromClass([self class]), self->fildes[0], self->fildes[1]]; } @end /* NGStreamPipe */ @implementation _NGConcretePipeFileHandle - (id)initWithDescriptor:(int *)_fd { self->fd = _fd; return self; } - (int)fileDescriptor { return *(self->fd); } - (void)closeFile { close(*(self->fd)); *(self->fd) = NGInvalidUnixDescriptor; } @end #endif /* WIN32 */ SOPE/sope-core/NGStreams/NGStreams-Info.plist0000644000000000000000000000134412242733417017701 0ustar rootroot CFBundleDevelopmentRegion English CFBundleExecutable NGStreams CFBundleGetInfoString CFBundleIdentifier org.OpenGroupware.SOPE.core.NGStreams CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType FMWK CFBundleShortVersionString CFBundleSignature ???? CFBundleVersion 4.5 SOPE/sope-core/NGStreams/NGInternetSocketDomain.m0000644000000000000000000000535512242733417020572 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NGInternetSocketDomain.h" #include "NGInternetSocketAddress.h" #include "common.h" #ifndef __MINGW32__ # include #endif @implementation NGInternetSocketDomain static NGInternetSocketDomain *domain = nil; + (void)initialize { if (domain == nil) domain = [[NGInternetSocketDomain alloc] init]; } + (id)domain { return domain; } /* NGSocketDomain */ - (id)addressWithRepresentation:(void *)_data size:(unsigned int)_size { NGInternetSocketAddress *address = nil; if ((unsigned int)[self addressRepresentationSize] != _size) { NSLog(@"%@: invalid address size %i ..", NSStringFromSelector(_cmd), _size); return nil; } address = [[NGInternetSocketAddress allocWithZone:[self zone]] initWithDomain:self internalRepresentation:_data size:_size]; return [address autorelease]; } - (BOOL)prepareAddress:(id)_address forBindWithSocket:(id)_socket { // nothing to prepare return YES; } - (BOOL)cleanupAddress:(id)_address afterCloseOfSocket:(id)_socket { // nothing to cleanup return YES; } - (int)socketDomain { return AF_INET; } - (int)addressRepresentationSize { return sizeof(struct sockaddr_in); } - (int)protocol { return 0; } /* NSCopying */ - (id)copyWithZone:(NSZone *)_zone { /* domain objects are immutable, just retain on copy */ return [self retain]; } /* NSCoding */ - (void)encodeWithCoder:(NSCoder *)_encoder { } - (id)initWithCoder:(NSCoder *)_decoder { [self release]; self = nil; return [domain retain]; } - (id)awakeAfterUsingCoder:(NSCoder *)_decoder { if (self != domain) { [self release]; self = nil; return [domain retain]; } else return self; } /* description */ - (NSString *)description { return [NSString stringWithFormat:@"", self]; } @end /* NGInternetSocketDomain */ SOPE/sope-core/NGStreams/NGConcreteStreamFileHandle.m0000644000000000000000000001304312242733417021324 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include "common.h" @interface NGStream(FileHandleReset) - (void)resetFileHandle; @end @implementation NGConcreteStreamFileHandle - (id)initWithStream:(id)_stream { if ((self = [super init])) { self->stream = [_stream retain]; } return self; } - (void)dealloc { if ([stream respondsToSelector:@selector(resetFileHandle)]) [(NGStream *)self->stream resetFileHandle]; [self->stream release]; [super dealloc]; } // accessors - (id)stream { return self->stream; } /* NSFileHandle operations */ - (void)closeFile { [self->stream close]; } - (int)fileDescriptor { if ([self->stream respondsToSelector:@selector(fileDescriptor)]) return [(id)self->stream fileDescriptor]; else { [self subclassResponsibility:_cmd]; return -1; } } /* buffering */ - (void)synchronizeFile { [self->stream flush]; } /* reading */ - (NSData *)readDataOfLength:(unsigned int)_length { char *buffer; NSData *data; *(&buffer) = NGMallocAtomic(_length); *(&data) = nil; NS_DURING { [stream safeReadBytes:buffer count:_length]; data = [[NSData alloc] initWithBytes:buffer length:_length]; } NS_HANDLER { if ([localException isKindOfClass:[NGEndOfStreamException class]]) { data = [(NGEndOfStreamException *)localException readBytes]; data = data ? [data retain] : [[NSData alloc] init]; } else { if (buffer) { NGFree(buffer); buffer = NULL; } [localException raise]; } } NS_ENDHANDLER; if (buffer) { NGFree(buffer); buffer = NULL; } return [data autorelease]; } - (NSData *)readDataToEndOfFile { NGBufferedStream *bs; NSMutableData *data; char buf[2048]; *(&data) = [NSMutableData dataWithCapacity:2048]; *(&bs) = [self->stream isKindOfClass:[NGBufferedStream class]] ? [self->stream retain] : [(NGBufferedStream *)[NGBufferedStream alloc] initWithSource:self->stream]; NS_DURING { while (1 == 1) { unsigned got = [bs readBytes:buf count:2048]; [data appendBytes:buf length:got]; } } NS_HANDLER { if (![localException isKindOfClass:[NGEndOfStreamException class]]) { [bs release]; bs = nil; [localException raise]; } } NS_ENDHANDLER; [bs release]; bs = nil; return data; } - (NSData *)availableData { NSLog(@"NGConcreteStreamFileHandle(availableData) not implemented"); [self notImplemented:_cmd]; return nil; } /* writing */ - (void)writeData:(NSData *)_data { [self->stream safeWriteBytes:[_data bytes] count:[_data length]]; } /* seeking */ - (unsigned long long)seekToEndOfFile { NSLog(@"NGConcreteStreamFileHandle(seekToEndOfFile) not implemented"); [self notImplemented:_cmd]; return 0; } - (void)seekToFileOffset:(unsigned long long)_offset { [(id)stream moveToLocation:_offset]; } - (unsigned long long)offsetInFile { NSLog(@"_NGConcreteFileStreamFileHandle(offsetInFile:) not implemented, abort"); [self notImplemented:_cmd]; return 0; } /* asynchronous operations */ - (void)acceptConnectionInBackgroundAndNotify { NSLog(@"NGConcreteStreamFileHandle(acceptConnectionInBackgroundAndNotify) " @"not implemented"); [self notImplemented:_cmd]; } - (void)acceptConnectionInBackgroundAndNotifyForModes:(NSArray *)_modes { NSLog(@"NGConcreteStreamFileHandle(acceptConnectionInBackgroundAndNotifyForModes:) " @"not implemented"); [self notImplemented:_cmd]; } - (void)readInBackgroundAndNotify { NSLog(@"NGConcreteStreamFileHandle(readInBackgroundAndNotify) not implemented"); [self notImplemented:_cmd]; } - (void)readInBackgroundAndNotifyForModes:(NSArray *)_modes { NSLog(@"NGConcreteStreamFileHandle(readInBackgroundAndNotifyForModes:) " @"not implemented"); [self notImplemented:_cmd]; } - (void)readToEndOfFileInBackgroundAndNotify { NSLog(@"NGConcreteStreamFileHandle(readToEndOfFileInBackgroundAndNotify)" @"not implemented"); [self notImplemented:_cmd]; } - (void)readToEndOfFileInBackgroundAndNotifyForModes:(NSArray *)_modes { NSLog(@"NGConcreteStreamFileHandle(" @"readToEndOfFileInBackgroundAndNotifyForModes:)" @"not implemented"); [self notImplemented:_cmd]; } - (void)waitForDataInBackgroundAndNotify { NSLog(@"NGConcreteStreamFileHandle(" @"waitForDataInBackgroundAndNotify)" @"not implemented"); [self notImplemented:_cmd]; } - (void)waitForDataInBackgroundAndNotifyForModes:(NSArray *)_modes { NSLog(@"NGConcreteStreamFileHandle(" @"waitForDataInBackgroundAndNotifyForModes:)" @"not implemented"); [self notImplemented:_cmd]; } @end /* NGConcreteStreamFileHandle */ SOPE/sope-core/NGStreams/COPYING0000644000000000000000000006130312242733417015124 0ustar rootroot GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 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. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] 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 Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, 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 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 a program 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. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, 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 companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. 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, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library 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 compile 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) 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. c) 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. d) 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 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. 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 to 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 Library 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 Appendix: 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 Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library 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! SOPE/sope-core/NGStreams/NGDatagramSocket.m0000644000000000000000000002154712242733417017373 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #if defined(__APPLE__) # include # include #endif #include #include #include #include "NGDatagramSocket.h" #include "NGDatagramPacket.h" #include "NGSocketExceptions.h" #include "NGSocket+private.h" #include "common.h" #if !defined(POLLRDNORM) # define POLLRDNORM POLLIN #endif NSString *NGSocketTimedOutNotificationName = @"NGSocketTimedOutNotification"; @interface NGSocket(privateMethods) - (void)_createSocketInDomain:(int)_domain; - (void)setOption:(int)_option level:(int)_level value:(void *)_value len:(int)_len; - (void)setOption:(int)_option value:(void *)_value len:(int)_len; - (void)getOption:(int)_option level:(int)_level value:(void *)_val len:(int *)_len; - (void)getOption:(int)_option value:(void *)_value len:(int *)_len; @end //static const int NGMaxTimeout = (int)-1; static const NSTimeInterval NGNoTimeout = 0.0; @implementation NGDatagramSocket #if !defined(WIN32) || defined(__CYGWIN32__) + (BOOL)socketPair:(id[2])_pair { int fds[2]; NGLocalSocketDomain *domain; _pair[0] = nil; _pair[1] = nil; domain = [NGLocalSocketDomain domain]; if (socketpair([domain socketDomain], SOCK_DGRAM, [domain protocol], fds) == 0) { NGDatagramSocket *s1 = nil; NGDatagramSocket *s2 = nil; s1 = [[self alloc] _initWithDomain:domain descriptor:fds[0]]; s2 = [[self alloc] _initWithDomain:domain descriptor:fds[1]]; s1 = AUTORELEASE(s1); s2 = AUTORELEASE(s2); if ((s1 != nil) && (s2 != nil)) { _pair[0] = s1; _pair[1] = s2; return YES; } else return NO; } else { int e = errno; NSString *reason = nil; switch (e) { case EACCES: reason = @"Not allowed to create socket of this type"; break; case ENOMEM: reason = @"Could not create socket: Insufficient user memory available"; break; case EPROTONOSUPPORT: reason = @"The protocol is not supported by the address family or " @"implementation"; break; case EPROTOTYPE: reason = @"The socket type is not supported by the protocol"; break; case EMFILE: reason = @"Could not create socket: descriptor table is full"; break; case EOPNOTSUPP: reason = @"The specified protocol does not permit creation of socket " @"pairs"; break; default: reason = [NSString stringWithFormat:@"Could not create socketpair: %s", strerror(e)]; break; } [[[NGCouldNotCreateSocketException alloc] initWithReason:reason domain:domain] raise]; return NO; } } #endif + (id)socketBoundToAddress:(id)_address { volatile id sock = [[self alloc] initWithDomain:[_address domain]]; if (sock != nil) { sock = AUTORELEASE(sock); [sock bindToAddress:_address]; } return sock; } - (id)initWithDomain:(id)_domain { // designated initializer if ((self = [super initWithDomain:_domain])) { [self setMaxPacketSize:2048]; [self setPacketFactory:(id)[NGDatagramPacket class]]; self->udpFlags.isConnected = NO; } return self; } // accessors - (void)setMaxPacketSize:(int)_maxPacketSize { self->maxPacketSize = _maxPacketSize; } - (int)maxPacketSize { return self->maxPacketSize; } - (void)setPacketFactory:(id)_factory { ASSIGN(self->packetFactory, _factory); } - (id)packetFactory { return self->packetFactory; } - (int)socketType { return SOCK_DGRAM; } - (BOOL)isConnected { return self->udpFlags.isConnected; } // polling - (BOOL)wouldBlockInMode:(NGStreamMode)_mode { short events = 0; if (fd == NGInvalidSocketDescriptor) return NO; if (NGCanReadInStreamMode(_mode)) events |= POLLRDNORM; if (NGCanWriteInStreamMode(_mode)) events |= POLLWRNORM; // timeout of 0 means return immediatly return (NGPollDescriptor([self fileDescriptor], events, 0) == 1 ? NO : YES); } // sending - (void)primarySendPacket:(id)_packet { NSAssert([_packet receiver], @"packet has no destination !"); sendto(self->fd, // socket [[_packet data] bytes], [[_packet data] length], 0, // flags [[_packet receiver] internalAddressRepresentation], [[_packet receiver] addressRepresentationSize]); if (!self->flags.isBound) // was not explictly bound, so get local address [self kernelBoundAddress]; [_packet setSender:[self localAddress]]; } - (BOOL)sendPacket:(id)_packet timeout:(NSTimeInterval)_to { if (_to > NGNoTimeout) { int result = NGPollDescriptor([self fileDescriptor], POLLWRNORM, (int)(_to * 1000.0)); if (result == 0) { // timeout [[NSNotificationCenter defaultCenter] postNotificationName:NGSocketTimedOutNotificationName object:self]; return NO; } else if (result < 0) { [[[NGSocketException alloc] initWithReason:@"error during poll on UDP socket"] raise]; return NO; } // else receive packet .. } [self primarySendPacket:_packet]; return YES; } - (BOOL)sendPacket:(id)_packet { return [self sendPacket:_packet timeout:NGNoTimeout]; } // receiving - (id)primaryReceivePacketWithMaxSize:(int)_maxSize { id remote = nil; id packet = nil; char buffer[_maxSize]; size_t size; unsigned int len = [[self domain] addressRepresentationSize]; char data[len + 2]; size = recvfrom(self->fd, buffer, _maxSize, 0, // flags (void *)data, &len); remote = [[self domain] addressWithRepresentation:(void *)data size:len]; if (!self->flags.isBound) // was not explictly bound, so get local address [self kernelBoundAddress]; packet = [[self packetFactory] packetWithBytes:buffer size:size]; [packet setReceiver:[self localAddress]]; [packet setSender:remote]; return packet; } - (id)receivePacketWithMaxSize:(int)_size timeout:(NSTimeInterval)_to { if (_to > NGNoTimeout) { int result = NGPollDescriptor([self fileDescriptor], POLLRDNORM, (int)(_to * 1000.0)); if (result == 0) { // timeout [[NSNotificationCenter defaultCenter] postNotificationName:NGSocketTimedOutNotificationName object:self]; return nil; } else if (result < 0) { [[[NGSocketException alloc] initWithReason:@"error during poll on UDP socket"] raise]; } // else receive packet .. } return [self primaryReceivePacketWithMaxSize:_size]; } - (id)receivePacketWithTimeout:(NSTimeInterval)_timeout { return [self receivePacketWithMaxSize:[self maxPacketSize] timeout:_timeout]; } - (id)receivePacketWithMaxSize:(int)_maxPacketSize { return [self receivePacketWithMaxSize:_maxPacketSize timeout:NGNoTimeout]; } - (id)receivePacket { return [self receivePacketWithMaxSize:[self maxPacketSize] timeout:NGNoTimeout]; } // ************************* options ************************* static int i_yes = 1; static int i_no = 0; static inline void setBoolOption(id self, int _option, BOOL _flag) { [self setOption:_option level:SOL_SOCKET value:(_flag ? &i_yes : &i_no) len:4]; } static inline BOOL getBoolOption(id self, int _option) { int value, len; [self getOption:_option level:SOL_SOCKET value:&value len:&len]; return (value ? YES : NO); } - (void)setBroadcast:(BOOL)_flag { setBoolOption(self, SO_BROADCAST, _flag); } - (BOOL)doesBroadcast { return getBoolOption(self, SO_BROADCAST); } // aborts, only supported for TCP - (void)setDebug:(BOOL)_flag { [self doesNotRecognizeSelector:_cmd]; } - (BOOL)doesDebug { [self doesNotRecognizeSelector:_cmd]; return NO; } @end SOPE/sope-core/NGStreams/NGStream.m0000644000000000000000000001524412242733417015732 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include "common.h" @implementation NGStream /* primitives */ - (void)setLastException:(NSException *)_exception { [_exception raise]; } - (NSException *)lastException { return nil; } - (unsigned)readBytes:(void *)_buf count:(unsigned)_len { [self subclassResponsibility:_cmd]; return 0; } - (unsigned)writeBytes:(const void *)_buf count:(unsigned)_len { [self subclassResponsibility:_cmd]; return 0; } - (BOOL)flush { return YES; } - (BOOL)close { return YES; } - (NGStreamMode)mode { [self subclassResponsibility:_cmd]; return 0; } - (BOOL)isRootStream { [self subclassResponsibility:_cmd]; return NO; } // methods method which write exactly _len bytes - (BOOL)safeReadBytes:(void *)_buf count:(unsigned)_len { return NGSafeReadBytesFromStream(self, _buf, _len); } - (BOOL)safeWriteBytes:(const void *)_buf count:(unsigned)_len { return NGSafeWriteBytesToStream(self, _buf, _len); } /* marking */ - (BOOL)mark { NSLog(@"WARNING: called mark on a stream which doesn't support marking !"); return NO; } - (BOOL)rewind { [NGStreamException raiseWithStream:self reason:@"marking not supported"]; return NO; } - (BOOL)markSupported { return NO; } /* convenience methods */ - (int)readByte { return NGReadByteFromStream(self); } /* description */ - (NSString *)modeDescription { NSString *result = @"unknown"; switch ([self mode]) { case NGStreamMode_undefined: result = @"undefined"; break; case NGStreamMode_readOnly: result = @"r"; break; case NGStreamMode_writeOnly: result = @"w"; break; case NGStreamMode_readWrite: result = @"rw"; break; default: [NGUnknownStreamModeException raiseWithStream:self]; break; } return result; } - (NSString *)description { return [NSString stringWithFormat: @"<%@[0x%p] mode=%@>", NSStringFromClass([self class]), self, [self modeDescription]]; } @end /* NGStream */ @implementation NGStream(DataMethods) - (NSData *)readDataOfLength:(unsigned int)_length { unsigned readCount; char buf[_length]; if (_length == 0) return [NSData data]; readCount = [self readBytes:buf count:_length]; if (readCount == NGStreamError) return nil; return [NSData dataWithBytes:buf length:readCount]; } - (NSData *)safeReadDataOfLength:(unsigned int)_length { char buf[_length]; if (_length == 0) return [NSData data]; if (![self safeReadBytes:buf count:_length]) return nil; return [NSData dataWithBytes:buf length:_length]; } - (unsigned int)writeData:(NSData *)_data { return [self writeBytes:[_data bytes] count:[_data length]]; } - (BOOL)safeWriteData:(NSData *)_data { return [self safeWriteBytes:[_data bytes] count:[_data length]]; } @end /* NGStream(DataMethods) */ // concrete implementations as functions int NGReadByteFromStream(id _stream) { volatile int result = -1; unsigned char c; NS_DURING { int l; l = [_stream readBytes:&c count:sizeof(unsigned char)]; if (l == NGStreamError) { NSException *e = [(id)_stream lastException]; if ([e isKindOfClass:[NGEndOfStreamException class]]) *(&result) = -1; else [e raise]; } else *(&result) = c; } NS_HANDLER { if ([localException isKindOfClass:[NGEndOfStreamException class]]) *(&result) = -1; else [localException raise]; } NS_ENDHANDLER; return result; } BOOL NGSafeReadBytesFromStream(id _in, void *_buf, unsigned _len){ volatile int toBeRead; volatile int readResult; volatile NGIOReadMethodType readBytes; *(&toBeRead) = _len; readBytes = (NGIOReadMethodType) [(NSObject *)_in methodForSelector:@selector(readBytes:count:)]; NS_DURING { void *pos = _buf; while (YES) { *(&readResult) = (unsigned)readBytes(_in, @selector(readBytes:count:), pos, toBeRead); if (readResult == NGStreamError) { /* TODO: improve exception handling ... */ [[(id)_in lastException] raise]; } else if (readResult == toBeRead) { // all bytes were read successfully, return break; } if (readResult < 1) { [NSException raise:NSInternalInconsistencyException format:@"readBytes:count: returned a value < 1"]; } toBeRead -= readResult; pos += readResult; } } NS_HANDLER { if ([localException isKindOfClass:[NGEndOfStreamException class]]) { [[[NGEndOfStreamException alloc] initWithStream:(id)_in readCount:(_len - toBeRead) safeCount:_len data:[NSData dataWithBytes:_buf length:(_len - toBeRead)]] raise]; } else { [localException raise]; } } NS_ENDHANDLER; return YES; } BOOL NGSafeWriteBytesToStream(id _o,const void *_b,unsigned _l) { int toBeWritten = _l; int writeResult; void *pos = (void *)_b; NGIOWriteMethodType writeBytes; writeBytes = (NGIOWriteMethodType) [(NSObject *)_o methodForSelector:@selector(writeBytes:count:)]; while (YES) { writeResult = (int)writeBytes(_o, @selector(writeBytes:count:), pos, toBeWritten); if (writeResult == NGStreamError) { /* remember number of written bytes ??? */ return NO; } else if (writeResult == toBeWritten) { // all bytes were written successfully, return break; } if (writeResult < 1) { [NSException raise:NSInternalInconsistencyException format:@"writeBytes:count: returned a value<1 in %@", _o]; } toBeWritten -= writeResult; pos += writeResult; } return YES; } SOPE/sope-core/NGStreams/NGByteBuffer.m0000644000000000000000000002120012242733417016521 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NGByteBuffer.h" #include "common.h" #include typedef struct NGByteBufferLA { unsigned char byte; char isEOF:1; char isFetched:1; } LA_NGByteBuffer; @implementation NGByteBuffer static BOOL ProfileByteBuffer = NO; static Class DataStreamClass = Nil; + (void)initialize { NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; static BOOL didInit = NO; if (didInit) return; didInit = YES; ProfileByteBuffer = [ud boolForKey:@"ProfileByteBufferEnabled"]; DataStreamClass = NSClassFromString(@"NGDataStream"); } + (int)version { return [super version] + 1; } + (id)byteBufferWithSource:(id)_source la:(unsigned)_la { if (_source == nil) return nil; if (*(Class *)_source == DataStreamClass) return _source; return [[[self alloc] initWithSource:_source la:_la] autorelease]; } - (id)initWithSource:(id)_source la:(unsigned)_la { if (_source == nil) { [self release]; return nil; } if (*(Class *)_source == DataStreamClass) { [self release]; return [_source retain]; } if ((self = [super initWithSource:_source])) { unsigned size = 0; if (_la < 1) { [NSException raise:NSRangeException format:@"lookahead depth is less than one (%d)", _la]; } // Find first power of 2 >= to requested size for (size = 2; size < _la; size *=2); self->la = malloc(sizeof(LA_NGByteBuffer) * size + 4); memset(self->la, 0, sizeof(LA_NGByteBuffer) * size); self->bufLen = size; self->sizeLessOne = self->bufLen - 1; self->headIdx = 0; self->wasEOF = NO; if ([self->source respondsToSelector:@selector(methodForSelector:)]) { self->readByte = (int(*)(id, SEL)) [(NSObject *)self->source methodForSelector:@selector(readByte)]; } if ([self respondsToSelector:@selector(methodForSelector:)]) { self->laFunction = (int(*)(id, SEL, unsigned)) [(NSObject *)self methodForSelector:@selector(la:)]; } } return self; } - (id)init { [self release]; [self doesNotRecognizeSelector:_cmd]; return nil; } - (id)initWithSource:(id)_source { [self release]; [self doesNotRecognizeSelector:_cmd]; return nil; } - (id)initWithInputSource:(id)_source { [self release]; [self doesNotRecognizeSelector:_cmd]; return nil; } - (id)initWithOutputSource:(id)_source { [self release]; [self doesNotRecognizeSelector:_cmd]; return nil; } - (void)dealloc { if (self->la) free(self->la); [super dealloc]; } /* operations */ - (int)readByte { int byte = (self->laFunction == NULL) ? [self la:0] : self->laFunction(self, @selector(la:), 0); [self consume]; return byte; } - (unsigned)readBytes:(void *)_buf count:(unsigned)_len { if (_len == 0) return 0; if (!(self->la[(self->headIdx & self->sizeLessOne)].isFetched)) { int byte = [self readByte]; if (byte == -1) [NGEndOfStreamException raiseWithStream:self->source]; ((char *)_buf)[0] = byte; return 1; } else { unsigned cnt = 0; int idxCnt = self->headIdx & sizeLessOne; unsigned char buffer[self->bufLen]; while (self->la[idxCnt].isFetched && cnt < _len && cnt < bufLen) { buffer[cnt] = self->la[idxCnt].byte; cnt++; idxCnt = (cnt + self->headIdx) & sizeLessOne; } memcpy(_buf, buffer, cnt); [self consume:cnt]; return cnt; } return 0; } - (int)la:(unsigned)_la { // TODO: huge method, should be split up volatile unsigned result, idx; unsigned i = 0; result = -1; *(&idx) = (_la + self->headIdx) & self->sizeLessOne; if (_la > self->sizeLessOne) { [NSException raise:NSRangeException format:@"tried to look ahead too far (la=%d, max=%d)", _la, self->bufLen]; } if (self->wasEOF) { result = (!self->la[idx].isFetched || self->la[idx].isEOF) ? -1 : self->la[idx].byte; return result; } if (self->la[idx].isFetched) { result = (self->la[idx].isEOF) ? -1 : self->la[idx].byte; return result; } *(&i) = 0; for (i = 0; i < _la && self->la[(self->headIdx + i) & self->sizeLessOne].isFetched; i++); /* If we should read more than 5 bytes, we take the time costs of an exception handler */ if ((_la - i + 1) <= 5) { while (i <= _la) { #if DEBUG struct timeval tv; double ti = 0.0; #endif int byte = 0; #if DEBUG if (ProfileByteBuffer) { gettimeofday(&tv, NULL); ti = (double)tv.tv_sec + ((double)tv.tv_usec / 1000000.0); } #endif byte = (self->readByte == NULL) ? [self->source readByte] : (int)self->readByte(self->source, @selector(readByte)); #if DEBUG if (ProfileByteBuffer) { gettimeofday(&tv, NULL); ti = (double)tv.tv_sec + ((double)tv.tv_usec / 1000000.0) - ti; if (ti > 0.01) { fprintf(stderr, "[%s] : time " "needed: %4.4fs\n", __PRETTY_FUNCTION__, ti < 0.0 ? -1.0 : ti); } } #endif if (byte == -1) { // EOF was reached self->wasEOF = YES; break; } else { int ix = (self->headIdx + i) & self->sizeLessOne; self->la[ix].byte = byte; self->la[ix].isFetched = 1; } i++; } } else { BOOL readStream = YES; NSException *exc = nil; while (readStream) { int cntReadBytes = 0; int cnt = 0; int desiredBytes = _la - i+1; char *tmpBuffer; // TODO: check whether malloc is used for sufficiently large blocks! tmpBuffer = malloc(desiredBytes + 2); cntReadBytes = (self->readBytes == NULL) ? [self->source readBytes:tmpBuffer count:desiredBytes] : self->readBytes(self->source, @selector(readBytes:count:), tmpBuffer, desiredBytes); if (cntReadBytes == NGStreamError) { exc = [[self->source lastException] retain]; break; } else { if (cntReadBytes == desiredBytes) readStream = NO; cnt = 0; while (cntReadBytes > 0) { int ix = (self->headIdx + i) & self->sizeLessOne; self->la[ix].byte = tmpBuffer[cnt]; self->la[ix].isFetched = 1; i++; cnt++; cntReadBytes--; } } if (tmpBuffer) free(tmpBuffer); } if (exc) { if (![exc isKindOfClass:[NGEndOfStreamException class]]) { [self setLastException:exc]; return NGStreamError; } self->wasEOF = YES; } } if (self->wasEOF) { while (i <= _la) { self->la[(self->headIdx + i) & self->sizeLessOne].isEOF = YES; i++; } } result = (self->la[idx].isEOF) ? -1 : self->la[idx].byte; return result; } - (void)consume { int idx = self->headIdx & sizeLessOne; if (!(self->la[idx].isFetched)) { (self->laFunction == NULL) ? [self la:0] : self->laFunction(self, @selector(la:), 0); } self->la[idx].isFetched = 0; self->headIdx++; } - (void)consume:(unsigned)_cnt { while (_cnt > 0) { int idx = self->headIdx & sizeLessOne; if (!(self->la[idx].isFetched)) (self->laFunction == NULL) ? [self la:0] : self->laFunction(self, @selector(la:), 0); self->la[idx].isFetched = 0; self->headIdx++; _cnt--; } } /* description */ - (NSString *)description { NSMutableString *ms; ms = [NSMutableString stringWithCapacity:128]; [ms appendFormat:@"<0x%p[%@]:", self, NSStringFromClass([self class])]; if (self->source) [ms appendFormat:@" source=%@", self->source]; [ms appendFormat:@" mode=%@", [self modeDescription]]; [ms appendFormat:@" la=%d", self->bufLen]; [ms appendString:@">"]; return ms; } @end /* NGByteBuffer */ SOPE/sope-core/NGStreams/NGSocketExceptions.m0000644000000000000000000001672112242733417017772 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import #import #import #include "NGSocketExceptions.h" @implementation NGSocketException - (id)init { return [self initWithReason:@"a socket exception occured" socket:nil]; } - (id)initWithReason:(NSString *)_reason { return [self initWithReason:_reason socket:nil]; } - (id)initWithReason:(NSString *)_reason socket:(id)_socket { self = [super initWithName:NSStringFromClass([self class]) reason:_reason userInfo:nil]; if (self) { self->socket = [_socket retain]; } return self; } - (void)dealloc { [self->socket release]; [super dealloc]; } - (id)socket { return self->socket; } @end /* NGSocketException */ @implementation NGCouldNotResolveHostNameException - (id)init { return [self initWithHostName:@"" reason:nil]; } - (id)initWithHostName:(NSString *)_name reason:(NSString *)_reason { NSString *r; r = [[NSString alloc] initWithFormat:@"Could not resolve host %@: %@", _name, _reason ? _reason : (NSString *)@"error"]; if ((self = [super initWithReason:r socket:nil]) != nil) { self->hostName = [_name copy]; } [r release]; r = nil; return self; } - (void)dealloc { [self->hostName release]; [super dealloc]; } /* accessors */ - (NSString *)hostName { return self->hostName; } @end /* NGCouldNotResolveHostNameException */ @implementation NGDidNotFindServiceException - (id)init { return [self initWithServiceName:nil]; } - (id)initWithServiceName:(NSString *)_service { self = [super initWithReason: [NSString stringWithFormat:@"did not find service %@", _service] socket:nil]; if (self) { self->serviceName = [_service copy]; } return self; } - (void)dealloc { [self->serviceName release]; [super dealloc]; } - (NSString *)serviceName { return self->serviceName; } @end /* NGDidNotFindServiceException */ @implementation NGInvalidSocketDomainException - (id)initWithReason:(NSString *)_reason socket:(id)_socket domain:(id)_domain { if ((self = [super initWithReason:_reason socket:nil])) { self->domain = [_domain retain]; } return self; } - (void)dealloc { [self->domain release]; [super dealloc]; } - (id)domain { return self->domain; } @end /* NGInvalidSocketDomainException */ @implementation NGCouldNotCreateSocketException - (id)init { return [self initWithReason:@"Could not create socket" domain:nil]; } - (id)initWithReason:(NSString *)_reason domain:(id)_domain { if ((self = [super initWithReason:_reason socket:nil])) { self->domain = [_domain retain]; } return self; } - (void)dealloc { [self->domain release]; [super dealloc]; } - (id)domain { return self->domain; } @end /* NGCouldNotCreateSocketException */ // ******************** bind *********************** @implementation NGSocketBindException @end /* NGSocketBindException */ @implementation NGSocketAlreadyBoundException - (id)init { return [self initWithReason:@"Socket is already bound"]; } @end /* NGSocketAlreadyBoundException */ @implementation NGCouldNotBindSocketException - (id)init { return [self initWithReason:@"could not bind socket" socket:nil address:nil]; } - (id)initWithReason:(NSString *)_reason socket:(id)_socket address:(id)_address { if ((self = [super initWithReason:_reason socket:_socket])) { self->address = [_address retain]; } return self; } - (void)dealloc { [self->address release]; [super dealloc]; } - (id)address { return self->address; } @end /* NGCouldNotBindSocketException */ // ******************** connect ******************** @implementation NGSocketConnectException @end /* NGSocketConnectException */ @implementation NGSocketNotConnectedException - (id)init { return [self initWithReason:@"Socket is not connected"]; } @end /* NGSocketNotConnectedException */ @implementation NGSocketAlreadyConnectedException - (id)init { return [self initWithReason:@"Socket is already connected"]; } @end /* NGSocketAlreadyConnectedException */ @implementation NGCouldNotConnectException - (id)init { return [self initWithReason:@"could not connect socket" socket:nil address:nil]; } - (id)initWithReason:(NSString *)_reason socket:(id)_socket address:(id)_address { if ((self = [super initWithReason:_reason socket:_socket])) { self->address = [_address retain]; } return self; } - (void)dealloc { [self->address release]; [super dealloc]; } - (id)address { return self->address; } @end /* NGCouldNotConnectException */ // ******************** listen ******************** @implementation NGSocketIsAlreadyListeningException - (id)init { return [self initWithReason:@"Socket is already listening"]; } @end /* NGSocketIsAlreadyListeningException */ @implementation NGCouldNotListenException @end /* NGCouldNotListenException */ // ******************** accept ******************** @implementation NGCouldNotAcceptException @end /* NGCouldNotAcceptException */ // ******************** options ******************** @implementation NGSocketOptionException - (id)init { return [self initWithReason:@"Could not get/set socket option" option:-1 level:-1]; } - (id)initWithReason:(NSString *)_reason option:(int)_option level:(int)_level { if ((self = [super initWithReason:_reason])) { option = _option; level = _level; } return self; } - (int)option { return option; } - (int)level { return level; } @end /* NGSocketOptionException */ @implementation NGCouldNotSetSocketOptionException @end /* NGCouldNotSetSocketOptionException */ @implementation NGCouldNotGetSocketOptionException @end /* NGCouldNotGetSocketOptionException */ // ******************** socket closed ************** @implementation NGSocketShutdownException - (id)init { return [self initWithStream:nil reason:@"the socket was shutdown"]; } - (id)initWithReason:(NSString *)_reason { return [self initWithStream:nil reason:_reason]; } - (id)initWithReason:(NSString *)_reason socket:(id)_socket { return [self initWithStream:_socket reason:_reason]; } - (id)initWithSocket:(id)_socket { return [self initWithStream:_socket reason:@"the socket was shutdown"]; } /* accessors */ - (id)socket { return [self->streamPointer nonretainedObjectValue]; } @end /* NGSocketShutdownException */ @implementation NGSocketShutdownDuringReadException @end @implementation NGSocketShutdownDuringWriteException @end @implementation NGSocketTimedOutException @end @implementation NGSocketConnectionResetException @end SOPE/sope-core/NGStreams/config.guess0000755000000000000000000012763712242733417016426 0ustar rootroot#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 # Free Software Foundation, Inc. timestamp='2009-12-30' # This file 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., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner. Please send patches (context # diff format) to and include a ChangeLog # entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[456]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else echo ${UNAME_MACHINE}-unknown-linux-gnueabi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in i386) eval $set_cc_for_build if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then UNAME_PROCESSOR="x86_64" fi fi ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp 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` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: SOPE/sope-core/NGStreams/configure.in0000644000000000000000000000524312242733417016403 0ustar rootrootAC_PREREQ(2.4) AC_INIT(NGStream.m) # Determine the host, build, and target systems CC_TARGET=$target # use --target value for CC, not the canonical form AC_CANONICAL_SYSTEM AC_CONFIG_HEADER(config.h:config.h.in) AC_PREFIX_DEFAULT(/usr/local) # check for cross compilation if test "x$target" = "xNONE"; then set target $host fi if test "x$host" != "x$target"; then cross_defines="CROSS=-DCROSS_COMPILE" cross_compiling="yes" echo "cross compiling from $host to $target .." AC_CHECK_PROG(CC, "${CC_TARGET}-gcc", "${CC_TARGET}-gcc", gcc) AC_CHECK_PROG(RANLIB, "${CC_TARGET}-ranlib", "${CC_TARGET}-ranlib", ranlib) AC_CHECK_PROG(AR, "${CC_TARGET}-ar", "${CC_TARGET}-ar", ar) AC_CHECK_PROG(DLLTOOL, "${CC_TARGET}-dlltool", "${CC_TARGET}-dlltool", dlltool) CC=${CC_TARGET}-gcc LD=${CC_TARGET}-ld AR=${CC_TARGET}-ar RANLIB=${CC_TARGET}-ranlib else AC_CHECK_PROG(CC, "gcc", "gcc", gcc) AC_CHECK_PROG(RANLIB, "ranlib", "ranlib", ranlib) AC_CHECK_PROG(AR, "ar", "ar", ar) AC_CHECK_PROG(DLLTOOL, "dlltool", "dlltool", dlltool) fi changequote(,)dnl case "${host_cpu}" in i[45]86*) host_cpu=i386;; hppa1.1) host_cpu=hppa;; esac if test "x$cross_compiling" = "xyes"; then case "${target_cpu}" in i[45]86*) target_cpu=i386;; hppa1.1) target_cpu=hppa;; esac else target_cpu=${host_cpu} target_os=${host_os} target_vendor=${host_vendor} fi case "x${target_os}" in xfreebsd*) target_os=freebsd;; esac changequote([,])dnl # Assign the HOST variables for sharedlib.mak HOST=$host HOST_CPU=$host_cpu HOST_VENDOR=$host_vendor HOST_OS=$host_os TARGET=$target TARGET_CPU=$target_cpu TARGET_VENDOR=$target_vendor TARGET_OS=$target_os AC_CHECK_LIB(nsl, chown) AC_CHECK_LIB(socket, accept) AC_CHECK_LIB(wsock32) AC_CHECK_LIB(advapi32) AC_HEADER_DIRENT AC_HAVE_HEADERS(dir.h libc.h time.h stdlib.h memory.h string.h dnl strings.h sys/stat.h sys/fcntl.h fcntl.h dnl sys/vfs.h sys/statfs.h sys/statvfs.h dnl netinet/in.h windows.h winsock.h sys/socket.h dnl Windows32/Sockets.h pwd.h process.h grp.h sys/param.h dnl sys/file.h sys/errno.h sys/select.h sys/poll.h poll.h dnl sys/time.h sys/types.h dnl sys/ioctl.h sys/filio.h dnl netdb.h unistd.h unistd.h limits.h) AC_HEADER_SYS_WAIT AC_CHECK_FUNCS(memcpy getcwd kill poll isatty ttyname ttyname_r dnl gethostbyname_r gethostbyaddr_r gethostent_r) AC_FUNC_MMAP AC_FUNC_VFORK # uses AC_TRY_RUN if test "$cross_compiling" = yes; then echo "WARNING: cannot check for restartable system calls during cross compilation." else AC_SYS_RESTARTABLE_SYSCALLS fi AC_OUTPUT SOPE/sope-core/NGStreams/NGBufferedStream.m0000644000000000000000000003167612242733417017404 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include "common.h" #define NEWLINE_CHAR '\n' #define WRITE_WARN_SIZE (1024 * 1024 * 100) /* 100MB */ @implementation NGBufferedStream static const unsigned DEFAULT_BUFFER_SIZE = 512; static Class DataStreamClass = Nil; + (void)initialize { DataStreamClass = NSClassFromString(@"NGDataStream"); } // returns the number of bytes which where read from the buffer #define numberOfConsumedReadBufferBytes(self) \ ((self->readBufferSize == 0) ? 0 : (self->readBufferPos - self->readBuffer)) // returns the number of bytes which can be read from buffer (without source access) #define numberOfAvailableReadBufferBytes(self) \ (self->readBufferFillSize - numberOfConsumedReadBufferBytes(self)) // look whether all bytes in the buffer where consumed, if so, reset the buffer #define checkReadBufferFillState(self) \ if (numberOfAvailableReadBufferBytes(self) == 0) { \ self->readBufferPos = self->readBuffer; \ self->readBufferFillSize = 0; \ } // ******************** constructors ******************** + (id)filterWithSource:(id)_source bufferSize:(unsigned)_size { if (_source == nil) return nil; if (*(Class *)_source == DataStreamClass) return _source; return [[[self alloc] initWithSource:_source bufferSize:_size] autorelease]; } // TODO: can we reduced duplicate code here ... - (id)initWithSource:(id)_source bufferSize:(unsigned)_size { if (_source == nil) { [self release]; return nil; } if (*(Class *)_source == DataStreamClass) { [self release]; return [_source retain]; } if ((self = [super initWithSource:_source])) { self->readBuffer = calloc(_size, 1); self->writeBuffer = calloc(_size, 1); self->readBufferPos = self->readBuffer; self->readBufferSize = _size; self->readBufferFillSize = 0; // no bytes are read from source self->writeBufferFillSize = 0; self->writeBufferSize = _size; self->flags._flushOnNewline = 1; } return self; } - (id)initWithInputSource:(id)_source bufferSize:(unsigned)_s { if (_source == nil) { [self release]; return nil; } if (*(Class *)_source == DataStreamClass) { [self release]; return [_source retain]; } if ((self = [super initWithInputSource:_source])) { self->readBuffer = calloc(_s, 1); self->readBufferPos = self->readBuffer; self->readBufferSize = _s; self->readBufferFillSize = 0; // no bytes are read from source self->flags._flushOnNewline = 1; } return self; } - (id)initWithOutputSource:(id)_src bufferSize:(unsigned)_s { if (_src == nil) { [self release]; return nil; } if (*(Class *)_src == DataStreamClass) { [self release]; return [_src retain]; } if ((self = [super initWithOutputSource:_src])) { self->writeBuffer = calloc(_s, 1); self->writeBufferFillSize = 0; self->writeBufferSize = _s; self->flags._flushOnNewline = 1; } return self; } - (id)initWithSource:(id)_source { return [self initWithSource:_source bufferSize:DEFAULT_BUFFER_SIZE]; } - (id)initWithInputSource:(id)_source { return [self initWithInputSource:_source bufferSize:DEFAULT_BUFFER_SIZE]; } - (id)initWithOutputSource:(id)_source { return [self initWithOutputSource:_source bufferSize:DEFAULT_BUFFER_SIZE]; } - (void)dealloc { [self flush]; if (self->readBuffer) { free(self->readBuffer); self->readBuffer = NULL; self->readBufferPos = NULL; } self->readBufferFillSize = 0; self->readBufferSize = 0; if (self->writeBuffer) { free(self->writeBuffer); self->writeBuffer = NULL; } self->writeBufferFillSize = 0; self->writeBufferSize = 0; [super dealloc]; } /* accessors */ - (void)setReadBufferSize:(unsigned)_size { [self flush]; if (_size == self->readBufferSize) return; if (_size == 0) { if (self->readBuffer != NULL) { free(self->readBuffer); self->readBuffer = NULL; } self->readBufferSize = _size; self->readBufferPos = NULL; } else { if (self->readBuffer != NULL) self->readBuffer = realloc(self->readBuffer, _size); else self->readBuffer = calloc(_size, 1); self->readBufferSize = _size; self->readBufferPos = self->readBuffer; self->readBufferFillSize = 0; // no bytes a read from source } } - (unsigned)readBufferSize { return self->readBufferSize; } - (void)setWriteBufferSize:(unsigned)_size { [self flush]; if (_size == self->writeBufferSize) return; self->writeBuffer = realloc(self->writeBuffer, _size); self->writeBufferSize = _size; } - (unsigned)writeBufferSize { return self->writeBufferSize; } /* blocking .. */ - (BOOL)wouldBlockInMode:(NGStreamMode)_mode { BOOL canRead, canWrite; if (self->readBufferSize == 0) canRead = NO; else canRead = (numberOfAvailableReadBufferBytes(self) > 0); canWrite = (self->writeBufferSize == 0) ? NO : (self->writeBufferFillSize > 0); if ((_mode == NGStreamMode_readWrite) && canRead && canWrite) return NO; if ((_mode == NGStreamMode_readOnly) && canRead) { return NO; } if ((_mode == NGStreamMode_writeOnly) && canWrite) return NO; return ([self->source respondsToSelector:@selector(wouldBlockInMode:)]) ? [(id)self->source wouldBlockInMode:_mode] : YES; } /* primitives */ - (unsigned)readBytes:(void *)_buf count:(unsigned)_len { register unsigned availBytes = numberOfAvailableReadBufferBytes(self); if (self->readBufferSize == 0) { // no read buffering is done (buffersize==0) return (readBytes != NULL) ? readBytes(source, _cmd, _buf, _len) : [source readBytes:_buf count:_len]; } if (availBytes >= _len) { // there are enough bytes in the buffer to fulfill the request if (_len == 1) { *(unsigned char *)_buf = *(unsigned char *)self->readBufferPos; self->readBufferPos++; } else { memcpy(_buf, self->readBufferPos, _len); self->readBufferPos += _len; // update read position (consumed-size) } checkReadBufferFillState(self); // check whether all bytes where consumed return _len; } else if (availBytes > 0) { // there are some bytes in the buffer, these are returned memcpy(_buf, self->readBufferPos, availBytes);// copy all bytes from buffer self->readBufferPos = self->readBuffer; // reset position self->readBufferFillSize = 0; // no bytes available in buffer anymore return availBytes; } else if (_len > self->readBufferSize) { /* requested _len is bigger than the buffersize, so we can bypass the buffer (which is empty, as guaranteed by the previous 'ifs' */ NSAssert(self->readBufferPos == self->readBuffer, @"read buffer position is not reset"); NSAssert(self->readBufferFillSize == 0, @"there are bytes in the buffer"); availBytes = (readBytes != NULL) ? (unsigned)readBytes(source, _cmd, _buf, _len) : [source readBytes:_buf count:_len]; if (availBytes == NGStreamError) return NGStreamError; NSAssert(availBytes != 0, @"readBytes:count: may never return zero !"); return availBytes; // return the number of bytes which could be read } else { /* no bytes are available and the requested _len is smaller than the possible buffer size, we have to read the next block of input from the source */ NSAssert(self->readBufferPos == self->readBuffer, @"read buffer position is not reset"); NSAssert(self->readBufferFillSize == 0, @"there are bytes in the buffer"); self->readBufferFillSize = (readBytes != NULL) ? (unsigned)readBytes(source,_cmd, self->readBuffer,self->readBufferSize) : [source readBytes:self->readBuffer count:self->readBufferSize]; if (self->readBufferFillSize == NGStreamError) { self->readBufferFillSize = 0; return NGStreamError; } NSAssert(self->readBufferFillSize != 0, @"readBytes:count: may never return zero !"); /* now comes a section which is roughly the same like the first to conditionals in this method */ if (self->readBufferFillSize >= _len) { // there are enough bytes in the buffer to fulfill the request memcpy(_buf, self->readBufferPos, _len); self->readBufferPos += _len; // update read position (consumed-size) checkReadBufferFillState(self); // check whether all bytes where consumed return _len; } else { // (readBufferFillSize > 0) (this is ensured by the above assert) // there are some bytes in the buffer, these are returned availBytes = self->readBufferFillSize; // copy all bytes from buffer memcpy(_buf, self->readBufferPos, self->readBufferFillSize); self->readBufferPos = self->readBuffer; // reset position self->readBufferFillSize = 0; // no bytes available in buffer anymore return availBytes; } } } - (int)readByte { if (self->readBufferSize == 0) // no read buffering is done (buffersize==0) return [super readByte]; if (numberOfAvailableReadBufferBytes(self) >= 1) { unsigned char byte = *(unsigned char *)self->readBufferPos; self->readBufferPos++; checkReadBufferFillState(self); // check whether all bytes where consumed return byte; } return [super readByte]; } - (unsigned)writeBytes:(const void *)_buf count:(unsigned)_len { register unsigned tmp = 0; register unsigned remaining = _len; register void *track = (void *)_buf; #if DEBUG if (_len > WRITE_WARN_SIZE) { NSLog(@"WARNING(%s): got passed in length %uMB (%u bytes, errcode=%u) ...", __PRETTY_FUNCTION__, (_len / 1024 / 1024), _len, NGStreamError); } #endif while (remaining > 0) { // how much bytes available in buffer ? tmp = self->writeBufferSize - self->writeBufferFillSize; tmp = (tmp > remaining) ? remaining : tmp; memcpy((self->writeBuffer + self->writeBufferFillSize), track, tmp); track += tmp; remaining -= tmp; self->writeBufferFillSize += tmp; if (self->writeBufferFillSize == self->writeBufferSize) { BOOL ok; ok = [self->source safeWriteBytes:self->writeBuffer count:self->writeBufferFillSize]; if (!ok) return NGStreamError; self->writeBufferFillSize = 0; } } if (self->flags._flushOnNewline == 1) { // scan buffer for newlines, if one is found, flush buffer for (tmp = 0; tmp < _len; tmp++) { if (tmp == NEWLINE_CHAR) { if (![self flush]) return NGStreamError; break; } } } /* clean up for GC */ tmp = 0; track = NULL; // clean up for GC remaining = 0; return _len; } - (BOOL)close { if (![self flush]) return NO; if (self->readBuffer) { free(self->readBuffer); self->readBuffer = NULL; self->readBufferPos = NULL; } self->readBufferFillSize = 0; self->readBufferSize = 0; if (self->writeBuffer) { free(self->writeBuffer); self->writeBuffer = NULL; } self->writeBufferFillSize = 0; self->writeBufferSize = 0; return [super close]; } - (BOOL)flush { if (self->writeBufferFillSize > 0) { BOOL ok; #if DEBUG if (self->writeBufferFillSize > WRITE_WARN_SIZE) { NSLog(@"WARNING(%s): shall flush %uMB (%u bytes, errcode=%u) ...", __PRETTY_FUNCTION__, (self->writeBufferFillSize/1024/1024), self->writeBufferFillSize, NGStreamError); //abort(); } #endif ok = [self->source safeWriteBytes:self->writeBuffer count:self->writeBufferFillSize]; if (!ok) { /* should check exception for fill size ? ... */ return NO; } self->writeBufferFillSize = 0; } return YES; } @end /* NGBufferedStream */ @implementation NGStream(NGBufferedStreamExtensions) - (NGBufferedStream *)bufferedStream { return [NGBufferedStream filterWithSource:self]; } @end /* NGStream(NGBufferedStreamExtensions) */ @implementation NGBufferedStream(NGBufferedStreamExtensions) - (NGBufferedStream *)bufferedStream { return self; } @end /* NGBufferedStream(NGBufferedStreamExtensions) */ SOPE/sope-core/NGStreams/NGBase64Stream.m0000644000000000000000000002310212242733417016667 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include "common.h" static inline BOOL isbase64(char a) { if (('A' <= a) && (a <= 'Z')) return YES; if (('a' <= a) && (a <= 'z')) return YES; if (('0' <= a) && (a <= '9')) return YES; if ((a == '+') || (a == '/')) return YES; return NO; } @implementation NGBase64Stream // ******************** decoding ******************** static char dmap[256] = { 127, 127, 127, 127, 127, 127, 127, 127, // 000-007 127, 127, 127, 127, 127, 127, 127, 127, // 010-017 127, 127, 127, 127, 127, 127, 127, 127, // 020-027 127, 127, 127, 127, 127, 127, 127, 127, // 030-037 127, 127, 127, 127, 127, 127, 127, 127, // 040-047 !"#$%&' 127, 127, 127, 62, 127, 127, 127, 63, // 050-057 ()*+,-./ 52, 53, 54, 55, 56, 57, 58, 59, // 060-067 01234567 60, 61, 127, 127, 127, 126, 127, 127, // 070-077 89:;<=>? 127, 0, 1, 2, 3, 4, 5, 6, // 100-107 @ABCDEFG 7, 8, 9, 10, 11, 12, 13, 14, // 110-117 HIJKLMNO 15, 16, 17, 18, 19, 20, 21, 22, // 120-127 PQRSTUVW 23, 24, 25, 127, 127, 127, 127, 127, // 130-137 XYZ[\]^_ 127, 26, 27, 28, 29, 30, 31, 32, // 140-147 `abcdefg 33, 34, 35, 36, 37, 38, 39, 40, // 150-157 hijklmno 41, 42, 43, 44, 45, 46, 47, 48, // 160-167 pqrstuvw 49, 50, 51, 127, 127, 127, 127, 127, // 170-177 xyz{|}~ 127, 127, 127, 127, 127, 127, 127, 127, // 200-207 127, 127, 127, 127, 127, 127, 127, 127, // 210-217 127, 127, 127, 127, 127, 127, 127, 127, // 220-227 127, 127, 127, 127, 127, 127, 127, 127, // 230-237 127, 127, 127, 127, 127, 127, 127, 127, // 240-247 127, 127, 127, 127, 127, 127, 127, 127, // 250-257 127, 127, 127, 127, 127, 127, 127, 127, // 260-267 127, 127, 127, 127, 127, 127, 127, 127, // 270-277 127, 127, 127, 127, 127, 127, 127, 127, // 300-307 127, 127, 127, 127, 127, 127, 127, 127, // 310-317 127, 127, 127, 127, 127, 127, 127, 127, // 320-327 127, 127, 127, 127, 127, 127, 127, 127, // 330-337 127, 127, 127, 127, 127, 127, 127, 127, // 340-347 127, 127, 127, 127, 127, 127, 127, 127, // 350-357 127, 127, 127, 127, 127, 127, 127, 127, // 360-367 127, 127, 127, 127, 127, 127, 127, 127, // 370-377 }; - (unsigned)readBytes:(void *)_buf count:(unsigned)_len { unsigned char chunk[4]; // input buffer unsigned char chunkLen; // input buffer length unsigned readLen = 0; if (self->decBufferLen == 0) { // no bytes in buffer, read next token register unsigned value; { volatile unsigned pos = 0, toGo = 4; char tmp[4]; memset(chunk, 126, sizeof(chunk)); // set all EOF NS_DURING { do { unsigned readCount = 0; unsigned char i; readCount = [super readBytes:tmp count:toGo]; NSAssert(readCount != 0, @"invalid result from readBytes:count:"); for (i = 0; i < readCount; i++) { if (isbase64(tmp[(int)i])) { chunk[pos] = tmp[(int)i]; pos++; toGo--; } } } while (toGo > 0); } NS_HANDLER { if ([localException isKindOfClass:[NGEndOfStreamException class]]) { if (pos == 0) [localException raise]; } else [localException raise]; } NS_ENDHANDLER; chunkLen = pos; } NSAssert(chunkLen > 0, @"invalid chunk len (should have thrown EOF) .."); if (chunkLen == 4) { // complete token NSCAssert(self->decBufferLen == 0, @"data pending in buffer .."); NSCAssert(chunkLen == 4, @"invalid chunk size .."); value = ((dmap[chunk[0]] << 18) | (dmap[chunk[1]] << 12) | (dmap[chunk[2]] << 6) | (dmap[chunk[3]])); self->decBuffer[0] = (unsigned char)(0xFF & (value >> 16)); self->decBuffer[1] = (unsigned char)(0xFF & (value >> 8)); self->decBuffer[2] = (unsigned char)(0xFF & (value)); self->decBufferLen = 3; } else { unsigned char b0 = dmap[chunk[0]]; unsigned char b1 = dmap[chunk[1]]; unsigned char b2 = dmap[chunk[2]]; unsigned char b3 = dmap[chunk[3]]; char eqCount = 0; // number of equal signs NSCAssert(self->decBufferLen == 0, @"data pending in buffer .."); if (b0 == 126) { b0 = 0; eqCount++; } if (b1 == 126) { b1 = 0; eqCount++; } if (b2 == 126) { b2 = 0; eqCount++; } if (b3 == 126) { b3 = 0; eqCount++; } value = ((b0 << 18) | (b1 << 12) | (b2 << 6) | (b3)); self->decBuffer[0] = (unsigned char)(value >> 16); self->decBufferLen = 1; if (eqCount <= 1) { self->decBuffer[1] = (unsigned char)((value >> 8) & 0xFF); self->decBufferLen = 2; if (eqCount == 0) { self->decBuffer[2] = (unsigned char)((value & 0xFF)); self->decBufferLen = 3; } } } NSAssert((self->decBufferLen > 0) && (self->decBufferLen < 4), @"invalid result length .."); } // copy decoded bytes to output buffer if (_len >= self->decBufferLen) { readLen = self->decBufferLen; memcpy(_buf, self->decBuffer, readLen); self->decBufferLen = 0; } else { readLen = _len; NSAssert((readLen > 0) && (readLen < 3), @"invalid length .."); if (readLen == 1) { *(char *)_buf = self->decBuffer[0]; self->decBuffer[0] = self->decBuffer[1]; self->decBuffer[1] = self->decBuffer[2]; self->decBufferLen--; } else { // readLen == 2; ((char *)_buf)[0] = self->decBuffer[0]; ((char *)_buf)[1] = self->decBuffer[1]; self->decBuffer[0] = self->decBuffer[2]; self->decBufferLen -= 2; } } return readLen; } // ******************** encoding ******************** static char emap[] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', // 0-7 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', // 8-15 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', // 16-23 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', // 24-31 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', // 32-39 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', // 40-47 'w', 'x', 'y', 'z', '0', '1', '2', '3', // 48-55 '4', '5', '6', '7', '8', '9', '+', '/' // 56-63 }; static inline void _encodeToken(NGBase64Stream *self) { int i = self->lineLength; // ratio 3:4 self->line[i] = emap[0x3F & (self->buf >> 18)]; // sextet 1 (octet 1) self->line[i + 1] = emap[0x3F & (self->buf >> 12)]; // sextet 2 (octet 1 and 2) self->line[i + 2] = emap[0x3F & (self->buf >> 6)]; // sextet 3 (octet 2 and 3) self->line[i + 3] = emap[0x3F & (self->buf)]; // sextet 4 (octet 3) self->lineLength += 4; self->buf = 0; self->bufBytes = 0; } static inline void _encodePartialToken(NGBase64Stream *self) { int i = self->lineLength; self->line[i] = emap[0x3F & (self->buf >> 18)]; // sextet 1 (octet 1) self->line[i + 1] = emap[0x3F & (self->buf >> 12)]; // sextet 2 (octet 1 and 2) self->line[i + 2] = (self->bufBytes == 1) ? '=' : emap[0x3F & (self->buf >> 6)]; self->line[i + 3] = (self->bufBytes <= 2) ? '=' : emap[0x3F & (self->buf)]; self->lineLength += 4; self->buf = 0; self->bufBytes = 0; } static inline void _flushLine(NGBase64Stream *self) { [self->source safeWriteBytes:self->line count:self->lineLength]; self->lineLength = 0; } static inline void _encode(NGBase64Stream *self, const char *_in, unsigned _inLen) { // Given a sequence of input bytes, produces a sequence of output bytes // using the base64 encoding. register unsigned int i; for (i = 0; i < _inLen; i++) { if (self->bufBytes == 0) self->buf = ((self->buf & 0xFFFF) | (_in[i] << 16)); else if (self->bufBytes == 1) self->buf = ((self->buf & 0xFF00FF) | ((_in[i] << 8) & 0xFFFF)); else self->buf = ((self->buf & 0xFFFF00) | (_in[i] & 0xFF)); if ((++(self->bufBytes)) == 3) { _encodeToken(self); if (self->lineLength >= 72) _flushLine(self); } if (i == (_inLen - 1)) { if ((self->bufBytes > 0) && (self->bufBytes < 3)) _encodePartialToken(self); if (self->lineLength > 0) _flushLine(self); } } // reset line buffer memset(self->line, 0, sizeof(self->line)); } - (BOOL)close { if (![self flush]) return NO; if (![super close]) return NO; return YES; } - (BOOL)flush { // output buffer if (self->bufBytes) _encodePartialToken(self); _flushLine(self); // reset line buffer memset(self->line, 0, sizeof(self->line)); return [super flush]; } - (unsigned)writeBytes:(const void *)_buf count:(unsigned)_len { _encode(self, _buf, _len); return _len; } @end /* NGBase64Stream */ SOPE/sope-core/NGStreams/SxCore-NGStreams.graffle0000644000000000000000000036303312242733417020472 0ustar rootroot CanvasColor w 1.000000e+00 ColumnAlign 0 ColumnSpacing 5.400000e+01 GraphDocumentVersion 2 GraphicsList Class Group Graphics Bounds {{639, 1332}, {225, 18}} Class ShapedGraphic ID 8385 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGSocketExceptions.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGCouldNotGetSocketOptionException} Bounds {{720, 1359}, {225, 18}} Class ShapedGraphic ID 8386 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGSocketExceptions.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGCouldNotSetSocketOptionException} Bounds {{702, 1296}, {171, 18}} Class ShapedGraphic ID 8387 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGSocketExceptions.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGSocketOptionException} Class LineGraphic Head ID 8385 ID 8388 Points {778.5, 1314} {760.5, 1332} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8387 Class LineGraphic Head ID 8386 ID 8389 Points {793.929, 1314} {826.071, 1359} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8387 ID 8384 Bounds {{567, 999}, {234, 18}} Class ShapedGraphic ID 8383 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGSocketExceptions.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGCouldNotResolveHostNameException} Class Group Graphics Bounds {{324, 315}, {126, 18}} Class ShapedGraphic ID 8368 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGBase64Stream.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGBase64Stream} Bounds {{396, 279}, {126, 18}} Class ShapedGraphic ID 8369 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGLockingStream.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGLockingStream} Bounds {{252, 279}, {126, 18}} Class ShapedGraphic ID 8370 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGMD5Stream.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGMD5Stream} Bounds {{396, 252}, {126, 18}} Class ShapedGraphic ID 8371 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGByteBuffer.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGByteBuffer} Bounds {{396, 225}, {126, 18}} Class ShapedGraphic ID 8372 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGByteCountStream.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGByteCountStream} Bounds {{252, 252}, {126, 18}} Class ShapedGraphic ID 8373 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGBufferedStream.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGBufferedStream} Bounds {{252, 225}, {126, 18}} Class ShapedGraphic ID 8374 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGGZipStream.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGGZipStream} Bounds {{324, 189}, {126, 18}} Class ShapedGraphic ID 8375 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGFilterStream.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGFilterStream} Class LineGraphic Head ID 8368 ID 8376 Points {387, 207} {387, 315} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8375 Class LineGraphic Head ID 8369 ID 8377 Points {394.2, 207} {451.8, 279} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8375 Class LineGraphic Head ID 8370 ID 8378 Points {379.8, 207} {322.2, 279} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8375 Class LineGraphic Head ID 8371 ID 8379 Points {397.286, 207} {448.714, 252} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8375 Class LineGraphic Head ID 8372 ID 8380 Points {405, 207} {441, 225} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8375 Class LineGraphic Head ID 8373 ID 8381 Points {376.714, 207} {325.286, 252} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8375 Class LineGraphic Head ID 8374 ID 8382 Points {369, 207} {333, 225} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8375 ID 8367 Bounds {{36, 981}, {207, 18}} Class ShapedGraphic ID 8366 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGStreamExceptions.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGCouldNotCloseStreamException} Class Group Graphics Bounds {{117, 1404}, {243, 18}} Class ShapedGraphic ID 8357 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGSocketExceptions.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGSocketShutdownDuringReadException} Bounds {{18, 1377}, {243, 18}} Class ShapedGraphic ID 8358 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGSocketExceptions.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGSocketConnectionResetException} Bounds {{117, 1350}, {243, 18}} Class ShapedGraphic ID 8359 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGSocketExceptions.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGSocketTimedOutException} Bounds {{54, 1287}, {279, 18}} Class ShapedGraphic ID 8360 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGSocketExceptions.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGSocketShutdownException} Bounds {{18, 1323}, {243, 18}} Class ShapedGraphic ID 8361 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGSocketExceptions.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGSocketShutdownDuringWriteException} Class LineGraphic Head ID 8357 ID 8362 Points {196.962, 1305} {235.038, 1404} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8360 Class LineGraphic Head ID 8358 ID 8363 Points {188.1, 1305} {144.9, 1377} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8360 Class LineGraphic Head ID 8359 ID 8364 Points {199.929, 1305} {232.071, 1350} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8360 Class LineGraphic Head ID 8361 ID 8365 Points {180, 1305} {153, 1323} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8360 ID 8356 Bounds {{567, 972}, {234, 18}} Class ShapedGraphic ID 8355 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGSocketExceptions.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGSocketIsAlreadyListeningException} Class Group Graphics Bounds {{225, 1089}, {180, 18}} Class ShapedGraphic ID 8348 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGStreamExceptions.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGStreamSeekErrorException} Bounds {{333, 1062}, {180, 18}} Class ShapedGraphic ID 8349 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGStreamExceptions.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGStreamWriteErrorException} Bounds {{225, 1035}, {180, 18}} Class ShapedGraphic ID 8350 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGStreamExceptions.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGStreamReadErrorException} Bounds {{279, 999}, {153, 18}} Class ShapedGraphic ID 8351 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGStreamExceptions.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGStreamErrorException} Class LineGraphic Head ID 8348 ID 8352 Points {351.45, 1017} {319.05, 1089} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8351 Class LineGraphic Head ID 8349 ID 8353 Points {365.143, 1017} {413.357, 1062} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8351 Class LineGraphic Head ID 8350 ID 8354 Points {345.375, 1017} {325.125, 1035} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8351 ID 8347 Class Group Graphics Bounds {{171, 540}, {126, 18}} Class ShapedGraphic ID 8334 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGDatagramSocket.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGDatagramSocket} Bounds {{315, 567}, {117, 18}} Class ShapedGraphic ID 8335 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGSocketProtocols.h Shape Rectangle Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica-Oblique;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\i\fs24 \cf0 NGActiveSocket} Bounds {{171, 567}, {126, 18}} Class ShapedGraphic ID 8336 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGActiveSocket.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGActiveSocket} Bounds {{315, 513}, {117, 18}} Class ShapedGraphic ID 8337 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGSocketProtocols.h Shape Rectangle Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica-Oblique;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\i\fs24 \cf0 NGPassiveSocket} Bounds {{171, 513}, {126, 18}} Class ShapedGraphic ID 8338 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGPassiveSocket.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGPassiveSocket} Bounds {{45, 576}, {81, 18}} Class ShapedGraphic ID 8339 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGSocketProtocols.h Shape Rectangle Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica-Oblique;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\i\fs24 \cf0 NGSocket} Bounds {{45, 540}, {81, 18}} Class ShapedGraphic ID 8340 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGSocket.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGSocket} Class LineGraphic Head ID 8334 ID 8341 Points {126, 549} {171, 549} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8340 Class LineGraphic Head ID 8336 ID 8342 Points {315, 576} {297, 576} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 8335 Class LineGraphic Head ID 8336 ID 8343 Points {124.876, 556.159} {184.5, 567} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8340 Class LineGraphic Head ID 8338 ID 8344 Points {315, 522} {297, 522} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 8337 Class LineGraphic Head ID 8338 ID 8345 Points {124.876, 541.841} {184.5, 531} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8340 Class LineGraphic Head ID 8340 ID 8346 Points {85.5, 576} {85.5, 558} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 8339 ID 8333 Class Group Graphics Bounds {{558, 1179}, {198, 18}} Class ShapedGraphic ID 8329 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGSocketExceptions.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGSocketAlreadyBoundException} Bounds {{585, 1143}, {171, 18}} Class ShapedGraphic ID 8330 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGSocketExceptions.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGSocketBindException} Bounds {{603, 1206}, {198, 18}} Class ShapedGraphic ID 8331 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGSocketExceptions.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGCouldNotBindSocketException} Class LineGraphic Head ID 8331 ID 8332 Points {675, 1161} {697.5, 1206} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8330 ID 8328 Bounds {{567, 945}, {234, 18}} Class ShapedGraphic ID 8327 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGSocketExceptions.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGInvalidSocketDomainException} Class Group Graphics Bounds {{99, 684}, {126, 18}} Class ShapedGraphic ID 8316 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGCharBuffer.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGCharBuffer} Bounds {{243, 684}, {126, 18}} Class ShapedGraphic ID 8317 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGStringTextStream.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGStringTextStream} Bounds {{99, 648}, {126, 18}} Class ShapedGraphic ID 8318 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGFilterTextStream.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGFilterTextStream} Bounds {{306, 648}, {126, 18}} Class ShapedGraphic ID 8319 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGCTextStream.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGCTextStream} Bounds {{297, 612}, {153, 18}} Class ShapedGraphic ID 8320 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGTextStreamProtocols.h Shape Rectangle Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica-Oblique;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\i\fs24 \cf0 NGExtendedTextStream} Bounds {{153, 612}, {126, 18}} Class ShapedGraphic ID 8321 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGTextStream.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGTextStream} Class LineGraphic Head ID 8316 ID 8322 Points {162, 666} {162, 684} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8318 Class LineGraphic Head ID 8317 ID 8323 Points {227.25, 630} {294.75, 684} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8321 Class LineGraphic Head ID 8318 ID 8324 Points {202.5, 630} {175.5, 648} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8321 Class LineGraphic Head ID 8319 ID 8325 Points {254.25, 630} {330.75, 648} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8321 Class LineGraphic Head ID 8321 ID 8326 Points {297, 621} {279, 621} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 8320 ID 8315 Class Group Graphics Bounds {{234, 1233}, {180, 18}} Class ShapedGraphic ID 8308 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGStreamExceptions.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGWriteOnlyStreamException} Bounds {{234, 1179}, {180, 18}} Class ShapedGraphic ID 8309 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGStreamExceptions.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGReadOnlyStreamException} Bounds {{270, 1134}, {207, 18}} Class ShapedGraphic ID 8310 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGStreamExceptions.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGStreamModeException} Bounds {{306, 1206}, {207, 18}} Class ShapedGraphic ID 8311 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGStreamExceptions.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGUnknownStreamModeException} Class LineGraphic Head ID 8308 ID 8312 Points {369, 1152} {328.5, 1233} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8310 Class LineGraphic Head ID 8309 ID 8313 Points {363.6, 1152} {333.9, 1179} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8310 Class LineGraphic Head ID 8311 ID 8314 Points {378, 1152} {405, 1206} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8310 ID 8307 Bounds {{567, 918}, {234, 18}} Class ShapedGraphic ID 8306 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGSocketExceptions.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGDidNotFindServiceException} Bounds {{351, 837}, {171, 18}} Class ShapedGraphic ID 8305 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGStreamExceptions.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGIOSearchAccessException} Class Group Graphics Bounds {{99, 234}, {90, 18}} Class ShapedGraphic ID 8302 Shape RoundedRectangle Style fill Color b 5.000000e-01 g 1.000000e+00 r 1.000000e+00 Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NSFileHandle} Bounds {{54, 270}, {180, 18}} Class ShapedGraphic ID 8303 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGConcreteStreamFileHandle.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGConcreteStreamFileHandle} Class LineGraphic Head ID 8303 ID 8304 Points {144, 252} {144, 270} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8302 ID 8301 Bounds {{567, 891}, {234, 18}} Class ShapedGraphic ID 8300 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGSocketExceptions.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGCouldNotListenException} Bounds {{189, 837}, {144, 18}} Class ShapedGraphic ID 8299 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGStreamExceptions.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGIOAccessException} Class Group Graphics Bounds {{837, 1116}, {225, 18}} Class ShapedGraphic ID 8292 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGSocketExceptions.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGSocketAlreadyConnectedException} Bounds {{801, 1143}, {198, 18}} Class ShapedGraphic ID 8293 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGSocketExceptions.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGSocketNotConnectedException} Bounds {{837, 1053}, {171, 18}} Class ShapedGraphic ID 8294 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGSocketExceptions.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGSocketConnectException} Bounds {{801, 1089}, {198, 18}} Class ShapedGraphic ID 8295 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGSocketExceptions.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGCouldNotConnectException} Class LineGraphic Head ID 8292 ID 8296 Points {926.357, 1071} {945.643, 1116} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8294 Class LineGraphic Head ID 8293 ID 8297 Points {920.25, 1071} {902.25, 1143} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8294 Class LineGraphic Head ID 8295 ID 8298 Points {916.875, 1071} {905.625, 1089} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8294 ID 8291 Class Group Graphics Bounds {{45, 306}, {207, 18}} Class ShapedGraphic ID 8289 Shape Rectangle Style fill Color b 5.000000e-01 g 1.000000e+00 r 1.000000e+00 stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica-Oblique;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\i\fs24 \cf0 NSObjCTypeSerializationCallBack} Bounds {{45, 342}, {207, 18}} Class ShapedGraphic ID 8290 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGStreamCoder.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGStreamCoder} ID 8288 Class Group Graphics Bounds {{45, 477}, {153, 18}} Class ShapedGraphic ID 8283 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGInternetSocketDomain.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGInternetSocketDomain} Bounds {{216, 468}, {117, 18}} Class ShapedGraphic ID 8284 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGSocketProtocols.h Shape Rectangle Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica-Oblique;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\i\fs24 \cf0 NGSocketDomain} Bounds {{45, 450}, {153, 18}} Class ShapedGraphic ID 8285 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGLocalSocketDomain.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGLocalSocketDomain} Class LineGraphic Head ID 8283 ID 8286 Points {216, 480.441} {197.975, 481.501} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 8284 Class LineGraphic Head ID 8285 ID 8287 Points {216, 470.118} {194.883, 467.633} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 8284 ID 8282 Class Group Graphics Bounds {{252, 72}, {99, 18}} Class ShapedGraphic ID 8277 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGDataStream.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGDataStream} Bounds {{369, 45}, {135, 18}} Class ShapedGraphic ID 8278 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGStreamProtocols.h Shape Rectangle Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica-Oblique;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\i\fs24 \cf0 NGPositionableStream} Bounds {{252, 27}, {99, 18}} Class ShapedGraphic ID 8279 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGFileStream.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGFileStream} Class LineGraphic Head ID 8277 ID 8280 Points {391.5, 63} {346.415, 72.017} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 8278 Class LineGraphic Head ID 8279 ID 8281 Points {369, 45} {350.325, 42.51} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 8278 ID 8276 Class Group Graphics Bounds {{72, 27}, {99, 18}} Class ShapedGraphic ID 8273 Shape RoundedRectangle Style fill Color b 5.000000e-01 g 1.000000e+00 r 1.000000e+00 Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NSPipe} Bounds {{72, 63}, {99, 18}} Class ShapedGraphic ID 8274 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGStreamPipe.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGStreamPipe} Class LineGraphic Head ID 8274 ID 8275 Points {121.5, 45} {121.5, 63} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8273 ID 8272 Bounds {{306, 936}, {207, 18}} Class ShapedGraphic ID 8271 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGStreamExceptions.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGStreamNotOpenException} Bounds {{27, 1197}, {162, 18}} Class ShapedGraphic ID 8270 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGStreamExceptions.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGEndOfStreamException} Bounds {{207, 774}, {108, 18}} Class ShapedGraphic ID 8269 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGStreamExceptions.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGIOException} Bounds {{567, 864}, {234, 18}} Class ShapedGraphic ID 8268 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGSocketExceptions.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGCouldNotCreateSocketException} Bounds {{198, 900}, {126, 18}} Class ShapedGraphic ID 8267 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGStreamExceptions.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGStreamException} Bounds {{18, 945}, {207, 18}} Class ShapedGraphic ID 8266 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGStreamExceptions.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGCouldNotOpenStreamException} Bounds {{729, 774}, {126, 18}} Class ShapedGraphic ID 8265 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGSocketExceptions.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGSocketException} Bounds {{567, 837}, {234, 18}} Class ShapedGraphic ID 8264 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGSocketExceptions.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGCouldNotAcceptException} Class Group Graphics Bounds {{351, 459}, {153, 18}} Class ShapedGraphic ID 8261 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGInternetSocketAddress.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGInternetSocketAddress} Bounds {{216, 441}, {117, 18}} Class ShapedGraphic ID 8262 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGSocketProtocols.h Shape Rectangle Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica-Oblique;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\i\fs24 \cf0 NGSocketAddress} Bounds {{351, 432}, {153, 18}} Class ShapedGraphic ID 8263 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGLocalSocketAddress.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGLocalSocketAddress} ID 8260 Class LineGraphic Head ID 8261 ID 8259 Points {333, 456.882} {354.117, 459.367} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 8262 Class LineGraphic Head ID 8263 ID 8258 Points {333, 446.559} {351.025, 445.499} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 8262 Bounds {{342, 108}, {99, 18}} Class ShapedGraphic ID 8257 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGTaskStream.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGTaskStream} Class Group Graphics Bounds {{216, 387}, {126, 18}} Class ShapedGraphic ID 8255 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGSocketProtocols.h Shape Rectangle Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica-Oblique;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\i\fs24 \cf0 NGDatagramPacket} Bounds {{45, 387}, {153, 18}} Class ShapedGraphic ID 8256 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGDatagramPacket.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGDatagramPacket} ID 8254 Class LineGraphic Head ID 8256 ID 8253 Points {216, 396} {198, 396} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 8255 Bounds {{207, 738}, {108, 18}} Class ShapedGraphic ID 8252 Shape RoundedRectangle Style fill Color b 5.000000e-01 g 1.000000e+00 r 1.000000e+00 Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NSException} Bounds {{45, 189}, {81, 18}} Class ShapedGraphic ID 8251 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGStreamProtocols.h Shape Rectangle Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica-Oblique;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\i\fs24 \cf0 NGStream} Bounds {{117, 117}, {153, 18}} Class ShapedGraphic ID 8250 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGStreamProtocols.h Shape Rectangle Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica-Oblique;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\i\fs24 \cf0 NGByteSequenceStream} Bounds {{153, 189}, {81, 18}} Class ShapedGraphic ID 8249 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGStream.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGStream} Class LineGraphic Head ID 8383 ID 8248 Points {787.68, 792} {688.32, 999} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8265 Class LineGraphic Head ID 8366 ID 8247 Points {247.5, 918} {153, 981} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8267 Class LineGraphic Head ID 8269 ID 8246 Points {261, 756} {261, 774} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8252 Class LineGraphic Head ID 8355 ID 8245 Points {787.091, 792} {688.909, 972} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8265 Class LineGraphic Head ID 8329 ID 8244 Points {667.125, 1161} {660.375, 1179} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8330 Class LineGraphic Head ID 8294 ID 8243 Points {796.21, 792} {918.29, 1053} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8265 Class LineGraphic Head ID 8360 ID 8242 Points {116.55, 1215} {184.95, 1287} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8270 Class LineGraphic Head ID 8327 ID 8241 Points {786.316, 792} {689.684, 945} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8265 Class LineGraphic Head ID 8387 ID 8240 Points {791.922, 792} {787.578, 1296} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8265 Class LineGraphic Head ID 8330 ID 8239 Points {789.037, 792} {673.463, 1143} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8265 Class LineGraphic Head ID 8306 ID 8238 Points {785.25, 792} {690.75, 918} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8265 Class LineGraphic Head ID 8305 ID 8237 Points {333, 846} {351, 846} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8299 Class LineGraphic Head ID 8300 ID 8236 Points {783.692, 792} {692.308, 891} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8265 Class LineGraphic Head ID 8299 ID 8235 Points {261, 792} {261, 837} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8269 Class LineGraphic Head ID 8290 ID 8234 Points {148.5, 324} {148.5, 342} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 8289 Class LineGraphic Head ID 8277 ID 8233 Points {201.808, 189} {293.192, 90} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8249 Class LineGraphic Head ID 8274 ID 8232 Points {88.0714, 189} {118.929, 81} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 8251 Class LineGraphic Head ID 8274 ID 8231 Points {181.5, 117} {133.5, 81} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 8250 Class LineGraphic Head ID 8279 ID 8230 Points {199.5, 189} {295.5, 45} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8249 Class LineGraphic Head ID 8271 ID 8229 Points {298.125, 918} {372.375, 936} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8267 Class LineGraphic Head ID 8351 ID 8228 Points {269.591, 918} {346.909, 999} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8267 Class LineGraphic Head ID 8310 ID 8227 Points {265.327, 918} {369.173, 1134} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8267 Class LineGraphic Head ID 8267 ID 8226 Points {261, 792} {261, 900} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8269 Class LineGraphic Head ID 8375 ID 8225 Points {234, 198} {324, 198} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8249 Class LineGraphic Head ID 8270 ID 8224 Points {256.364, 918} {112.636, 1197} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8267 Class LineGraphic Head ID 8265 ID 8223 Points {315, 783} {729, 783} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8269 Class LineGraphic Head ID 8268 ID 8222 Points {781.2, 792} {694.8, 864} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8265 Class LineGraphic Head ID 8266 ID 8221 Points {233.1, 918} {149.4, 945} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8267 Class LineGraphic Head ID 8264 ID 8220 Points {776.571, 792} {699.429, 837} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8265 Class LineGraphic Head ID 8257 ID 8219 Points {215.5, 189} {369.5, 126} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 8249 Class LineGraphic Head ID 8249 ID 8218 Points {126, 198} {153, 198} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 8251 Class LineGraphic Head ID 8249 ID 8217 Points {193.5, 135} {193.5, 189} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 8250 Class LineGraphic Head ID 8251 ID 8216 Points {85.5, 576} {85.5, 207} Style stroke HeadArrow FilledDiamond LineType 1 TailArrow 0 Tail ID 8339 GridInfo HPages 4 ImageCounter 1 IsPalette NO Layers Lock NO Name Layer 1 Print YES View YES LayoutInfo AutoAdjust YES HierarchicalOrientation 0 MagneticFieldCenter {0, 0} MagnetsEnabled YES PageBreakColor w 3.333333e-01 PageBreaks YES PageSetup BAt0eXBlZHN0cmVhbYED6IQBQISEhAtOU1ByaW50SW5mbwGEhAhOU09iamVjdACFkoSE hBNOU011dGFibGVEaWN0aW9uYXJ5AISEDE5TRGljdGlvbmFyeQCUhAFpEpKEhIQITlNT dHJpbmcBlIQBKxBOU0pvYkRpc3Bvc2l0aW9uhpKEmZkPTlNQcmludFNwb29sSm9ihpKE mZkOTlNCb3R0b21NYXJnaW6GkoSEhAhOU051bWJlcgCEhAdOU1ZhbHVlAJSEASqEhAFm nSSGkoSZmQtOU1BhcGVyTmFtZYaShJmZBkxldHRlcoaShJmZD05TUHJpbnRBbGxQYWdl c4aShJ2chIQBc54AhpKEmZkNTlNSaWdodE1hcmdpboaShJ2cn50khpKEmZkITlNDb3Bp ZXOGkoSdnISEAVOfAYaShJmZD05TU2NhbGluZ0ZhY3RvcoaShJ2chIQBZKABhpKEmZkL TlNGaXJzdFBhZ2WGkoSdnKmfAYaShJmZFE5TVmVydGljYWxQYWdpbmF0aW9uhpKEnZyk ngCGkoSZmRVOU0hvcml6b25hbFBhZ2luYXRpb26GkoSdnKSeAIaShJmZFk5TSG9yaXpv bnRhbGx5Q2VudGVyZWSGkoSdnKSeAYaShJmZDE5TTGVmdE1hcmdpboaShJ2cn50khpKE mZkNTlNPcmllbnRhdGlvboaShJ2cpJ4AhpKEmZkZTlNQcmludFJldmVyc2VPcmllbnRh dGlvboaSo5KEmZkKTlNMYXN0UGFnZYaShJ2chJeXgn////+GkoSZmQtOU1RvcE1hcmdp boaShJ2cn50khpKEmZkUTlNWZXJ0aWNhbGx5Q2VudGVyZWSGkrSShJmZC05TUGFwZXJT aXplhpKEnpyEhAx7X05TU2l6ZT1mZn2hgQJkgQMYhoaG RowAlign 0 RowSpacing 9.000000e+00 VPages 2 WindowInfo Frame {{185, 90}, {794, 751}} VisibleRegion {{0, 0}, {1038.67, 898.667}} Zoom 0.75 SOPE/sope-core/NGStreams/NGFileStream.m0000644000000000000000000004212212242733417016525 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "config.h" #if HAVE_UNISTD_H || __APPLE__ # include #endif #if HAVE_SYS_STAT_H # include #endif #if HAVE_SYS_FCNTL_H # include #endif #if HAVE_FCNTL_H || __APPLE__ # include #endif #include #include #include #include #include #include #include "common.h" #import #if !defined(POLLRDNORM) # define POLLRDNORM POLLIN #endif // TODO: NGFileStream needs to be changed to operate without throwing // exceptions NGStreams_DECLARE NSString *NGFileReadOnly = @"r"; NGStreams_DECLARE NSString *NGFileWriteOnly = @"w"; NGStreams_DECLARE NSString *NGFileReadWrite = @"rw"; NGStreams_DECLARE NSString *NGFileAppend = @"a"; NGStreams_DECLARE NSString *NGFileReadAppend = @"ra"; static const int NGInvalidUnixDescriptor = -1; static const int NGFileCreationMask = 0666; // rw-rw-rw- @interface _NGConcreteFileStreamFileHandle : NGConcreteStreamFileHandle @end NGStreams_DECLARE id NGIn = nil; NGStreams_DECLARE id NGOut = nil; NGStreams_DECLARE id NGErr = nil; @implementation NGFileStream // stdio stream #if defined(__MINGW32__) - (id)__initWithInConsole { if ((self = [self init])) { self->systemPath = @"CONIN$"; self->streamMode = NGStreamMode_readWrite; self->fh = GetStdHandle(STD_INPUT_HANDLE); /* self->fh = CreateFile("CONIN$", GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); */ } return self; } - (id)__initWithOutConsole { if ((self = [self init])) { DWORD written; self->systemPath = @"CONOUT$"; self->streamMode = NGStreamMode_readWrite; self->fh = GetStdHandle(STD_OUTPUT_HANDLE); /* self->fh = CreateFile("CONOUT$", GENERIC_WRITE, FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL); */ FlushFileBuffers(self->fh); } return self; } #else - (id)__initWithDescriptor:(int)_fd mode:(NGStreamMode)_mode { if ((self = [self init])) { self->fd = _fd; self->streamMode = _mode; } return self; } #endif void NGInitStdio(void) { static BOOL isInitialized = NO; if (!isInitialized) { NGFileStream *ti = nil, *to = nil, *te = nil; isInitialized = YES; #if defined(__MINGW32__) ti = [[NGFileStream alloc] __initWithInConsole]; to = [[NGFileStream alloc] __initWithOutConsole]; te = [to retain]; #else ti = [[NGFileStream alloc] __initWithDescriptor:0 mode:NGStreamMode_readOnly]; to = [[NGFileStream alloc] __initWithDescriptor:1 mode:NGStreamMode_writeOnly]; te = [[NGFileStream alloc] __initWithDescriptor:2 mode:NGStreamMode_writeOnly]; #endif NGIn = [[NGBufferedStream alloc] initWithSource:(id)ti]; NGOut = [[NGBufferedStream alloc] initWithSource:(id)to]; NGErr = [[NGBufferedStream alloc] initWithSource:(id)te]; [ti release]; ti = nil; [to release]; to = nil; [te release]; te = nil; } } + (void)_makeThreadSafe:(NSNotification *)_notification { NGLockingStream *li = nil, *lo = nil, *le = nil; if ([NGIn isKindOfClass:[NGLockingStream class]]) return; li = [[NGLockingStream alloc] initWithSource:(id)NGIn]; [NGIn release]; NGIn = li; lo = [[NGLockingStream alloc] initWithSource:(id)NGOut]; [NGOut release]; NGOut = lo; le = [[NGLockingStream alloc] initWithSource:(id)NGErr]; [NGErr release]; NGErr = le; } + (void)_flushForExit:(NSNotification *)_notification { //[NGIn flush]; [NGOut flush]; [NGErr flush]; } static void _flushForExit(void) { //[NGIn flush]; [NGOut flush]; [NGErr flush]; } + (void)initialize { BOOL isInitialized = NO; if (!isInitialized) { isInitialized = YES; if ([NSThread isMultiThreaded]) [self _makeThreadSafe:nil]; else { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_makeThreadSafe:) name:NSWillBecomeMultiThreadedNotification object:nil]; } atexit(_flushForExit); } } /* normal file stream */ - (id)init { if ((self = [super init])) { self->streamMode = NGStreamMode_undefined; self->systemPath = nil; self->markDelta = -1; self->handle = nil; #if defined(__MINGW32__) self->fh = INVALID_HANDLE_VALUE; #else self->fd = NGInvalidUnixDescriptor; #endif } return self; } - (id)initWithPath:(NSString *)_path { if ((self = [self init])) { self->systemPath = [_path copy]; } return self; } - (id)initWithFileHandle:(NSFileHandle *)_handle { if ((self = [self init])) { #if defined(__MINGW32__) self->fh = [_handle nativeHandle]; #else self->fd = [_handle fileDescriptor]; #endif } return self; } - (void)gcFinalize { if ([self isOpen]) { #if DEBUG && 0 NSLog(@"NGFileStream(gcFinalize): closing %@", self); #endif [self close]; } } - (void)dealloc { [self gcFinalize]; self->streamMode = NGStreamMode_undefined; [self->systemPath release]; self->systemPath = nil; self->handle = nil; [super dealloc]; } // opening - (BOOL)openInMode:(NSString *)_mode { // throws // NGUnknownStreamModeException when _mode is invalid // NGCouldNotOpenStreamException when the file could not be opened #if defined(__MINGW32__) DWORD openFlags; DWORD shareMode; if (self->fh != INVALID_HANDLE_VALUE) [self close]; // if stream is open, close and reopen if ([_mode isEqualToString:NGFileReadOnly]) { self->streamMode = NGStreamMode_readOnly; openFlags = GENERIC_READ; shareMode = FILE_SHARE_READ; } else if ([_mode isEqualToString:NGFileWriteOnly]) { self->streamMode = NGStreamMode_writeOnly; openFlags = GENERIC_WRITE; shareMode = FILE_SHARE_WRITE; } else if ([_mode isEqualToString:NGFileReadWrite]) { self->streamMode = NGStreamMode_readWrite; openFlags = GENERIC_READ | GENERIC_WRITE; shareMode = FILE_SHARE_READ | FILE_SHARE_WRITE; } else { [[[NGUnknownStreamModeException alloc] initWithStream:self mode:_mode] raise]; return NO; } self->fh = CreateFile([self->systemPath fileSystemRepresentation], openFlags, shareMode, NULL, OPEN_ALWAYS, // same as the Unix O_CREAT flag 0, // security flags ? NULL); if (self->fh == INVALID_HANDLE_VALUE) [NGCouldNotOpenStreamException raiseWithStream:self]; #else int openFlags; // flags passed to open() call if (self->fd != NGInvalidUnixDescriptor) [self close]; // if stream is open, close and reopen if ([_mode isEqualToString:NGFileReadOnly]) { self->streamMode = NGStreamMode_readOnly; openFlags = O_RDONLY; } else if ([_mode isEqualToString:NGFileWriteOnly]) { self->streamMode = NGStreamMode_writeOnly; openFlags = O_WRONLY | O_CREAT; } else if ([_mode isEqualToString:NGFileReadWrite]) { self->streamMode = NGStreamMode_readWrite; openFlags = O_RDWR | O_CREAT; } else if ([_mode isEqualToString:NGFileAppend]) { self->streamMode = NGStreamMode_writeOnly; openFlags = O_WRONLY | O_CREAT | O_APPEND; } else if ([_mode isEqualToString:NGFileReadAppend]) { self->streamMode = NGStreamMode_readWrite; openFlags = O_RDWR | O_CREAT | O_APPEND; } else { [[[NGUnknownStreamModeException alloc] initWithStream:self mode:_mode] raise]; return NO; } self->fd = open([self->systemPath fileSystemRepresentation], openFlags, NGFileCreationMask); if (self->fd == -1) { self->fd = NGInvalidUnixDescriptor; [NGCouldNotOpenStreamException raiseWithStream:self]; return NO; } #endif self->markDelta = -1; // not marked return YES; } - (BOOL)isOpen { #if defined(__MINGW32__) return (self->fh != INVALID_HANDLE_VALUE) ? YES : NO; #else return (self->fd != NGInvalidUnixDescriptor) ? YES : NO; #endif } // Foundation file handles - (void)resetFileHandle { // called by NSFileHandle on dealloc self->handle = nil; } - (NSFileHandle *)fileHandle { if (self->handle == nil) self->handle = [[_NGConcreteFileStreamFileHandle allocWithZone:[self zone]] initWithStream:self]; return [self->handle autorelease]; } #if defined(__MINGW32__) - (HANDLE)windowsFileHandle { return self->fh; } #endif - (int)fileDescriptor { #if defined(__MINGW32__) return (int)[self fileHandle]; #else return self->fd; #endif } // primitives static void _checkOpen(NGFileStream *self, NSString *_reason) { #if defined(__MINGW32__) if (self->fh == INVALID_HANDLE_VALUE) [NGStreamNotOpenException raiseWithStream:self reason:_reason]; #else if (self->fd == NGInvalidUnixDescriptor) [NGStreamNotOpenException raiseWithStream:self reason:_reason]; #endif } - (unsigned)readBytes:(void *)_buf count:(unsigned)_len { // throws // NGWriteOnlyStreamException when the stream is not readable // NGStreamNotOpenException when the stream is not open // NGEndOfStreamException when the end of the stream is reached // NGStreamReadErrorException when the read call failed _checkOpen(self, @"tried to read from a file stream which is closed"); if (!NGCanReadInStreamMode(streamMode)) [NGWriteOnlyStreamException raiseWithStream:self]; { #if defined(__MINGW32__) DWORD readResult = 0; if (ReadFile(self->fh, _buf, _len, &readResult, NULL) == FALSE) { DWORD lastErr = GetLastError(); if (lastErr == ERROR_HANDLE_EOF) [NGEndOfStreamException raiseWithStream:self]; else [NGStreamReadErrorException raiseWithStream:self errorCode:lastErr]; } if (readResult == 0) [NGEndOfStreamException raiseWithStream:self]; #else int readResult; int retryCount = 0; do { readResult = read(self->fd, _buf, _len); if (readResult == 0) [NGEndOfStreamException raiseWithStream:self]; else if (readResult == -1) { int errCode = errno; if (errCode == EINTR) // system call was interrupted retryCount++; else [NGStreamReadErrorException raiseWithStream:self errorCode:errCode]; } } while ((readResult <= 0) && (retryCount < 10)); if (retryCount >= 10) [NGStreamReadErrorException raiseWithStream:self errorCode:EINTR]; #endif NSAssert(readResult > 0, @"invalid read method state"); // adjust mark if (self->markDelta != -1) self->markDelta += readResult; // increase delta return readResult; } } - (unsigned)writeBytes:(const void *)_buf count:(unsigned)_len { // throws // NGReadOnlyStreamException when the stream is not writeable // NGStreamNotOpenException when the stream is not open // NGStreamWriteErrorException when the write call failed _checkOpen(self, @"tried to write to a file stream which is closed"); if (!NGCanWriteInStreamMode(streamMode)) [NGReadOnlyStreamException raiseWithStream:self]; { #if defined(__MINGW32__) DWORD writeResult = 0; if (WriteFile(self->fh, _buf, _len, &writeResult, NULL) == FALSE) { DWORD errorCode = GetLastError(); switch (errorCode) { case ERROR_INVALID_HANDLE: [NGStreamWriteErrorException raiseWithStream:self reason:@"incorrect file handle"]; break; case ERROR_WRITE_PROTECT: [NGStreamWriteErrorException raiseWithStream:self reason:@"disk write protected"]; break; case ERROR_NOT_READY: [NGStreamWriteErrorException raiseWithStream:self reason:@"the drive is not ready"]; break; case ERROR_HANDLE_EOF: [NGStreamWriteErrorException raiseWithStream:self reason:@"reached end of file"]; break; case ERROR_DISK_FULL: [NGStreamWriteErrorException raiseWithStream:self reason:@"disk is full"]; break; default: [NGStreamWriteErrorException raiseWithStream:self errorCode:GetLastError()]; } NSLog(@"invalid program state, aborting"); abort(); } #else int writeResult; int retryCount = 0; do { writeResult = write(self->fd, _buf, _len); if (writeResult == -1) { int errCode = errno; if (errCode == EINTR) // system call was interrupted retryCount++; else [NGStreamWriteErrorException raiseWithStream:self errorCode:errno]; } } while ((writeResult == -1) && (retryCount < 10)); if (retryCount >= 10) [NGStreamWriteErrorException raiseWithStream:self errorCode:EINTR]; #endif return writeResult; } } - (BOOL)close { #if defined(__MINGW32__) if (self->fh == INVALID_HANDLE_VALUE) { NSLog(@"tried to close already closed stream %@", self); return YES; /* not signaled as an error .. */ } if (CloseHandle(self->fh) == FALSE) { [NGCouldNotCloseStreamException raiseWithStream:self]; return NO; } self->fh = INVALID_HANDLE_VALUE; #else if (self->fd == NGInvalidUnixDescriptor) { NSLog(@"tried to close already closed stream %@", self); return YES; /* not signaled as an error .. */ } if (close(self->fd) != 0) { [NGCouldNotCloseStreamException raiseWithStream:self]; return NO; } self->fd = NGInvalidUnixDescriptor; #endif self->markDelta = -1; return YES; } - (NGStreamMode)mode { return self->streamMode; } - (BOOL)isRootStream { return YES; } #if defined(__MINGW32__) - (BOOL)flush { if (self->fh != INVALID_HANDLE_VALUE) FlushFileBuffers(self->fh); return YES; } #endif // blocking #if defined(__MINGW32__) - (BOOL)wouldBlockInMode:(NGStreamMode)_mode { NSLog(@"%@ not supported in Windows environment !", NSStringFromSelector(_cmd)); return YES; } #else - (BOOL)wouldBlockInMode:(NGStreamMode)_mode { short events = 0; if (self->fd == NGInvalidUnixDescriptor) return NO; if (NGCanReadInStreamMode(_mode)) events |= POLLRDNORM; if (NGCanWriteInStreamMode(_mode)) events |= POLLWRNORM; // timeout of 0 means return immediatly return (NGPollDescriptor(self->fd, events, 0) == 1 ? NO : YES); } #endif // marking - (BOOL)mark { self->markDelta = 0; return YES; } - (BOOL)rewind { if (![self moveByOffset:-(self->markDelta)]) return NO; self->markDelta = -1; return YES; } - (BOOL)markSupported { return YES; } // NGPositionableStream - (BOOL)moveToLocation:(unsigned)_location { self->markDelta = -1; #if defined(__MINGW32__) if (SetFilePointer(self->fh, _location, NULL, FILE_BEGIN) == -1) { [NGStreamSeekErrorException raiseWithStream:self errorCode:GetLastError()]; return NO; } #else if (lseek(self->fd, _location, SEEK_SET) == -1) { [NGStreamSeekErrorException raiseWithStream:self errorCode:errno]; return NO; } #endif return YES; } - (BOOL)moveByOffset:(int)_delta { self->markDelta += _delta; #if defined(__MINGW32__) if (SetFilePointer(self->fh, _delta, NULL, FILE_CURRENT) == -1) { [NGStreamSeekErrorException raiseWithStream:self errorCode:GetLastError()]; return NO; } #else if (lseek(self->fd, _delta, SEEK_CUR) == -1) { [NGStreamSeekErrorException raiseWithStream:self errorCode:errno]; return NO; } #endif return YES; } /* description */ - (NSString *)description { return [NSString stringWithFormat: @"<%@[0x%p] path=%@ mode=%@>", NSStringFromClass([self class]), self, self->systemPath ? self->systemPath : (NSString *)@"nil", [self modeDescription]]; } @end /* NGFileStream */ @implementation _NGConcreteFileStreamFileHandle // accessors #if defined(__MINGW32__) - (HANDLE)fileHandle { return [(NGFileStream *)stream windowsFileHandle]; } #endif - (int)fileDescriptor { return [(NGFileStream *)stream fileDescriptor]; } @end SOPE/sope-core/NGStreams/NGPassiveSocket.m0000644000000000000000000001617212242733417017263 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NGPassiveSocket.h" #include "NGSocketExceptions.h" #include "NGActiveSocket.h" #include "NGSocket+private.h" #if defined(__APPLE__) # include # include #endif #if HAVE_SYS_ERRNO_H || defined(__APPLE__) # include #endif #include "common.h" @interface NGActiveSocket(privateMethods) - (id)_initWithDescriptor:(int)_fd localAddress:(id)_local remoteAddress:(id)_remote; @end @implementation NGPassiveSocket + (id)socketBoundToAddress:(id)_address { volatile id sock; sock = [[[self alloc] initWithDomain:[_address domain]] autorelease]; [sock bindToAddress:_address]; return sock; } - (id)initWithDomain:(id)_domain { // designated initializer if ((self = [super initWithDomain:_domain])) { backlogSize = -1; // -1 means 'not listening' if ([NSThread isMultiThreaded]) acceptLock = [[NSLock allocWithZone:[self zone]] init]; else { acceptLock = nil; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(taskNowMultiThreaded:) name:NSWillBecomeMultiThreadedNotification object:nil]; } if (self->fd != NGInvalidSocketDescriptor) { int i_yes = 1; if (setsockopt(self->fd, SOL_SOCKET, SO_REUSEADDR, (void *)&i_yes, sizeof(int)) != 0) { NSLog(@"WARNING: could not set SO_REUSEADDR option for socket %@: %s", self, strerror(errno)); } } } return self; } - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self name:NSWillBecomeMultiThreadedNotification object:nil]; [self->acceptLock release]; [super dealloc]; } - (void)taskNowMultiThreaded:(NSNotification *)_notification { if (acceptLock == nil) acceptLock = [[NSLock alloc] init]; } // accessors - (BOOL)isListening { return (backlogSize != -1); } - (BOOL)isOpen { return [self isListening]; } - (id)localAddress { return localAddress; } - (int)socketType { return SOCK_STREAM; } /* operations */ #if defined(WIN32) && !defined(__CYGWIN32__) - (NSString *)reasonForLastError { int errorCode = WSAGetLastError(); switch (errorCode) { case WSAEBADF: return @"not a valid socket descriptor"; case WSAENOTSOCK: return @"descriptor is not a socket descriptor"; case WSAEOPNOTSUPP: return @"socket does not support listen"; case WSAEINTR: return @"interrupted by signal"; case WSAEMFILE: return @"descriptor table is full"; default: return [NSString stringWithCString:strerror(errorCode)]; } } #else - (NSString *)reasonForLastError { int errorCode = errno; switch (errorCode) { case EBADF: return @"not a valid socket descriptor"; case ENOTSOCK: return @"descriptor is not a socket descriptor"; case EOPNOTSUPP: return @"socket does not support listen"; case EINTR: return @"interrupted by signal"; case EMFILE: return @"descriptor table is full"; case EPROTONOSUPPORT: return @"The protocol is not supported by the address family or " @"implementation"; case EPROTOTYPE: return @"The socket type is not supported by the protocol"; default: return [NSString stringWithCString:strerror(errorCode)]; } } #endif - (BOOL)listenWithBacklog:(int)_backlogSize { // throws // NGSocketIsAlreadyListeningException when the socket is in the listen state // NGCouldNotListenException when the listen call failed if ([self isListening]) { [[[NGSocketIsAlreadyListeningException alloc] initWithReason:@"already called listen" socket:self] raise]; return NO; } if (listen([self fileDescriptor], _backlogSize) != 0) { NSString *reason; reason = [self reasonForLastError]; reason = [@"Could not listen: %@" stringByAppendingString:reason]; [[[NGCouldNotListenException alloc] initWithReason:reason socket:self] raise]; return NO; } /* set backlog size (and mark socket as 'listening') */ self->backlogSize = _backlogSize; return YES; } - (id)accept { // throws // NGCouldNotAcceptException when the socket is not listening // NGCouldNotAcceptException when the accept call failed id socket; *(&socket) = nil; if (![self isListening]) { [[[NGCouldNotAcceptException alloc] initWithReason:@"socket is not listening" socket:self] raise]; } SYNCHRONIZED(self->acceptLock) { id local = nil; id remote = nil; socklen_t len; char *data; int newFd = NGInvalidSocketDescriptor; len = [[self domain] addressRepresentationSize]; data = calloc(1, len + 1); if ((newFd = accept(fd, (void *)data, &len)) == -1) { // call failed NSString *reason = nil; reason = [self reasonForLastError]; reason = [@"Could not accept: " stringByAppendingString:reason]; [[[NGCouldNotAcceptException alloc] initWithReason:reason socket:self] raise]; } /* produce remote socket address object */ remote = [[self domain] addressWithRepresentation:(void *)data size:len]; // getsockname if wildcard-IP-bind to get local IP address assigned // to the connection len = [[self domain] addressRepresentationSize]; if (getsockname(newFd, (void *)data, &len) != 0) { // function is MT-safe [[[NGSocketException alloc] initWithReason:@"could not get local socket name" socket:self] raise]; } local = [[self domain] addressWithRepresentation:(void *)data size:len]; if (data) { free(data); data = NULL; } socket = [[NGActiveSocket alloc] _initWithDescriptor:newFd localAddress:local remoteAddress:remote]; socket = [socket autorelease]; } END_SYNCHRONIZED; return socket; } // description - (NSString *)description { return [NSString stringWithFormat:@"", [self localAddress]]; } @end /* NGPassiveSocket */ SOPE/sope-core/NGStreams/NGSocket.m0000644000000000000000000005056112242733417015730 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include "NGSocketExceptions.h" #include "NGSocket.h" #include "NGSocket+private.h" #include "NGInternetSocketDomain.h" #include "config.h" #if defined(__APPLE__) # include # include #endif #if defined(HAVE_UNISTD_H) || defined(__APPLE__) # include #endif #include "common.h" @interface _NGConcreteSocketFileHandle : NGConcreteStreamFileHandle { } - (id)initWithSocket:(id)_socket; @end @interface NSObject(WildcardAddresses) - (BOOL)isWildcardAddress; @end #ifdef __s390__ # define SockAddrLenType socklen_t #elif __APPLE__ # define SockAddrLenType unsigned int #else # define SockAddrLenType socklen_t #endif @implementation NGSocket #if defined(WIN32) && !defined(__CYGWIN32__) static BOOL isInitialized = NO; static WSADATA wsaData; + (void)initialize { if (!isInitialized) { isInitialized = YES; if (WSAStartup(MAKEWORD(1, 1), &wsaData) != 0) NSLog(@"WARNING: Could not start Windows sockets !"); NSLog(@"WinSock version %i.%i.", LOBYTE(wsaData.wVersion), HIBYTE(wsaData.wVersion)); } } static void _killWinSock(void) __attribute__((destructor)); static void _killWinSock(void) { fprintf(stderr, "killing Windows sockets ..\n"); if (isInitialized) { WSACleanup(); isInitialized = NO; } } #endif /* WIN32 */ + (id)socketInDomain:(id)_domain { return [[[self alloc] initWithDomain:_domain] autorelease]; } - (id)init { return [self initWithDomain:[NGInternetSocketDomain domain]]; } #if defined(WIN32) && !defined(__CYGWIN32__) - (id)_initWithDomain:(id)_domain descriptor:(SOCKET)_fd { #else - (id)_initWithDomain:(id)_domain descriptor:(int)_fd { #endif if ((self = [super init])) { self->fd = _fd; self->flags.closeOnFree = YES; self->flags.isBound = (_fd == NGInvalidSocketDescriptor) ? NO : YES; self->domain = [_domain retain]; if (_fd == NGInvalidSocketDescriptor) [self primaryCreateSocket]; } return self; } - (id)initWithDomain:(id)_domain { return [self _initWithDomain:_domain descriptor:NGInvalidSocketDescriptor]; } - (void)gcFinalize { if (self->flags.closeOnFree) [self close]; else NSLog(@"WARNING: socket was not 'closeOnFree' !"); } - (void)dealloc { [self gcFinalize]; [self->lastException release]; [self->localAddress release]; [self->domain release]; self->fileHandle = nil; [super dealloc]; } /* creation */ - (BOOL)primaryCreateSocket { // throws // NGCouldNotCreateSocketException if the socket creation failed fd = socket([domain socketDomain], [self socketType], [domain protocol]); #if defined(WIN32) && !defined(__CYGWIN32__) if (fd == SOCKET_ERROR) { // error int e = WSAGetLastError(); NSString *reason = nil; switch (e) { case WSAEACCES: reason = @"Not allowed to create socket of this type"; break; case WSAEMFILE: reason = @"Could not create socket: descriptor table is full"; break; case WSAEPROTONOSUPPORT: reason = @"Could not create socket: The protocol type or the specified " @"protocol is not supported within this domain"; break; default: reason = [NSString stringWithFormat:@"Could not create socket: %s", strerror(e)]; break; } #else if (fd == -1) { // error int e = errno; NSString *reason = nil; switch (e) { case EACCES: reason = @"Not allowed to create socket of this type"; break; case EMFILE: reason = @"Could not create socket: descriptor table is full"; break; case ENOMEM: reason = @"Could not create socket: Insufficient user memory available"; break; case EPROTONOSUPPORT: reason = @"Could not create socket: The protocol type or the specified " @"protocol is not supported within this domain"; break; default: reason = [NSString stringWithFormat:@"Could not create socket: %s", strerror(e)]; break; } #endif [[[NGCouldNotCreateSocketException alloc] initWithReason:reason domain:domain] raise]; return NO; } return YES; } - (BOOL)close { if (self->fd != NGInvalidSocketDescriptor) { #if DEBUG && 0 NSLog(@"%@: closing socket fd %i", self, self->fd); #endif #if defined(WIN32) && !defined(__CYGWIN32__) closesocket(self->fd); #else close(self->fd); #endif self->fd = NGInvalidSocketDescriptor; if (self->flags.isBound) { self->flags.isBound = NO; [[self domain] cleanupAddress:self->localAddress afterCloseOfSocket:self]; } else self->flags.isBound = NO; } return YES; } /* operations */ - (void)setLastException:(NSException *)_exception { /* NOTE: watch out for cycles !!! */ // THREAD ASSIGN(self->lastException, _exception); } - (NSException *)lastException { // THREAD return self->lastException; } - (void)resetLastException { // THREAD ASSIGN(self->lastException,(id)nil); } - (BOOL)primaryBindToAddress:(id)_address { // throws // NGCouldNotBindSocketException if the bind failed [[self domain] prepareAddress:_address forBindWithSocket:self]; if (bind(fd, (struct sockaddr *)[_address internalAddressRepresentation], [_address addressRepresentationSize]) != 0) { NSString *reason = nil; #if defined(WIN32) && !defined(__CYGWIN32__) int errorCode = WSAGetLastError(); #else int errorCode = errno; #endif switch (errorCode) { default: reason = [NSString stringWithCString:strerror(errorCode)]; break; } reason = [NSString stringWithFormat:@"Could not bind to address %@: %@", _address, reason]; [[[NGCouldNotBindSocketException alloc] initWithReason:reason socket:self address:_address] raise]; return NO; } /* bind was successful */ ASSIGN(self->localAddress, _address); self->flags.isBound = YES; return YES; } - (BOOL)bindToAddress:(id)_address { // throws // NGSocketAlreadyBoundException if the socket is already bound // NGCouldNotCreateSocketException if the socket creation failed // NGCouldNotBindSocketException if the bind failed // check whether socket is already bound (either manually or by the kernel) if (flags.isBound) { [[[NGSocketAlreadyBoundException alloc] initWithReason:@"socket is already bound." socket:self] raise]; } if (_address == nil) { /* let kernel bind address */ return [self kernelBoundAddress]; } // perform bind if (![self primaryBindToAddress:_address]) return NO; /* check for wildcard port */ if ([_address respondsToSelector:@selector(isWildcardAddress)]) { if ([(id)_address isWildcardAddress]) { SockAddrLenType len = [[_address domain] addressRepresentationSize]; char data[len]; // struct sockaddr if (getsockname(fd, (void *)&data, &len) == 0) { // function is MT-safe id boundAddr; boundAddr = [[_address domain] addressWithRepresentation:&(data[0]) size:len]; #if 0 NSLog(@"got sock name (addr-len=%d, %s, %d) %@ ..", len, inet_ntoa( (((struct sockaddr_in *)(&data[0]))->sin_addr)), ntohs(((struct sockaddr_in *)(&data[0]))->sin_port), boundAddr); #endif ASSIGN(self->localAddress, boundAddr); } else { // could not get local socket name, THROW NSLog(@"ERROR: couldn't resolve wildcard address %@", _address); } } } return YES; } - (BOOL)kernelBoundAddress { SockAddrLenType len = [[self domain] addressRepresentationSize]; char data[len]; // check whether socket is already bound (either manually or by the kernel) if (flags.isBound) { [[[NGSocketAlreadyBoundException alloc] initWithReason:@"socket is already bound." socket:self] raise]; return NO; } #if 0 NSLog(@"socket: kernel bound address of %i in domain %@", self->fd, [self domain]); #endif if (getsockname(self->fd, (void *)&data, &len) != 0) { // function is MT-safe // could not get local socket name, THROW [[[NGSocketException alloc] initWithReason:@"could not get local socket name" socket:self] raise]; return NO; } if (self->localAddress) { // release old address [self->localAddress release]; self->localAddress = nil; } self->localAddress = [[self domain] addressWithRepresentation:(void *)data size:len]; self->localAddress = [self->localAddress retain]; self->flags.isBound = YES; return YES; } /* accessors */ - (id)localAddress { return self->localAddress; } - (BOOL)isBound { return self->flags.isBound; } - (int)socketType { [self subclassResponsibility:_cmd]; return -1; } - (id)domain { return self->domain; } #if defined(WIN32) && !defined(__CYGWIN32__) - (SOCKET)fileDescriptor { #else - (int)fileDescriptor { #endif return self->fd; } - (void)setFileDescriptor: (int) theFd { self->fd = theFd; } - (void)resetFileHandle { // called by the NSFileHandle on dealloc self->fileHandle = nil; } - (NSFileHandle *)fileHandle { /* the filehandle will reset itself from the stream when being deallocated */ if (self->fileHandle == nil) { self->fileHandle = [(_NGConcreteSocketFileHandle *)[_NGConcreteSocketFileHandle alloc] initWithSocket:self]; } return [self->fileHandle autorelease]; } /* options */ - (void)setOption:(int)_option level:(int)_level value:(void *)_value len:(int)_len { if (setsockopt(fd, _level, _option, _value, _len) != 0) { NSString *reason = nil; #if defined(WIN32) && !defined(__CYGWIN32__) int e = WSAGetLastError(); switch (e) { case WSAEBADF: reason = @"Could not set socket option, invalid file descriptor"; break; case WSAEINVAL: reason = @"Could not set socket option, option is invalid or socket has been" @"shut down"; break; case WSAENOPROTOOPT: reason = @"Could not set socket option, option is not supported by protocol"; break; case WSAENOTSOCK: reason = @"Could not set socket option, descriptor isn't a socket"; break; default: reason = [NSString stringWithFormat:@"Could not set socket option: %s", strerror(e)]; break; } #else int e = errno; switch (e) { case EBADF: reason = @"Could not set socket option, invalid file descriptor"; break; case EINVAL: reason = @"Could not set socket option, option is invalid or socket has been" @"shut down"; break; case ENOPROTOOPT: reason = @"Could not set socket option, option is not supported by protocol"; break; case ENOTSOCK: reason = @"Could not set socket option, descriptor isn't a socket"; break; default: reason = [NSString stringWithFormat:@"Could not set socket option: %s", strerror(e)]; break; } #endif [[[NGCouldNotSetSocketOptionException alloc] initWithReason:reason option:_option level:_level] raise]; } } - (void)setOption:(int)_option value:(void *)_value len:(int)_len { [self setOption:_option level:SOL_SOCKET value:_value len:_len]; } - (void)getOption:(int)_option level:(int)_level value:(void *)_value len:(int *)_len { int rc; socklen_t tlen; rc = getsockopt(fd, _level, _option, _value, &tlen); if (_len) *_len = tlen; if (rc != 0) { NSString *reason = nil; #if defined(WIN32) && !defined(__CYGWIN32__) int e = WSAGetLastError(); switch (e) { case WSAEBADF: reason = @"Could not get socket option, invalid file descriptor"; break; case WSAEINVAL: reason = @"Could not get socket option, option is invalid at the specified level"; break; case WSAENOPROTOOPT: reason = @"Could not get socket option, option is not supported by protocol"; break; case WSAENOTSOCK: reason = @"Could not get socket option, descriptor isn't a socket"; break; case WSAEOPNOTSUPP: reason = @"Could not get socket option, operation is not supported by protocol"; break; default: reason = [NSString stringWithFormat:@"Could not get socket option: %s", strerror(e)]; break; } #else int e = errno; switch (e) { case EBADF: reason = @"Could not get socket option, invalid file descriptor"; break; case EINVAL: reason = @"Could not get socket option, option is invalid at the specified level"; break; case ENOPROTOOPT: reason = @"Could not get socket option, option is not supported by protocol"; break; case ENOTSOCK: reason = @"Could not get socket option, descriptor isn't a socket"; break; case EOPNOTSUPP: reason = @"Could not get socket option, operation is not supported by protocol"; break; default: reason = [NSString stringWithFormat:@"Could not get socket option: %s", strerror(e)]; break; } #endif [[[NGCouldNotGetSocketOptionException alloc] initWithReason:reason option:_option level:_level] raise]; } } - (void)getOption:(int)_option value:(void *)_value len:(int *)_len { [self getOption:_option level:SOL_SOCKET value:_value len:_len]; } static int i_yes = 1; static int i_no = 0; static inline void setBoolOption(id self, int _option, BOOL _flag) { [self setOption:_option level:SOL_SOCKET value:(_flag ? &i_yes : &i_no) len:4]; } static inline BOOL getBoolOption(id self, int _option) { int value, len; [self getOption:_option level:SOL_SOCKET value:&value len:&len]; return (value ? YES : NO); } - (void)setDebug:(BOOL)_flag { setBoolOption(self, SO_DEBUG, _flag); } - (BOOL)doesDebug { return getBoolOption(self, SO_DEBUG); } - (void)setReuseAddress:(BOOL)_flag { setBoolOption(self, SO_REUSEADDR, _flag); } - (BOOL)doesReuseAddress { return getBoolOption(self, SO_REUSEADDR); } - (void)setKeepAlive:(BOOL)_flag { setBoolOption(self, SO_KEEPALIVE, _flag); } - (BOOL)doesKeepAlive { return getBoolOption(self, SO_KEEPALIVE); } - (void)setDontRoute:(BOOL)_flag { setBoolOption(self, SO_DONTROUTE, _flag); } - (BOOL)doesNotRoute { return getBoolOption(self, SO_DONTROUTE); } - (void)setSendBufferSize:(int)_size { [self setOption:SO_SNDBUF level:SOL_SOCKET value:&_size len:sizeof(_size)]; } - (int)sendBufferSize { int size, len; [self getOption:SO_SNDBUF level:SOL_SOCKET value:&size len:&len]; return size; } - (void)setReceiveBufferSize:(int)_size { [self setOption:SO_RCVBUF level:SOL_SOCKET value:&_size len:sizeof(_size)]; } - (int)receiveBufferSize { int size, len; [self getOption:SO_RCVBUF level:SOL_SOCKET value:&size len:&len]; return size; } - (int)getSocketError { int error, len; [self getOption:SO_ERROR level:SOL_SOCKET value:&error len:&len]; return error; } /* description */ - (NSString *)description { return [NSString stringWithFormat: @"<%@[0x%p]: fd=%i type=%i bound=%@ domain=%@>", NSStringFromClass([self class]), self, [self fileDescriptor], [self socketType], [self localAddress] ? [self localAddress] : (id)@"no", [self domain] ]; } @end /* NGSocket */ @implementation _NGConcreteSocketFileHandle - (id)initWithSocket:(id)_socket { return [super initWithStream:(id)_socket]; } // accessors - (int)fileDescriptor { return [(NGSocket *)stream fileDescriptor]; } @end /* _NGConcreteSocketFileHandle */ #if defined(WIN32) && !defined(__CYGWIN32__) // Windows Descriptor functions // ******************** Poll ********************* int NGPollDescriptor(SOCKET _fd, short _events, int _timeout) { struct timeval timeout; fd_set rSet; fd_set wSet; fd_set eSet; int result; FD_ZERO(&rSet); FD_ZERO(&wSet); FD_ZERO(&eSet); if (_events & POLLIN) FD_SET(_fd, &rSet); if (_events & POLLOUT) FD_SET(_fd, &wSet); if (_events & POLLERR) FD_SET(_fd, &eSet); timeout.tv_sec = _timeout / 1000; timeout.tv_usec = _timeout * 1000 - timeout.tv_sec * 1000000; do { result = select(FD_SETSIZE, &rSet, &wSet, &eSet, &timeout); if (result == -1) { // error int e = WSAGetLastError(); if (e != WSAEINTR) // only retry of interrupted or repeatable break; } } while (result == -1); return (result < 0) ? -1 : result; } // ******************** Flags ******************** #if 0 int NGGetDescriptorFlags(int _fd) { int val; val = fcntl(_fd, F_GETFL, 0); if (val < 0) [NGIOException raiseWithReason:@"could not get descriptor flags"]; return val; } void NGSetDescriptorFlags(int _fd, int _flags) { if (fcntl(_fd, F_SETFL, _flags) == -1) [NGIOException raiseWithReason:@"could not set descriptor flags"]; } void NGAddDescriptorFlag (int _fd, int _flag) { int val = NGGetDescriptorFlags(_fd); NGSetDescriptorFlags(_fd, val | _flag); } #endif // ******************** NonBlocking IO ************ int NGDescriptorRecv(SOCKET _fd, char *_buf, int _len, int _flags, int _timeout) { int errorCode; int result; result = recv(_fd, _buf, _len, _flags); if (result == 0) return 0; // EOF errorCode = errno; if ((result == -1) && (errorCode == WSAEWOULDBLOCK)) { // retry #if 0 struct pollfd pfd; pfd.fd = _fd; pfd.events = POLLRDNORM; pfd.revents = 0; do { if ((result = poll(&pfd, 1, _timeout)) < 0) { errorCode = errno; // retry if interrupted if ((errorCode != EINTR) && (errorCode != EAGAIN)) break; } } while (result < 0); #endif result = 1; if (result == 1) { // data waiting, try to read result = recv(_fd, _buf, _len, _flags); if (result == 0) return 0; // EOF else if (result == -1) { errorCode = errno; if (errorCode == WSAEWOULDBLOCK) NSLog(@"WARNING: would block although descriptor was polled .."); } } else if (result == 0) { result = -2; } else result = -1; } return result; } int NGDescriptorSend(SOCKET _fd, const char *_buf, int _len, int _flags, int _timeout) { int errorCode; int result; result = send(_fd, _buf, _len, _flags); if (result == 0) return 0; // EOF errorCode = errno; if ((result == -1) && (errorCode == WSAEWOULDBLOCK)) { // retry #if 0 struct pollfd pfd; pfd.fd = _fd; pfd.events = POLLWRNORM; pfd.revents = 0; do { if ((result = poll(&pfd, 1, _timeout)) < 0) { errorCode = errno; if (errorCode != WSAEINTR) // retry only if interrupted break; } } while (result < 0); #endif result = 1; // block .. if (result == 1) { // data waiting, try to read result = send(_fd, _buf, _len, _flags); if (result == 0) return 0; // EOF } else if (result == 0) { #if 0 NSLog(@"nonblock: send on %i timed out after %i milliseconds ..", _fd, _timeout); #endif result = -2; } else result = -1; } return result; } #endif /* WIN32 */ SOPE/sope-core/NGStreams/COPYRIGHT0000644000000000000000000000010612242733417015356 0ustar rootrootCopyright (C) 2000-2005 SKYRIX Software AG Contact: info@skyrix.com SOPE/sope-core/NGStreams/NGDescriptorFunctions.m0000644000000000000000000002361612242733417020510 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #if !defined(WIN32) || defined(__CYGWIN32__) // similiar functions for Windows can be found in NGSocket.[hm] #include "NGDescriptorFunctions.h" #include "NGStreamExceptions.h" #include "common.h" #include "config.h" #ifdef HAVE_POLL # ifdef HAVE_POLL_H # include # endif # ifdef HAVE_SYS_POLL_H # include # endif # ifndef POLLRDNORM # define POLLRDNORM POLLIN /* needed on Linux */ # endif #else # ifdef HAVE_SELECT_H # include # endif #endif #if defined(HAVE_SYS_SOCKET_H) || defined(__APPLE__) # include #endif #ifdef HAVE_SYS_FCNTL_H # include #endif #if defined(HAVE_FCNTL_H) || defined(__APPLE__) # include #endif #if HAVE_UNISTD_H || defined(__APPLE__) # include #endif #if HAVE_LIMITS_H # include #endif #if HAVE_SYS_TIME_H || defined(__APPLE__) # include #endif #if HAVE_SYS_TYPES_H || defined(__APPLE__) # include #endif #if !HAVE_TTYNAME_R # if LIB_FOUNDATION_LIBRARY extern NSRecursiveLock *libFoundationLock = nil; # define systemLock libFoundationLock # else # ifndef __APPLE__ # warning "No locking support for ttyname on this platform" # endif # define systemLock (id)nil # endif #endif // ******************** Poll ********************* int NGPollDescriptor(int _fd, short _events, int _timeout) { #ifdef HAVE_POLL struct pollfd pfd; int result; pfd.fd = _fd; pfd.events = _events; pfd.revents = 0; do { result = poll(&pfd, 1, _timeout); if (result < 0) { // error int e = errno; if (e == 0) { NSLog(@"%s: errno is 0, but return value of poll is <0 (%i) (retry) ?!", __PRETTY_FUNCTION__, result); continue; } if ((e != EAGAIN) && (e != EINTR)) // only retry of interrupted or repeatable break; } } while (result < 0); /* revents: POLLERR POLLHUP POLLNVAL */ return (result < 0) ? -1 : result; #else struct timeval timeout; fd_set rSet; fd_set wSet; fd_set eSet; int result; FD_ZERO(&rSet); FD_ZERO(&wSet); FD_ZERO(&eSet); if (_events & POLLIN) FD_SET(_fd, &rSet); if (_events & POLLOUT) FD_SET(_fd, &wSet); if (_events & POLLERR) FD_SET(_fd, &eSet); timeout.tv_sec = _timeout / 1000; timeout.tv_usec = _timeout * 1000 - timeout.tv_sec * 1000000; do { result = select(FD_SETSIZE, &rSet, &wSet, &eSet, &timeout); if (result == -1) { // error int e = errno; if ((e != EAGAIN) && (e != EINTR)) // only retry of interrupted or repeatable break; } } while (result == -1); return (result < 0) ? -1 : result; #endif } // ******************** Flags ******************** int NGGetDescriptorFlags(int _fd) { int val; val = fcntl(_fd, F_GETFL, 0); if (val < 0) [NGIOException raiseWithReason:@"could not get descriptor flags"]; return val; } void NGSetDescriptorFlags(int _fd, int _flags) { if (fcntl(_fd, F_SETFL, _flags) == -1) [NGIOException raiseWithReason:@"could not set descriptor flags"]; } void NGAddDescriptorFlag(int _fd, int _flag) { int val = NGGetDescriptorFlags(_fd); NGSetDescriptorFlags(_fd, val | _flag); } // ******************** NonBlocking IO ************ static int enableDescLogging = -1; int NGDescriptorRecv(int _fd, char *_buf, int _len, int _flags, int _timeout /* in ms */) { int errorCode; int result; if (enableDescLogging == -1) { enableDescLogging = [[[NSUserDefaults standardUserDefaults] objectForKey:@"NGLogDescriptorRecv"] boolValue] ? YES : NO; } if (enableDescLogging) { NSLog(@"%s(fd=%i,buf=0x%p,len=%i,flags=%i,timeout=%i)", __PRETTY_FUNCTION__, _fd,_buf,_len,_flags,_timeout); } if (_timeout == -1) _timeout = 1000 * 60 * 60; /* default timeout: 1 hour */ result = recv(_fd, _buf, _len, _flags); errorCode = errno; if (result == 0) return 0; // EOF if (enableDescLogging) { if ((result < 0) && (errorCode == EINVAL)) { NSLog(@"%s: invalid argument in recv(%i, 0x%p, %i, %i)", __PRETTY_FUNCTION__, _fd, _buf, _len, _flags); } } if (enableDescLogging) { NSLog(@"result=%i, error=%i(%s)", result, errorCode, strerror(errorCode)); } if ((result == -1) && (errorCode == EWOULDBLOCK)) { // retry #if HAVE_POLL struct pollfd pfd; pfd.fd = _fd; pfd.events = POLLRDNORM; pfd.revents = 0; do { if (enableDescLogging) NSLog(@"starting poll, loop (to=%i)", _timeout); if ((result = poll(&pfd, 1, _timeout)) < 0) { errorCode = errno; if (enableDescLogging) { if (errno == EINVAL) NSLog(@"%s: invalid argument to poll(...)", __PRETTY_FUNCTION__); } if (errorCode == 0) { NSLog(@"%s: errno is 0, but return value of poll is <0 (%i) (retry) ?!", __PRETTY_FUNCTION__, result); continue; } // retry if interrupted if ((errorCode != EINTR) && (errorCode != EAGAIN)) break; } } while (result < 0); #else struct timeval timeout; fd_set rSet; fd_set wSet; fd_set eSet; FD_ZERO(&rSet); FD_ZERO(&wSet); FD_ZERO(&eSet); FD_SET(_fd, &rSet); timeout.tv_sec = _timeout / 1000; timeout.tv_usec = _timeout * 1000 - timeout.tv_sec * 1000000; do { result = select(FD_SETSIZE, &rSet, &wSet, &eSet, &timeout); if (enableDescLogging) { if ((result < 0) && (errno == EINVAL)) NSLog(@"%s: invalid argument in select(...)", __PRETTY_FUNCTION__); } if (result == -1) { // error int e = errno; if ((e != EAGAIN) && (e != EINTR)) // only retry of interrupted or repeatable break; } } while (result == -1); #endif if (result == 1) { // data waiting, try to read if (enableDescLogging) NSLog(@"receiving data ..."); result = recv(_fd, _buf, _len, _flags); if (result == 0) return 0; // EOF else if (result == -1) { errorCode = errno; if (errorCode == EWOULDBLOCK) NSLog(@"WARNING: would block although descriptor was polled .."); } } else if (result == 0) { if (enableDescLogging) { NSLog(@"nonblock: recv on %i timed out after %i milliseconds ..", _fd, _timeout); } result = -2; } else result = -1; } return result; } int NGDescriptorSend (int _fd, const char *_buf, int _len, int _flags, int _timeout) { int errorCode; int result; result = send(_fd, _buf, _len, _flags); if (result == 0) return 0; // EOF errorCode = errno; if ((result == -1) && (errorCode == EWOULDBLOCK)) { // retry #if HAVE_POLL struct pollfd pfd; pfd.fd = _fd; pfd.events = POLLWRNORM; pfd.revents = 0; do { if ((result = poll(&pfd, 1, _timeout)) < 0) { errorCode = errno; if (errorCode == 0) { NSLog(@"%s: errno is 0, but return value of poll is <0 (%i) (retry) ?!", __PRETTY_FUNCTION__, result); continue; } if (errorCode != EINTR) // retry only if interrupted break; } } while (result < 0); #else struct timeval timeout; fd_set rSet; fd_set wSet; fd_set eSet; FD_ZERO(&rSet); FD_ZERO(&wSet); FD_ZERO(&eSet); FD_SET(_fd, &wSet); timeout.tv_sec = _timeout / 1000; timeout.tv_usec = _timeout * 1000 - timeout.tv_sec * 1000000; do { result = select(FD_SETSIZE, &rSet, &wSet, &eSet, &timeout); if (result == -1) { // error int e = errno; if ((e != EAGAIN) && (e != EINTR)) // only retry of interrupted or repeatable break; } } while (result == -1); #endif if (result == 1) { // data waiting, try to read result = send(_fd, _buf, _len, _flags); if (result == 0) return 0; // EOF } else if (result == 0) { NSLog(@"nonblock: send on %i timed out after %i milliseconds ..", _fd, _timeout); result = -2; } else result = -1; } return result; } // ******************** TTY ********************* /* Check whether the descriptor is associated to a terminal device. Get the name of the associated terminal device. */ BOOL NGDescriptorIsAtty(int _fd) { #if HAVE_ISATTY return isatty(_fd) == 1 ? YES : NO; #else return NO; #endif } NSString *NGDescriptorGetTtyName(int _fd) { #if HAVE_ISATTY if (isatty(_fd) != 1) // not connected to a terminal device ? return nil; #endif { #if HAVE_TTYNAME_R # ifndef sparc extern int ttyname_r(int, char*, size_t); # endif # ifdef _POSIX_PATH_MAX char namebuffer[_POSIX_PATH_MAX + 128]; # else char namebuffer[4096]; # endif if (ttyname_r(_fd, namebuffer, sizeof(namebuffer))) return [NSString stringWithCString:namebuffer]; #elif HAVE_TTYNAME char *result = NULL; NSString *str = nil; int errCode = 0; [systemLock lock]; { result = ttyname(_fd); errCode = errno; if (result) str = [NSString stringWithCString:result]; } [systemLock unlock]; if (str) return str; #endif } return nil; } #endif // WIN32 SOPE/sope-core/NGStreams/NGStreamExceptions.m0000644000000000000000000001663012242733417017774 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "common.h" #include "NGStreamExceptions.h" @interface NSObject(setLastException) - (void)setLastException:(NSException *)_exception; @end @implementation NGIOException - (id)init { self = [super initWithName:NSStringFromClass([self class]) reason:@"an IO exception occured" userInfo:nil]; return self; } - (id)initWithReason:(NSString *)_reason { self = [super initWithName:NSStringFromClass([self class]) reason:_reason userInfo:nil]; return self; } + (void)raiseWithReason:(NSString *)_reason { [[[self alloc] initWithReason:_reason] raise]; } + (void)raiseOnStream:(id)_stream reason:(NSString *)_reason { NGIOException *e; e = [[self alloc] initWithReason:_reason]; if (_stream) { if ([_stream respondsToSelector:@selector(setLastException:)]) { [_stream setLastException:e]; [e release]; return; } } [e raise]; } + (void)raiseOnStream:(id)_stream { [self raiseOnStream:_stream reason:nil]; } @end /* NGIOException */ @implementation NGStreamException - (NSString *)defaultReason { return @"a stream exception occured"; } - (id)init { return [self initWithStream:nil reason:[self defaultReason]]; } - (id)initWithStream:(id)_stream { return [self initWithStream:_stream reason:[self defaultReason]]; } - (id)initWithStream:(id)_stream format:(NSString *)_format,... { NSString *tmp = nil; va_list ap; va_start(ap, _format); tmp = [[NSString alloc] initWithFormat:_format arguments:ap]; va_end(ap); self = [self initWithStream:_stream reason:tmp]; [tmp release]; return self; } - (id)initWithStream:(id)_stream reason:(NSString *)_reason { NSDictionary *ui = nil; ui = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:errno], @"errno", [NSString stringWithCString:strerror(errno)], @"error", [NSValue valueWithNonretainedObject:_stream], @"stream", nil]; self = [super initWithName:NSStringFromClass([self class]) reason:_reason userInfo:ui]; if (self) { self->streamPointer = [[NSValue valueWithNonretainedObject:_stream] retain]; } return self; } + (id)exceptionWithStream:(id)_stream { return [[self alloc] initWithStream:_stream]; } + (id)exceptionWithStream:(id)_stream reason:(NSString *)_reason { return [[self alloc] initWithStream:_stream reason:_reason]; } + (void)raiseWithStream:(id)_stream { [[[self alloc] initWithStream:_stream] raise]; } + (void)raiseWithStream:(id)_stream reason:(NSString *)_reason { [[[self alloc] initWithStream:_stream reason:_reason] raise]; } + (void)raiseWithStream:(id)_stream format:(NSString *)_format,... { NSString *tmp = nil; va_list ap; va_start(ap, _format); tmp = [[NSString alloc] initWithFormat:_format arguments:ap]; va_end(ap); tmp = [tmp autorelease]; [[[self alloc] initWithStream:_stream reason:tmp] raise]; } - (void)dealloc { [self->streamPointer release]; [super dealloc]; } @end /* NGStreamException */ // ******************** NGEndOfStreamException ******************** @implementation NGEndOfStreamException - (id)initWithStream:(id)_stream { return [self initWithStream:_stream readCount:0 safeCount:0 data:nil]; } - (id)initWithStream:(id)_stream readCount:(unsigned)_readCount safeCount:(unsigned)_safeCount data:(NSData *)_data { NSString *tmp; tmp = [NSString stringWithFormat:@"reached end of stream %@", _stream]; if ((self = [super initWithStream:_stream reason:tmp])) { self->readCount = _readCount; self->safeCount = _safeCount; self->data = [_data retain]; } return self; } - (void)dealloc { [self->data release]; [super dealloc]; } /* accessors */ - (NSData *)readBytes { return self->data; } @end /* NGEndOfStreamException */ // ******************** open state exceptions ********************* @implementation NGCouldNotOpenStreamException - (NSString *)defaultReason { return @"could not open stream"; } @end @implementation NGCouldNotCloseStreamException - (NSString *)defaultReason { return @"could not close stream"; } @end @implementation NGStreamNotOpenException - (NSString *)defaultReason { return @"stream is not open"; } @end // ******************** NGStreamErrors **************************** @implementation NGStreamErrorException - (id)initWithStream:(id)_stream errorCode:(int)_code { NSString *tmp = nil; tmp = [NSString stringWithFormat:@"stream error occured, errno=%i error=%s", _code, strerror(_code)]; if ((self = [self initWithStream:_stream reason:tmp])) { osErrorCode = _code; } tmp = nil; return self; } + (void)raiseWithStream:(id)_stream errorCode:(int)_code { [[[self alloc] initWithStream:_stream errorCode:_code] raise]; } - (int)operationSystemErrorCode { return osErrorCode; } - (NSString *)operatingSystemError { return [NSString stringWithCString:strerror(osErrorCode)]; } @end /* NGStreamErrorException */ @implementation NGStreamReadErrorException - (NSString *)defaultReason { return @"read error on stream"; } @end /* NGStreamReadErrorException */ @implementation NGStreamWriteErrorException - (NSString *)defaultReason { return @"write error on stream"; } @end /* NGStreamWriteErrorException */ @implementation NGStreamSeekErrorException - (NSString *)defaultReason { return @"seek error on stream"; } @end // ******************** NGStreamModeExceptions ******************** @implementation NGStreamModeException - (NSString *)defaultReason { return @"stream mode failure"; } @end @implementation NGUnknownStreamModeException - (NSString *)defaultReason { return @"unknow stream mode"; } - (id)initWithStream:(id)_stream mode:(NSString *)_streamMode { if ((self = [super initWithStream:_stream format:@"unknown stream mode: %@", _streamMode])) { streamMode = [_streamMode copy]; } return self; } - (void)dealloc { [self->streamMode release]; [super dealloc]; } @end /* NGUnknownStreamModeException */ @implementation NGReadOnlyStreamException - (NSString *)defaultReason { return @"stream is read only"; } @end /* NGReadOnlyStreamException */ @implementation NGWriteOnlyStreamException - (NSString *)defaultReason { return @"stream is write only"; } @end /* NGWriteOnlyStreamException */ // ******************** NGIOAccessException ****************** @implementation NGIOAccessException @end @implementation NGIOSearchAccessException @end SOPE/sope-core/NGStreams/ChangeLog0000644000000000000000000003553312242733417015651 0ustar rootroot2010-01-28 Wolfgang Sourdeau * NGActiveSocket.m (-safeReadBytes:count:): explicitly make use of [NGEndOfStreamException alloc] when allocating localException, since the init method is only present in that class and this may cause a crash on rare occasions. 2010-01-25 Wolfgang Sourdeau * NGCTextStream.m (-writeString:): use getCString:maxLength:encoding: on GNUstep too to avoid a possible segfault in GNUstep's handling of cStringLength. 2009-11-11 Wolfgang Sourdeau * NGActiveSocket.m (+socketPair): removed the domain: parameter as only AF_LOCAL is permitted. Assign a default instance of NGLocalSocketAddress to the sockets to "declare" the sockets as connected. * NGActiveSocket.m (-setSendTimeout, -setReceiveTimeout): make use of those methods to actually configure the timeouts on the socket objects (via setsockopt and SO_RCVTIMEO and SO_SNDTIMEO). 2009-03-24 Wolfgang Sourdeau * GNUmakefile.preamble: add machine-type to include path (eg i386) (v4.7.57) 2008-02-09 Helge Hess * NGCTextStream.m: fixed -writeString: on MacOS > 10.4, use -maximumLengthOfBytesUsingEncoding: (v4.7.56) 2007-12-03 Helge Hess * NGCTextStream.m: replaced usage of getCString on MacOS > 10.4 (v4.7.55) * NGTextStream.m: do not use exception handlers in combination with varargs on MacOS >10.5 (v4.7.54) 2007-08-09 Wolfgang Sourdeau * NGInternetSocketAddress.m: properly convert ports returned by getservbyname() to host byteorder prior calling -initWithPort:onHost: (fixes OGo bug #1896) (v4.7.53) 2007-08-07 Marcus Mueller * NGInternetSocketAddress.m: do not define USE_GETHOSTBYNAME_R on FreeBSD (although HAVE_GETHOSTBYNAME_R is defined). It appears gethostbyname() is thread safe on FreeBSD and there are 3 API versions of gethostbyname_r(), which isn't worth the hassle to check in this case. Changed code to consequently use USE_GETHOSTBYNAME_R. (v4.7.52) 2006-07-04 Helge Hess * 64bit fixes (v4.5.51) 2006-07-03 Helge Hess * use %p for pointer formats, fixed gcc 4.1 warnings (v4.5.50) 2005-08-10 Helge Hess * reorganized inclusion to support frameworks (v4.5.49) 2005-05-03 Helge Hess * NGSocket.m (SockAddrLenType): fixed a Tiger warning (v4.5.48) 2005-04-24 Helge Hess * v4.5.47 * fixed some gcc 4.0 warnings * NGCTextStream.m, NGFileStream.m: do not flush input streams 2004-11-07 Helge Hess * NGStreams.xcode: properly link against libssl/libcrypto and set HAVE_OPENSSL=1, this enables SSL support on MacOSX 2004-10-04 Marcus Mueller * NGStreams.xcode: updated to the current build version 2004-09-29 Helge Hess * NGInternetSocketAddress.m: _fillAddress() does not throw an exception, just returns it. Improved -description (v4.3.46) 2004-09-06 Helge Hess * NGByteBuffer.m, NGLocalSocketAddress.m, NGCharBuffer.m: fixed exception handling to be the same on all Foundation libraries (v4.3.45) 2004-08-29 Helge Hess * added hack to install the project in FHS locations - the library, its headers, the tools and the resources will be installed in FHS_INSTALL_ROOT if specified (eg make FHS_INSTALL_ROOT=/usr/local) (v4.3.44) 2004-08-29 Marcus Mueller * NGStreams.xcode: various fixes for project settings 2004-08-27 Helge Hess * GNUmakefile.postamble: do not automatically run autoconf to update configure (the configure checked in should work fine on all platforms) (v4.3.43) 2004-08-23 Marcus Mueller * added new Xcode project 2004-08-20 Helge Hess * moved to SOPE 4.3 (v4.3.42) 2004-07-22 Helge Hess * NGLocalSocketAddress.m: fixed a gcc 3.4 warning (v4.2.41) 2004-07-05 Helge Hess * GNUmakefile.preamble: added missing library lookup path to EOControl, this fixes OGo bug #820 (v4.2.40) 2004-06-09 Helge Hess * GNUmakefile.preamble: added prebinding (v4.2.39) 2004-05-05 Marcus Mueller * GNUmakefile.preamble: added support for building with GNUSTEP_BUILD_DIR environment variable set for recent gnustep-make package. (v4.2.38) 2004-02-11 Helge Hess * GNUmakefile.preamble: define OPENSSL_NO_KRB5 to keep Fedora and RH9 happy on compilation (v4.2.37) 2004-02-11 Helge Hess * GNUmakefile: enable SSL per default (this adds OpenSSL-devel as a prerequisite unless you compile with ssl=no) (v4.2.36) 2004-02-10 Helge Hess * NGCTextStream.m, NGConcreteStreamFileHandle.m, NGFilterStream.m, NGFilterTextStream.m: fixed minor compilation warnings on OSX (v4.2.35) 2004-01-25 Helge Hess * v4.2.34 * NGDataStream.m: optimized processing for readonly streams (only call -length and -bytes on the data object in the beginning) - this gives us about 100ms when parsing 1000 IMAP4 headers (about 3-4% speedup) * NGDataStream.m: added method to open a datastream in read-only mode even with NSMutableData objects (allows for optimizations in the stream) 2004-01-24 Helge Hess * v4.2.33 * NGBufferedStream.m, NGByteBuffer.m: avoid creation of buffered stream if the source is an NGDataStream (no buffering needed ;-), do not create buffer streams when no source stream is passed in * NGDataStream.m: NGDataStream objects can now add as byte buffers on their own - which removes a lot of unncessary overhead when parsing NSData (this gives a speedup of about 10% when parsing IMAP4 mail headers) 2004-01-19 Helge Hess * NGDataStream.m: properly return last-exception (always returned nil!) - could have side-effects (v4.2.32) 2004-01-12 Helge Hess * NGDataStream.m: subminor cleanups (v4.2.31) 2003-11-30 Helge Hess * configure.in: patched to use GNUSTEP_MAKEFILES (as suggested by chunsj@embian.com) (v4.2.30) 2003-11-09 Helge Hess * NGActiveSocket.m, NGFilterStream.m, NGStreamCoder.m: minor tweaks for MacOSX (v4.2.29) 2003-10-13 Helge Hess * GNUmakefile, GNUmakefile.postamble: removed NGStream+serialization, NGActiveSocket+serialization from compilation - those files should be removed completely as they aren't used anywhere (v4.2.28) 2003-09-07 Marcus Mueller * NGLocalSocketAddress.m, NGLocalSocketDomain.m: include if __FreeBSD__ is defined. This will currently affect FreeBSD 4.x only. (v4.2.27) 2003-09-06 Helge Hess * various fixes to warnings on MacOSX (v4.2.26) 2003-09-06 Marcus Mueller * configure.in: truncate target_os to "freebsd" on FreeBSD 2003-09-01 Helge Hess * v4.2.25 * fixes for MacOSX * GNUmakefile.postamble: do not generate config.h on MacOSX, use the preconfigured on in the macosx subdir 2003-07-28 Helge Hess * small cleanups to the included headers to improve gstep-base compatibility (v4.2.24) 2003-07-20 Helge Hess * NGGZipStream.m: removed dependency on zutil.h (v4.2.23) 2003-05-26 Helge Hess * updated MacOSX support, removed dependencies on FoundationExt (v4.2.22) 2003-05-15 Helge Hess * NGByteBuffer.m: fixed the last signed/unsigned warnings, smaller cleanups to -la: (v4.2.21) 2003-05-14 Helge Hess * v4.2.20 * fixed some more gcc 3.3 (signed/unsigned) warnings * NGInternetSocketAddress.m: some change ? * removed several gcc 3.3 warnings 2003-01-30 Helge Hess * NGSocket.m: allocate sockets in the NGInternetSocketDomain by default (v4.2.19) 2003-01-20 Helge Hess * replaced some RETAIN macros (v4.2.18) 2003-01-14 Helge Hess * NGPassiveSocket.m, NGInternetSocketDomain.m: small code cleanups (v4.2.17) 2003-01-07 Helge Hess * moved testsock.m to skyrix-core-42/samples/ * GNUmakefile: added optional SSL activation (using ssl=yes) * v4.2.16 * changes for improved compilation on MacOSX, replaced RETAIN macros with methods Mon Dec 30 13:51:15 2002 Helge Hess * v4.2.15 * NGStreams/NGStreams.h: do not include NGStream+serialization.h * NGStreams/NGNet.h: do not include NGActiveSocket+serialization.h * NGByteBuffer.m: fixed a gcc 3.2 warning Fri Dec 27 10:50:56 2002 Helge Hess * GNUmakefile: removed NGStreamCoder from library * testsock.m: rewritten to use a tool class * NGStreamCoder.m: fixed some gcc 3.2 compiler warnings * NGStreams/NGStreams.h: does not include NGStreamCoder.h * fixed Copyright headers in most files (v4.2.14) 2002-11-01 Helge Hess * NGDescriptorFunctions.m: added some debugging/logging (new default NGLogDescriptorRecv) (v4.2.13) 2002-09-30 Helge Hess * testsock.m: added various tests * NGLockingStream.m, NGDataStream.m, NGFileStream.m, NGByteBuffer.m: removed compilation warnings * NGCTextStream.m: do not create a text stream if the source stream is nil ... * started support for OpenSSL sockets (v4.2.12) 2002-08-30 Helge Hess * NGInternetSocketAddress.m: fixed a compilation bug on hosts which are have gethostbyaddr_r() but are not Linux (eg Solaris) (v4.2.11) Thu Aug 29 16:46:25 2002 Jan Reichmann * v4.2.10 * NGBase64Stream.m, NGConcreteStreamFileHandle.m, NGStream.m: fixed 'char-buffer in Exception Handler scope' bug 2002-08-28 Helge Hess * some tweaks to support OSX Jaguar (v4.2.9) 2002-08-15 Helge Hess * NGFileStream.m: do not log, if the filestream is closed on deallocation (v4.2.8) Wed Aug 14 09:49:05 2002 Bjoern Stierand * NGNetUtilities.m (NGSocketAddressFromString): allows definition of kernel bound addresses using 'host:auto' or '*:auto' (v4.2.7) 2002-07-08 Helge Hess * v4.2.6 [extracted from cvs] * fixed a major retain cycle between stream exceptions and streams (lastException ptr). In the case of datastreams this lead to huge memory consumption if the stream reached EOF (the datastream was never released and the whole data kept in memory, most notably this resulted in a leaking MIME parser) => fixes SuSE bug 16845 * added DESIGN document (small ;-) Fri Jun 26 10:40:05 2002 Helge Hess * NGLocalSocketAddress.h: small fix for MacOSX Fri May 31 16:08:56 2002 Jan41 Reichmann * NGCTextStream.m, NGByteBuffer.m, NGActiveSocket.m, NGBufferedStream.m: remove NSLogs * NGDataStream.*: add exception-handling (raise version) * NGStreamExceptions.*: add +exceptionWithStream methods Tue May 21 12:26:03 2002 Helge Hess * NGActiveSocket.m: fixed a small exception related problem with +socketConnectedToAddress: ... v4.2.5 [extracted from cvs] Fri May 17 14:49:21 2002 Helge Hess * added NGGZipStream from NGZlib Mon Apr 29 13:46:11 2002 Helge Hess * NGByteBuffer.m: modified to support the new exception-less IO ... Tue Apr 23 12:32:23 2002 Helge Hess * NGActiveSocket.m: do not throw exception if connect failed (rather set the last exception ...) Thu Mar 14 13:39:10 2002 Helge Hess * NGActiveSocket.m: marks itself as shut down, if the errno says so * NGStream.m(NGSafe...): fixed exception handling * NGActiveSocket.m(safeWriteBytes:length:): added IMP cache, fixed exception handling bug ... * NGBufferedStream.m: added flush buffer size check Wed Mar 13 17:24:47 2002 Helge Hess * NGCTextStream.m: added new exception handling * NGTextStream.m: added +version, added lastException * NGActiveSocket.m: does not throw exceptions in -read.. and -write.. Mon Mar 4 11:05:54 2002 Helge Hess * NGActiveSocket.m: throws less exceptions (uses -lastException,retval) Mon Feb 25 18:43:13 2002 Helge Hess * NGBufferedStream.m: checks return codes Thu Feb 21 12:04:16 2002 Helge Hess * NGStreamExceptions.m: added -raiseOnStream:... Wed Feb 20 13:30:44 2002 Helge Hess * everything reworked not to throw exceptions ... Fri Dec 7 14:35:47 2001 Jan41 Reichmann * NGByteBuffer.m: add profiling Mon Oct 8 17:47:01 2001 Helge Hess * NGLocalSocketAddress.m, NGPassiveSocket.m: better Linux-bug support ;-) (local sock addresses with length=2, as given by accept()) Thu Oct 4 11:15:34 2001 Helge Hess * NGInternetSocketAddress.m: fixed recursion bug Thu Aug 9 14:14:17 2001 Helge Hess * removed all NGUrl related stuff Thu Aug 9 14:00:04 2001 Helge Hess * moved URL escaping to NGExtensions * NGFileStream.m: added -initWithPath: Tue May 15 19:05:45 2001 Helge Hess * NGActiveSocket.m: added max-retry count (20) for writeBytes: with errno==0 Wed May 9 19:22:43 2001 Joerg Grimm * NGActiveSocket.m: check for errno=0 if writeResult<0 Mon Feb 26 11:13:12 2001 Helge Hess * NGActiveSocket.m: added more errno=0-on-fail checking Fri Feb 23 21:40:40 2001 Helge Hess * NGActiveSocket.m: check for errno=0 if result<0 * NGDescriptorFunctions.m: check for errno=0 if result<0 Tue Jan 30 19:50:13 2001 Helge Hess * NGUrl.m: modified URL encoding/decoding stuff to use unsigned char Mon Sep 18 10:47:41 2000 Helge Hess * NGCTextStream.m: fixed bug in -writeString Tue Jun 13 19:40:41 2000 Helge Hess * NGUrl.m, NGFileUrl.m: doesn't use stack-based buffers anymore Fri Jun 9 17:38:27 2000 Helge Hess * GNUmakefile: added -Wall Tue Feb 29 17:08:45 2000 Helge Hess * MOF3 import SOPE/sope-core/NGStreams/config.h.in0000644000000000000000000001344012242733417016113 0ustar rootroot#ifndef __config_h__ #define __config_h__ /* Define if system calls automatically restart after interruption by a signal. */ #undef HAVE_RESTARTABLE_SYSCALLS /* Define if you have the gethostbyname_r function. */ #undef HAVE_GETHOSTBYNAME_R /* Define if you have the gethostbyaddr_r function. */ #undef HAVE_GETHOSTBYADDR_R /* Define if you have the gethostent_r function. */ #undef HAVE_GETHOSTENT_R /* Define if you have posix mmap function. */ #undef HAVE_MMAP /* Define if you have the getcwd function */ #undef HAVE_GETCWD /* Define if you have the getuid function */ #undef HAVE_GETUID /* Define if you have the getpwnam function */ #undef HAVE_GETPWNAM /* Define if you have the getpwuid function */ #undef HAVE_GETPWUID /* Define if you have the kill function */ #undef HAVE_KILL /* Define if you have the statvfs function */ #undef HAVE_STATVFS /* Define if you have the poll function */ #undef HAVE_POLL /* Define if you have the chown function */ #undef HAVE_CHOWN /* Define if you have the symlink function */ #undef HAVE_SYMLINK /* Define if you have the readlink function */ #undef HAVE_READLINK /* Define if you have the fsync function */ #undef HAVE_FSYNC /* Define if you have the opendir family of functions */ #undef HAVE_OPENDIR /* Define if you have the isatty function */ #undef HAVE_ISATTY /* Define if you have the ttyname function */ #undef HAVE_TTYNAME /* Define if you have the ttyname_r function */ #undef HAVE_TTYNAME_R /* Define if you have the header file. */ #undef HAVE_STRING_H /* Define if you have the header file. */ #undef HAVE_STRINGS_H /* Define if you have the header file */ #undef HAVE_MEMORY_H /* Define if you have the header file. */ #undef HAVE_STDLIB_H /* Define if you have the header file. */ #undef HAVE_LIMITS_H /* Define if you have the header file. */ #undef HAVE_LIBC_H /* Define if you have the header file */ #undef HAVE_SYS_STAT_H /* Define if you have the header file */ #undef HAVE_SYS_FCNTL_H /* Define if you have the header file */ #undef HAVE_FCNTL_H /* Define if you have the header file */ #undef HAVE_SYS_VFS_H /* Define if you have the header file */ #undef HAVE_SYS_STATFS_H /* Define if you have the header file */ #undef HAVE_SYS_STATVFS_H /* Define if you have the header file */ #undef HAVE_POLL_H /* Define if you have the header file */ #undef HAVE_SYS_POLL_H /* Define if you have the header file */ #undef HAVE_SYS_SOCKET_H /* Define if you have the header file */ #undef HAVE_UNISTD_H /* Define if you have the header file */ #undef HAVE_SYS_IOCTL_H /* Define if you have the header file */ #undef HAVE_SYS_FILIO_H /* Define if you have the header file */ #undef HAVE_NETINET_IN_H /* Define if you have the header file */ #undef HAVE_NETDB_H /* Define if you have the header file */ #undef HAVE_WINDOWS_H /* Define if you have the header file */ #undef HAVE_WINSOCK_H /* Define if you have the header file */ #undef HAVE_WINDOWS32_SOCKETS_H /* Define if you have the header file */ #undef HAVE_PWD_H /* Define if you have the header file */ #undef HAVE_PROCESS_H /* Define if you have the header file */ #undef HAVE_GRP_H /* Define if you have the header file */ #undef HAVE_SYS_FILE_H /* Define if you have the header file */ #undef HAVE_SYS_SELECT_H /* Define if you have the header file */ #undef HAVE_TIME_H /* Define if you have the header file */ #undef HAVE_SYS_TIME_H /* Define if you have the header file */ #undef HAVE_SYS_TYPES_H /* Define if you have the header file */ #undef HAVE_UTIME_H /* Define if you have the header file */ #undef HAVE_SYS_ERRNO_H /* Define if sys/wait.h is POSIX compatible */ #undef HAVE_SYS_WAIT_H /* Define this if you have the header file */ #undef HAVE_VFORK_H /* Define for vfork in case it's not defined */ #undef vfork /* Define for pid_t in case it's not defined */ #undef pid_t /* The following macros deal with directory entries. */ #undef HAVE_DIRENT_H #undef HAVE_SYS_NDIR_H #undef HAVE_SYS_DIR_H #undef HAVE_NDIR_H #undef HAVE_DIR_H /* The structure alignment as determined by configure */ #define STRUCT_ALIGNMENT @STRUCT_ALIGNMENT@ /* The name of the target platform, obtained by configure */ #define TARGET_PLATFORM "@host@" /* define POLL constants */ #if HAVE_POLL_H # include #endif #if HAVE_SYS_POLL_H # include #endif #ifndef POLLIN # ifdef HAVE_POLL # warning "manually declared POLLIN=1 .." # endif # define POLLIN 1 #endif #ifndef POLLOUT # ifdef HAVE_POLL # warning "manually declared POLLOUT=2 .." # endif # define POLLOUT 2 #endif #ifndef POLLERR # ifdef HAVE_POLL # warning "manually declared POLLERR=4 .." # endif # define POLLERR 4 #endif #ifndef POLLRDNORM # ifdef linux # define POLLRDNORM POLLIN # else /* !linux */ # ifdef POLLIN # ifdef HAVE_POLL # warning "manually declared POLLRDNORM=POLLIN .." # endif # define POLLRDNORM POLLIN # else # ifdef HAVE_POLL # warning "manually declared POLLRDNORM .." # endif # define POLLRDNORM 1 # endif # endif /* !linux */ #endif #ifndef POLLWRNORM # ifdef linux # define POLLWRNORM POLLOUT # else /* !linux */ # ifdef POLLOUT # ifdef HAVE_POLL # warning "manually declared POLLWRNORM=POLLOUT .." # endif # define POLLWRNORM POLLOUT # else # ifdef HAVE_POLL # warning "manually declared POLLWRNORM .." # endif # define POLLWRNORM 2 # endif # endif /* !linux */ #endif #endif /* __config_h__ */ SOPE/sope-core/NGStreams/NGStream+serialization.m0000644000000000000000000002261112242733417020577 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "config.h" #if !defined(WIN32) # if HAVE_SYS_TYPES_H # include # endif # if HAVE_SYS_SOCKET_H # include # endif # if HAVE_NETINET_IN_H # include # endif # include #endif #include "common.h" #include "NGStream+serialization.h" #if NeXT_RUNTIME # include #endif @implementation NGStream(serialization) // serialization - (void)serializeChar:(char)_value { NGStreamSerializeObjC(self, &_value, @encode(char), nil); } - (void)serializeShort:(short)_value { NGStreamSerializeObjC(self, &_value, @encode(short), nil); } - (void)serializeInt:(int)_value { NGStreamSerializeObjC(self, &_value, @encode(int), nil); } - (void)serializeLong:(long)_value { NGStreamSerializeObjC(self, &_value, @encode(long), nil); } - (void)serializeFloat:(float)_value { NGStreamSerializeObjC(self, &_value, @encode(float), nil); } - (void)serializeDouble:(double)_value { NGStreamSerializeObjC(self, &_value, @encode(double), nil); } - (void)serializeLongLong:(long long)_value { NGStreamSerializeObjC(self, &_value, @encode(long long), nil); } - (void)serializeCString:(const char *)_value { NGStreamSerializeObjC(self, &_value, @encode(char *), nil); } #if USE_SERIALIZER - (void)serializeDataAt:(const void*)_value ofObjCType:(const char*)_type context:(id)_callback { NGStreamSerializeObjC(self, _value, _type, _callback); } #endif // deserialization - (char)deserializeChar { char c; NGStreamDeserializeObjC(self, &c, @encode(char), nil); return c; } - (short)deserializeShort { short s; NGStreamDeserializeObjC(self, &s, @encode(short), nil); return s; } - (int)deserializeInt { int i; NGStreamDeserializeObjC(self, &i, @encode(int), nil); return i; } - (long)deserializeLong { long l; NGStreamDeserializeObjC(self, &l, @encode(long), nil); return l; } - (float)deserializeFloat { float f; NGStreamDeserializeObjC(self, &f, @encode(float), nil); return f; } - (double)deserializeDouble { double d; NGStreamDeserializeObjC(self, &d, @encode(double), nil); return d; } - (long long)deserializeLongLong { long long l; NGStreamDeserializeObjC(self, &l, @encode(long long), nil); return l; } - (char *)deserializeCString { char *result = NULL; NGStreamDeserializeObjC(self, &result, @encode(char *), nil); return result; } #if USE_SERIALIZER - (void)deserializeDataAt:(void *)_value ofObjCType:(const char *)_type context:(id)_callback { NGStreamDeserializeObjC(self, _value, _type, _callback); } #endif @end void NGStreamSerializeObjC(id self, const void *_value, const char *_type, #if USE_SERIALIZER id _callback #else id _callback #endif ) { switch (*_type) { case _C_ID: case _C_CLASS: [_callback serializeObjectAt:(id *)_value ofObjCType:_type intoData:(NSMutableData *)self]; break; case _C_CHARPTR: { const char *cstr = *(char **)_value; int len = cstr ? (int)strlen(cstr) : -1; NGStreamSerializeObjC(self, &len, @encode(int), _callback); if (cstr) [self safeWriteBytes:cstr count:len]; break; } case _C_ARY_B: { int i, offset, itemSize, count; count = atoi(_type + 1); // skip '[' and get dimension while (isdigit((int)*++_type)) ; // skip '[' and dimension itemSize = objc_sizeof_type(_type); for (i = offset = 0; i < count; i++, offset += itemSize) NGStreamSerializeObjC(self, (char *)_value + offset, _type, _callback); break; } case _C_STRUCT_B: { int offset = 0; while ((*_type != _C_STRUCT_E) && (*_type++ != '=')) ; // skip '=' while (YES) { NGStreamSerializeObjC(self, (char *)_value + offset, _type, _callback); offset += objc_sizeof_type(_type); _type = objc_skip_typespec(_type); if (*_type != _C_STRUCT_E) { int align, remainder; align = objc_alignof_type(_type); if ((remainder = offset % align)) offset += align - remainder; } else // done with structure break; } break; } case _C_PTR: NGStreamSerializeObjC(self, *(char **)_value, _type + 1, _callback); break; case _C_CHR: case _C_UCHR: [self safeWriteBytes:_value count:1]; break; case _C_SHT: case _C_USHT: { short netValue = htons(*(short *)_value); [self safeWriteBytes:&netValue count:2]; break; } case _C_INT: case _C_UINT: { int netValue = htonl(*(int *)_value); [self safeWriteBytes:&netValue count:4]; break; } case _C_LNG: case _C_ULNG: { long netValue = htonl(*(long *)_value); [self safeWriteBytes:&netValue count:sizeof(long)]; break; } case _C_FLT: { union fconv { float value; unsigned long ul; } fc; fc.value = *(float *)_value; fc.ul = htonl(fc.ul); [self safeWriteBytes:&fc count:sizeof(unsigned long)]; break; } case _C_DBL: { [self safeWriteBytes:_value count:8]; break; } default: NSCAssert1(0, @"unsupported C type %s ..", _type); break; } } void NGStreamDeserializeObjC(id self, void *_value, const char *_type, #if USE_SERIALIZER id _callback #else id _callback #endif ) { if ((_value == NULL) || (_type == NULL)) return; switch (*_type) { case _C_ID: case _C_CLASS: [_callback deserializeObjectAt:(id *)_value ofObjCType:_type fromData:(NSData *)self atCursor:0]; break; case _C_CHARPTR: { // malloced C-string int len = -1; NGStreamDeserializeObjC(self, &len, @encode(int), _callback); if (len == -1) // NULL-string *(char **)_value = NULL; else { char *result = NULL; #if LIB_FOUNDATION_LIBRARY result = NSZoneMallocAtomic(NULL, len + 1); #else result = NSZoneMalloc(NULL, len + 1); #endif result[len] = '\0'; if (len > 0) [self safeReadBytes:result count:len]; *(char **)_value = result; } break; } case _C_ARY_B: { int i, offset, itemSize, count; count = atoi(_type + 1); // skip '[' and get dimension while (isdigit((int)*++_type)) ; // skip '[' and dimension itemSize = objc_sizeof_type(_type); for (i = offset = 0; i < count; i++, offset += itemSize) NGStreamDeserializeObjC(self, (char *)_value + offset, _type, _callback); break; } case _C_STRUCT_B: { int offset = 0; while ((*_type != _C_STRUCT_E) && (*_type++ != '=')) ; // skip '=' while (YES) { NGStreamDeserializeObjC(self, (char *)_value + offset, _type, _callback); offset += objc_sizeof_type(_type); _type = objc_skip_typespec(_type); if (*_type != _C_STRUCT_E) { int align, remainder; align = objc_alignof_type(_type); if ((remainder = offset % align)) offset += align - remainder; } else // done with structure break; } break; } case _C_PTR: { // skip '^', type of the value the ptr points to void *result = NULL; result = NSZoneMalloc(NULL, objc_sizeof_type(_type + 1)); NGStreamDeserializeObjC(self, result, _type + 1, _callback); *(char **)_value = result; result = NULL; break; } case _C_CHR: case _C_UCHR: [self safeReadBytes:_value count:1]; break; case _C_SHT: case _C_USHT: [self safeReadBytes:_value count:2]; *(short *)_value = ntohs(*(short *)_value); break; case _C_INT: case _C_UINT: [self safeReadBytes:_value count:4]; *(int *)_value = ntohl(*(int *)_value); break; case _C_LNG: case _C_ULNG: [self safeReadBytes:_value count:4]; *(long *)_value = ntohl(*(long *)_value); break; case _C_FLT: { [self safeReadBytes:_value count:4]; *(long *)_value = ntohl(*(long *)_value); break; } case _C_DBL: { [self safeReadBytes:_value count:8]; break; } default: NSLog(@"unsupported C type %s ..", _type); break; } } void __link_NGStream_serialization(void) { __link_NGStream_serialization(); } SOPE/sope-core/NGStreams/NGFilterStream.m0000644000000000000000000001036512242733417017077 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include "common.h" @implementation NGFilterStream + (id)filterWithInputSource:(id)_s { return [[(NGFilterStream *)[self alloc] initWithInputSource:_s] autorelease]; } + (id)filterWithOutputSource:(id)_s { return [[(NGFilterStream *)[self alloc] initWithOutputSource:_s] autorelease]; } + (id)filterWithSource:(id)_s { return [[(NGFilterStream *)[self alloc] initWithSource:_s] autorelease]; } - (id)init { return [self initWithSource:nil]; } - (id)initWithSource:(id)_source { if ((self = [super init])) { self->source = [_source retain]; if ([source isKindOfClass:[NSObject class]]) { self->readBytes = (NGIOReadMethodType) [(NSObject *)self->source methodForSelector:@selector(readBytes:count:)]; self->writeBytes = (NGIOWriteMethodType) [(NSObject *)self->source methodForSelector:@selector(writeBytes:count:)]; } } return self; } - (id)initWithInputSource:(id)_source { if ((self = [super init])) { self->source = [_source retain]; if ([source isKindOfClass:[NSObject class]]) { self->readBytes = (NGIOReadMethodType) [(NSObject *)self->source methodForSelector:@selector(readBytes:count:)]; } } return self; } - (id)initWithOutputSource:(id)_source { if ((self = [super init])) { self->source = [_source retain]; if ([source isKindOfClass:[NSObject class]]) { self->writeBytes = (NGIOWriteMethodType) [(NSObject *)self->source methodForSelector:@selector(writeBytes:count:)]; } } return self; } - (void)dealloc { [self->source release]; self->readBytes = NULL; self->writeBytes = NULL; [super dealloc]; } /* accessors */ - (id)inputStream { return [self source]; } - (id)outputStream { return [self source]; } - (id)source { return self->source; } /* primitives */ - (NSException *)lastException { return [self->source lastException]; } - (void)resetLastException { [self->source resetLastException]; } - (void)setLastException:(NSException *)_exception { [self->source setLastException:_exception]; } - (BOOL)isOpen { return [self->source isOpen]; } - (unsigned)readBytes:(void *)_buf count:(unsigned)_len { if (self->readBytes) return (unsigned)readBytes(self->source, _cmd, _buf, _len); else return [self->source readBytes:_buf count:_len]; } - (unsigned)writeBytes:(const void *)_buf count:(unsigned)_len { if (self->writeBytes) return (unsigned)writeBytes(self->source, _cmd, _buf, _len); else return [self->source writeBytes:_buf count:_len]; } - (BOOL)flush { return [self->source flush]; } - (BOOL)close { return [((NGStream *)self->source) close]; } - (NGStreamMode)mode { return [(NGStream *)self->source mode]; } - (BOOL)isRootStream { return NO; } // all other things are forward - (void)forwardInvocation:(NSInvocation *)_invocation { if ([self->source respondsToSelector:[_invocation selector]]) { [_invocation setTarget:self->source]; [_invocation invoke]; } else [self doesNotRecognizeSelector:[_invocation selector]]; } /* description */ - (NSString *)description { return [NSString stringWithFormat: @"<%@[0x%p] source=%@ mode=%@>", NSStringFromClass([self class]), self, self->source ? (id)self->source : (id)@"nil", [self modeDescription]]; } @end /* NGFilterStream */ SOPE/sope-core/NGStreams/NGLocalSocketDomain.m0000644000000000000000000000632112242733417020026 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #if !defined(WIN32) #include "NGLocalSocketDomain.h" #include "NGLocalSocketAddress.h" #include "NGSocket.h" #if defined(__APPLE__) || defined(__FreeBSD__) # include # include #else # include #endif #include "common.h" @implementation NGLocalSocketDomain static NGLocalSocketDomain *domain = nil; + (void)initialize { BOOL isInitialized = NO; if (!isInitialized) { isInitialized = YES; [NGSocket initialize]; domain = [[NGLocalSocketDomain alloc] init]; } } + (id)domain { return domain; } // NGSocketDomain - (id)addressWithRepresentation:(void *)_data size:(unsigned int)_size { NGLocalSocketAddress *address = nil; address = [[NGLocalSocketAddress alloc] initWithDomain:self internalRepresentation:_data size:_size]; return AUTORELEASE(address); } - (BOOL)prepareAddress:(id)_address forBindWithSocket:(id)_socket { if ([_socket conformsToProtocol:@protocol(NGPassiveSocket)]) { NSString *path = [(NGLocalSocketAddress *)_address path]; // ignore errors .. [[NSFileManager defaultManager] removeFileAtPath:path handler:nil]; } return YES; } - (BOOL)cleanupAddress:(id)_address afterCloseOfSocket:(id)_socket { if ([_socket conformsToProtocol:@protocol(NGPassiveSocket)]) { #if 0 NSString *path = [(NGLocalSocketAddress *)_address path]; // ignore errors .. [[NSFileManager defaultManager] removeFileAtPath:path handler:nil]; #endif } return YES; } - (int)socketDomain { return AF_LOCAL; } - (int)addressRepresentationSize { // maximum size return sizeof(struct sockaddr_un); } - (int)protocol { return 0; } /* NSCopying */ - (id)copyWithZone:(NSZone *)_zone { /* domains are immutable, just return self on copy .. */ return [self retain]; } /* NSCoding */ - (void)encodeWithCoder:(NSCoder *)_encoder { } - (id)initWithCoder:(NSCoder *)_decoder { [self release]; self = nil; return [domain retain]; /* replace with singleton */ } - (id)awakeAfterUsingCoder:(NSCoder *)_decoder { if (self != domain) { [self release]; self = nil; return [domain retain]; /* replace with singleton */ } else return self; } /* description */ - (NSString *)description { return [NSString stringWithFormat:@"", self]; } @end /* NGLocalSocketDomain */ #endif // !WIN32 SOPE/sope-core/NGStreams/NGByteCountStream.m0000644000000000000000000000535212242733417017566 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include "common.h" @implementation NGByteCountStream + (id)byteCounterForStream:(id)_stream byte:(unsigned char)_byte { return [[[self alloc] initWithSource:_stream byte:_byte] autorelease]; } - (id)initWithSource:(id)_source byte:(unsigned char)_byte { if ((self = [super initWithSource:_source])) { [self setByteToCount:_byte]; } return self; } - (id)initWithSource:(id)_source { return [self initWithSource:_source byte:'\n']; } // accessors - (void)setByteToCount:(unsigned char)_byte { if (_byte != byteToCount) { byteReadCount = 0; byteWriteCount = 0; byteToCount = _byte; } } - (unsigned char)byteToCount { return byteToCount; } - (unsigned)readCount { return byteReadCount; } - (unsigned)writeCount { return byteWriteCount; } - (unsigned)totalReadCount { return totalReadCount; } - (unsigned)totalWriteCount { return totalWriteCount; } // operations - (void)resetCounters { totalReadCount = 0; totalWriteCount = 0; byteReadCount = 0; byteWriteCount = 0; } // primitives - (unsigned)readBytes:(void *)_buf count:(unsigned)_len { unsigned result; result = (readBytes != NULL) ? readBytes(source, _cmd, _buf, _len) : [source readBytes:_buf count:_len]; totalReadCount += result; { register unsigned char *byteBuffer = _buf; for (_len = result - 1; _len >= 0; _len--, byteBuffer++) { if (*byteBuffer == byteToCount) byteReadCount++; } } return result; } - (unsigned)writeBytes:(const void *)_buf count:(unsigned)_len { unsigned result; result = (writeBytes != NULL) ? writeBytes(source, _cmd, _buf, _len) : [source writeBytes:_buf count:_len]; totalWriteCount += result; { register unsigned char *byteBuffer = (unsigned char *)_buf; for (_len = result - 1; _len >= 0; _len--, byteBuffer++) { if (*byteBuffer == byteToCount) byteWriteCount++; } } return result; } @end SOPE/sope-core/NGStreams/NGActiveSSLSocket.m0000644000000000000000000002146712242733417017451 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG Copyright (C) 2011 Jeroen Dekkers This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include "common.h" #if HAVE_GNUTLS # include #elif HAVE_OPENSSL # define id openssl_id # include # include # undef id #endif @interface NGActiveSocket(UsedPrivates) - (BOOL)primaryConnectToAddress:(id)_address; @end @implementation NGActiveSSLSocket #if HAVE_GNUTLS - (id)initWithDomain:(id)_domain { if ((self = [super initWithDomain:_domain])) { //BIO *bio_err; static BOOL didGlobalInit = NO; int ret; if (!didGlobalInit) { /* Global system initialization*/ if (gnutls_global_init()) { [self release]; return nil; } didGlobalInit = YES; } ret = gnutls_certificate_allocate_credentials ((gnutls_certificate_credentials_t *) &self->cred); if ( ret) { NSLog(@"ERROR(%s): couldn't create GnuTLS credentials (%s)", __PRETTY_FUNCTION__, gnutls_strerror(ret)); [self release]; return nil; } self->session = NULL; } return self; } - (void)dealloc { if (self->session) { gnutls_deinit((gnutls_session_t) self->session); self->session = NULL; } if (self->cred) { gnutls_certificate_free_credentials((gnutls_certificate_credentials_t) self->cred); self->cred = NULL; } [super dealloc]; } /* basic IO, reading and writing bytes */ - (unsigned)readBytes:(void *)_buf count:(unsigned)_len { ssize_t ret; if (self->session == NULL) // should throw error return NGStreamError; ret = gnutls_record_recv((gnutls_session_t) self->session, _buf, _len); if (ret < 0) return NGStreamError; else return ret; } - (unsigned)writeBytes:(const void *)_buf count:(unsigned)_len { ssize_t ret; if (self->session == NULL) // should throw error return NGStreamError; ret = gnutls_record_send((gnutls_session_t) self->session, _buf, _len); if (ret < 0) return NGStreamError; else return ret; } /* connection and shutdown */ - (BOOL)markNonblockingAfterConnect { return NO; } - (BOOL) startTLS { int ret; ret = gnutls_init((gnutls_session_t *) &self->session, GNUTLS_CLIENT); if (ret) { // should set exception ! NSLog(@"ERROR(%s): couldn't create GnuTLS session (%s)", __PRETTY_FUNCTION__, gnutls_strerror(ret)); return NO; } gnutls_priority_set_direct (session, "NORMAL", NULL); ret = gnutls_credentials_set((gnutls_session_t) self->session, GNUTLS_CRD_CERTIFICATE, (gnutls_certificate_credentials_t) self->cred); if (ret) { // should set exception ! NSLog(@"ERROR(%s): couldn't set GnuTLS credentials (%s)", __PRETTY_FUNCTION__, gnutls_strerror(ret)); return NO; } gnutls_transport_set_ptr((gnutls_session_t) self->session, (gnutls_transport_ptr_t) self->fd); ret = gnutls_handshake((gnutls_session_t) self->session); if (ret) { NSLog(@"ERROR(%s): couldn't setup SSL connection on socket (%s)", __PRETTY_FUNCTION__, gnutls_strerror(ret)); if (ret == GNUTLS_E_FATAL_ALERT_RECEIVED) { NSLog(@"Alert: %s", gnutls_alert_get_name(gnutls_alert_get(self->session))); } [self shutdown]; return NO; } return YES; } - (BOOL)primaryConnectToAddress:(id)_address { if (![super primaryConnectToAddress:_address]) /* could not connect to Unix socket ... */ return NO; return [self startTLS]; } - (BOOL)shutdown { if (self->session) { gnutls_deinit((gnutls_session_t) self->session); self->session = NULL; } if (self->cred) { gnutls_certificate_free_credentials((gnutls_certificate_credentials_t) self->cred); self->cred = NULL; } return [super shutdown]; } #elif HAVE_OPENSSL #if STREAM_BIO static int streamBIO_bwrite(BIO *, const char *, int) { } static int streamBIO_bread(BIO *, char *, int) { } static int streamBIO_bputs(BIO *, const char *) { } static int streamBIO_bgets(BIO *, char *, int) { } static long streamBIO_ctrl(BIO *, int, long, void *) { } static int streamBIO_create(BIO *) { } static int streamBIO_destroy(BIO *) { } static long streamBIO_callback_ctrl(BIO *, int, bio_info_cb *) { } static BIO_METHOD streamBIO = { 0 /* type */, "NGActiveSocket" /* name */, streamBIO_bwrite, streamBIO_bread, streamBIO_bputs, streamBIO_bgets, streamBIO_ctrl, streamBIO_create, streamBIO_destroy, streamBIO_callback_ctrl }; // create: BIO_new(&streamBIO); #endif /* STREAM_BIO */ - (id)initWithDomain:(id)_domain { if ((self = [super initWithDomain:_domain])) { //BIO *bio_err; static BOOL didGlobalInit = NO; if (!didGlobalInit) { /* Global system initialization*/ SSL_library_init(); SSL_load_error_strings(); didGlobalInit = YES; } /* An error write context */ //bio_err = BIO_new_fp(stderr, BIO_NOCLOSE); /* Create our context*/ if ((self->ctx = SSL_CTX_new(SSLv23_method())) == NULL) { NSLog(@"ERROR(%s): couldn't create SSL context for v23 method !", __PRETTY_FUNCTION__); [self release]; return nil; } SSL_CTX_set_verify(self->ctx, SSL_VERIFY_NONE, NULL); } return self; } - (void)dealloc { if (self->ctx) { SSL_CTX_free(self->ctx); self->ctx = NULL; } [super dealloc]; } /* basic IO, reading and writing bytes */ - (unsigned)readBytes:(void *)_buf count:(unsigned)_len { if (self->ssl == NULL) // should throw error return NGStreamError; return SSL_read(self->ssl, _buf, _len); } - (unsigned)writeBytes:(const void *)_buf count:(unsigned)_len { return SSL_write(self->ssl, _buf, _len); } /* connection and shutdown */ - (BOOL)markNonblockingAfterConnect { return NO; } - (BOOL) startTLS { int ret; if (self->ctx == NULL) { NSLog(@"ERROR(%s): ctx isn't setup yet !", __PRETTY_FUNCTION__); return NO; } if ((self->ssl = SSL_new(self->ctx)) == NULL) { // should set exception ! NSLog(@"ERROR(%s): couldn't create SSL socket structure ...", __PRETTY_FUNCTION__); return NO; } if (SSL_set_fd(self->ssl, self->fd) <= 0) { // should set exception ! NSLog(@"ERROR(%s): couldn't set FD ...", __PRETTY_FUNCTION__); return NO; } ret = SSL_connect(self->ssl); if (ret <= 0) { NSLog(@"ERROR(%s): couldn't setup SSL connection on socket (%s)...", __PRETTY_FUNCTION__, ERR_error_string(SSL_get_error(self->ssl, ret), NULL)); [self shutdown]; return NO; } return YES; } - (BOOL)primaryConnectToAddress:(id)_address { int ret; if (self->ctx == NULL) { NSLog(@"ERROR(%s): ctx isn't setup yet !", __PRETTY_FUNCTION__); return NO; } if ((self->ssl = SSL_new(self->ctx)) == NULL) { // should set exception ! NSLog(@"ERROR(%s): couldn't create SSL socket structure ...", __PRETTY_FUNCTION__); return NO; } if (![super primaryConnectToAddress:_address]) /* could not connect to Unix socket ... */ return NO; /* probably we should create a BIO for streams !!! */ if ((self->sbio = BIO_new_socket(self->fd, BIO_NOCLOSE)) == NULL) { NSLog(@"ERROR(%s): couldn't create SSL socket IO structure ...", __PRETTY_FUNCTION__); [self shutdown]; return NO; } NSAssert(self->ctx, @"missing SSL context ..."); NSAssert(self->ssl, @"missing SSL socket ..."); NSAssert(self->sbio, @"missing SSL BIO ..."); SSL_set_bio(self->ssl, self->sbio, self->sbio); ret = SSL_connect(self->ssl); if (ret <= 0) { NSLog(@"ERROR(%s): couldn't setup SSL connection on socket (%s)...", __PRETTY_FUNCTION__, ERR_error_string(SSL_get_error(self->ssl, ret), NULL)); [self shutdown]; return NO; } return YES; } - (BOOL)shutdown { if (self->ctx) { SSL_CTX_free(self->ctx); self->ctx = NULL; } return [super shutdown]; } #else /* no OpenSSL available */ + (void)initialize { NSLog(@"WARNING: The NGActiveSSLSocket class was accessed, " @"but OpenSSL support is turned off."); } - (id)initWithDomain:(id)_domain { [self release]; return nil; } #endif @end /* NGActiveSSLSocket */ SOPE/sope-core/NGStreams/GNUmakefile.preamble0000644000000000000000000000356612242733417017740 0ustar rootroot# compilation settings libNGStreams_INCLUDE_DIRS += \ -INGStreams \ -I../NGExtensions \ -I.. NGStreams_INCLUDE_DIRS += $(libNGStreams_INCLUDE_DIRS) # dependencies libNGStreams_LIBRARIES_DEPEND_UPON += \ -lz $(BASE_LIBS) NGStreams_LIBRARIES_DEPEND_UPON += \ -framework NGExtensions -framework EOControl \ -framework DOM -framework SaxObjC \ -lz # library/framework search pathes DEP_DIRS = \ ../NGExtensions \ ../EOControl \ ../../sope-xml/DOM ../../sope-xml/SaxObjC ifneq ($(frameworks),yes) ADDITIONAL_LIB_DIRS += \ $(foreach dir,$(DEP_DIRS),\ -L$(GNUSTEP_BUILD_DIR)/$(dir)/$(GNUSTEP_OBJ_DIR_NAME)) else ADDITIONAL_LIB_DIRS += \ $(foreach dir,$(DEP_DIRS),-F$(GNUSTEP_BUILD_DIR)/$(dir)) endif ifeq ($(findstring _64, $(GNUSTEP_TARGET_CPU)), _64) ifeq ($(findstring openbsd, $(GNUSTEP_TARGET_OS)), openbsd) SYSTEM_LIB_DIR += -L/usr/local/lib -L/usr/lib else SYSTEM_LIB_DIR += -L/usr/local/lib64 -L/usr/lib64 endif else SYSTEM_LIB_DIR += -L/usr/local/lib -L/usr/lib endif # activating SSL support ifeq ($(HAS_LIBRARY_gnutls),yes) libNGStreams_OBJC_FILES += NGActiveSSLSocket.m NGStreams_OBJC_FILES += NGActiveSSLSocket.m ADDITIONAL_CPPFLAGS += -DHAVE_GNUTLS=1 libNGStreams_LIBRARIES_DEPEND_UPON += -lgnutls NGStreams_LIBRARIES_DEPEND_UPON += -lgnutls else ifeq ($(HAS_LIBRARY_ssl),yes) libNGStreams_OBJC_FILES += NGActiveSSLSocket.m NGStreams_OBJC_FILES += NGActiveSSLSocket.m ADDITIONAL_CPPFLAGS += -DHAVE_OPENSSL=1 -DOPENSSL_NO_KRB5 libNGStreams_LIBRARIES_DEPEND_UPON += -lssl -lcrypto NGStreams_LIBRARIES_DEPEND_UPON += -lssl -lcrypto endif endif ADDITIONAL_CPPFLAGS += -Wall -Wno-protocol # reentrant ifeq ($(reentrant),yes) ADDITIONAL_CPPFLAGS += -D_REENTRANT=1 endif # Apple ifeq ($(FOUNDATION_LIB),apple) libNGStreams_PREBIND_ADDR="0xC1400000" libNGStreams_LDFLAGS += -seg1addr $(libNGStreams_PREBIND_ADDR) NGStreams_LDFLAGS += -seg1addr $(libNGStreams_PREBIND_ADDR) endif SOPE/sope-core/NGStreams/NGStreams/0000755000000000000000000000000012242733417015731 5ustar rootrootSOPE/sope-core/NGStreams/NGStreams/NGDatagramPacket.h0000644000000000000000000000337312242733417021205 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGNet_NGDatagramPacket_H__ #define __NGNet_NGDatagramPacket_H__ #import #include @class NSData; /* This class represents an UDP datagram. It contains the addresses of it's sender and it's receiver. */ @interface NGDatagramPacket : NSObject < NGDatagramPacket > { @protected id sender; id receiver; NSData *packet; } // packet factory + (id)packetWithData:(NSData *)_data; + (id)packetWithBytes:(const void *)_bytes size:(int)_packetSize; - (id)initWithBytes:(const void *)_bytes size:(int)_size; - (id)initWithData:(NSData *)_data; // accessors - (void)setSender:(id)_address; - (id)sender; - (void)setReceiver:(id)_address; - (id)receiver; - (void)setData:(NSData *)_data; - (NSData *)data; - (int)packetSize; // operations - (void)reverseAddresses; @end #endif /* __NGNet_NGDatagramPacket_H__ */ SOPE/sope-core/NGStreams/NGStreams/NGCTextStream.h0000644000000000000000000000560512242733417020540 0ustar rootroot/* Copyright (C) 2000-2008 SKYRIX Software AG Copyright (C) 2008 Helge Hess This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGStreams_NGCTextStream_H__ #define __NGStreams_NGCTextStream_H__ #include #include #include #include #include @class NSEnumerator; NGStreams_EXPORT id NGTextIn; NGStreams_EXPORT id NGTextOut; NGStreams_EXPORT id NGTextErr; NGStreams_EXPORT void NGInitTextStdio(void); /* NGCTextStream NGCTextStream is a text stream which operates in the operation systems default encoding (it returns the bytes read from the source as characters). Note that the results of the unicode-methods do not necessarily represent a valid unicode character. This is only the case for character codes in the 7bit ASCII set. NGCTextStream never returns a character value above 255. To retrieve correctly converted unicode characters use the NGTextStream class. */ @interface NGCTextStream : NGTextStream { @private id source; // retained NGIOReadMethodType readBytes; NGIOWriteMethodType writeBytes; BOOL (*flushBuffer)(id, SEL); NSStringEncoding encoding; } + (id)textStreamWithInputSource:(id)_source; + (id)textStreamWithOutputSource:(id)_source; + (id)textStreamWithSource:(id)_stream; - (id)initWithSource:(id)_stream; - (id)initWithInputSource:(id)_source; - (id)initWithOutputSource:(id)_source; // accessors - (id)source; // operations - (BOOL)close; // forwarded to source // NGTextInputStream, NGExtendedTextInputStream - (unichar)readCharacter; - (unsigned char)readChar; - (NSString *)readLineAsString; // Enumeration - (NSEnumerator *)lineEnumerator; // NGTextOutputStream, NGExtendedTextOutputStream - (BOOL)writeCharacter:(unichar)_character; - (BOOL)writeString:(NSString *)_string; - (BOOL)flush; - (BOOL)writeNewline; - (void)setEncoding: (NSStringEncoding) theEncoding; @end #endif /* __NGStreams_NGCTextStream_H__ */ SOPE/sope-core/NGStreams/NGStreams/NGNet.h0000644000000000000000000000270712242733417017063 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGNet_H__ #define __NGNet_H__ #include #include #include #include #include #include #include #include #include #include #if !defined(WIN32) # include # include #endif // kit class @interface NGNet : NSObject @end #define LINK_NGNet void __link_NGNet() { [NGNet class]; } #endif /* __NGNet_H__ */ SOPE/sope-core/NGStreams/NGStreams/NGDescriptorFunctions.h0000644000000000000000000000412012242733417022333 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGStreams_NGDescriptorFunctions_H__ #define __NGStreams_NGDescriptorFunctions_H__ #import #if !defined(WIN32) /* Polls a descriptor. Returns 1 if events occurred, 0 if a timeout occured and -1 if an error other than EINTR or EAGAIN occured. */ extern int NGPollDescriptor(int _fd, short _events, int _timeout); /* Set/Get descriptor flags */ extern int NGGetDescriptorFlags(int _fd); extern void NGSetDescriptorFlags(int _fd, int _flags); extern void NGAddDescriptorFlag (int _fd, int _flag); /* Reading and writing with non-blocking IO support. The functions return -1 on error, with errno set to either recv's or poll's errno 0 on the end of file condition -2 if the operation timed out Enable login topic 'nonblock' to find out about timeouts. */ extern int NGDescriptorRecv(int _fd, char *_buf, int _len, int _flags, int _timeout); extern int NGDescriptorSend(int _fd, const char *_buf, int _len, int _flags, int _timeout); /* Check whether the descriptor is associated to a terminal device. Get the name of the associated terminal device. */ extern BOOL NGDescriptorIsAtty(int _fd); extern NSString *NGDescriptorGetTtyName(int _fd); #endif /* !WIN32 */ #endif /* __NGStreams_NGDescriptorFunctions_H__ */ SOPE/sope-core/NGStreams/NGStreams/NGDatagramSocket.h0000644000000000000000000000773012242733417021227 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGNet_NGDatagramSocket_H__ #define __NGNet_NGDatagramSocket_H__ #import #include #include /* Represents an UDP socket. UDP is a protocol based on IP, it's major difference to TCP is that UDP is connectionless and unreliable (UDP datagrams send are not guaranteed to reach their destination). Note that you can connect an UDP socket. However, this only sets a 'default' target address, an UDP socket can be connected multiple times, therefore changing the default target. You can still use the send methods which take a target when the socket is connected. With UDP you do not have a distinction between active and passive sockets (you cannot put an UDP socket in the listen-state). A socket becomes a server socket by calling receive, which blocks the thread until a datagram is available and it becomes a client socket by calling send. However to send datagrams you have to know the target address of the server-socket. This is usually acomplished by binding the socket to a well-known address. The receive packet methods take a timeout argument. The timeout is accomplished by using a poll call that waits for read and timeout. A timeout of 0 specifies that no timeout is used, that means the thread will block if no data is available. When receiving a packet the socket needs to know the maximum packet size. While packets may be bigger than the maximum size, the additional bytes are discarded. If the packet size is known you should use receivePacketWithMaxSize: instead of receivePacket. If the packet size is always the same, set the maximum packet size and use receivePacket. */ extern NSString *NGSocketTimedOutNotificationName; @interface NGDatagramSocket : NGSocket { id packetFactory; int maxPacketSize; // default = 2048 struct { BOOL isConnected:1; } udpFlags; } + (id)socketBoundToAddress:(id)_address; #if !defined(WIN32) + (BOOL)socketPair:(id[2])_pair; #endif // accessors - (void)setMaxPacketSize:(int)_maxPacketSize; - (int)maxPacketSize; - (void)setPacketFactory:(id)_factory; - (id)packetFactory; - (int)socketType; // returns SOCK_DGRAM // polling - (BOOL)wouldBlockInMode:(NGStreamMode)_mode; // sending // returns NO on timeout - (BOOL)sendPacket:(id)_packet timeout:(NSTimeInterval)_timeout; // blocks until data can be send - (BOOL)sendPacket:(id)_packet; // receiving - (id)receivePacketWithMaxSize:(int)_maxPacketSize timeout:(NSTimeInterval)_timeout; - (id)receivePacketWithTimeout:(NSTimeInterval)_timeout; - (id)receivePacketWithMaxSize:(int)_maxPacketSize; - (id)receivePacket; // ************************* options ************************* // // set methods throw NGCouldNotSetSocketOptionException // get methods throw NGCouldNotGetSocketOptionException - (void)setBroadcast:(BOOL)_flag; - (BOOL)doesBroadcast; // aborts, only supported for TCP - (void)setDebug:(BOOL)_flag; - (BOOL)doesDebug; @end #endif /* __NGNet_NGDatagramSocket_H__ */ SOPE/sope-core/NGStreams/NGStreams/NGStream+serialization.h0000644000000000000000000000535412242733417022442 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGStreams_NGStream_serialization_H__ #define __NGStreams_NGStream_serialization_H__ #include #include #include #if !(MAC_OS_X_VERSION_10_2 <= MAC_OS_X_VERSION_MAX_ALLOWED) # define USE_SERIALIZER 1 # import #endif /* Serialization is implemented as a category because of it's importance. From a design point of view it would be better placed in an extra class, so that the serialization scheme could be replaced. */ @interface NGStream(serialization) < NGSerializer > - (void)serializeChar:(char)_value; - (void)serializeShort:(short)_value; - (void)serializeInt:(int)_value; - (void)serializeLong:(long)_value; - (void)serializeFloat:(float)_value; - (void)serializeDouble:(double)_value; - (void)serializeLongLong:(long long)_value; - (char)deserializeChar; - (short)deserializeShort; - (int)deserializeInt; - (long)deserializeLong; - (float)deserializeFloat; - (double)deserializeDouble; - (long long)deserializeLongLong; - (void)serializeCString:(const char *)_value; - (char *)deserializeCString; #if USE_SERIALIZER - (void)serializeDataAt:(const void*)data ofObjCType:(const char*)type context:(id)_callback; - (void)deserializeDataAt:(void *)data ofObjCType:(const char*)type context:(id)_callback; #endif @end NGStreams_EXPORT void NGStreamSerializeObjC(id self, const void *_data, const char *_type, #if USE_SERIALIZER id _callback #else id _callback #endif ); NGStreams_EXPORT void NGStreamDeserializeObjC(id self, void *_data, const char *_type, #if USE_SERIALIZER id _callback #else id _callback #endif ); #endif /* __NGStreams_NGStream_serialization_H__ */ SOPE/sope-core/NGStreams/NGStreams/NGBase64Stream.h0000644000000000000000000000316412242733417020533 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGStreams_NGBase64Stream_H__ #define __NGStreams_NGBase64Stream_H__ #include /* NGBase64Stream A filter stream which either decodes or encodes Base64 entities on the fly. */ @interface NGBase64Stream : NGFilterStream { @protected /* decoding */ unsigned char decBuffer[3]; // output buffer unsigned char decBufferLen; // number of bytes in buffer /* encoding */ unsigned int buf; // a 24-bit quantity unsigned int bufBytes; // how many octets are set in it unsigned char line[74]; // output buffer unsigned char lineLength; // output buffer fill pointer } - (unsigned)readBytes:(void *)_buf count:(unsigned)_len; // decoder - (unsigned)writeBytes:(const void *)_buf count:(unsigned)_len; // encoder - (BOOL)close; - (BOOL)flush; @end #endif /* __NGStreams_NGBase64Stream_H__ */ SOPE/sope-core/NGStreams/NGStreams/NGLocalSocketAddress.h0000644000000000000000000000420212242733417022036 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGNet_NGLocalSocketAddress_H__ #define __NGNet_NGLocalSocketAddress_H__ #if !defined(WIN32) || defined(__CYGWIN32__) /* UNIX domain sockets, currently not available on Windows The Win32 local sockets are done using so called 'named pipes'. */ #include /* Represents a UNIX domain socket address (AF_LOCAL) or a named pipe (Win32). Socket addresses are immutable. -copy therefore returns a retained self. Note that when a local socket address is archived it stores the host together with the path. This ensures that the address-space will be the same on unarchiving, otherwise it will return an error. */ @interface NGLocalSocketAddress : NSObject < NSCopying, NGSocketAddress > { @private #if defined(__WIN32__) && !defined(__CYGWIN32__) NSString *path; #else void *address; /* ptr to struct sockaddr_un */ #endif } + (id)addressWithPath:(NSString *)_path; + (id)address; - (id)initWithPath:(NSString *)_path; // designated initializer - (id)init; // creates unique path (pid,thread-id,cnt) /* accessors */ - (NSString *)path; /* testing for equality */ - (BOOL)isEqualToAddress:(NGLocalSocketAddress *)_addr; - (BOOL)isEqual:(id)_obj; /* test for accessibility */ - (BOOL)canSendOnAddress; - (BOOL)canReceiveOnAddress; @end #endif /* !WIN32 */ #endif /* __NGNet_NGLocalSocketAddress_H__ */ SOPE/sope-core/NGStreams/NGStreams/NGTaskStream.h0000644000000000000000000000205112242733417020403 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGStreams_NGTaskStream_H__ #define __NGStreams_NGTaskStream_H__ #include @class NSTask; @interface NGTaskStream : NGStream { @private NSTask *task; int stdinHandle; int stdoutHandle; } @end #endif /* __NGStreams_NGTaskStream_H__ */ SOPE/sope-core/NGStreams/NGStreams/NGLockingStream.h0000644000000000000000000000272712242733417021101 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGStreams_NGLockingStream_H__ #define __NGStreams_NGLockingStream_H__ #import #include @interface NGLockingStream : NGFilterStream { @private id readLock; id writeLock; void (*_lockMethod)(id, SEL); void (*_unlockMethod)(id, SEL); } + (id)filterWithSource:(id)_source lock:(id)_lock; - (id)initWithSource:(id)_source lock:(id)_lock; // primitives - (unsigned)readBytes:(void *)_buf count:(unsigned)_len; - (unsigned)writeBytes:(const void *)_buf count:(unsigned)_len; - (BOOL)flush; @end #endif /* __NGStreams_NGLockingStream_H__ */ SOPE/sope-core/NGStreams/NGStreams/NGByteBuffer.h0000644000000000000000000000416712242733417020374 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGStreams_NGByteBuffer_H__ #define __NGStreams_NGByteBuffer_H__ #include #include struct NGByteBufferLA; /* Although NGByteBuffer is defined to be a stream, it is usually not used as such. Instead most parsers implemented using NGByteBuffer will only call -la: and -consume. The stream interface is provided to read large blocks with a known length. Eg if you have a structure that prefixes some data with the data's length, you can first parse the length and then call -safeReadBytes:count: to read the content. Note that -readByte and -la: return -1 on EOF. */ @interface NGByteBuffer : NGFilterStream { @protected struct NGByteBufferLA *la; unsigned bufLen; BOOL wasEOF; unsigned headIdx; unsigned sizeLessOne; int (*readByte)(id, SEL); int (*laFunction)(id, SEL, unsigned); } /* Initialize a byte buffer with a lookahead depth of _la bytes. */ + (id)byteBufferWithSource:(id)_stream la:(unsigned)_la; - (id)initWithSource:(id)_stream la:(unsigned)_la; // LA - (int)la:(unsigned)_lookaheadPosition; - (void)consume; // consume one byte - (void)consume:(unsigned)_cnt; // consume _cnt bytes // NGStream - (int)readByte; - (unsigned)readBytes:(void *)_buf count:(unsigned)_len; @end #endif /* __NGStreams_NGByteBuffer_H__ */ SOPE/sope-core/NGStreams/NGStreams/NGStreams.h0000644000000000000000000000345012242733417017747 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGStreams_H__ #define __NGStreams_H__ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // kit class @interface NGStreams : NSObject @end // static linking #define LINK_NGStreams \ void __link_NGStreams(void) { \ [NGStreams class]; \ __link_NGStreams(); \ } #endif /* __NGStreams_H__ */ SOPE/sope-core/NGStreams/NGStreams/NGInternetSocketDomain.h0000644000000000000000000000276212242733417022427 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGNet_NGInternetSocketDomain_H__ #define __NGNet_NGInternetSocketDomain_H__ #import #include /* Represents the AF_INET socket domain. NGInternetSocketDomain is a singleton, therefore on copy it returns itself and on unarchiving it replaces the unarchived instance with the singleton. */ @interface NGInternetSocketDomain : NSObject < NSCoding, NSCopying, NGSocketDomain > + (id)domain; // NGSocketDomain - (id)addressWithRepresentation:(void *)_data size:(unsigned int)_size; - (int)socketDomain; - (int)protocol; @end #define NGDefaultInternetSocketDomain [NGInternetSocketDomain domain] #endif /* __NGNet_NGInternetSocketDomain_H__ */ SOPE/sope-core/NGStreams/NGStreams/NGTerminalSupport.h0000644000000000000000000000234612242733417021504 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGStreams_NGTerminalSupport_H__ #define __NGStreams_NGTerminalSupport_H__ #include #include @interface NGStream(NGTerminalSupport) - (BOOL)isAssociatedWithTerminalDevice; - (NSString *)nameOfAssociatedTerminalDevice; @end @interface NGTextStream(NGTerminalSupport) - (BOOL)isAssociatedWithTerminalDevice; - (NSString *)nameOfAssociatedTerminalDevice; @end #endif /* __NGStreams_NGTerminalSupport_H__ */ SOPE/sope-core/NGStreams/NGStreams/NGFilterTextStream.h0000644000000000000000000000224012242733417021573 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGStreams_NGFilterTextStream_H__ #define __NGStreams_NGFilterTextStream_H__ #include @interface NGFilterTextStream : NGTextStream { id source; } + (id)textFilterWithSource:(id)_source; - (id)initWithSource:(id)_source; // accessors - (id)source; @end #endif /* __NGStreams_NGFilterTextStream_H__ */ SOPE/sope-core/NGStreams/NGStreams/NGInternetSocketAddress.h0000644000000000000000000000621212242733417022577 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGNet_NGInternetSocketAddress_H__ #define __NGNet_NGInternetSocketAddress_H__ #include #include /* Represents an Internet socket address (AF_INET). Socket addresses are immutable. -copy therefore returns a retained self. The host arguments are id because they are allowed to be either NSString or NSHost objects (although NSString's are preferred). If the host is nil, then a wildcard (INADDR_ANY) is used. Note that the hostName is resolved when the internalAddressRepresentation is requested. */ @interface NGInternetSocketAddress : NSObject < NSCopying, NSCoding, NGSocketAddress > { @private void *address; /* ptr to struct sockaddr_in */ NSString *hostName; BOOL isAddressFilled; BOOL isHostFilled; BOOL isWildcardHost; } + (id)addressWithPort:(int)_port onHost:(id)_host; + (id)addressWithPort:(int)_port; // localhost - (id)initWithPort:(int)_port onHost:(id)_host; // designated init - (id)initWithPort:(int)_port; // localhost // these throw NGDidNotFindServiceException if the service is not found + (id)addressWithService:(NSString *)_serviceName onHost:(id)_host protocol:(NSString *)_protocol; + (id)addressWithService:(NSString *)_serviceName protocol:(NSString *)_proto; - (id)initWithService:(NSString *)_serviceName onHost:(id)_host protocol:(NSString *)_protocol; - (id)initWithService:(NSString *)_serviceName protocol:(NSString *)_protocol; + (id)wildcardAddress; + (id)wildcardAddressWithPort:(int)_port; /* accessors */ - (NSString *)hostName; - (NSString *)address; - (int)port; - (BOOL)isWildcardAddress; /* testing for equality */ - (BOOL)isEqualToAddress:(NGInternetSocketAddress *)_addr; - (BOOL)isEqual:(id)_obj; /* description */ - (NSString *)stringValue; // returns 'hostname:port' as used in URLs - (NSString *)description; /* NGSocketAddress */ // throws NGCouldNotResolveHostNameException - (void *)internalAddressRepresentation; - (int)addressRepresentationSize; - (id)domain; @end @interface NGActiveSocket(NGInternetActiveSocket) // this method calls +socketConnectedToAddress: with an NGInternetSocketAddress + (id)socketConnectedToPort:(int)_port onHost:(id)_host; // this method calls -connectToAddress: with an NGInternetSocketAddress - (BOOL)connectToPort:(int)_port onHost:(id)_host; @end #endif /* __NGNet_NGInternetSocketAddress_H__ */ SOPE/sope-core/NGStreams/NGStreams/NGByteCountStream.h0000644000000000000000000000303112242733417021414 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGStreams_NGByteCountStream_H__ #define __NGStreams_NGByteCountStream_H__ #include @interface NGByteCountStream : NGFilterStream { @protected unsigned totalReadCount; unsigned totalWriteCount; unsigned char byteToCount; unsigned byteReadCount; unsigned byteWriteCount; } + (id)byteCounterForStream:(id)_stream byte:(unsigned char)_byte; - (id)initWithSource:(id)_source byte:(unsigned char)_byte; // accessors - (void)setByteToCount:(unsigned char)_byte; - (unsigned char)byteToCount; - (unsigned)readCount; - (unsigned)writeCount; - (unsigned)totalReadCount; - (unsigned)totalWriteCount; // operations - (void)resetCounters; @end #endif /* __NGStreams_NGByteCountStream_H__ */ SOPE/sope-core/NGStreams/NGStreams/NGStreamProtocols.h0000644000000000000000000000713512242733417021475 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGStreams_NGStreamProtocols_H__ #define __NGStreams_NGStreamProtocols_H__ #import #if !(MAC_OS_X_VERSION_10_2 <= MAC_OS_X_VERSION_MAX_ALLOWED) # define USE_SERIALIZER 1 # import #endif @class NSException; typedef enum { NGStreamMode_undefined = 0, NGStreamMode_readOnly = 1, NGStreamMode_writeOnly = 2, NGStreamMode_readWrite = 4 } NGStreamMode; /* if this value is returned by -read, -lastException is set ... */ enum {NGStreamError = 0x7fffffff}; typedef unsigned (*NGIOReadMethodType )(id, SEL, void *, unsigned); typedef unsigned (*NGIOWriteMethodType)(id, SEL, const void *, unsigned); typedef BOOL (*NGIOSafeReadMethodType )(id, SEL, void *, unsigned); typedef BOOL (*NGIOSafeWriteMethodType)(id, SEL, const void *, unsigned); @protocol NGInputStream < NSObject > - (unsigned)readBytes:(void *)_buf count:(unsigned)_len; - (BOOL)safeReadBytes:(void *)_buf count:(unsigned)_len; - (BOOL)close; // marks - (BOOL)mark; - (BOOL)rewind; - (BOOL)markSupported; @end @protocol NGOutputStream < NSObject > - (unsigned)writeBytes:(const void *)_buf count:(unsigned)_len; - (BOOL)safeWriteBytes:(const void *)_buf count:(unsigned)_len; - (BOOL)flush; - (BOOL)close; @end @protocol NGPositionableStream < NSObject > - (BOOL)moveToLocation:(unsigned)_location; - (BOOL)moveByOffset:(int)_delta; @end @protocol NGStream < NGInputStream, NGOutputStream > - (BOOL)close; - (NGStreamMode)mode; - (NSException *)lastException; @end @protocol NGByteSequenceStream < NGInputStream > - (int)readByte; // Java semantics (-1 on EOF) @end typedef int (*NGSequenceReadByteMethod)(id self, SEL _cmd); // push streams @class NSData; @protocol NGPushStream < NSObject > - (void)pushChar:(char)_c; - (void)pushCString:(const char *)_cstr; - (void)pushData:(NSData *)_block; - (void)pushBytes:(const void *)_buffer count:(unsigned)_len; - (void)abort; @end // serializer @protocol NGSerializer < NSObject > - (void)serializeChar:(char)_value; - (void)serializeShort:(short)_value; - (void)serializeInt:(int)_value; - (void)serializeLong:(long)_value; - (void)serializeFloat:(float)_value; - (void)serializeDouble:(double)_value; - (void)serializeLongLong:(long long)_value; - (char)deserializeChar; - (short)deserializeShort; - (int)deserializeInt; - (long)deserializeLong; - (float)deserializeFloat; - (double)deserializeDouble; - (long long)deserializeLongLong; - (void)serializeCString:(const char *)_value; - (char *)deserializeCString; #if USE_SERIALIZER - (void)serializeDataAt:(const void*)data ofObjCType:(const char*)type context:(id)_callback; - (void)deserializeDataAt:(const void*)data ofObjCType:(const char*)type context:(id)_callback; #endif @end #endif /* __NGStreams_NGStreamProtocols_H__ */ SOPE/sope-core/NGStreams/NGStreams/NGStream.h0000644000000000000000000000564412242733417017573 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGStreams_NGStream_H__ #define __NGStreams_NGStream_H__ #import #include #include @class NSData, NSException; static inline BOOL NGCanReadInStreamMode(NGStreamMode _mode) { return ((_mode == NGStreamMode_readOnly) || (_mode == NGStreamMode_readWrite)); } static inline BOOL NGCanWriteInStreamMode(NGStreamMode _mode) { return ((_mode == NGStreamMode_writeOnly) || (_mode == NGStreamMode_readWrite)); } @interface NGStream : NSObject < NGStream, NGByteSequenceStream > // ******************** primitives ******************** // Never returns 0. If an EOF like condition occures, NGEndOfStreamException // is thrown. - (unsigned)readBytes:(void *)_buf count:(unsigned)_len; // abstract - (unsigned)writeBytes:(const void *)_buf count:(unsigned)_len; // abstract - (void)setLastException:(NSException *)_exception; - (BOOL)flush; // empty - (BOOL)close; // empty - (NGStreamMode)mode; // abstract - (BOOL)isRootStream; // abstract /* methods which read/write exactly _len bytes */ // TODO: should return exception? (would change the API significantly) - (BOOL)safeReadBytes:(void *)_buf count:(unsigned)_len; - (BOOL)safeWriteBytes:(const void *)_buf count:(unsigned)_len; /* marking */ - (BOOL)mark; // does nothing - (BOOL)rewind; // does nothing - (BOOL)markSupported; // returns NO /* convenience methods */ - (int)readByte; // java semantics (-1 returned on EOF) // description - (NSString *)modeDescription; @end @interface NGStream(DataMethods) - (NSData *)readDataOfLength:(unsigned int)_length; - (NSData *)safeReadDataOfLength:(unsigned int)_length; - (unsigned int)writeData:(NSData *)_data; - (BOOL)safeWriteData:(NSData *)_data; @end // concrete implementations as functions (to be used in non-subclasses) NGStreams_EXPORT int NGReadByteFromStream(id _stream); NGStreams_EXPORT BOOL NGSafeReadBytesFromStream(id _in, void *_buf, unsigned _len); NGStreams_EXPORT BOOL NGSafeWriteBytesToStream(id _out,const void *_buf,unsigned _len); #endif /* __NGStreams_NGStream_H__ */ SOPE/sope-core/NGStreams/NGStreams/NGSocket.h0000644000000000000000000001257212242733417017566 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGNet_NGSocket_H__ #define __NGNet_NGSocket_H__ #import #include #if defined(WIN32) # include #endif @class NSFileHandle, NSException; /* Represents the sockets accessible through the standard Unix sockets library. The socket class itself is abstract and has two concrete subclasses, NGActiveSocket and NGPassiveSocket. The terminology may be confusing at first, but I choose to use these instead of Client/ServerSocket because the NGPassiveSocket accept method returns a socket which isn't one of these. It's an active socket which is already connected. NGActiveSocket represents a connection while NGPassiveSocket only accepts connections (it can't be read or written). Each socket has a local address. The socket can be bound to an address by using the bind() call or the address can be assigned by the operating system kernel. Passive sockets are normally bound to a well-known port (or service), active sockets receive in most cases their address from the kernel. fd is the file descriptor gained through the socket() call. closeOnFree specifies whether the socket is closed when the memory for the socket object is reclaimed. Note that the creation of the actual socket has to wait until it is bound or a connect or listen call has been initiated. This is because the socket() call needs the socket-domain, which is encapsulated in the NGSocketAddress objects. Until the socket is created the fd variable contains the value NGInvalidSocketDescriptor. */ #if defined(WIN32) # define NGInvalidSocketDescriptor INVALID_SOCKET #else # define NGInvalidSocketDescriptor ((int)-1) #endif @interface NGSocket : NSObject < NGSocket > { @protected #if defined(WIN32) SOCKET fd; #else int fd; // socket descriptor #endif id domain; id localAddress; NSFileHandle *fileHandle; // not retained ! struct { int closeOnFree:1; // close socket on collect/dealloc ? int isBound:1; // was a bind issued (either by the kernel or explicitly) } flags; NSException *lastException; } + (id)socketInDomain:(id)_domain; - (id)initWithDomain:(id)_domain; // designated initializer // ************************* create a socket ***************** - (BOOL)primaryCreateSocket; - (BOOL)close; // ************************* bind a socket ******************* // throws // NGSocketAlreadyBoundException if the socket is already bound - (BOOL)bindToAddress:(id)_address; // throws // NGSocketAlreadyBoundException if the socket is already bound - (BOOL)kernelBoundAddress; // ************************* accessors *********************** - (id)localAddress; - (BOOL)isBound; - (void)setLastException:(NSException *)_exception; - (NSException *)lastException; - (void)resetLastException; - (int)socketType; // abstract - (id)domain; - (NSFileHandle *)fileHandle; #if defined(WIN32) - (SOCKET)fileDescriptor; #else - (int)fileDescriptor; - (void)setFileDescriptor: (int) theFd; #endif // ************************* options ************************* // // set methods throw NGCouldNotSetSocketOptionException // get methods throw NGCouldNotGetSocketOptionException - (void)setDebug:(BOOL)_flag; - (void)setReuseAddress:(BOOL)_flag; - (void)setKeepAlive:(BOOL)_flag; - (void)setDontRoute:(BOOL)_flag; - (BOOL)doesDebug; - (BOOL)doesReuseAddress; - (BOOL)doesKeepAlive; - (BOOL)doesNotRoute; - (void)setSendBufferSize:(int)_size; - (void)setReceiveBufferSize:(int)_size; - (int)sendBufferSize; - (int)receiveBufferSize; @end #if defined(WIN32) // Windows Descriptor Functions // events # ifndef POLLIN # define POLLRDNORM 1 # define POLLIN POLLRDNORM # define POLLWRNORM 2 # define POLLOUT POLLWRNORM # define POLLERR 4 # define POLLHUP 4 # endif /* Polls a descriptor. Returns 1 if events occurred, 0 if a timeout occured and -1 if an error other than EINTR or EAGAIN occured. */ int NGPollDescriptor(SOCKET _fd, short _events, int _timeout); /* Reading and writing with non-blocking IO support. The functions return -1 on error, with errno set to either recv's or poll's errno 0 on the end of file condition -2 if the operation timed out Enable login topic 'nonblock' to find out about timeouts. */ int NGDescriptorRecv(SOCKET _fd, char *_buf, int _len, int _flags, int _timeout); int NGDescriptorSend(SOCKET _fd, const char *_buf, int _len, int _flags, int _timeout); #endif /* WIN32 */ #endif /* __NGNet_NGSocket_H__ */ SOPE/sope-core/NGStreams/NGStreams/NGSocketExceptions.h0000644000000000000000000001257112242733417021627 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGNet_NGSocketExceptions_H__ #define __NGNet_NGSocketExceptions_H__ #import #include #include /* Exceptions: NGIOException NGSocketException NGSocketBindException NGSocketAlreadyBoundException NGCouldNotBindSocketException NGSocketConnectionException NGSocketNotConnectedException NGSocketAlreadyConnectedException NGCouldNotConnectException NGSocketOptionException NGCouldNotSetSocketOptionException NGCouldNotGetSocketOptionException NGCouldNotResolveHostNameException NGDidNotFindServiceException NGSocketIsAlreadyListeningException NGCouldNotListenException NGCouldNotAcceptException NGInvalidSocketDomainException NGCouldNotCreateSocketException NGStreamException NGEndOfStreamException NGSocketShutdownException NGSocketShutdownDuringReadException NGSocketShutdownDuringWriteException NGSocketConnectionResetException NGSocketTimedOutException */ @interface NGSocketException : NGIOException { @protected id socket; } - (id)init; - (id)initWithReason:(NSString *)_reason; - (id)initWithReason:(NSString *)_reason socket:(id)_socket; - (id)socket; @end @interface NGCouldNotResolveHostNameException : NGSocketException { @protected NSString *hostName; } - (id)initWithHostName:(NSString *)_name reason:(NSString *)_reason; - (NSString *)hostName; @end @interface NGDidNotFindServiceException : NGSocketException { @protected NSString *serviceName; } - (id)init; - (id)initWithServiceName:(NSString *)_service; - (NSString *)serviceName; @end @interface NGInvalidSocketDomainException : NGSocketException { @protected id domain; } - (id)initWithReason:(NSString *)_reason socket:(id)_socket domain:(id)_domain; @end @interface NGCouldNotCreateSocketException : NGSocketException { @protected id domain; } - (id)init; - (id)initWithReason:(NSString *)_reason domain:(id)_domain; @end // ******************** bind *********************** @interface NGSocketBindException : NGSocketException @end @interface NGSocketAlreadyBoundException : NGSocketBindException @end @interface NGCouldNotBindSocketException : NGSocketBindException { @protected id address; } - (id)initWithReason:(NSString *)_reason socket:(id)_socket address:(id)address; - (id)address; @end // ******************** connect ******************** @interface NGSocketConnectException : NGSocketException @end @interface NGSocketNotConnectedException : NGSocketConnectException @end @interface NGSocketAlreadyConnectedException : NGSocketConnectException @end @interface NGCouldNotConnectException : NGSocketConnectException { @protected id address; } - (id)initWithReason:(NSString *)_reason socket:(id)_socket address:(id)address; - (id)address; @end // ******************** listen ******************** @interface NGSocketIsAlreadyListeningException : NGSocketException @end @interface NGCouldNotListenException : NGSocketException @end // ******************** accept ******************** @interface NGCouldNotAcceptException : NGSocketException @end // ******************** options ******************** @interface NGSocketOptionException : NGSocketException { @protected int option; int level; } - (id)init; - (id)initWithReason:(NSString *)_reason option:(int)_option level:(int)_level; @end @interface NGCouldNotSetSocketOptionException : NGSocketOptionException @end @interface NGCouldNotGetSocketOptionException : NGSocketOptionException @end // ******************** socket closed ************** @interface NGSocketShutdownException : NGEndOfStreamException - (id)initWithReason:(NSString *)_reason; - (id)initWithReason:(NSString *)_reason socket:(id)_socket; - (id)initWithSocket:(id)_socket; /* Note: this only returns a valid ptr, if the socket is still retained ! */ - (id)socket; @end @interface NGSocketShutdownDuringReadException : NGSocketShutdownException @end @interface NGSocketShutdownDuringWriteException : NGSocketShutdownException @end @interface NGSocketTimedOutException : NGSocketShutdownException @end @interface NGSocketConnectionResetException : NGSocketShutdownException @end #endif /* __NGNet_NGSocketExceptions_H__ */ SOPE/sope-core/NGStreams/NGStreams/NGUrlChars.h0000644000000000000000000000452212242733417020055 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGStreams_NGUrlChars_H__ #define __NGStreams_NGUrlChars_H__ static inline BOOL isUrlAlpha(unsigned char _c) { return (((_c >= 'a') && (_c <= 'z')) || ((_c >= 'A') && (_c <= 'Z'))) ? YES : NO; } static inline BOOL isUrlDigit(unsigned char _c) { return ((_c >= '0') && (_c <= '9')) ? YES : NO; } static inline BOOL isUrlSafeChar(unsigned char _c) { switch (_c) { case '$': case '-': case '_': case '@': case '.': case '&': case '+': return YES; default: return NO; } } static inline BOOL isUrlExtraChar(unsigned char _c) { switch (_c) { case '!': case '*': case '"': case '\'': case '|': case ',': return YES; } return NO; } static inline BOOL isUrlEscapeChar(unsigned char _c) { return (_c == '%') ? YES : NO; } static inline BOOL isUrlReservedChar(unsigned char _c) { switch (_c) { case '=': case ';': case '/': case '#': case '?': case ':': case ' ': return YES; } return NO; } static inline BOOL isUrlXalpha(unsigned char _c) { if (isUrlAlpha(_c)) return YES; if (isUrlDigit(_c)) return YES; if (isUrlSafeChar(_c)) return YES; if (isUrlExtraChar(_c)) return YES; if (isUrlEscapeChar(_c)) return YES; return NO; } static inline BOOL isUrlHexChar(unsigned char _c) { if (isUrlDigit(_c)) return YES; if ((_c >= 'a') && (_c <= 'f')) return YES; if ((_c >= 'A') && (_c <= 'F')) return YES; return NO; } static inline BOOL isUrlAlphaNum(unsigned char _c) { return (isUrlAlpha(_c) || isUrlDigit(_c)) ? YES : NO; } #endif /* __NGStreams_NGUrlChars_H__ */ SOPE/sope-core/NGStreams/NGStreams/NGStreamExceptions.h0000644000000000000000000001361512242733417021632 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGStreams_NGStreamExceptions_H__ #define __NGStreams_NGStreamExceptions_H__ #import #include @class NSData; @interface NGIOException : NSException - (id)init; - (id)initWithReason:(NSString *)_reason; + (void)raiseWithReason:(NSString *)_reason; + (void)raiseOnStream:(id)_stream reason:(NSString *)_reason; + (void)raiseOnStream:(id)_stream; @end static inline BOOL NGIsIOException(NSException *_exception) { return [_exception isKindOfClass:[NGIOException class]]; } // ******************** NGStreamException ************************* @class NSValue; @interface NGStreamException : NGIOException { @protected NSValue *streamPointer; /* only valid if stream is not deallocated */ } - (id)init; - (id)initWithStream:(id)_stream; - (id)initWithStream:(id)_stream reason:(NSString *)_reason; - (id)initWithStream:(id)_stream format:(NSString *)_format,...; + (id)exceptionWithStream:(id)_stream; + (id)exceptionWithStream:(id)_stream reason:(NSString *)_reason; + (void)raiseWithStream:(id)_stream; + (void)raiseWithStream:(id)_stream format:(NSString *)_format,...; + (void)raiseWithStream:(id)_stream reason:(NSString *)_reason; @end static inline BOOL NGIsStreamException(NSException *_exception) { return [_exception isKindOfClass:[NGStreamException class]]; } // ******************** NGEndOfStreamException ******************** @interface NGEndOfStreamException : NGStreamException { @protected unsigned readCount; // number of bytes that could be read in unsigned safeCount; // number of bytes that were requested NSData *data; } - (id)initWithStream:(id)_stream; - (id)initWithStream:(id)_stream readCount:(unsigned)_readCount safeCount:(unsigned)_safeCount data:(NSData *)_data; - (NSData *)readBytes; // the bytes read before EOF @end static inline BOOL NGIsEndOfStreamException(NSException *_exception) { return [_exception isKindOfClass:[NGEndOfStreamException class]]; } // ******************** open state exceptions ********************* @interface NGCouldNotOpenStreamException : NGStreamException @end @interface NGCouldNotCloseStreamException : NGStreamException @end @interface NGStreamNotOpenException : NGStreamException @end static inline BOOL NGIsCouldNotOpenStreamException(NSException *_exception) { return [_exception isKindOfClass:[NGCouldNotOpenStreamException class]]; } static inline BOOL NGIsCouldNotCloseStreamException(NSException *_exception) { return [_exception isKindOfClass:[NGCouldNotCloseStreamException class]]; } static inline BOOL NGIsStreamNotOpenException(NSException *_exception) { return [_exception isKindOfClass:[NGStreamNotOpenException class]]; } // ******************** NGStreamErrors **************************** @interface NGStreamErrorException : NGStreamException { @protected int osErrorCode; } - (id)initWithStream:(id)_stream errorCode:(int)_code; + (void)raiseWithStream:(id)_stream errorCode:(int)_code; - (int)operationSystemErrorCode; - (NSString *)operatingSystemError; @end static inline BOOL NGIsStreamErrorException(NSException *_exception) { return [_exception isKindOfClass:[NGStreamErrorException class]]; } @interface NGStreamReadErrorException : NGStreamErrorException @end @interface NGStreamWriteErrorException : NGStreamErrorException @end @interface NGStreamSeekErrorException : NGStreamErrorException @end static inline BOOL NGIsStreamReadErrorException(NSException *_exception) { return [_exception isKindOfClass:[NGStreamReadErrorException class]]; } static inline BOOL NGIsStreamWriteErrorException(NSException *_exception) { return [_exception isKindOfClass:[NGStreamWriteErrorException class]]; } static inline BOOL NGIsStreamSeekErrorException(NSException *_exception) { return [_exception isKindOfClass:[NGStreamSeekErrorException class]]; } // ******************** NGStreamModeExceptions ******************** @interface NGStreamModeException : NGStreamException @end @interface NGUnknownStreamModeException : NGStreamModeException { @protected NSString *streamMode; } - (id)initWithStream:(id)_stream mode:(NSString *)_streamMode; @end @interface NGReadOnlyStreamException : NGStreamModeException @end @interface NGWriteOnlyStreamException : NGStreamModeException @end static inline BOOL NGIsStreamModeException(NSException *_exception) { return [_exception isKindOfClass:[NGStreamModeException class]]; } static inline BOOL NGIsUnknownStreamModeException(NSException *_exception) { return [_exception isKindOfClass:[NGUnknownStreamModeException class]]; } static inline BOOL NGIsReadOnlyStreamException(NSException *_exception) { return [_exception isKindOfClass:[NGReadOnlyStreamException class]]; } static inline BOOL NGIsWriteOnlyStreamException(NSException *_exception) { return [_exception isKindOfClass:[NGWriteOnlyStreamException class]]; } // ******************** NGIOAccessException *********************** @interface NGIOAccessException : NGIOException @end @interface NGIOSearchAccessException : NGIOAccessException @end #endif /* __NGStreams_NGStreamExceptions_H__ */ SOPE/sope-core/NGStreams/NGStreams/NGTextStreamProtocols.h0000644000000000000000000000325512242733417022341 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGStreams_NGTextStreamProtocols_H__ #define __NGStreams_NGTextStreamProtocols_H__ #import #import @class NSString, NSException; @protocol NGTextInputStream < NSObject > - (unichar)readCharacter; @end @protocol NGTextOutputStream < NSObject > - (BOOL)writeCharacter:(unichar)_character; - (BOOL)writeString:(NSString *)_string; - (BOOL)flush; @end @protocol NGTextStream < NGTextInputStream, NGTextOutputStream > - (NSException *)lastException; @end // extended text streams @protocol NGExtendedTextInputStream < NGTextInputStream > - (NSString *)readLineAsString; @end @protocol NGExtendedTextOutputStream < NGTextOutputStream > - (BOOL)writeFormat:(NSString *)_format, ...; - (BOOL)writeNewline; @end @protocol NGExtendedTextStream < NGExtendedTextInputStream, NGExtendedTextOutputStream > @end #endif /* __NGStreams_NGTextStreamProtocols_H__ */ SOPE/sope-core/NGStreams/NGStreams/NGNetUtilities.h0000644000000000000000000000323712242733417020756 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGNet_NGNetUtilities_H__ #define __NGNet_NGNetUtilities_H__ #import #include /* Some supporting functions */ /* This function tried to 'guess' the appropriate socket address from _string. It currently creates an internet domain address if a ':' is encountered and a local domain address if the string returns true on -isAbsolutePath. The function returns nil if the string argument is nil or empty. Examples are: INET: "*:20000" // wildcard IP, port 20000 "localhost:1000" // localhost, port 1000 "*:echo/udp" // wildcard IP, echo service on UDP "*:echo" // wildcard IP, echo service on TCP (TCP=default) LOCAL: "/tmp/mySocket" */ id NGSocketAddressFromString(NSString *_string); #endif /* __NGNet_NGNetUtilities_H__ */ SOPE/sope-core/NGStreams/NGStreams/NGStreamCoder.h0000644000000000000000000000642112242733417020542 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGStreams_NGStreamCoder_H__ #define __NGStreams_NGStreamCoder_H__ #import #if !(MAC_OS_X_VERSION_10_2 <= MAC_OS_X_VERSION_MAX_ALLOWED) # define USE_SERIALIZER 1 # import #endif #import #import #include @interface NGStreamCoder : NSCoder #if USE_SERIALIZER < NSObjCTypeSerializationCallBack > #endif { @protected id stream; // destination/source stream NGIOSafeReadMethodType readIMP; // safe read method NGIOSafeWriteMethodType writeIMP; // safe write method // used during encoding NSHashTable *outObjects; // objects written so far NSHashTable *outConditionals; // conditional objects NSHashTable *outPointers; // set of pointers NSMapTable *replacements; // src-object to replacement BOOL traceMode; // YES if finding conditionals BOOL didWriteHeader; SEL classForCoder; // default: classForCoder: SEL replObjectForCoder; // default: replacementObjectForCoder: BOOL encodingRoot; // used during decoding unsigned inArchiverVersion; // archiver's version that wrote the data NSMapTable *inObjects; // decoded objects: key -> object NSMapTable *inClasses; // decoded classes: key -> class info NSMapTable *inPointers; // decoded pointers: key -> pointer NSMapTable *inClassAlias; // archive name -> decoded name NSMapTable *inClassVersions; // archive name -> class info NSZone *objectZone; BOOL decodingRoot; BOOL didReadHeader; } + (id)coderWithStream:(id)_stream; - (id)initWithStream:(id)_stream; // accessors - (id)stream; - (NSString *)coderSignature; // ID of the coder used - (int)coderVersion; // Version of the coder used // encoding - (void)encodeConditionalObject:(id)_object; - (void)encodeRootObject:(id)_object; // decoding - (unsigned int)systemVersion; - (id)decodeObject; // Substituting One Class for Another + (NSString *)classNameDecodedForArchiveClassName:(NSString *)nameInArchive; + (void)decodeClassName:(NSString *)nameInArch asClassName:(NSString *)trueName; - (NSString *)classNameDecodedForArchiveClassName:(NSString *)nameInArchive; - (void)decodeClassName:(NSString *)nameInArch asClassName:(NSString *)trueName; @end #endif /* __NGStreams_NGStreamCoder_H__ */ SOPE/sope-core/NGStreams/NGStreams/NGNetDecls.h0000644000000000000000000000226212242733417020032 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGNet_NGNetDecls_H__ #define __NGNet_NGNetDecls_H__ #if BUILD_libNGStreams_DLL # define NGNet_EXPORT __declspec(dllexport) # define NGNet_DECLARE __declspec(dllexport) #elif libNGStreams_ISDLL # define NGNet_EXPORT extern __declspec(dllimport) # define NGNet_DECLARE extern __declspec(dllimport) #else # define NGNet_EXPORT extern # define NGNet_DECLARE #endif #endif /* __NGNet_NGNetDecls_H__ */ SOPE/sope-core/NGStreams/NGStreams/NGFilterStream.h0000644000000000000000000000367112242733417020737 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGStreams_NGFilterStream_H__ #define __NGStreams_NGFilterStream_H__ #include /* NGFilterStream This is an abstract superclass for streams which just operate on 'basic' streams like sockets or file streams. As an example subclass take the buffered stream which performs buffered IO on any given stream. */ @interface NGFilterStream : NGStream { @protected id source; NGIOReadMethodType readBytes; NGIOWriteMethodType writeBytes; } + (id)filterWithInputSource:(id)_source; + (id)filterWithOutputSource:(id)_source; + (id)filterWithSource:(id)_source; - (id)initWithInputSource:(id)_source; - (id)initWithOutputSource:(id)_source; - (id)initWithSource:(id)_source; /* accessors */ - (id)inputStream; - (id)outputStream; - (id)source; /* primitives */ - (unsigned)readBytes:(void *)_buf count:(unsigned)_len; - (unsigned)writeBytes:(const void *)_buf count:(unsigned)_len; - (BOOL)flush; - (BOOL)close; - (NGStreamMode)mode; - (BOOL)isRootStream; @end #endif /* __NGStreams_NGFilterStream_H__ */ SOPE/sope-core/NGStreams/NGStreams/NGBufferedStream.h0000644000000000000000000000400412242733417021223 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGStreams_NGBufferedStream_H__ #define __NGStreams_NGBufferedStream_H__ #include @interface NGBufferedStream : NGFilterStream { @private void *readBuffer; void *readBufferPos; // current position (ptr) in buffer unsigned readBufferFillSize; // number of 'read' bytes in the buffer unsigned readBufferSize; // maximum capacity in bytes void *writeBuffer; unsigned writeBufferFillSize; unsigned writeBufferSize; struct { unsigned int _flushOnNewline:1; } flags; } + (id)filterWithSource:(id)_source bufferSize:(unsigned)_size; - (id)initWithSource:(id)_source bufferSize:(unsigned)_size; - (id)initWithSource:(id)_source; /* accessors */ - (void)setReadBufferSize:(unsigned)_size; - (unsigned)readBufferSize; - (void)setWriteBufferSize:(unsigned)_size; - (unsigned)writeBufferSize; /* blocking .. */ - (BOOL)wouldBlockInMode:(NGStreamMode)_mode; /* primitives */ - (unsigned)readBytes:(void *)_buf count:(unsigned)_len; - (unsigned)writeBytes:(const void *)_buf count:(unsigned)_len; - (BOOL)flush; @end @interface NGStream(NGBufferedStreamExtensions) - (NGBufferedStream *)bufferedStream; @end #endif /* __NGStreams_NGBufferedStream_H__ */ SOPE/sope-core/NGStreams/NGStreams/NGCharBuffer.h0000644000000000000000000000361112242733417020337 0ustar rootroot/* Copyright (C) 2000-2006 SKYRIX Software AG Copyright (C) 2006 Helge Hess This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGStreams_NGCharBuffer_H__ #define __NGStreams_NGCharBuffer_H__ #include #include #include struct NGCharBufferLA; /* Although NGCharBuffer is defined to be a stream, it is usually not used as such. Instead most parsers implemented using NGCharBuffer will only call -la: and -consume. Note that -la: return -1 on EOF and -readCharacter throws an NGEndOfStreamException. -readCharacter is basically a -la:0 followed by a -consume. */ @interface NGCharBuffer : NGFilterTextStream { @protected struct NGCharBufferLA *la; int bufLen; BOOL wasEOF; int headIdx; int sizeLessOne; unichar (*readCharacter)(id, SEL); } + (id)charBufferWithSource:(id)_source la:(int)_la; - (id)initWithSource:(id)_source la:(int)_la; // LA - (int)la:(int)_ls; - (void)consume; // consume one character - (void)consume:(int)_cnt; // consume _cnt characters // NGTextStream - (unichar)readCharacter; @end #endif /* __NGStreams_NGCharBuffer_H__ */ SOPE/sope-core/NGStreams/NGStreams/NGActiveSocket.h0000644000000000000000000001027212242733417020715 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGNet_NGActiveSocket_H__ #define __NGNet_NGActiveSocket_H__ #import #include #include #include @class NSData, NSFileHandle; /* Represents an active STREAM socket based on the standard Unix sockets library. An active socket can be either a socket gained by calling accept with an passive socket or by explicitly connecting one to an address (a client socket). Therefore an active socket has two addresses, the local and the remote one. There are three methods to perform a close, this is rooted in the fact that a socket actually is full-duplex, it provides a send and a receive channel. The stream-mode is updated according to what channels are open/closed. Initially the socket is full-duplex and you cannot reopen a channel that was shutdown. If you have shutdown both channels the socket can be considered closed. */ @interface NGActiveSocket : NGSocket < NGActiveSocket > { @private id remoteAddress; NGStreamMode mode; NSTimeInterval receiveTimeout; NSTimeInterval sendTimeout; } + (id)socketConnectedToAddress:(id)_address; - (id)initWithDomain:(id)_domain; // designated initializer #if !defined(WIN32) + (BOOL)socketPair:(id[2])_pair; #endif // ******************** operations ******************** // throws // NGSocketAlreadyConnectedException when the socket is already connected // NGInvalidSocketDomainException when the remote domain != local domain // NGCouldNotCreateSocketException if the socket creation failed - (BOOL)connectToAddress:(id)_address; - (BOOL)shutdown; // do a complete shutdown - (BOOL)shutdownSendChannel; - (BOOL)shutdownReceiveChannel; // ******************** accessors ********************* - (id)remoteAddress; - (BOOL)isConnected; - (BOOL)isOpen; - (void)disableNagle:(BOOL)_disable; - (void)setSendTimeout:(NSTimeInterval)_timeout; - (NSTimeInterval)sendTimeout; - (void)setReceiveTimeout:(NSTimeInterval)_timeout; - (NSTimeInterval)receiveTimeout; // test whether a read, a write or both would block the thread (using select) - (BOOL)wouldBlockInMode:(NGStreamMode)_mode; - (int)waitForMode:(NGStreamMode)_mode timeout:(NSTimeInterval)_timeout; - (unsigned)numberOfAvailableBytesForReading; - (BOOL)isAlive; // ******************** NGStream ********************** // throws // NGStreamReadErrorException when the read call failed // NGSocketNotConnectedException when the socket is not connected // NGEndOfStreamException when the end of the stream is reached - (unsigned)readBytes:(void *)_buf count:(unsigned)_len; // throws // NGStreamWriteErrorException when the write call failed // NGSocketNotConnectedException when the socket is not connected - (unsigned)writeBytes:(const void *)_buf count:(unsigned)_len; - (BOOL)flush; // does nothing, sockets are unbuffered - (NGStreamMode)mode; // returns read/write - (BOOL)safeReadBytes:(void *)_buf count:(unsigned)_len; - (BOOL)safeWriteBytes:(const void *)_buf count:(unsigned)_len; @end @interface NGActiveSocket(DataMethods) - (NSData *)readDataOfLength:(unsigned int)_length; - (NSData *)safeReadDataOfLength:(unsigned int)_length; - (unsigned int)writeData:(NSData *)_data; - (BOOL)safeWriteData:(NSData *)_data; @end #endif /* __NGNet_NGActiveSocket_H__ */ SOPE/sope-core/NGStreams/NGStreams/NGActiveSocket+serialization.h0000644000000000000000000000412012242733417023561 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGNet_NGActiveSocket_serialization_H__ #define __NGNet_NGActiveSocket_serialization_H__ #if !(MAC_OS_X_VERSION_10_2 <= MAC_OS_X_VERSION_MAX_ALLOWED) # define USE_SERIALIZER 1 #endif #import #if USE_SERIALIZER # import #endif #include #include @interface NGActiveSocket(serialization) #if USE_SERIALIZER < NGSerializer > #endif - (void)serializeChar:(char)_value; - (void)serializeShort:(short)_value; - (void)serializeInt:(int)_value; - (void)serializeLong:(long)_value; - (void)serializeFloat:(float)_value; - (void)serializeDouble:(double)_value; - (void)serializeLongLong:(long long)_value; - (char)deserializeChar; - (short)deserializeShort; - (int)deserializeInt; - (long)deserializeLong; - (float)deserializeFloat; - (double)deserializeDouble; - (long long)deserializeLongLong; - (void)serializeCString:(const char *)_value; - (char *)deserializeCString; #if USE_SERIALIZER - (void)serializeDataAt:(const void*)data ofObjCType:(const char*)type context:(id)_callback; - (void)deserializeDataAt:(void *)data ofObjCType:(const char*)type context:(id)_callback; #endif @end #endif /* __NGNet_NGActiveSocket_serialization_H__ */ SOPE/sope-core/NGStreams/NGStreams/NGFileStream.h0000644000000000000000000000722412242733417020367 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGStreams_NGFileStream_H__ #define __NGStreams_NGFileStream_H__ /* NGFileStream NGFileStream is a stream which allows reading/writing local files. */ #if defined(__MINGW32__) && defined(HAVE_WINDOWS_H) # include #endif #ifdef HAVE_POLL_H # include #endif #ifdef HAVE_SYS_POLL_H # include #endif #ifdef HAVE_UNISTD_H # include #endif #if defined(__MINGW32__) # include #endif #include #include #include @class NSFileHandle; NGStreams_EXPORT NSString *NGFileReadOnly; NGStreams_EXPORT NSString *NGFileWriteOnly; NGStreams_EXPORT NSString *NGFileReadWrite; NGStreams_EXPORT NSString *NGFileAppend; NGStreams_EXPORT NSString *NGFileReadAppend; NGStreams_EXPORT id NGIn; NGStreams_EXPORT id NGOut; NGStreams_EXPORT id NGErr; NGStreams_EXPORT void NGInitStdio(void); @interface NGFileStream : NGStream < NGPositionableStream > { @private #if defined(__MINGW32__) HANDLE fh; // Windows file handle #else int fd; // Unix file descriptor #endif NGStreamMode streamMode; NSString *systemPath; NSFileHandle *handle; // not retained ! int markDelta; // tracks mark, for marking (special value -1) } - (id)initWithPath:(NSString *)_path; - (id)initWithFileHandle:(NSFileHandle *)_handle; // use with care ! // throws // NGUnknownStreamModeException when _mode is invalid // NGCouldNotOpenStreamException when the file could not be opened - (BOOL)openInMode:(NSString *)_mode; - (BOOL)isOpen; // Foundation file handles - (NSFileHandle *)fileHandle; - (int)fileDescriptor; #if defined(__MINGW32__) - (HANDLE)windowsFileHandle; #endif // primitives // throws // NGWriteOnlyStreamException when the stream is not readable // NGStreamNotOpenException when the stream is not open // NGEndOfStreamException when the end of the stream is reached // NGReadErrorException when the read call failed - (unsigned)readBytes:(void *)_buf count:(unsigned)_len; // throws // NGReadOnlyStreamException when the stream is not writeable // NGStreamNotOpenException when the stream is not open // NGWriteErrorException when the write call failed - (unsigned)writeBytes:(const void *)_buf count:(unsigned)_len; // throws NGCouldNotCloseStreamException when the close call failed - (BOOL)close; - (NGStreamMode)mode; - (BOOL)isRootStream; // blocking - (BOOL)wouldBlockInMode:(NGStreamMode)_mode; // not supported with Windows // marking - (BOOL)mark; - (BOOL)rewind; - (BOOL)markSupported; // returns YES // NGPositionableStream // throws // NGStreamSeekErrorException - (BOOL)moveToLocation:(unsigned)_location; // note that absolute moves delete marks // throws // NGStreamSeekErrorException - (BOOL)moveByOffset:(int)_delta; @end #endif /* __NGStreams_NGFileStream_H__ */ SOPE/sope-core/NGStreams/NGStreams/NGGZipStream.h0000644000000000000000000000242612242733417020360 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGZlib_NGGZipStream_H__ #define __NGZlib_NGGZipStream_H__ #include @interface NGGZipStream : NGFilterStream { @private void *outp; void *outBuf; unsigned outBufLen; unsigned long crc; BOOL headerIsWritten; } - (unsigned)readBytes:(void *)_buf count:(unsigned)_len; // decoder - (unsigned)writeBytes:(const void *)_buf count:(unsigned)_len; // encoder - (void)close; - (void)flush; @end #endif /* __NGZlib_NGGZipStream_H__ */ SOPE/sope-core/NGStreams/NGStreams/NGStreamsDecls.h0000644000000000000000000000232712242733417020724 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGStreams_NGStreamDecls_H__ #define __NGStreams_NGStreamDecls_H__ #if BUILD_libNGStreams_DLL # define NGStreams_EXPORT __declspec(dllexport) # define NGStreams_DECLARE __declspec(dllexport) #elif libNGStreams_ISDLL # define NGStreams_EXPORT extern __declspec(dllimport) # define NGStreams_DECLARE __declspec(dllimport) #else # define NGStreams_EXPORT extern # define NGStreams_DECLARE #endif #endif /* __NGStreams_NGStreamDecls_H__ */ SOPE/sope-core/NGStreams/NGStreams/NGStringTextStream.h0000644000000000000000000000371512242733417021624 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGStreams_NGStringTextStream_H__ #define __NGStreams_NGStringTextStream_H__ #include #include /* NGStringTextStream A text stream which navigates inside an NSString or NSMutableString object. */ @interface NGStringTextStream : NGTextStream { @private NSString *string; // retained unsigned index; // position BOOL isMutable; } + (id)textStreamWithString:(NSString *)_string; - (id)initWithString:(NSString *)_string; // accessors - (NSString *)string; // operations - (BOOL)close; // releases string // NGTextInputStream, NGExtendedTextInputStream - (unichar)readCharacter; - (NSString *)readLineAsString; // inefficient implementation // NGTextOutputStream, NGExtendedTextOutputStream // throws // NGReadOnlyStreamException when the stream is not writeable // NGStreamNotOpenException when the stream is not open - (BOOL)writeCharacter:(unichar)_character; // throws // NGReadOnlyStreamException when the stream is not writeable // NGStreamNotOpenException when the stream is not open - (BOOL)writeString:(NSString *)_string; - (BOOL)flush; @end #endif /* __NGStreams_NGStringTextStream_H__ */ SOPE/sope-core/NGStreams/NGStreams/NGDataStream.h0000644000000000000000000000454312242733417020362 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGStreams_NGDataStream_H__ #define __NGStreams_NGDataStream_H__ #include #include @class NSData; @interface NGDataStream : NGStream < NGPositionableStream > { @private NSException *lastException; NGStreamMode streamMode; NSData *data; unsigned position; unsigned int (*dataLength)(id, SEL); const void *(*dataBytes)(id, SEL); /* for read-only streams */ unsigned int length; const void *bytes; } + (id)dataStream; + (id)dataStreamWithCapacity:(int)_capacity; + (id)streamWithData:(NSData *)_data; - (id)initWithData:(NSData *)_data mode:(NGStreamMode)_mode; - (id)initWithData:(NSData *)_data; - (NSException *)lastException; - (void)setLastException:(NSException *)_exception; - (void)resetLastException; // accessors - (NSData *)data; - (unsigned)availableBytes; // returns number of available bytes // primitives // throws // NGStreamNotOpenException when the stream is not open // NGEndOfStreamException when the end of the stream is reached - (unsigned)readBytes:(void *)_buf count:(unsigned)_len; // throws // NGReadOnlyStreamException when the stream is not writeable // NGStreamNotOpenException when the stream is not open - (unsigned)writeBytes:(const void *)_buf count:(unsigned)_len; - (BOOL)close; - (NGStreamMode)mode; - (BOOL)isRootStream; // NGPositionableStream - (BOOL)moveToLocation:(unsigned)_location; - (BOOL)moveByOffset:(int)_delta; // blocking .. - (BOOL)wouldBlockInMode:(NGStreamMode)_mode; // always NO .. @end #endif /* __NGStreams_NGDataStream_H__ */ SOPE/sope-core/NGStreams/NGStreams/NGPassiveSocket.h0000644000000000000000000000470712242733417021122 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGNet_NGPassiveSocket_H__ #define __NGNet_NGPassiveSocket_H__ #import #include #include /* Represents a STREAM server socket based on the standard Unix sockets library. A passive socket has exactly one address, the address the socket is bound to. If you do not bind the socket, the address is determined after the listen() call was executed through the getsockname() call. Note that if the socket is bound it's still an active socket in the system's view, it becomes an passive one when the listen call is executed. NOTE: Currently the passive _must_ be bound. This is because during the creation of the socket the domain is needed. The domain is encapsulated in the socket-address. Therefore the method of letting the kernel determine a socket address, as described above, currently does not work. */ @interface NGPassiveSocket : NGSocket < NGPassiveSocket > { @protected id acceptLock; // prevents file-locking int backlogSize; } + (id)socketBoundToAddress:(id)_address; /* accessors */ - (BOOL)isListening; - (BOOL)isOpen; /* operations */ // throws // NGSocketIsAlreadyListeningException when the socket is in the listen state // NGCouldNotListenException when the listen call failed - (BOOL)listenWithBacklog:(int)_backlogSize; // accept blocks when multiple threads try to accept (using acceptLock) // throws // NGCouldNotAcceptException when the socket is not listening // NGCouldNotAcceptException when the accept call failed - (id)accept; @end #endif /* __NGNet_NGPassiveSocket_H__ */ SOPE/sope-core/NGStreams/NGStreams/NGActiveSSLSocket.h0000644000000000000000000000254112242733417021277 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG Copyright (C) 2011 Jeroen Dekkers This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGNet_NGActiveSSLSocket_H__ #define __NGNet_NGActiveSSLSocket_H__ #include #include "../config.h" @interface NGActiveSSLSocket : NGActiveSocket { #ifdef HAVE_GNUTLS void *cred; /* real type: gnutls_certificate_credentials_t */ void *session; /* real type: gnutls_session_t */ #else void *ctx; /* real type: SSL_CTX */ void *ssl; /* real type: SSL */ void *sbio; /* real type: BIO (basic input/output) */ #endif } - (BOOL) startTLS; @end #endif /* __NGNet_NGActiveSSLSocket_H__ */ SOPE/sope-core/NGStreams/NGStreams/NGSocketProtocols.h0000644000000000000000000000542512242733417021472 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGNet_NGSocketProtocols_H__ #define __NGNet_NGSocketProtocols_H__ #import #include @class NSException; // addresses @protocol NGSocketAddress < NSObject > - (void *)internalAddressRepresentation; - (int)addressRepresentationSize; - (id)domain; // (a NGSocketDomain) // needed by socket address factory: - (id)initWithDomain:(id)_domain internalRepresentation:(void *)_representation size:(int)_length; @end // sockets @protocol NGSocket < NSObject > - (id)localAddress; - (BOOL)bindToAddress:(id)_localAddress; - (BOOL)close; - (NSException *)lastException; @end // domains @protocol NGSocketDomain < NSObject > - (id)addressWithRepresentation:(void *)_data size:(unsigned int)_size; - (int)socketDomain; - (int)addressRepresentationSize; - (int)protocol; // these two methods manage resources associated with addresses // (primarily the files used for AF_LOCAL sockets) - (BOOL)prepareAddress:(id)_address forBindWithSocket:(id)_socket; - (BOOL)cleanupAddress:(id)_address afterCloseOfSocket:(id)_socket; @end // concrete sockets @protocol NGActiveSocket < NGSocket, NGStream, NGByteSequenceStream > - (BOOL)connectToAddress:(id)_address; - (BOOL)shutdown; - (BOOL)isConnected; - (id)remoteAddress; @end @protocol NGPassiveSocket < NGSocket > - (BOOL)listenWithBacklog:(int)_backlogSize; - (id)accept; @end // packets @protocol NGDatagramPacket < NSObject > - (void)setSender:(id)_address; - (id)sender; - (void)setReceiver:(id)_address; - (id)receiver; - (NSData *)data; @end @protocol NGDatagramPacketFactory < NSObject > - (id)packetWithData:(NSData *)_data; - (id) packetWithBytes:(const void *)_bytes size:(int)_packetSize; @end #endif /* __NGNet_NGSocketProtocols_H__ */ SOPE/sope-core/NGStreams/NGStreams/NGTextStream.h0000644000000000000000000000417712242733417020440 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGStreams_NGTextStream_H__ #define __NGStreams_NGTextStream_H__ #import #include /* NGTextStream Abstract superclass for 'text streams'. Text streams are streams which are based on unichars and NSStrings instead of bytes and byte buffers. */ @class NSException; @interface NGTextStream : NSObject < NGExtendedTextStream > { @private NSException *lastException; } // NGTextInputStream - (unichar)readCharacter; // abstract - (NSException *)lastException; - (void)setLastException:(NSException *)_exception; - (void)resetLastException; /* NGExtendedTextInputStream */ - (NSString *)readLineAsString; // inefficient - (unsigned)readCharacters:(unichar *)_chars count:(unsigned)_count; - (BOOL)safeReadCharacters:(unichar *)_chars count:(unsigned)_count; // NGTextOutputStream - (BOOL)writeCharacter:(unichar)_character; // abstract - (BOOL)writeString:(NSString *)_string; // writeCharacter: based - (BOOL)flush; // does nothing // NGExtendedTextOutputStream - (BOOL)writeFormat:(NSString *)_format arguments:(va_list)_ap; - (BOOL)writeFormat:(NSString *)_format, ...; - (BOOL)writeNewline; - (unsigned)writeCharacters:(const unichar *)_chars count:(unsigned)_count; - (BOOL)safeWriteCharacters:(const unichar *)_chars count:(unsigned)_count; @end #endif /* __NGStreams_NGTextStream_H__ */ SOPE/sope-core/NGStreams/NGStreams/NGLocalSocketDomain.h0000644000000000000000000000307112242733417021663 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGNet_NGLocalSocketDomain_H__ #define __NGNet_NGLocalSocketDomain_H__ #if !defined(WIN32) // UNIX domain, not available on WIN32 #import #include /* Represents the AF_LOCAL (AF_UNIX) socket domain. NGLocalSocketDomain is a singleton, therefore on copy it returns itself and on unarchiving it replaces the unarchived instance with the singleton. */ @interface NGLocalSocketDomain : NSObject < NSCopying, NSCoding, NGSocketDomain > + (id)domain; // NGSocketDomain - (id)addressWithRepresentation:(void *)_data size:(unsigned int)_size; - (int)socketDomain; - (int)protocol; @end #define NGDefaultLocalSocketDomain [NGLocalSocketDomain domain] #endif /* !WIN32 */ #endif /* __NGNet_NGLocalSocketDomain_H__ */ SOPE/sope-core/NGStreams/NGStreams/NGStreamPipe.h0000644000000000000000000000327212242733417020404 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGStreams_NGStreamPipe_H__ #define __NGStreams_NGStreamPipe_H__ #import @interface NGStreamPipe : NSPipe < NGStream, NGByteSequenceStream > { @private int fildes[2]; NSFileHandle *fhIn; NSFileHandle *fhOut; } + (id)pipe; - (id)init; - (NSFileHandle *)fileHandleForReading; - (NSFileHandle *)fileHandleForWriting; - (id)streamForReading; - (id)streamForWriting; // NGInputStream - (unsigned)readBytes:(void *)_buf count:(unsigned)_len; - (BOOL)safeReadBytes:(void *)_buf count:(unsigned)_len; - (BOOL)mark; - (BOOL)rewind; - (BOOL)markSupported; // NGOutputStream - (unsigned)writeBytes:(const void *)_buf count:(unsigned)_len; - (BOOL)safeWriteBytes:(const void *)_buf count:(unsigned)_len; - (BOOL)flush; // NGStream - (BOOL)close; - (NGStreamMode)mode; // Extensions - (BOOL)isOpen; @end #endif /* __NGStreams_NGStreamPipe_H__ */ SOPE/sope-core/NGStreams/NGStreams/NGConcreteStreamFileHandle.h0000644000000000000000000000275212242733417023167 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGStreams_NGConcreteStreamFileHandle_H__ #define __NGStreams_NGConcreteStreamFileHandle_H__ #import #include @class NSData; @interface NGConcreteStreamFileHandle : NSFileHandle { id stream; } - (id)initWithStream:(id)_stream; // accessors - (id)stream; // ops - (void)closeFile; - (int)fileDescriptor; // abstract // buffering - (void)synchronizeFile; // reading - (NSData *)readDataOfLength:(unsigned int)_length; - (NSData *)readDataToEndOfFile; // writing - (void)writeData:(NSData *)_data; // seeking - (void)seekToFileOffset:(unsigned long long)_offset; @end #endif /* __NGStreams_NGConcreteStreamFileHandle_H__ */ SOPE/sope-core/NGStreams/NGSocket+private.h0000644000000000000000000000246512242733417017371 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NGSocket.h" @interface NGSocket(PrivateMethods) #if defined(WIN32) - (id)_initWithDomain:(id)_domain descriptor:(SOCKET)_fd; #else - (id)_initWithDomain:(id)_domain descriptor:(int)_fd; #endif - (void)setOption:(int)_option value:(void *)_value len:(int)_len; - (void)getOption:(int)_option value:(void *)_value len:(int *)_len; - (void)setOption:(int)_option level:(int)_level value:(void *)_value len:(int)_len; - (void)getOption:(int)_option level:(int)_level value:(void *)_val len:(int *)_len; @end SOPE/sope-core/NGStreams/TODO0000644000000000000000000000021712242733417014556 0ustar rootrootTODO for NGStreams ================== - can we support NSxxStreams? - do we really need the dependency to: - NGStreams - NGExtensions ? SOPE/sope-core/NGStreams/NGTerminalSupport.m0000644000000000000000000000520012242733417017636 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NGTerminalSupport.h" #include "NGFileStream.h" #include "NGFilterStream.h" #include "NGCTextStream.h" #include "NGDescriptorFunctions.h" @implementation NGStream(NGTerminalSupport) - (BOOL)isAssociatedWithTerminalDevice { return NO; } - (NSString *)nameOfAssociatedTerminalDevice { return nil; } @end @implementation NGFileStream(NGTerminalSupport) - (BOOL)isAssociatedWithTerminalDevice { #if defined(WIN32) return NO; #else return [self isOpen] ? NGDescriptorIsAtty(self->fd) : NO; #endif } - (NSString *)nameOfAssociatedTerminalDevice { #if defined(WIN32) return nil; #else return [self isOpen] ? NGDescriptorGetTtyName(self->fd) : (NSString *)nil; #endif } @end /* NGFileStream(NGTerminalSupport) */ @implementation NGFilterStream(NGTerminalSupport) - (BOOL)isAssociatedWithTerminalDevice { id src = [self source]; return [src respondsToSelector:_cmd] ? [src isAssociatedWithTerminalDevice] : NO; } - (NSString *)nameOfAssociatedTerminalDevice { id src = [self source]; return [src respondsToSelector:_cmd] ? [src nameOfAssociatedTerminalDevice] : NO; } @end /* NGFilterStream(NGTerminalSupport) */ @implementation NGTextStream(NGTerminalSupport) - (BOOL)isAssociatedWithTerminalDevice { return NO; } - (NSString *)nameOfAssociatedTerminalDevice { return nil; } @end /* NGTextStream(NGTerminalSupport) */ @implementation NGCTextStream(NGTerminalSupport) - (BOOL)isAssociatedWithTerminalDevice { id src = [self source]; return [src respondsToSelector:_cmd] ? [src isAssociatedWithTerminalDevice] : NO; } - (NSString *)nameOfAssociatedTerminalDevice { id src = [self source]; return [src respondsToSelector:_cmd] ? [src nameOfAssociatedTerminalDevice] : NO; } @end /* NGCTextStream(NGTerminalSupport) */ void __link_NGStreams_NGTerminalSupport(void) { __link_NGStreams_NGTerminalSupport(); } SOPE/sope-core/NGStreams/NGCharBuffer.m0000644000000000000000000001144412242733417016504 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NGCharBuffer.h" #include "common.h" typedef struct NGCharBufferLA { unichar character; char isEOF:1; char isFetched:1; } LA_NGCharBuffer; @implementation NGCharBuffer + (id)charBufferWithSource:(id)_source la:(int)_la { return [[[self alloc] initWithSource:_source la:_la] autorelease]; } - (id)initWithSource:(id)_source la:(int)_la { if ((self = [super initWithSource:_source])) { int size = 0; if (_la < 1) { [NSException raise:NSRangeException format:@"lookahead depth is less than one (%d)", _la]; } // Find first power of 2 >= to requested size for (size = 2; size < _la; size *=2); #if LIB_FOUNDATION_LIBRARY self->la = NSZoneMallocAtomic([self zone], sizeof(LA_NGCharBuffer) * size); #else self->la = NSZoneMalloc([self zone], sizeof(LA_NGCharBuffer) * size); #endif memset(self->la, 0, sizeof(LA_NGCharBuffer) * size); self->bufLen = size; self->sizeLessOne = self->bufLen - 1; self->headIdx = 0; self->wasEOF = NO; if ([self->source respondsToSelector:@selector(methodForSelector:)]) { self->readCharacter = (unichar (*)(id, SEL)) [(NSObject *)self->source methodForSelector:@selector(readCharacter)]; } } return self; } - (id)initWithSource:(id)_source { [self release]; [self doesNotRecognizeSelector:_cmd]; return nil; } - (id)init { [self release]; [self doesNotRecognizeSelector:_cmd]; return nil; } #if !LIB_FOUNDATION_BOEHM_GC - (void)dealloc { NSZoneFree([self zone], self->la); self->readCharacter = NULL; [super dealloc]; } #endif - (unichar)readCharacter { int character = [self la:0]; if (character < 1) [[[NGEndOfStreamException alloc] init] raise]; [self consume]; return character; } /* LA */ - (int)la:(int)_la { int result = -1; int idx = (_la + self->headIdx) & self->sizeLessOne; idx = *(&idx); if (_la > self->sizeLessOne) { [NSException raise:NSRangeException format:@"tried to look ahead too far (la=%d, max=%d)", _la, self->bufLen]; } if (self->wasEOF) { result = (!self->la[idx].isFetched || self->la[idx].isEOF) ? -1 : self->la[idx].character; } else { if (!self->la[idx].isFetched) { int i; *(&i) = 0; while ((i < _la) && (self->la[(self->headIdx + i) & self->sizeLessOne].isFetched)) i++; NS_DURING { while (i <= _la) { int ix = 0; unichar character = 0; if (self->readCharacter == NULL) character = [self->source readCharacter]; else { character = self->readCharacter(self->source, @selector(readCharacter)); } ix = (self->headIdx + i) & self->sizeLessOne; self->la[ix].character = character; self->la[ix].isFetched = 1; i++; } } NS_HANDLER { if ([localException isKindOfClass:[NGEndOfStreamException class]]) { while (i <= _la) { self->la[(self->headIdx + i) & self->sizeLessOne].isEOF = YES; i++; self->wasEOF = YES; } } else { [localException raise]; } } NS_ENDHANDLER; } result = (self->la[idx].isEOF) ? -1 : self->la[idx].character; } return result; } - (void)consume { int idx = self->headIdx & sizeLessOne; if (!(self->la[idx].isFetched)) [self la:0]; self->la[idx].isFetched = 0; self->headIdx++; } - (void)consume:(int)_cnt { while (_cnt > 0) { int idx = self->headIdx & sizeLessOne; if (!(self->la[idx].isFetched)) [self la:0]; self->la[idx].isFetched = 0; self->headIdx++; _cnt--; } } /* description */ - (NSString *)description { return [NSString stringWithFormat:@"<%@[0x%p] source=%@ la=%d", NSStringFromClass([self class]), self, self->source, self->bufLen]; } @end /* NGCharBuffer */ SOPE/sope-core/NGStreams/NGFilterTextStream.m0000644000000000000000000000253412242733417017743 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include "common.h" @implementation NGFilterTextStream + (id)textFilterWithSource:(id)_s { return [[(NGFilterTextStream *)[self alloc] initWithSource:_s] autorelease]; } - (id)initWithSource:(id)_source { if ((self = [super init])) { self->source = [_source retain]; } return self; } - (id)init { return [self initWithSource:nil]; } - (void)dealloc { [self->source release]; [super dealloc]; } /* accessors */ - (id)source { return self->source; } @end /* NGFilterTextStream */ SOPE/sope-core/NGStreams/NGStreamCoder.m0000644000000000000000000010212312242733417016700 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "config.h" #include "common.h" #include "NGStreamCoder.h" #include "NGStream+serialization.h" #if APPLE_RUNTIME || NeXT_RUNTIME # include #endif #define FINAL static inline extern id nil_method(id, SEL, ...); /* Debugging topics: encoder decoder */ typedef unsigned char NGTagType; #define REFERENCE 128 #define VALUE 127 static unsigned __NGHashPointer(void *table, const void *anObject) { return (unsigned)((long)anObject / 4); } static BOOL __NGComparePointers(void *table, const void *anObject1, const void *anObject2) { return anObject1 == anObject2 ? YES : NO; } static void __NGRetainObjects(void *table, const void *anObject) { (void)[(NSObject*)anObject retain]; } static void __NGReleaseObjects(void *table, void *anObject) { [(NSObject*)anObject release]; } static NSString* __NGDescribePointers(void *table, const void *anObject) { return [NSString stringWithFormat:@"%p", anObject]; } static NSMapTableKeyCallBacks NGIdentityObjectMapKeyCallbacks = { (unsigned(*)(NSMapTable *, const void *)) __NGHashPointer, (BOOL(*)(NSMapTable *, const void *, const void *))__NGComparePointers, (void (*)(NSMapTable *, const void *anObject)) __NGRetainObjects, (void (*)(NSMapTable *, void *anObject)) __NGReleaseObjects, (NSString *(*)(NSMapTable *, const void *)) __NGDescribePointers, (const void *)NULL }; static const char *NGCoderSignature = "MDlink NGStreamCoder"; static int NGCoderVersion = 1100; @implementation NGStreamCoder static NSMapTable *classToAliasMappings = NULL; // archive name => decoded name + (void)initialize { BOOL isInitialized = NO; if (!isInitialized) { isInitialized = YES; classToAliasMappings = NSCreateMapTable(NSObjectMapKeyCallBacks, NSObjectMapValueCallBacks, 19); } } + (id)coderWithStream:(id)_stream { return AUTORELEASE([[self alloc] initWithStream:_stream]); } - (id)initWithStream:(id)_stream mode:(NGStreamMode)_mode { if ((self = [super init])) { self->stream = [_stream retain]; self->classForCoder = @selector(classForCoder); self->replObjectForCoder = @selector(replacementObjectForCoder:); if ([self->stream isKindOfClass:[NSObject class]]) { self->readIMP = (NGIOSafeReadMethodType) [(NSObject*)self->stream methodForSelector:@selector(safeReadBytes:count:)]; self->writeIMP = (NGIOSafeWriteMethodType) [(NSObject*)self->stream methodForSelector:@selector(safeWriteBytes:count:)]; } if (NGCanReadInStreamMode(_mode)) { // setup decoder self->inObjects = NSCreateMapTable(NSIntMapKeyCallBacks, NSObjectMapValueCallBacks, 119); self->inClasses = NSCreateMapTable(NSIntMapKeyCallBacks, NSObjectMapValueCallBacks, 19); self->inPointers = NSCreateMapTable(NSIntMapKeyCallBacks, NSIntMapValueCallBacks, 19); self->inClassAlias = NSCreateMapTable(NSObjectMapKeyCallBacks, NSObjectMapValueCallBacks, 19); self->inClassVersions = NSCreateMapTable(NSObjectMapKeyCallBacks, NSObjectMapValueCallBacks, 19); } if (NGCanWriteInStreamMode(_mode)) { // setup encoder self->outObjects = NSCreateHashTable(NSNonOwnedPointerHashCallBacks, 119); self->outConditionals = NSCreateHashTable(NSNonOwnedPointerHashCallBacks, 119); self->outPointers = NSCreateHashTable(NSNonOwnedPointerHashCallBacks, 0); self->replacements = NSCreateMapTable(NGIdentityObjectMapKeyCallbacks, NSObjectMapValueCallBacks, 19); } } return self; } - (id)init { return [self initWithStream:nil mode:NGStreamMode_undefined]; } - (id)initWithStream:(id)_stream { return [self initWithStream:_stream mode:[_stream mode]]; } - (void)dealloc { // release encoding restreams if (self->outObjects) { NSFreeHashTable(self->outObjects); self->outObjects = NULL; } if (self->outConditionals) { NSFreeHashTable(self->outConditionals); self->outConditionals = NULL; } if (self->outPointers) { NSFreeHashTable(self->outPointers); self->outPointers = NULL; } if (self->replacements) { NSFreeMapTable(self->replacements); self->replacements = NULL; } // release decoding restreams if (self->inObjects) { NSFreeMapTable(self->inObjects); self->inObjects = NULL; } if (self->inClasses) { NSFreeMapTable(self->inClasses); self->inClasses = NULL; } if (self->inPointers) { NSFreeMapTable(self->inPointers); self->inPointers = NULL; } if (self->inClassAlias) { NSFreeMapTable(self->inClassAlias); self->inClassAlias = NULL; } if (self->inClassVersions) { NSFreeMapTable(self->inClassVersions); self->inClassVersions = NULL; } [self->stream release]; self->stream = nil; [super dealloc]; } /* accessors */ - (id)stream { return self->stream; } - (NSString *)coderSignature { return [NSString stringWithCString:NGCoderSignature]; } - (int)coderVersion { return NGCoderVersion; } - (unsigned int)systemVersion { return self->inArchiverVersion; } // misc FINAL BOOL isBaseType(const char *_type) { switch (*_type) { case _C_CHR: case _C_UCHR: case _C_SHT: case _C_USHT: case _C_INT: case _C_UINT: case _C_LNG: case _C_ULNG: case _C_FLT: case _C_DBL: return YES; default: return NO; } } FINAL BOOL isReferenceTag(NGTagType _tag) { return (_tag & REFERENCE) ? YES : NO; } FINAL NGTagType tagValue(NGTagType _tag) { return _tag & VALUE; // mask out bit 8 } FINAL int _archiveIdOfObject(NGStreamCoder *self, id _object) { return (_object == nil) ? 0 : (int)_object; } FINAL int _archiveIdOfClass(NGStreamCoder *self, Class _class) { return _archiveIdOfObject(self, _class); } // primitive encoding FINAL void _writeBytes(NGStreamCoder *self, const void *_bytes, unsigned _len); FINAL void _writeTag (NGStreamCoder *self, NGTagType _tag); FINAL void _writeChar (NGStreamCoder *self, char _value); FINAL void _writeShort(NGStreamCoder *self, short _value); FINAL void _writeInt (NGStreamCoder *self, int _value); FINAL void _writeLong (NGStreamCoder *self, long _value); FINAL void _writeFloat(NGStreamCoder *self, float _value); FINAL void _writeCString(NGStreamCoder *self, const char *_value); FINAL void _writeObjC(NGStreamCoder *self, const void *_value, const char *_type); // primitive decoding FINAL void _readBytes(NGStreamCoder *self, void *_bytes, unsigned _len); FINAL NGTagType _readTag(NGStreamCoder *self); FINAL char _readChar (NGStreamCoder *self); FINAL short _readShort(NGStreamCoder *self); FINAL int _readInt (NGStreamCoder *self); FINAL long _readLong (NGStreamCoder *self); FINAL float _readFloat(NGStreamCoder *self); FINAL char *_readCString(NGStreamCoder *self); FINAL void _readObjC(NGStreamCoder *self, void *_value, const char *_type); // -------------------- encoding -------------------- - (void)beginEncoding { self->traceMode = NO; self->encodingRoot = YES; } - (void)endEncoding { NSResetHashTable(self->outObjects); NSResetHashTable(self->outConditionals); NSResetHashTable(self->outPointers); NSResetMapTable(self->replacements); self->traceMode = NO; self->encodingRoot = NO; } - (void)writeArchiveHeader { if (self->didWriteHeader == NO) { _writeCString(self, [[self coderSignature] cString]); _writeInt(self, [self coderVersion]); self->didWriteHeader = YES; } } - (void)writeArchiveTrailer { } - (void)traceObjectsWithRoot:(id)_root { // encoding pass 1 NS_DURING { self->traceMode = YES; [self encodeObject:_root]; } NS_HANDLER { self->traceMode = NO; NSResetHashTable(self->outObjects); [localException raise]; } NS_ENDHANDLER; self->traceMode = NO; NSResetHashTable(self->outObjects); } - (void)encodeObjectsWithRoot:(id)_root { // encoding pass 2 [self encodeObject:_root]; } - (void)encodeRootObject:(id)_object { NSAutoreleasePool *pool = [[NSAutoreleasePool allocWithZone:[self zone]] init]; [self beginEncoding]; NS_DURING { /* * Prepare for writing the graph objects for which `rootObject' is the root * node. The algorithm consists from two passes. In the first pass it * determines the nodes so-called 'conditionals' - the nodes encoded *only* * with -encodeConditionalObject:. They represent nodes that are not * related directly to the graph. In the second pass objects are encoded * normally, except for the conditional objects which are encoded as nil. */ // pass1: start tracing for conditionals [self traceObjectsWithRoot:_object]; // pass2: start writing [self writeArchiveHeader]; [self encodeObjectsWithRoot:_object]; [self writeArchiveTrailer]; } NS_HANDLER { [self endEncoding]; // release resources [localException raise]; } NS_ENDHANDLER; [self endEncoding]; // release resources [pool release]; pool = nil; } - (void)encodeConditionalObject:(id)_object { if (self->traceMode) { // pass 1 /* * This is the first pass of the determining the conditionals * algorithm. We traverse the graph and insert into the `conditionals' * set. In the second pass all objects that are still in this set will * be encoded as nil when they receive -encodeConditionalObject:. An * object is removed from this set when it receives -encodeObject:. */ if (_object) { if (NSHashGet(self->outObjects, _object)) // object isn't conditional any more .. (was stored using encodeObject:) ; else if (NSHashGet(self->outConditionals, _object)) // object is already stored as conditional ; else // insert object in conditionals set NSHashInsert(self->outConditionals, _object); } } else { // pass 2 BOOL isConditional; isConditional = (NSHashGet(self->outConditionals, _object) != nil); // If anObject is still in the `conditionals' set, it is encoded as nil. [self encodeObject:isConditional ? nil : _object]; } } - (void)_traceObject:(id)_object { if (_object == nil) // don't trace nil objects .. return; if (NSHashGet(self->outObjects, _object) == nil) { // object wasn't traced yet // Look-up the object in the `conditionals' set. If the object is // there, then remove it because it is no longer a conditional one. if (NSHashGet(self->outConditionals, _object)) { // object was marked conditional .. NSHashRemove(self->outConditionals, _object); } // mark object as traced NSHashInsert(self->outObjects, _object); if (object_is_instance(_object)) { Class archiveClass = Nil; id replacement = nil; replacement = [_object performSelector:self->replObjectForCoder withObject:self]; if (replacement != _object) { NSMapInsert(self->replacements, _object, replacement); _object = replacement; } if (object_is_instance(_object)) { archiveClass = [_object performSelector:self->classForCoder withObject:self]; } [self encodeObject:archiveClass]; [_object encodeWithCoder:self]; } else { // there are no class-variables .. } } } - (void)_encodeObject:(id)_object { NGTagType tag; int archiveId = _archiveIdOfObject(self, _object); tag = object_is_instance(_object) ? _C_ID : _C_CLASS; if (_object == nil) { // nil object #if 0 NSLog(@"encoding nil reference .."); #endif _writeTag(self, tag | REFERENCE); _writeInt(self, archiveId); } else if (NSHashGet(self->outObjects, _object)) { // object was already written #if 0 if (tag == _C_CLASS) { NSLog(@"encoding reference to class <%s> ..", class_get_class_name(_object)); } else { NSLog(@"encoding reference to object 0x%p<%s> ..", _object, class_get_class_name(*(Class *)_object)); } #endif _writeTag(self, tag | REFERENCE); _writeInt(self, archiveId); } else { // mark object as written NSHashInsert(self->outObjects, _object); #if 0 if (tag == _C_CLASS) { // a class object NSLog( @"encoding class %s:%i ..", class_get_class_name(_object), [_object version]); } else { NSLog(@"encoding object 0x%p<%s> ..", _object, class_get_class_name(*(Class *)_object)); } #endif _writeTag(self, tag); _writeInt(self, archiveId); if (tag == _C_CLASS) { // a class object _writeCString(self, class_get_class_name(_object)); _writeInt(self, [_object version]); } else { Class archiveClass = Nil; id replacement = nil; replacement = NSMapGet(self->replacements, _object); if (replacement) _object = replacement; /* _object = [_object performSelector:self->replObjectForCoder withObject:self]; */ archiveClass = [_object performSelector:self->classForCoder withObject:self]; // class of replacement NSAssert(archiveClass, @"no archive class found .."); [self encodeObject:archiveClass]; [_object encodeWithCoder:self]; } } } - (void)encodeObject:(id)_object { if (self->encodingRoot) { [self encodeValueOfObjCType:object_is_instance(_object) ? "@" : "#" at:&_object]; } else { [self encodeRootObject:_object]; } } - (void)_traceValueOfObjCType:(const char *)_type at:(const void *)_value { #if 0 NSLog(@"tracing value of ObjC-type '%s'", _type); #endif switch (*_type) { case _C_ID: case _C_CLASS: [self _traceObject:*(id *)_value]; break; case _C_ARY_B: { int count = atoi(_type + 1); // eg '[15I' => count = 15 const char *itemType = _type; while(isdigit((int)*(++itemType))) ; // skip dimension [self encodeArrayOfObjCType:itemType count:count at:_value]; break; } case _C_STRUCT_B: { // C-structure begin '{' int offset = 0; while ((*_type != _C_STRUCT_E) && (*_type++ != '=')); // skip "=" while (YES) { [self encodeValueOfObjCType:_type at:((char *)_value) + offset]; offset += objc_sizeof_type(_type); _type = objc_skip_typespec(_type); if(*_type != _C_STRUCT_E) { // C-structure end '}' int align, remainder; align = objc_alignof_type(_type); if((remainder = offset % align)) offset += (align - remainder); } else break; } break; } } } - (void)_encodeValueOfObjCType:(const char *)_type at:(const void *)_value { switch (*_type) { case _C_ID: case _C_CLASS: // ?? Write another tag just to be possible to read using the // ?? decodeObject method. (Otherwise a lookahead would be required) // ?? _writeTag(self, *_type); [self _encodeObject:*(id *)_value]; break; case _C_ARY_B: { int count = atoi(_type + 1); // eg '[15I' => count = 15 const char *itemType = _type; while(isdigit((int)*(++itemType))) ; // skip dimension // Write another tag just to be possible to read using the // decodeArrayOfObjCType:count:at: method. _writeTag(self, _C_ARY_B); [self encodeArrayOfObjCType:itemType count:count at:_value]; break; } case _C_STRUCT_B: { // C-structure begin '{' int offset = 0; _writeTag(self, '{'); while ((*_type != _C_STRUCT_E) && (*_type++ != '=')); // skip "=" while (YES) { [self encodeValueOfObjCType:_type at:((char *)_value) + offset]; offset += objc_sizeof_type(_type); _type = objc_skip_typespec(_type); if(*_type != _C_STRUCT_E) { // C-structure end '}' int align, remainder; align = objc_alignof_type(_type); if((remainder = offset % align)) offset += (align - remainder); } else break; } break; } case _C_SEL: _writeTag(self, _C_SEL); _writeCString(self, (*(SEL *)_value) ? sel_get_name(*(SEL *)_value) : NULL); break; case _C_PTR: _writeTag(self, *_type); _writeObjC(self, *(char **)_value, _type + 1); break; case _C_CHARPTR: _writeTag(self, *_type); _writeObjC(self, _value, _type); break; case _C_CHR: case _C_UCHR: case _C_SHT: case _C_USHT: case _C_INT: case _C_UINT: case _C_LNG: case _C_ULNG: case _C_FLT: case _C_DBL: _writeTag(self, *_type); _writeObjC(self, _value, _type); break; default: NSLog(@"unsupported C type '%s' ..", _type); break; } } - (void)encodeValueOfObjCType:(const char *)_type at:(const void *)_value { if (self->traceMode) [self _traceValueOfObjCType:_type at:_value]; else { if (self->didWriteHeader == NO) [self writeArchiveHeader]; [self _encodeValueOfObjCType:_type at:_value]; } } - (void)encodeArrayOfObjCType:(const char *)_type count:(unsigned int)_count at:(const void *)_array { if ((self->didWriteHeader == NO) && (self->traceMode == NO)) [self writeArchiveHeader]; // array header if (self->traceMode == NO) { // nothing is written during trace-mode _writeTag(self, _C_ARY_B); _writeInt(self, _count); } // Optimize writing arrays of elementary types. If such an array has to // be written, write the type and then the elements of array. if ((*_type == _C_ID) || (*_type == _C_CLASS)) { // object array int i; if (self->traceMode == NO) _writeTag(self, *_type); // object array for (i = 0; i < _count; i++) [self encodeObject:((id *)_array)[i]]; } else if ((*_type == _C_CHR) || (*_type == _C_UCHR)) { // byte array if (self->traceMode == NO) { // write base type tag _writeTag(self, *_type); // write buffer _writeBytes(self, _array, _count); } } else if (isBaseType(_type)) { if (self->traceMode == NO) { unsigned offset, itemSize = objc_sizeof_type(_type); int i; // write base type tag _writeTag(self, *_type); // write contents for (i = offset = 0; i < _count; i++, offset += itemSize) _writeObjC(self, (char *)_array + offset, _type); } } else { // encoded using normal method IMP encodeValue = NULL; unsigned offset, itemSize = objc_sizeof_type(_type); int i; encodeValue = [self methodForSelector:@selector(encodeValueOfObjCType:at:)]; for (i = offset = 0; i < _count; i++, offset += itemSize) { encodeValue(self, @selector(encodeValueOfObjCType:at:), (char *)_array + offset, _type); } } } // -------------------- decoding -------------------- - (void)decodeArchiveHeader { if (self->didReadHeader == NO) { char *archiver = _readCString(self); self->inArchiverVersion = _readInt(self); if (strcmp(archiver, [[self coderSignature] cString])) { NSLog(@"WARNING: used a different archiver (signature %s:%i)", archiver, [self systemVersion]); } else if ([self systemVersion] != [self coderVersion]) { NSLog(@"WARNING: used a different archiver version " @"(archiver=%i, unarchiver=%i)", [self systemVersion], [self coderVersion]); } if (archiver) { NGFree(archiver); archiver = NULL; } self->didReadHeader = YES; } } - (void)beginDecoding { #if 0 NSLog(@"start decoding .."); #endif [self decodeArchiveHeader]; } - (void)endDecoding { #if 0 NSLog(@"finish decoding .."); #endif NSResetMapTable(self->inObjects); NSResetMapTable(self->inClasses); NSResetMapTable(self->inPointers); NSResetMapTable(self->inClassAlias); NSResetMapTable(self->inClassVersions); } - (Class)_decodeClass:(BOOL)_isReference { int archiveId = _readInt(self); Class result = Nil; if (_isReference) { result = (Class)NSMapGet(self->inClasses, (void *)archiveId); if (result == Nil) { NSLog(@"did not find class for archive-id %i", archiveId); } } else { NSString *name = NULL; int version = 0; name = [NSString stringWithCString:_readCString(self)]; version = _readInt(self); if (name == nil) { [NSException raise:NSInconsistentArchiveException format:@"did not find class name"]; } { // check whether the class is to be replaced NSString *newName = NSMapGet(self->inClassAlias, name); if (newName) name = newName; else { newName = NSMapGet(classToAliasMappings, name); if (newName) name = newName; } } result = NSClassFromString(name); #if 0 NSLog(@"decoded class %@:%i (result=%@).", name, version, result); #endif NSAssert([result version] == version, @"class versions do not match .."); NSMapInsert(self->inClasses, (void *)archiveId, result); } NSAssert(result, @"class may not be Nil .."); return result; } - (id)_decodeObject:(BOOL)_isReference { // this method returns a retained object ! int archiveId = _readInt(self); id result = nil; if (archiveId == 0) // nil object or unused conditional object return nil; if (_isReference) { result = [(id)NSMapGet(self->inObjects, (void *)archiveId) retain]; } else { Class class = Nil; id replacement = nil; // decode class info [self decodeValueOfObjCType:"#" at:&class]; NSAssert(class, @"invalid class .."); result = [class allocWithZone:self->objectZone]; NSMapInsert(self->inObjects, (void *)archiveId, result); replacement = [result initWithCoder:self]; if (replacement != result) { replacement = [replacement retain]; NSMapRemove(self->inObjects, result); result = replacement; NSMapInsert(self->inObjects, (void *)archiveId, result); [replacement release]; } replacement = [result awakeAfterUsingCoder:self]; if (replacement != result) { replacement = [replacement retain]; NSMapRemove(self->inObjects, result); result = replacement; NSMapInsert(self->inObjects, (void *)archiveId, result); [replacement release]; } } NSAssert([result retainCount] > 0, @"invalid retain count .."); return result; } - (id)decodeObject { id result = nil; [self decodeValueOfObjCType:"@" at:&result]; // result is retained return [result autorelease]; } - (void)decodeValueOfObjCType:(const char *)_type at:(void *)_value { BOOL startedDecoding = NO; NGTagType tag = 0; BOOL isReference = NO; if (self->decodingRoot == NO) { self->decodingRoot = YES; startedDecoding = YES; [self beginDecoding]; } tag = _readTag(self); isReference = isReferenceTag(tag); tag = tagValue(tag); switch (tag) { case _C_ID: NSAssert((*_type == _C_ID) || (*_type == _C_CLASS), @"invalid type .."); *(id *)_value = [self _decodeObject:isReference]; break; case _C_CLASS: NSAssert((*_type == _C_ID) || (*_type == _C_CLASS), @"invalid type .."); *(Class *)_value = [self _decodeClass:isReference]; break; case _C_ARY_B: { int count = atoi(_type + 1); // eg '[15I' => count = 15 const char *itemType = _type; NSAssert(*_type == _C_ARY_B, @"invalid type .."); while(isdigit((int)*(++itemType))) ; // skip dimension [self decodeArrayOfObjCType:itemType count:count at:_value]; break; } case _C_STRUCT_B: { int offset = 0; NSAssert(*_type == _C_STRUCT_B, @"invalid type .."); while ((*_type != _C_STRUCT_E) && (*_type++ != '=')); // skip "=" while (YES) { [self decodeValueOfObjCType:_type at:((char *)_value) + offset]; offset += objc_sizeof_type(_type); _type = objc_skip_typespec(_type); if(*_type != _C_STRUCT_E) { // C-structure end '}' int align, remainder; align = objc_alignof_type(_type); if((remainder = offset % align)) offset += (align - remainder); } else break; } break; } case _C_SEL: { char *name = NULL; NSAssert(*_type == tag, @"invalid type .."); _readObjC(self, &name, @encode(char *)); *(SEL *)_value = name ? sel_get_any_uid(name) : NULL; NGFree(name); name = NULL; } case _C_PTR: _readObjC(self, *(char **)_value, _type + 1); // skip '^' break; case _C_CHARPTR: case _C_CHR: case _C_UCHR: case _C_SHT: case _C_USHT: case _C_INT: case _C_UINT: case _C_LNG: case _C_ULNG: case _C_FLT: case _C_DBL: NSAssert(*_type == tag, @"invalid type .."); _readObjC(self, _value, _type); break; default: NSAssert2(0, @"unsupported tag '%c', type %s ..", tag, _type); break; } if (startedDecoding) { [self endDecoding]; self->decodingRoot = NO; } } - (void)decodeArrayOfObjCType:(const char *)_type count:(unsigned int)_count at:(void *)_array { BOOL startedDecoding = NO; NGTagType tag = _readTag(self); int count = _readInt(self); if (self->decodingRoot == NO) { self->decodingRoot = YES; startedDecoding = YES; [self beginDecoding]; } #if 0 NSLog(@"decoding array[%i/%i] of ObjC-type '%s' array-tag='%c'", _count, count, _type, tag); #endif NSAssert(tag == _C_ARY_B, @"invalid type .."); NSAssert(count == _count, @"invalid array size .."); // Arrays of elementary types are written optimized: the type is written // then the elements of array follow. if ((*_type == _C_ID) || (*_type == _C_CLASS)) { // object array int i; #if 0 NSLog(@"decoding object-array[%i] type='%s'", _count, _type); #endif tag = _readTag(self); // object array NSAssert(tag == *_type, @"invalid array element type .."); for (i = 0; i < _count; i++) ((id *)_array)[i] = [self decodeObject]; } else if ((*_type == _C_CHR) || (*_type == _C_UCHR)) { // byte array tag = _readTag(self); NSAssert((tag == _C_CHR) || (tag == _C_UCHR), @"invalid byte array type .."); #if 0 NSLog(@"decoding byte-array[%i] type='%s' tag='%c'", _count, _type, tag); #endif // read buffer _readBytes(self, _array, _count); } else if (isBaseType(_type)) { unsigned offset, itemSize = objc_sizeof_type(_type); int i; tag = _readTag(self); NSAssert(tag == *_type, @"invalid array base type .."); for (i = offset = 0; i < _count; i++, offset += itemSize) _readObjC(self, (char *)_array + offset, _type); } else { IMP decodeValue = NULL; unsigned offset, itemSize = objc_sizeof_type(_type); int i; decodeValue = [self methodForSelector:@selector(decodeValueOfObjCType:at:)]; for (i = offset = 0; i < count; i++, offset += itemSize) { decodeValue(self, @selector(decodeValueOfObjCType:at:), (char *)_array + offset, _type); } } if (startedDecoding) { [self endDecoding]; self->decodingRoot = NO; } } // Substituting One Class for Another + (NSString *)classNameDecodedForArchiveClassName:(NSString *)nameInArchive { NSString *className = NSMapGet(classToAliasMappings, nameInArchive); return className ? className : nameInArchive; } + (void)decodeClassName:(NSString *)nameInArchive asClassName:(NSString *)trueName { NSMapInsert(classToAliasMappings, nameInArchive, trueName); } - (NSString *)classNameDecodedForArchiveClassName:(NSString *)_nameInArchive { NSString *className = NSMapGet(self->inClassAlias, _nameInArchive); return className ? className : _nameInArchive; } - (void)decodeClassName:(NSString *)nameInArchive asClassName:(NSString *)trueName { NSMapInsert(self->inClassAlias, nameInArchive, trueName); } // ******************** primitives ******************** // encoding FINAL void _writeBytes(NGStreamCoder *self, const void *_bytes, unsigned _len) { NSCAssert(self->traceMode == NO, @"nothing can be written during trace-mode .."); self->writeIMP ? self->writeIMP(self->stream, @selector(safeWriteBytes:count:), _bytes, _len) : [self->stream safeWriteBytes:_bytes count:_len]; } FINAL void _writeTag(NGStreamCoder *self, NGTagType _tag) { NSCAssert(self, @"invalid self .."); #if 0 NSLog(@"write tag '%s%c'", isReferenceTag(_tag) ? "&" : "", tagValue(_tag)); #endif [self->stream serializeChar:_tag]; } FINAL void _writeChar(NGStreamCoder *self, char _value) { [self->stream serializeChar:_value]; } FINAL void _writeShort(NGStreamCoder *self, short _value) { [self->stream serializeShort:_value]; } FINAL void _writeInt(NGStreamCoder *self, int _value) { [self->stream serializeInt:_value]; } FINAL void _writeLong(NGStreamCoder *self, long _value) { [self->stream serializeLong:_value]; } FINAL void _writeFloat(NGStreamCoder *self, float _value) { [self->stream serializeFloat:_value]; } FINAL void _writeCString(NGStreamCoder *self, const char *_value) { [(id)self->stream serializeDataAt:&_value ofObjCType:@encode(char *) context:self]; } FINAL void _writeObjC(NGStreamCoder *self, const void *_value, const char *_type) { if ((_value == NULL) || (_type == NULL)) return; if (self->traceMode) { // no need to track base-types in trace-mode switch (*_type) { case _C_ID: case _C_CLASS: case _C_CHARPTR: case _C_ARY_B: case _C_STRUCT_B: case _C_PTR: [(id)self->stream serializeDataAt:_value ofObjCType:_type context:self]; break; default: break; } } else { [(id)self->stream serializeDataAt:_value ofObjCType:_type context:self]; } } // decoding FINAL void _readBytes(NGStreamCoder *self, void *_bytes, unsigned _len) { self->readIMP ? self->readIMP(self->stream, @selector(safeReadBytes:count:), _bytes, _len) : [self->stream safeReadBytes:_bytes count:_len]; } FINAL NGTagType _readTag(NGStreamCoder *self) { return [self->stream deserializeChar]; } FINAL char _readChar(NGStreamCoder *self) { return [self->stream deserializeChar]; } FINAL short _readShort(NGStreamCoder *self) { return [self->stream deserializeShort]; } FINAL int _readInt(NGStreamCoder *self) { return [self->stream deserializeInt]; } FINAL long _readLong (NGStreamCoder *self) { return [self->stream deserializeLong]; } FINAL float _readFloat(NGStreamCoder *self) { return [self->stream deserializeFloat]; } FINAL char *_readCString(NGStreamCoder *self) { char *result = NULL; [(id)self->stream deserializeDataAt:&result ofObjCType:@encode(char *) context:self]; return result; } FINAL void _readObjC(NGStreamCoder *self, void *_value, const char *_type) { [(id)self->stream deserializeDataAt:_value ofObjCType:_type context:(id)self]; } // NSObjCTypeSerializationCallBack - (void)serializeObjectAt:(id *)_object ofObjCType:(const char *)_type intoData:(NSMutableData *)_data { switch (*_type) { case _C_ID: case _C_CLASS: if (self->traceMode) [self _traceObject:*_object]; else [self _encodeObject:*_object]; break; default: abort(); break; } } - (void)deserializeObjectAt:(id *)_object ofObjCType:(const char *)_type fromData:(NSData *)_data atCursor:(unsigned int *)_cursor { NGTagType tag = 0; BOOL isReference = NO; tag = _readTag(self); isReference = isReferenceTag(tag); tag = tagValue(tag); switch (*_type) { case _C_ID: NSAssert((*_type == _C_ID) || (*_type == _C_CLASS), @"invalid type .."); break; *_object = [self _decodeObject:isReference]; break; case _C_CLASS: NSAssert((*_type == _C_ID) || (*_type == _C_CLASS), @"invalid type .."); *_object = [self _decodeClass:isReference]; break; default: abort(); break; } } @end SOPE/sope-core/NGStreams/install-sh0000755000000000000000000001124512242733417016075 0ustar rootroot#! /bin/sh # # install - install a program, script, or datafile # This comes from X11R5. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. # # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 SOPE/sope-core/NGStreams/NGDatagramPacket.m0000644000000000000000000000467012242733417017350 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NGDatagramPacket.h" #include "common.h" @implementation NGDatagramPacket + (id)packetWithData:(NSData *)_data { return [[[self alloc] initWithData:_data] autorelease]; } + (id)packetWithBytes:(const void *)_bytes size:(int)_packetSize { return [[[self alloc] initWithBytes:_bytes size:_packetSize] autorelease]; } - (id)initWithBytes:(const void *)_bytes size:(int)_packetSize { return [self initWithData:[NSData dataWithBytes:_bytes length:_packetSize]]; } - (id)initWithData:(NSData *)_data { if ((self = [self init])) { self->packet = [_data copyWithZone:[self zone]]; } return self; } - (void)dealloc { [self->packet release]; [self->sender release]; [self->receiver release]; [super dealloc]; } /* accessors */ - (void)setSender:(id)_address { ASSIGN(self->sender, _address); } - (id)sender { return self->sender; } - (void)setReceiver:(id)_address { ASSIGN(self->receiver, _address); } - (id)receiver { return self->receiver; } - (void)setData:(NSData *)_data { ASSIGN(self->packet, _data); } - (NSData *)data { return self->packet; } - (int)packetSize { return [self->packet length]; } /* operations */ - (void)reverseAddresses { id oldSender = [[self sender] retain]; [self setSender:[self receiver]]; [self setReceiver:oldSender]; [oldSender release]; oldSender = nil; } /* description */ - (NSString *)description { return [NSString stringWithFormat:@"<%@[0x%p]: from=%@ to=%@ size=%i>", NSStringFromClass([self class]), self, [self sender], [self receiver], [self packetSize]]; } @end /* NGDatagramPacket */ SOPE/sope-core/NGStreams/DESIGN0000644000000000000000000000045512242733417014766 0ustar rootrootDESIGN ====== This library was roughly designed after the Java IO package. Additionally it fully supports Unix socket abstractions (domains, addresses and sockets). Some ObjC design decisions: - do not throw exceptions (but keep them in -lastException) - use protocols - support streaming operation SOPE/sope-core/NGStreams/NGGZipStream.m0000644000000000000000000001256112242733417016523 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include "common.h" #ifdef Assert #undef Assert #endif #include #ifndef DEF_MEM_LEVEL /* zutil.h */ # if MAX_MEM_LEVEL >= 8 # define DEF_MEM_LEVEL 8 # else # define DEF_MEM_LEVEL MAX_MEM_LEVEL # endif # define OS_CODE 0x07 /* TODO: probably need to adjust that ... */ #endif #undef Assert @implementation NGGZipStream - (id)initWithSource:(id)_source level:(int)_level { if ((self = [super initWithSource:_source])) { z_stream *zout; NSAssert1((_level >= NGGZipMinimalCompression && _level <= NGGZipMaximalCompression) || (_level == Z_DEFAULT_COMPRESSION), @"invalid compression level %i (0-9)", _level); self->outBufLen = 2048; #if LIB_FOUNDATION_LIBRARY self->outBuf = NSZoneMallocAtomic([self zone], self->outBufLen); self->outp = NSZoneMallocAtomic([self zone], sizeof(z_stream)); #else self->outBuf = NSZoneMalloc([self zone], self->outBufLen); self->outp = NSZoneMalloc([self zone], sizeof(z_stream)); #endif zout = self->outp; zout->zalloc = (alloc_func)NULL; zout->zfree = (free_func)NULL; zout->opaque = (voidpf)NULL; zout->next_out = self->outBuf; zout->avail_out = self->outBufLen; zout->next_in = Z_NULL; zout->avail_in = 0; self->crc = crc32(0L, Z_NULL, 0); if (deflateInit2(zout, _level, Z_DEFLATED, -MAX_WBITS, DEF_MEM_LEVEL, 0) != Z_OK) { NSLog(@"Could not init deflate .."); self = [self autorelease]; return nil; } } return self; } - (void)gcFinalize { [self close]; } - (void)dealloc { if (self->outBuf) NSZoneFree([self zone], self->outBuf); if (self->outp) NSZoneFree([self zone], self->outp); [self gcFinalize]; [super dealloc]; } /* headers */ - (void)writeGZipHeader { // gzip header char buf[10] = { 0x1f, 0x8b, // magic Z_DEFLATED, 0, // flags 0, 0, 0, 0, // time 0, OS_CODE // flags }; [self safeWriteBytes:buf count:10]; } static inline void putLong(NGGZipStream *self, uLong x) { int n; for (n = 0; n < 4; n++) { unsigned char c = (int)(x & 0xff); [self safeWriteBytes:&c count:1]; x >>= 8; } } - (void)writeGZipTrailer { putLong(self, self->crc); putLong(self, ((z_stream *)self->outp)->total_in); } /* primitives */ - (unsigned)readBytes:(void *)_buf count:(unsigned)_len { // decoder [self notImplemented:_cmd]; return -1; } - (unsigned)writeBytes:(const void *)_buf count:(unsigned)_len { // encoder z_stream *zout = self->outp; if (!self->headerIsWritten) [self writeGZipHeader]; { // gz_write zout->next_in = (void*)_buf; zout->avail_in = _len; while (zout->avail_in > 0) { int errorCode; if (zout->avail_out == 0) { [self safeWriteBytes:self->outBuf count:self->outBufLen]; zout->next_out = self->outBuf; // reset buffer position zout->avail_out = self->outBufLen; } errorCode = deflate(self->outp, Z_NO_FLUSH); if (errorCode != Z_OK) { if (zout->state) deflateEnd(self->outp); [NGStreamException raiseWithStream:self format:@"could not deflate chunk !"]; } } self->crc = crc32(self->crc, _buf, _len); } return _len; } - (BOOL)safeWriteBytes:(const void *)_buf count:(unsigned)_len { // encoder // gzip writes are safe if ([self writeBytes:_buf count:_len] == NGStreamError) return NO; else return YES; } - (void)close { [self flush]; [self writeGZipTrailer]; if (((z_stream *)self->outp)->state) deflateEnd(self->outp); [super close]; } - (void)flush { int errorCode = Z_OK; z_stream *zout = self->outp; BOOL done = NO; zout->next_in = NULL; zout->avail_in = 0; // should be zero already anyway while (1) { int len = self->outBufLen - zout->avail_out; if (len > 0) { [self safeWriteBytes:self->outBuf count:len]; zout->next_out = self->outBuf; zout->avail_out = self->outBufLen; } if (done) break; errorCode = deflate(zout, Z_FINISH); // deflate has finished flushing only when it hasn't used up // all the available space in the output buffer: done = (zout->avail_out != 0 || errorCode == Z_STREAM_END); if (errorCode != Z_OK && errorCode != Z_STREAM_END) break; } if (errorCode != Z_STREAM_END) { if (zout->state) deflateEnd(zout); [NGStreamException raiseWithStream:self format:@"flush failed"]; } [super flush]; } @end SOPE/sope-core/NGStreams/common.h0000644000000000000000000000612612242733417015534 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGStreams_common_H__ #define __NGStreams_common_H__ // common include files #include // configuration #include "config.h" #if defined(WIN32) # include # include #endif #if LIB_FOUNDATION_BOEHM_GC # include #endif #ifdef GNU_RUNTIME #if __GNU_LIBOBJC__ >= 20100911 # include #else # include # include # include #endif #endif #if WITH_FOUNDATION_EXT #if NeXT_Foundation_LIBRARY || APPLE_Foundation_LIBRARY # import # import # import # import # import # import # import #endif #endif #if !LIB_FOUNDATION_LIBRARY && !NeXT_Foundation_LIBRARY # define NSWillBecomeMultiThreadedNotification NSBecomingMultiThreaded #endif #ifndef ASSIGN # define ASSIGN(object, value) \ ({id __object = (id)object; \ id __value = (id)value; \ if (__value != __object) { if (__value) [__value retain]; \ if (__object) [__object release]; \ object = __value;}}) #endif #include /* system config */ #if !defined(__CYGWIN32__) # ifdef HAVE_WINDOWS_H # include # endif # ifdef HAVE_WINSOCK_H # include # endif #endif #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_STRINGS_H # include #endif #if HAVE_SYS_TYPES_H # include #endif #ifndef __MINGW32__ # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif #ifdef HAVE_NETDB_H # include #endif #if !defined(WIN32) || defined(__CYGWIN32__) # include # include # include #endif #ifndef AF_LOCAL # define AF_LOCAL AF_UNIX #endif #if !defined(SHUT_RD) # define SHUT_RD 0 #endif #if !defined(SHUT_WR) # define SHUT_WR 1 #endif #if !defined(SHUT_RDWR) # define SHUT_RDWR 2 #endif // local common's #include @interface NSObject(OSXHacks) - (void)subclassResponsibility:(SEL)_acmd; - (void)notImplemented:(SEL)_acmd; @end #endif /* __NGStreams_common_H__ */ SOPE/sope-core/NGStreams/NGTextStream.m0000644000000000000000000001125512242733417016575 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NGTextStream.h" #include "common.h" @implementation NGTextStream - (void)dealloc { [self->lastException release]; [super dealloc]; } /* NGTextInputStream */ - (NSException *)lastException { return nil; } - (void)setLastException:(NSException *)_exception { ASSIGN(self->lastException, _exception); } - (void)resetLastException { [self->lastException release]; self->lastException = nil; } - (unichar)readCharacter { [self subclassResponsibility:_cmd]; return 0; } - (BOOL)isOpen { return YES; } /* NGExtendedTextInputStream */ - (NSString *)readLineAsString { NSMutableString *str; unichar c; *(&str) = (id)[NSMutableString string]; NS_DURING { while ((c = [self readCharacter]) != '\n') [str appendString:[NSString stringWithCharacters:&c length:1]]; } NS_HANDLER { if ([localException isKindOfClass:[NGEndOfStreamException class]]) { if ([str length] == 0) str = nil; } else [localException raise]; } NS_ENDHANDLER; return str; } - (unsigned)readCharacters:(unichar *)_chars count:(unsigned)_count { /* Read up to _count characters, but one at the minimum. */ volatile unsigned pos; NS_DURING { for (pos = 0; pos < _count; pos++) _chars[pos] = [self readCharacter]; } NS_HANDLER { if ([localException isKindOfClass:[NGEndOfStreamException class]]) { if (pos == 0) [localException raise]; } else [localException raise]; } NS_ENDHANDLER; NSAssert1(pos > 0, @"invalid character count to be returned: %i", pos); return pos; } - (BOOL)safeReadCharacters:(unichar *)_chars count:(unsigned)_count { volatile unsigned pos; for (pos = 0; pos < _count; pos++) _chars[pos] = [self readCharacter]; return YES; } /* NGTextOutputStream */ - (BOOL)writeCharacter:(unichar)_character { [self subclassResponsibility:_cmd]; return NO; } - (BOOL)writeString:(NSString *)_string { unsigned length = [_string length], cnt = 0; unichar buffer[length]; void (*writeChar)(id, SEL, unichar); writeChar = (void (*)(id,SEL,unichar)) [self methodForSelector:@selector(writeCharacter:)]; [_string getCharacters:buffer]; for (cnt = 0; cnt < length; cnt++) writeChar(self, @selector(writeCharacter:), buffer[cnt]); return YES; } - (BOOL)flush { return YES; } /* NGExtendedTextOutputStream */ - (BOOL)writeFormat:(NSString *)_format arguments:(va_list)_ap { NSString *tmp; tmp = [[[NSString alloc] initWithFormat:_format arguments:_ap] autorelease]; [self writeString:tmp]; return YES; } - (BOOL)writeFormat:(NSString *)_format, ... { va_list ap; BOOL res = NO; va_start(ap, _format); #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 /* As soon as we add an exception handler on Leopard compilation * breaks. Probably some GCC bug. */ res = [self writeFormat:_format arguments:ap]; #else NS_DURING { res = [self writeFormat:_format arguments:ap]; } NS_HANDLER { va_end(ap); [localException raise]; } NS_ENDHANDLER; #endif va_end(ap); return res; } - (BOOL)writeNewline { if (![self writeString:@"\n"]) return NO; return [self flush]; } - (unsigned)writeCharacters:(const unichar *)_chars count:(unsigned)_count { /* Write up to _count characters, but one at the minimum. */ volatile unsigned pos; NS_DURING { for (pos = 0; pos < _count; pos++) [self writeCharacter:_chars[pos]]; } NS_HANDLER { if ([localException isKindOfClass:[NGEndOfStreamException class]]) { if (pos == 0) [localException raise]; } else [localException raise]; } NS_ENDHANDLER; NSAssert1(pos > 0, @"invalid character count to be returned: %i", pos); return pos; } - (BOOL)safeWriteCharacters:(const unichar *)_chars count:(unsigned)_count { unsigned pos; for (pos = 0; pos < _count; pos++) { if (![self writeCharacter:_chars[pos]]) return NO; } return YES; } @end /* NGTextStream */ SOPE/sope-core/NGStreams/Version0000644000000000000000000000004512242733417015435 0ustar rootroot# version file SUBMINOR_VERSION:=57 SOPE/sope-core/NGStreams/NGCTextStream.m0000644000000000000000000002420312242733417016675 0ustar rootroot/* Copyright (C) 2000-2008 SKYRIX Software AG Copyright (C) 2007-2008 Helge Hess This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include "common.h" static NSString *NGNewLineString = @"\n"; @interface _NGCTextStreamLineEnumerator : NSEnumerator { NGCTextStream *stream; } - (id)initWithTextStream:(NGCTextStream *)_stream; - (id)nextObject; @end NGStreams_DECLARE id NGTextIn = nil; NGStreams_DECLARE id NGTextOut = nil; NGStreams_DECLARE id NGTextErr = nil; @implementation NGCTextStream // stdio NGStreams_DECLARE void NGInitTextStdio(void) { static BOOL isInitialized = NO; if (!isInitialized) { isInitialized = YES; NGInitStdio(); NGTextIn = [(NGCTextStream *)[NGCTextStream alloc] initWithSource:(id)NGIn]; NGTextOut = [(NGCTextStream *)[NGCTextStream alloc] initWithSource:(id)NGOut]; NGTextErr = [(NGCTextStream *)[NGCTextStream alloc] initWithSource:(id)NGErr]; } } + (void)_flushForExit:(NSNotification *)_notification { // [NGTextIn flush]; [NGTextIn release]; NGTextIn = nil; [NGTextOut flush]; [NGTextOut release]; NGTextOut = nil; [NGTextErr flush]; [NGTextErr release]; NGTextErr = nil; } static void _flushAtExit(void) { // [NGTextIn flush]; [NGTextIn release]; NGTextIn = nil; [NGTextOut flush]; [NGTextOut release]; NGTextOut = nil; [NGTextErr flush]; [NGTextErr release]; NGTextErr = nil; } + (void)initialize { BOOL isInitialized = NO; if (!isInitialized) { isInitialized = YES; atexit(_flushAtExit); } } // system text stream + (id)textStreamWithInputSource:(id)_s { if (_s == nil) return nil; return [[(NGCTextStream *)[self alloc] initWithInputSource:_s] autorelease]; } + (id)textStreamWithOutputSource:(id)_s { if (_s == nil) return nil; return [[(NGCTextStream *)[self alloc] initWithOutputSource:_s] autorelease]; } + (id)textStreamWithSource:(id)_stream { if (_stream == nil) return nil; return [[(NGCTextStream *)[self alloc] initWithSource:_stream] autorelease]; } - (id)initWithSource:(id)_stream { if (_stream == nil) { [self release]; return nil; } if ((self = [super init]) != nil) { self->source = [_stream retain]; /* On MacOS 10.5 this is per default 30 aka MacOS Roman */ self->encoding = [NSString defaultCStringEncoding]; #ifdef __APPLE__ //# warning no selector caching on MacOSX ... #else /* check whether we are dealing with a proxy .. */ if ([source isKindOfClass:[NSObject class]]) { self->readBytes = (NGIOReadMethodType) [(NSObject *)source methodForSelector:@selector(readBytes:count:)]; self->writeBytes = (NGIOWriteMethodType) [(NSObject *)source methodForSelector:@selector(writeBytes:count:)]; self->flushBuffer = (BOOL (*)(id,SEL)) [(NSObject *)source methodForSelector:@selector(flush)]; } #endif } return self; } - (id)initWithInputSource:(id)_source { return [self initWithSource:(id)_source]; } - (id)initWithOutputSource:(id)_source { return [self initWithSource:(id)_source]; } - (void)dealloc { [self->source release]; self->readBytes = NULL; self->writeBytes = NULL; self->flushBuffer = NULL; [super dealloc]; } /* accessors */ - (id)source { return self->source; } - (int)fileDescriptor { return [(id)[self source] fileDescriptor]; } - (BOOL)isOpen { return [(id)[self source] isOpen]; } /* operations */ - (BOOL)close { return [self->source close]; } /* NGTextInputStream */ - (unichar)readCharacter { return [self readChar]; } - (unsigned char)readChar { unsigned char c; unsigned res; if (readBytes) { res = readBytes(self->source, @selector(readBytes:count:), &c, sizeof(unsigned char)); } else res = [self->source readBytes:&c count:sizeof(unsigned char)]; if (res == NGStreamError) { [self setLastException:[self->source lastException]]; return -1; } return c; } /* TODO: fix exception handling */ - (NSString *)readLineAsString { NGCharBuffer8 buffer = NULL; unsigned char c; *(&buffer) = NGCharBuffer8_new(128); NS_DURING { unsigned int res; if (readBytes) { do { res = self->readBytes(source, @selector(readBytes:count:), &c, sizeof(unsigned char)); if (res != 1) [[self->source lastException] raise]; if (c == '\r') { res = readBytes(source, @selector(readBytes:count:), &c, sizeof(unsigned char)); if (res != 1) [[self->source lastException] raise]; } if ((c != '\n') && (c != 0)) { NSAssert1(c != 0, @"tried to add '0' character to buffer '%s' ..", buffer->buffer); NGCharBuffer8_addChar(buffer, c); } } while ((c != '\n') && (c != 0)); } else { do { res = [self->source readBytes:&c count:sizeof(unsigned char)]; /* TODO: raises exception */ if (res != 1) [[self->source lastException] raise]; if (c == '\r') { res = [self->source readBytes:&c count:sizeof(unsigned char)]; if (res != 1) [[self->source lastException] raise]; } if ((c != '\n') && (c != 0)) NGCharBuffer8_addChar(buffer, c); } while ((c != '\n') && (c != 0)); } } NS_HANDLER { if ([localException isKindOfClass:[NGEndOfStreamException class]]) { if (buffer->length == 0) { NGCharBuffer8_dealloc(buffer); buffer = NULL; } } else [localException raise]; } NS_ENDHANDLER; return buffer ? NGCharBuffer8_makeStringAndDealloc(buffer) : (NSString *)nil; } - (NSEnumerator *)lineEnumerator { return [[[_NGCTextStreamLineEnumerator alloc] initWithTextStream:self] autorelease]; } /* NGTextOutputStream */ - (BOOL)writeCharacter:(unichar)_character { unsigned char c; unsigned res; if (_character > ((sizeof(unsigned char) * 256) - 1)) { // character is not in range of maximum system encoding [NSException raise:@"NGCTextStreamEncodingException" format: @"called writeCharacter: with character code (0x%X)" @" exceeding the maximum system character code (0x%X)", _character, ((sizeof(unsigned char) * 256) - 1)]; } c = _character; if (self->writeBytes != NULL) { res = self->writeBytes(self->source, @selector(writeBytes:count:), &c, sizeof(unsigned char)); } else res = [self->source writeBytes:&c count:sizeof(unsigned char)]; if (res == NGStreamError) { [self setLastException:[self->source lastException]]; return NO; } return YES; } - (BOOL)writeString:(NSString *)_string { unsigned char *str, *buf; unsigned toGo; #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040 || (GNUSTEP && OS_API_VERSION(100400,GS_API_LATEST)) if ((toGo = [_string maximumLengthOfBytesUsingEncoding:self->encoding]) == 0) return YES; buf = str = calloc(toGo + 2, sizeof(unsigned char)); // Note: maxLength INCLUDES the 0-terminator. And -getCString: does // 0-terminate the buffer if (![_string getCString:(char *)str maxLength:(toGo + 1) encoding:self->encoding]) { NSLog(@"ERROR(%s): failed to extract cString in defaultCStringEncoding(%i)" @" from NSString: '%@'\n", __PRETTY_FUNCTION__, self->encoding, _string); return NO; } // we need to update the *real* (not the max) length toGo = strlen((char *)str); #else if ((toGo = [_string cStringLength]) == 0) return YES; buf = str = calloc(toGo + 2, sizeof(unsigned char)); [_string getCString:(char *)str]; str[toGo] = '\0'; #endif NS_DURING { while (toGo > 0) { unsigned writeCount; writeCount = writeBytes ? writeBytes(source, @selector(writeBytes:count:), str, toGo) : [source writeBytes:str count:toGo]; if (writeCount == NGStreamError) [[self->source lastException] raise]; toGo -= writeCount; str += writeCount; } } NS_HANDLER { if (buf != NULL) { free(buf); buf = NULL; }; [localException raise]; } NS_ENDHANDLER; if (buf) { free(buf); buf = NULL; } return YES; } - (BOOL)flush { if (flushBuffer) return flushBuffer(self->source, @selector(flush)); else return [self->source flush]; } - (BOOL)writeNewline { if (![self writeString:NGNewLineString]) return NO; if (![self flush]) return NO; return YES; } - (void) setEncoding: (NSStringEncoding) theEncoding { self->encoding = theEncoding; } @end /* NGCTextStream */ @implementation _NGCTextStreamLineEnumerator - (id)initWithTextStream:(NGCTextStream *)_stream { self->stream = [_stream retain]; return self; } - (void)dealloc { [self->stream release]; [super dealloc]; } - (id)nextObject { id result; *(&result) = nil; NS_DURING { result = [self->stream readLineAsString]; } NS_HANDLER { if ([localException isKindOfClass:[NGEndOfStreamException class]]) result = nil; else [localException raise]; } NS_ENDHANDLER; return result; } @end /* _NGCTextStreamLineEnumerator */ SOPE/sope-core/NGStreams/config.sub0000755000000000000000000010344512242733417016060 0ustar rootroot#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 # Free Software Foundation, Inc. timestamp='2010-01-22' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file 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., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted GNU ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | ubicom32 \ | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | picochip) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile-* | tilegx-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze) basic_machine=microblaze-xilinx ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; # This must be matched before tile*. tilegx*) basic_machine=tilegx-unknown os=-linux-gnu ;; tile*) basic_machine=tile-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: SOPE/sope-core/NGStreams/configure0000755000000000000000000050444412242733417016010 0ustar rootroot#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.67. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 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 more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. 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 IFS=$as_save_IFS ;; 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 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; 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 if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # 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 as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_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 sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # 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'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= PACKAGE_URL= ac_unique_file="NGStream.m" ac_default_prefix=/usr/local # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_header_list= ac_subst_vars='LTLIBOBJS LIBOBJS EGREP GREP CPP OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS DLLTOOL AR RANLIB CC target_os target_vendor target_cpu target host_os host_vendor host_cpu host build_os build_vendor build_cpu build target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # 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. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= 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 case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -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) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$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 ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$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 ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) 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 ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$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_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=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 ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_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'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" 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 $as_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 ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # 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 the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | 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 test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # 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 this package 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 \`..'] 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] --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] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] --target=TARGET configure for building compilers for TARGET [HOST] _ACEOF fi if test -n "$ac_init_help"; then 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 LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) 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 the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested 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 else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.67 Copyright (C) 2010 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 fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval "test \"\${$3+set}\"" = set; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_header_mongrel # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_header_compile # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_func # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_type cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.67. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { 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` /usr/bin/hostinfo = `(/usr/bin/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=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&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_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=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append 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 as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset 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: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > 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 cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5 ; } 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. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi as_fn_append ac_header_list " stdlib.h" as_fn_append ac_header_list " unistd.h" as_fn_append ac_header_list " sys/param.h" # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; 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,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_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 # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_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. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## 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 # Determine the host, build, and target systems CC_TARGET=$target # use --target value for CC, not the canonical form ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if test "${ac_cv_build+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if test "${ac_cv_host+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 $as_echo_n "checking target system type... " >&6; } if test "${ac_cv_target+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "x$target_alias" = x; then ac_cv_target=$ac_cv_host else ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 $as_echo "$ac_cv_target" >&6; } case $ac_cv_target in *-*-*) ;; *) as_fn_error $? "invalid value of canonical target" "$LINENO" 5 ;; esac target=$ac_cv_target ac_save_IFS=$IFS; IFS='-' set x $ac_cv_target shift target_cpu=$1 target_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: target_os=$* IFS=$ac_save_IFS case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac # The aliases save the names the user supplied, while $host etc. # will get canonicalized. test -n "$target_alias" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && program_prefix=${target_alias}- ac_config_headers="$ac_config_headers config.h:config.h.in" # check for cross compilation if test "x$target" = "xNONE"; then set target $host fi if test "x$host" != "x$target"; then cross_defines="CROSS=-DCROSS_COMPILE" cross_compiling="yes" echo "cross compiling from $host to $target .." # Extract the first word of ""${CC_TARGET}-gcc"", so it can be a program name with args. set dummy "${CC_TARGET}-gcc"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC=""${CC_TARGET}-gcc"" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_CC" && ac_cv_prog_CC="gcc" fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of ""${CC_TARGET}-ranlib"", so it can be a program name with args. set dummy "${CC_TARGET}-ranlib"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB=""${CC_TARGET}-ranlib"" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB="ranlib" fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of ""${CC_TARGET}-ar"", so it can be a program name with args. set dummy "${CC_TARGET}-ar"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AR+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AR=""${CC_TARGET}-ar"" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar" fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of ""${CC_TARGET}-dlltool"", so it can be a program name with args. set dummy "${CC_TARGET}-dlltool"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_DLLTOOL+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DLLTOOL=""${CC_TARGET}-dlltool"" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_DLLTOOL" && ac_cv_prog_DLLTOOL="dlltool" fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi CC=${CC_TARGET}-gcc LD=${CC_TARGET}-ld AR=${CC_TARGET}-ar RANLIB=${CC_TARGET}-ranlib else # Extract the first word of ""gcc"", so it can be a program name with args. set dummy "gcc"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC=""gcc"" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_CC" && ac_cv_prog_CC="gcc" fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of ""ranlib"", so it can be a program name with args. set dummy "ranlib"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB=""ranlib"" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB="ranlib" fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of ""ar"", so it can be a program name with args. set dummy "ar"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AR+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AR=""ar"" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar" fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of ""dlltool"", so it can be a program name with args. set dummy "dlltool"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_DLLTOOL+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DLLTOOL=""dlltool"" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_DLLTOOL" && ac_cv_prog_DLLTOOL="dlltool" fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi case "${host_cpu}" in i[45]86*) host_cpu=i386;; hppa1.1) host_cpu=hppa;; esac if test "x$cross_compiling" = "xyes"; then case "${target_cpu}" in i[45]86*) target_cpu=i386;; hppa1.1) target_cpu=hppa;; esac else target_cpu=${host_cpu} target_os=${host_os} target_vendor=${host_vendor} fi case "x${target_os}" in xfreebsd*) target_os=freebsd;; esac # Assign the HOST variables for sharedlib.mak HOST=$host HOST_CPU=$host_cpu HOST_VENDOR=$host_vendor HOST_OS=$host_os TARGET=$target TARGET_CPU=$target_cpu TARGET_VENDOR=$target_vendor TARGET_OS=$target_os 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5 ; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM 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. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5 ; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; 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 | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5 ; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5 ; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if test "${ac_cv_objext+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5 ; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 -std 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 -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 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 for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for chown in -lnsl" >&5 $as_echo_n "checking for chown in -lnsl... " >&6; } if test "${ac_cv_lib_nsl_chown+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char chown (); int main () { return chown (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_nsl_chown=yes else ac_cv_lib_nsl_chown=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_chown" >&5 $as_echo "$ac_cv_lib_nsl_chown" >&6; } if test "x$ac_cv_lib_nsl_chown" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBNSL 1 _ACEOF LIBS="-lnsl $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for accept in -lsocket" >&5 $as_echo_n "checking for accept in -lsocket... " >&6; } if test "${ac_cv_lib_socket_accept+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char accept (); int main () { return accept (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_socket_accept=yes else ac_cv_lib_socket_accept=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_accept" >&5 $as_echo "$ac_cv_lib_socket_accept" >&6; } if test "x$ac_cv_lib_socket_accept" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBSOCKET 1 _ACEOF LIBS="-lsocket $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for in -lwsock32" >&5 $as_echo_n "checking for in -lwsock32... " >&6; } if test "${ac_cv_lib_wsock32_+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lwsock32 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char (); int main () { return (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_wsock32_=yes else ac_cv_lib_wsock32_=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_wsock32_" >&5 $as_echo "$ac_cv_lib_wsock32_" >&6; } if test "x$ac_cv_lib_wsock32_" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBWSOCK32 1 _ACEOF LIBS="-lwsock32 $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for in -ladvapi32" >&5 $as_echo_n "checking for in -ladvapi32... " >&6; } if test "${ac_cv_lib_advapi32_+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ladvapi32 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char (); int main () { return (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_advapi32_=yes else ac_cv_lib_advapi32_=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_advapi32_" >&5 $as_echo "$ac_cv_lib_advapi32_" >&6; } if test "x$ac_cv_lib_advapi32_" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBADVAPI32 1 _ACEOF LIBS="-ladvapi32 $LIBS" fi ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 $as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } if eval "test \"\${$as_ac_Header+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include <$ac_hdr> int main () { if ((DIR *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$as_ac_Header=yes" else eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$as_ac_Header { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 _ACEOF ac_header_dirent=$ac_hdr; break fi done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } if test "${ac_cv_search_opendir+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' dir; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_opendir=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if test "${ac_cv_search_opendir+set}" = set; then : break fi done if test "${ac_cv_search_opendir+set}" = set; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 $as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } if test "${ac_cv_search_opendir+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' x; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_opendir=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if test "${ac_cv_search_opendir+set}" = set; then : break fi done if test "${ac_cv_search_opendir+set}" = set; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 $as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&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 : $as_echo_n "(cached) " >&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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5 ; } 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if test "${ac_cv_path_GREP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if test "${ac_cv_path_EGREP+set}" = set; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if test "${ac_cv_header_stdc+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #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)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h 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=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dir.h libc.h time.h stdlib.h memory.h string.h strings.h sys/stat.h sys/fcntl.h fcntl.h sys/vfs.h sys/statfs.h sys/statvfs.h netinet/in.h windows.h winsock.h sys/socket.h Windows32/Sockets.h pwd.h process.h grp.h sys/param.h sys/file.h sys/errno.h sys/select.h sys/poll.h poll.h sys/time.h sys/types.h sys/ioctl.h sys/filio.h netdb.h unistd.h unistd.h limits.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5 $as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } if test "${ac_cv_header_sys_wait_h+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #ifndef WEXITSTATUS # define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8) #endif #ifndef WIFEXITED # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif int main () { int s; wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_sys_wait_h=yes else ac_cv_header_sys_wait_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_wait_h" >&5 $as_echo "$ac_cv_header_sys_wait_h" >&6; } if test $ac_cv_header_sys_wait_h = yes; then $as_echo "#define HAVE_SYS_WAIT_H 1" >>confdefs.h fi for ac_func in memcpy getcwd kill poll isatty ttyname ttyname_r gethostbyname_r gethostbyaddr_r gethostent_r do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in $ac_header_list do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in getpagesize do : ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize" if test "x$ac_cv_func_getpagesize" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GETPAGESIZE 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mmap" >&5 $as_echo_n "checking for working mmap... " >&6; } if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_mmap_fixed_mapped=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default /* malloc might have been renamed as rpl_malloc. */ #undef malloc /* Thanks to Mike Haertel and Jim Avera for this test. Here is a matrix of mmap possibilities: mmap private not fixed mmap private fixed at somewhere currently unmapped mmap private fixed at somewhere already mapped mmap shared not fixed mmap shared fixed at somewhere currently unmapped mmap shared fixed at somewhere already mapped For private mappings, we should verify that changes cannot be read() back from the file, nor mmap's back from the file at a different address. (There have been systems where private was not correctly implemented like the infamous i386 svr4.0, and systems where the VM page cache was not coherent with the file system buffer cache like early versions of FreeBSD and possibly contemporary NetBSD.) For shared mappings, we should conversely verify that changes get propagated back to all the places they're supposed to be. Grep wants private fixed already mapped. The main things grep needs to know about mmap are: * does it exist and is it safe to write into the mmap'd area * how to use it (BSD variants) */ #include #include #if !defined STDC_HEADERS && !defined HAVE_STDLIB_H char *malloc (); #endif /* This mess was copied from the GNU getpagesize.h. */ #ifndef HAVE_GETPAGESIZE # ifdef _SC_PAGESIZE # define getpagesize() sysconf(_SC_PAGESIZE) # else /* no _SC_PAGESIZE */ # ifdef HAVE_SYS_PARAM_H # include # ifdef EXEC_PAGESIZE # define getpagesize() EXEC_PAGESIZE # else /* no EXEC_PAGESIZE */ # ifdef NBPG # define getpagesize() NBPG * CLSIZE # ifndef CLSIZE # define CLSIZE 1 # endif /* no CLSIZE */ # else /* no NBPG */ # ifdef NBPC # define getpagesize() NBPC # else /* no NBPC */ # ifdef PAGESIZE # define getpagesize() PAGESIZE # endif /* PAGESIZE */ # endif /* no NBPC */ # endif /* no NBPG */ # endif /* no EXEC_PAGESIZE */ # else /* no HAVE_SYS_PARAM_H */ # define getpagesize() 8192 /* punt totally */ # endif /* no HAVE_SYS_PARAM_H */ # endif /* no _SC_PAGESIZE */ #endif /* no HAVE_GETPAGESIZE */ int main () { char *data, *data2, *data3; const char *cdata2; int i, pagesize; int fd, fd2; pagesize = getpagesize (); /* First, make a file with some known garbage in it. */ data = (char *) malloc (pagesize); if (!data) return 1; for (i = 0; i < pagesize; ++i) *(data + i) = rand (); umask (0); fd = creat ("conftest.mmap", 0600); if (fd < 0) return 2; if (write (fd, data, pagesize) != pagesize) return 3; close (fd); /* Next, check that the tail of a page is zero-filled. File must have non-zero length, otherwise we risk SIGBUS for entire page. */ fd2 = open ("conftest.txt", O_RDWR | O_CREAT | O_TRUNC, 0600); if (fd2 < 0) return 4; cdata2 = ""; if (write (fd2, cdata2, 1) != 1) return 5; data2 = (char *) mmap (0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2, 0L); if (data2 == MAP_FAILED) return 6; for (i = 0; i < pagesize; ++i) if (*(data2 + i)) return 7; close (fd2); if (munmap (data2, pagesize)) return 8; /* Next, try to mmap the file at a fixed address which already has something else allocated at it. If we can, also make sure that we see the same garbage. */ fd = open ("conftest.mmap", O_RDWR); if (fd < 0) return 9; if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED, fd, 0L)) return 10; for (i = 0; i < pagesize; ++i) if (*(data + i) != *(data2 + i)) return 11; /* Finally, make sure that changes to the mapped area do not percolate back to the file as seen by read(). (This is a bug on some variants of i386 svr4.0.) */ for (i = 0; i < pagesize; ++i) *(data2 + i) = *(data2 + i) + 1; data3 = (char *) malloc (pagesize); if (!data3) return 12; if (read (fd, data3, pagesize) != pagesize) return 13; for (i = 0; i < pagesize; ++i) if (*(data + i) != *(data3 + i)) return 14; close (fd); return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_mmap_fixed_mapped=yes else ac_cv_func_mmap_fixed_mapped=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_fixed_mapped" >&5 $as_echo "$ac_cv_func_mmap_fixed_mapped" >&6; } if test $ac_cv_func_mmap_fixed_mapped = yes; then $as_echo "#define HAVE_MMAP 1" >>confdefs.h fi rm -f conftest.mmap conftest.txt ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" if test "x$ac_cv_type_pid_t" = x""yes; then : else cat >>confdefs.h <<_ACEOF #define pid_t int _ACEOF fi for ac_header in vfork.h do : ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default" if test "x$ac_cv_header_vfork_h" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_VFORK_H 1 _ACEOF fi done for ac_func in fork vfork do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test "x$ac_cv_func_fork" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5 $as_echo_n "checking for working fork... " >&6; } if test "${ac_cv_func_fork_works+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_fork_works=cross else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* By Ruediger Kuhlmann. */ return fork () < 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_fork_works=yes else ac_cv_func_fork_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5 $as_echo "$ac_cv_func_fork_works" >&6; } else ac_cv_func_fork_works=$ac_cv_func_fork fi if test "x$ac_cv_func_fork_works" = xcross; then case $host in *-*-amigaos* | *-*-msdosdjgpp*) # Override, as these systems have only a dummy fork() stub ac_cv_func_fork_works=no ;; *) ac_cv_func_fork_works=yes ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 $as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;} fi ac_cv_func_vfork_works=$ac_cv_func_vfork if test "x$ac_cv_func_vfork" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5 $as_echo_n "checking for working vfork... " >&6; } if test "${ac_cv_func_vfork_works+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_vfork_works=cross else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Thanks to Paul Eggert for this test. */ $ac_includes_default #include #ifdef HAVE_VFORK_H # include #endif /* On some sparc systems, changes by the child to local and incoming argument registers are propagated back to the parent. The compiler is told about this with #include , but some compilers (e.g. gcc -O) don't grok . Test for this by using a static variable whose address is put into a register that is clobbered by the vfork. */ static void #ifdef __cplusplus sparc_address_test (int arg) # else sparc_address_test (arg) int arg; #endif { static pid_t child; if (!child) { child = vfork (); if (child < 0) { perror ("vfork"); _exit(2); } if (!child) { arg = getpid(); write(-1, "", 0); _exit (arg); } } } int main () { pid_t parent = getpid (); pid_t child; sparc_address_test (0); child = vfork (); if (child == 0) { /* Here is another test for sparc vfork register problems. This test uses lots of local variables, at least as many local variables as main has allocated so far including compiler temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should reuse the register of parent for one of the local variables, since it will think that parent can't possibly be used any more in this routine. Assigning to the local variable will thus munge parent in the parent process. */ pid_t p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); /* Convince the compiler that p..p7 are live; otherwise, it might use the same hardware register for all 8 local variables. */ if (p != p1 || p != p2 || p != p3 || p != p4 || p != p5 || p != p6 || p != p7) _exit(1); /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent from child file descriptors. If the child closes a descriptor before it execs or exits, this munges the parent's descriptor as well. Test for this by closing stdout in the child. */ _exit(close(fileno(stdout)) != 0); } else { int status; struct stat st; while (wait(&status) != child) ; return ( /* Was there some problem with vforking? */ child < 0 /* Did the child fail? (This shouldn't happen.) */ || status /* Did the vfork/compiler bug occur? */ || parent != getpid() /* Did the file descriptor bug occur? */ || fstat(fileno(stdout), &st) != 0 ); } } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_vfork_works=yes else ac_cv_func_vfork_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5 $as_echo "$ac_cv_func_vfork_works" >&6; } fi; if test "x$ac_cv_func_fork_works" = xcross; then ac_cv_func_vfork_works=$ac_cv_func_vfork { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 $as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;} fi if test "x$ac_cv_func_vfork_works" = xyes; then $as_echo "#define HAVE_WORKING_VFORK 1" >>confdefs.h else $as_echo "#define vfork fork" >>confdefs.h fi if test "x$ac_cv_func_fork_works" = xyes; then $as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h fi # uses AC_TRY_RUN if test "$cross_compiling" = yes; then echo "WARNING: cannot check for restartable system calls during cross compilation." else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for restartable system calls" >&5 $as_echo_n "checking for restartable system calls... " >&6; } if test "${ac_cv_sys_restartable_syscalls+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5 ; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Exit 0 (true) if wait returns something other than -1, i.e. the pid of the child, which means that wait was restarted after getting the signal. */ $ac_includes_default #include #ifdef HAVE_SYS_WAIT_H # include #endif /* Some platforms explicitly require an extern "C" signal handler when using C++. */ #ifdef __cplusplus extern "C" void ucatch (int dummy) { } #else void ucatch (dummy) int dummy; { } #endif int main () { int i = fork (), status; if (i == 0) { sleep (3); kill (getppid (), SIGINT); sleep (3); return 0; } signal (SIGINT, ucatch); status = wait (&i); if (status == -1) wait (&i); return status == -1; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_sys_restartable_syscalls=yes else ac_cv_sys_restartable_syscalls=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_restartable_syscalls" >&5 $as_echo "$ac_cv_sys_restartable_syscalls" >&6; } if test $ac_cv_sys_restartable_syscalls = yes; then $as_echo "#define HAVE_RESTARTABLE_SYSCALLS 1" >>confdefs.h fi fi 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, we kill variables containing newlines. # 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. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end 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" && { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} 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}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $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} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. 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 IFS=$as_save_IFS ;; 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 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; 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 if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # 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 ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # 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'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.67. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_headers="$ac_config_headers" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration headers: $config_headers Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.67, with options \\"\$ac_cs_config\\" Copyright (C) 2010 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. 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=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; 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 || ac_write_fail=1 if \$ac_cs_recheck; then set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.h.in" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;; 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_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 against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_t=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_t"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #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. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :H $CONFIG_HEADERS " shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # 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. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" } >"$tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # 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 || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi SOPE/sope-core/NGStreams/NGLocalSocketAddress.m0000644000000000000000000001363512242733417020212 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #if !defined(WIN32) || defined(__CYGWIN32__) #include "NGSocketExceptions.h" #include "NGLocalSocketAddress.h" #include "NGLocalSocketDomain.h" #import #include "config.h" #if defined(__APPLE__) || defined(__FreeBSD__) # include #else # include #endif #if defined(HAVE_UNISTD_H) || defined(__APPLE__) # include #endif #ifndef SUN_LEN #define SUN_LEN(su) \ (sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path)) #endif #include "common.h" #ifndef AF_LOCAL # define AF_LOCAL AF_UNIX #endif #if defined(__WIN32__) && !defined(__CYGWIN32__) static NSString *socketDirectoryPath = @"\\\\.\\pipe\\"; #else static NSString *socketDirectoryPath = @"/tmp"; #endif @implementation NGLocalSocketAddress + (id)addressWithPath:(NSString *)_p { return [[(NGLocalSocketAddress *)[self alloc] initWithPath:_p] autorelease]; } + (id)address { return [[[self alloc] init] autorelease]; } - (id)initWithPath:(NSString *)_path { if ((self = [super init])) { self->address = calloc(1, sizeof(struct sockaddr_un)); memset(self->address, 0, sizeof(struct sockaddr_un)); #if defined(__WIN32__) && !defined(__CYGWIN32__) self->path = [_path copyWithZone:[self zone]]; #else if ([_path cStringLength] >= sizeof(((struct sockaddr_un *)self->address)->sun_path)) { NSLog(@"LocalDomain name too long: maxlen=%i, len=%i, path=%@", sizeof(((struct sockaddr_un *)self->address)->sun_path), [_path cStringLength], _path); [NSException raise:NSInvalidArgumentException format:@"path to long as local domain socket address !"]; [self release]; return nil; } ((struct sockaddr_un *)self->address)->sun_family = [[self domain] socketDomain]; [_path getCString:((struct sockaddr_un *)self->address)->sun_path maxLength:sizeof(((struct sockaddr_un *)self->address)->sun_path)]; #endif } return self; } - (id)init { int addressCounter = 0; NSString *newPath; newPath = [NSString stringWithFormat:@"_ngsocket_%p_%p_%03d", getpid(), [NSThread currentThread], addressCounter]; newPath = [socketDirectoryPath stringByAppendingPathComponent:newPath]; return [self initWithPath:newPath]; } - (id)initWithDomain:(id)_domain internalRepresentation:(void *)_representation size:(int)_length { // this method is used by the address factory struct sockaddr_un *nun = _representation; NSString *path; path = (_length < 3) ? (id)@"" : [[NSString alloc] initWithCString:nun->sun_path]; self = [self initWithPath:path]; [path release]; path = nil; return self; } - (void)dealloc { if (self->address) free(self->address); [super dealloc]; } /* accessors */ - (NSString *)path { const char *sp; sp = ((struct sockaddr_un *)self->address)->sun_path; if (strlen(sp) == 0) return @""; return [NSString stringWithCString:sp]; } /* operations */ - (void)deletePath { const char *sp; sp = ((struct sockaddr_un *)self->address)->sun_path; if (strlen(sp) == 0) return; unlink(sp); } // NGSocketAddress protocol - (void *)internalAddressRepresentation { return self->address; } - (int)addressRepresentationSize { // varies in length return SUN_LEN(((struct sockaddr_un *)self->address)); } - (id)domain { return [NGLocalSocketDomain domain]; } /* test for accessibility */ - (BOOL)canSendOnAddress { return (access(((struct sockaddr_un *)self->address)->sun_path, W_OK) == 0) ? YES : NO; } - (BOOL)canReceiveOnAddress { return (access(((struct sockaddr_un *)self->address)->sun_path, R_OK) == 0) ? YES : NO; } /* testing for equality */ - (BOOL)isEqualToAddress:(NGLocalSocketAddress *)_addr { return [[_addr path] isEqualToString:[self path]]; } - (BOOL)isEqual:(id)_object { if (_object == self) return YES; if ([_object class] != [self class]) return NO; return [self isEqualToAddress:_object]; } /* NSCopying */ - (id)copyWithZone:(NSZone *)_zone { /* socket addresses are immutable, just retain on copy ... */ return [self retain]; } /* NSCoding */ - (void)encodeWithCoder:(NSCoder *)_encoder { [_encoder encodeObject:[[NSHost currentHost] name]]; [_encoder encodeObject:[self path]]; } - (id)initWithCoder:(NSCoder *)_decoder { NSString *hostName = [_decoder decodeObject]; NSString *path = [_decoder decodeObject]; NSAssert([path isKindOfClass:[NSString class]], @"path must be a string .."); if (![hostName isEqualToString:[[NSHost currentHost] name]]) { NSLog(@"unarchived local socket address on a different host, " @"encoded on %@, decoded on %@ (path=%@)", hostName, [[NSHost currentHost] name], path); } return [self initWithPath:path]; } /* description */ - (NSString *)stringValue { NSString *p = [self path]; return [p length] == 0 ? (NSString *)@"*" : p; } - (NSString *)description { NSString *p = [self path]; if ([p length] == 0) p = @"[no path]"; return [NSString stringWithFormat:@"<0x%p[%@]: %@>", self, NSStringFromClass([self class]), p]; } @end /* NGLocalSocketAddress */ #endif /* !WIN32 */ SOPE/sope-core/NGStreams/NGActiveSocket+serialization.m0000644000000000000000000000627012242733417021733 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NGActiveSocket+serialization.h" #include "common.h" @implementation NGActiveSocket(serialization) // serialization - (void)serializeChar:(char)_value { NGStreamSerializeObjC(self, &_value, @encode(char), nil); } - (void)serializeShort:(short)_value { NGStreamSerializeObjC(self, &_value, @encode(short), nil); } - (void)serializeInt:(int)_value { NGStreamSerializeObjC(self, &_value, @encode(int), nil); } - (void)serializeLong:(long)_value { NGStreamSerializeObjC(self, &_value, @encode(long), nil); } - (void)serializeFloat:(float)_value { NGStreamSerializeObjC(self, &_value, @encode(float), nil); } - (void)serializeDouble:(double)_value { NGStreamSerializeObjC(self, &_value, @encode(double), nil); } - (void)serializeLongLong:(long long)_value { NGStreamSerializeObjC(self, &_value, @encode(long long), nil); } - (void)serializeCString:(const char *)_value { NGStreamSerializeObjC(self, &_value, @encode(char *), nil); } #if USE_SERIALIZER - (void)serializeDataAt:(const void*)_value ofObjCType:(const char*)_type context:(id)_callback { NGStreamSerializeObjC(self, _value, _type, _callback); } #endif // deserialization - (char)deserializeChar { char c; NGStreamDeserializeObjC(self, &c, @encode(char), nil); return c; } - (short)deserializeShort { short s; NGStreamDeserializeObjC(self, &s, @encode(short), nil); return s; } - (int)deserializeInt { int i; NGStreamDeserializeObjC(self, &i, @encode(int), nil); return i; } - (long)deserializeLong { long l; NGStreamDeserializeObjC(self, &l, @encode(long), nil); return l; } - (float)deserializeFloat { float f; NGStreamDeserializeObjC(self, &f, @encode(float), nil); return f; } - (double)deserializeDouble { double d; NGStreamDeserializeObjC(self, &d, @encode(double), nil); return d; } - (long long)deserializeLongLong { long long l; NGStreamDeserializeObjC(self, &l, @encode(long long), nil); return l; } - (char *)deserializeCString { char *result = NULL; NGStreamDeserializeObjC(self, &result, @encode(char *), nil); return result; } #if USE_SERIALIZER - (void)deserializeDataAt:(void *)_value ofObjCType:(const char *)_type context:(id)_callback { NGStreamDeserializeObjC(self, _value, _type, _callback); } #endif @end /* NGActiveSocket(serialization) */ void __link_NGActiveSocket_serialization(void) { __link_NGActiveSocket_serialization(); } SOPE/sope-core/NGStreams/NGInternetSocketAddress.m0000644000000000000000000004315112242733417020744 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "common.h" #if HAVE_SYS_TYPES_H || defined(__APPLE__) # include #endif #if HAVE_NETINET_IN_H # include #endif #if HAVE_UNISTD_H || defined(__APPLE__) # include #endif #if defined(__APPLE__) # include #endif #if !defined(__CYGWIN32__) # if HAVE_WINDOWS_H # include # endif # if HAVE_WINSOCK_H # include # endif #endif #include "NGSocketExceptions.h" #include "NGInternetSocketAddress.h" #include "NGInternetSocketDomain.h" #include "common.h" #if defined(HAVE_GETHOSTBYNAME_R) && !defined(linux) && !defined(__FreeBSD__) && !defined(__GLIBC__) #define USE_GETHOSTBYNAME_R 1 #endif @implementation NGInternetSocketAddress #if LIB_FOUNDATION_LIBRARY extern NSRecursiveLock *libFoundationLock; #define systemLock libFoundationLock #else static NSRecursiveLock *systemLock = nil; #endif static NSMapTable *nameCache = NULL; + (void)initialize { [NGSocket initialize]; if (nameCache == NULL) { nameCache = NSCreateMapTable(NSIntMapKeyCallBacks, NSObjectMapValueCallBacks, 128); } #if !LIB_FOUNDATION_LIBRARY [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(taskNowMultiThreaded:) name:NSWillBecomeMultiThreadedNotification object:nil]; #endif } + (void)taskNowMultiThreaded:(NSNotification *)_notification { if (systemLock == nil) systemLock = [[NSRecursiveLock alloc] init]; } static inline NSString *_nameOfLocalhost(void) { #if 1 return [[NSHost currentHost] name]; #else NSString *hostName = nil; [systemLock lock]; { char buffer[1024]; gethostname(buffer, sizeof(buffer)); hostName = [[NSString alloc] initWithCString:buffer]; } [systemLock unlock]; return [hostName autorelease]; #endif } - (void)_fillHost { /* Fill up the host and port ivars based on the INET address. TODO: cache some information, takes quite some time (11% of execution time on MacOSX proftest) to get the hostname of an address. */ struct hostent *hostEntity = NULL; // only valid during lock NSString *newHost = nil; int errorCode = 0; struct sockaddr_in *sockAddr = self->address; if (self->isHostFilled) /* host is already filled .. */ return; #if DEBUG NSAssert(self->isAddressFilled, @"either host or address must be filled ..."); #endif if (sockAddr->sin_addr.s_addr != 0) { // not a wildcard address #if !defined(HAVE_GETHOSTBYADDR_R) [systemLock lock]; newHost = NSMapGet(nameCache, (void *)(unsigned long)sockAddr->sin_addr.s_addr); #else [systemLock lock]; newHost = NSMapGet(nameCache, (void *)(unsigned long)sockAddr->sin_addr.s_addr); [systemLock unlock]; #endif if (newHost == nil) { BOOL done = NO; while (!done) { #if USE_GETHOSTBYNAME_R struct hostent hostEntityBuffer; char buffer[8200]; hostEntity = gethostbyaddr_r((char *)&(sockAddr->sin_addr.s_addr), 4, [[self domain] socketDomain], &hostEntityBuffer, buffer, 8200, &errorCode); #else # ifdef __MINGW32__ # warning "doesn't resolve host name on mingw32 !" hostEntity = NULL; errorCode = -1; # else hostEntity = gethostbyaddr((char *)&(sockAddr->sin_addr.s_addr), 4, [[self domain] socketDomain]); # if defined(WIN32) && !defined(__CYGWIN32__) errorCode = WSAGetLastError(); # else errorCode = h_errno; # endif # endif #endif if (hostEntity == NULL) { done = YES; switch (errorCode) { #ifdef __MINGW32__ case -1: break; #endif case HOST_NOT_FOUND: NSLog(@"%s: host not found ..", __PRETTY_FUNCTION__); break; case TRY_AGAIN: #ifndef __linux NSLog(@"%s:\n couldn't lookup host, retry ..", __PRETTY_FUNCTION__); done = NO; #else NSLog(@"%s: couldn't lookup host ..", __PRETTY_FUNCTION__); #endif break; case NO_RECOVERY: NSLog(@"%s: no recovery", __PRETTY_FUNCTION__); break; case NO_DATA: NSLog(@"%s: no data", __PRETTY_FUNCTION__); break; default: NSLog(@"%s: unknown error: h_errno=%i errno=%s", __PRETTY_FUNCTION__, errorCode, strerror(errno)); break; } newHost = [NSString stringWithCString:inet_ntoa(sockAddr->sin_addr)]; } else { newHost = [NSString stringWithCString:hostEntity->h_name]; done = YES; } } if (hostEntity == NULL) { // throw could not get address .. NSLog(@"could not get DNS name of address %@ in domain %@: %i", newHost, [self domain], errorCode); } else if (newHost) { /* add to cache */ NSMapInsert(nameCache, (void *)(unsigned long)sockAddr->sin_addr.s_addr, newHost); } /* TODO: should also cache unknown IPs ! */ } //else printf("%s: CACHE HIT !\n", __PRETTY_FUNCTION__); #if !defined(HAVE_GETHOSTBYADDR_R) [systemLock unlock]; #endif } else { /* wildcard address */ newHost = nil; } ASSIGNCOPY(self->hostName, newHost); self->isHostFilled = YES; } - (NSException *)_fillAddress { /* Fill up the INET address based on the host and port ivars. */ // throws // NGCouldNotResolveHostNameException when a DNS lookup fails #if defined(WIN32) && !defined(__CYGWIN32__) u_long *ia = &(((struct sockaddr_in *)self->address)->sin_addr.s_addr); #else unsigned int *ia = &(((struct sockaddr_in *)self->address)->sin_addr.s_addr); #endif if (self->isAddressFilled) /* address is already filled .. */ return nil; #if DEBUG NSAssert(self->isHostFilled, @"either host or address must be filled ..."); #endif if (self->hostName == nil) { // if ([self isWildcardAddress]) *ia = htonl(INADDR_ANY); // wildcard (0) self->isAddressFilled = YES; } else { const unsigned char *chost; chost = (unsigned char *)[[self hostName] cString]; // try to interpret hostname as INET dotted address (eg 122.133.44.87) *ia = inet_addr((char *)chost); if ((int)*ia != -1) { // succeeded self->isAddressFilled = YES; } else { // failed, try to interpret hostname as DNS hostname BOOL didFail = NO; int errorCode = 0; int addrType = AF_INET; #if defined(USE_GETHOSTBYNAME_R) char buffer[4096]; struct hostent hostEntity; #else struct hostent *hostEntity; // only valid during lock #endif #if defined(USE_GETHOSTBYNAME_R) if (gethostbyname_r(chost, &hostEntity, buffer, sizeof(buffer), &errorCode) == NULL) { didFail = YES; } else { addrType = hostEntity.h_addrtype; if (addrType == AF_INET) *ia = ((struct in_addr *)(hostEntity.h_addr_list[0]))->s_addr; else didFail = YES; // invalid domain (eg AF_INET6) } #else [systemLock lock]; { if ((hostEntity = gethostbyname((char *)chost)) == NULL) { didFail = YES; #if defined(WIN32) && !defined(__CYGWIN32__) errorCode = WSAGetLastError(); #else errorCode = h_errno; #endif } else { addrType = hostEntity->h_addrtype; if (addrType == AF_INET) *ia = ((struct in_addr *)(hostEntity->h_addr_list[0]))->s_addr; else didFail = YES; // invalid domain (eg AF_INET6) } } [systemLock unlock]; #endif if (didFail) { // could not resolve hostname // did not find host NSString *reason = nil; if (addrType != AF_INET) { // invalid domain (eg AF_INET6) reason = @"resolved address is in invalid domain"; } else { switch (errorCode) { case HOST_NOT_FOUND: reason = @"host not found"; break; case TRY_AGAIN: reason = @"try again"; break; case NO_RECOVERY: reason = @"no recovery"; break; case NO_DATA: reason = @"no address available"; break; default: reason = [NSString stringWithFormat:@"error code %i", errorCode]; break; } } return [[[NGCouldNotResolveHostNameException alloc] initWithHostName:[self hostName] reason:reason] autorelease]; } self->isAddressFilled = YES; } } return nil; } /* constructors */ + (id)addressWithPort:(int)_port onHost:(id)_host { return [[[self alloc] initWithPort:_port onHost:_host] autorelease]; } + (id)addressWithPort:(int)_port { return [[[self alloc] initWithPort:_port] autorelease]; } + (id)addressWithService:(NSString *)_sname onHost:(id)_host protocol:(NSString *)_protocol { return [[[self alloc] initWithService:_sname onHost:_host protocol:_protocol] autorelease]; } + (id)addressWithService:(NSString *)_sname protocol:(NSString *)_protocol { return [[[self alloc] initWithService:_sname protocol:_protocol] autorelease]; } + (id)wildcardAddress { return [[[self alloc] initWithPort:0 onHost:@"*"] autorelease]; } + (id)wildcardAddressWithPort:(int)_port { return [[[self alloc] initWithPort:_port onHost:@"*"] autorelease]; } - (id)init { if ((self = [super init])) { self->address = malloc(sizeof(struct sockaddr_in)); } return self; } - (id)initWithPort:(int)_port onHost:(id)_host { /* designated initializer */ if ((self = [self init])) { self->isAddressFilled = NO; self->isHostFilled = YES; if (_host != nil) { if ([_host isKindOfClass:[NSHost class]]) _host = [(NSHost *)_host address]; if ([_host isEqualToString:@"*"]) { self->hostName = nil; /* wildcard host */ } else { self->hostName = [_host copy]; self->isWildcardHost = NO; } } else { /* wildcard host */ self->isWildcardHost = YES; } ((struct sockaddr_in *)self->address)->sin_family = [[self domain] socketDomain]; ((struct sockaddr_in *)self->address)->sin_port = htons((short)(_port & 0xffff)); } return self; } - (id)initWithService:(NSString *)_serviceName onHost:(id)_host protocol:(NSString *)_protocol { /* careful: the port in servent is in network byteorder! */ NSException *exc = nil; int port = -1; #if defined(HAVE_GETSERVBYNAME_R) char buffer[2048]; struct servent entry; #else struct servent *entry; #endif #if defined(HAVE_GETSERVBYNAME_R) if (getservbyname_r((char *)[_serviceName cString], [_protocol cString], &entry, buffer, sizeof(buffer)) == NULL) { exc = [[NGDidNotFindServiceException alloc] initWithServiceName:_serviceName]; } else port = entry.s_port; #else [systemLock lock]; { entry = getservbyname((char *)[_serviceName cString], [_protocol cString]); if (entry == NULL) { exc = [[NGDidNotFindServiceException alloc] initWithServiceName:_serviceName]; } else port = entry->s_port; } [systemLock unlock]; #endif if (exc != nil) { self = [self autorelease]; [exc raise]; return nil; } return [self initWithPort:ntohs(port) onHost:_host]; } - (id)initWithPort:(int)_port { return [self initWithPort:_port onHost:_nameOfLocalhost()]; } - (id)initWithService:(NSString *)_serviceName protocol:(NSString *)_protocol { return [self initWithService:_serviceName onHost:_nameOfLocalhost() protocol:_protocol]; } - (id)initWithDomain:(id)_domain internalRepresentation:(void *)_representation size:(int)_length { struct sockaddr_in *sockAddr = _representation; #if DEBUG NSAssert(_length == sizeof(struct sockaddr_in), @"invalid socket address length"); #else if (_length != sizeof(struct sockaddr_in)) { NSLog(@"%s: got invalid sockaddr_in size ...", __PRETTY_FUNCTION__); [self release]; return nil; } #endif if ((self = [self init]) == nil) return nil; self->isHostFilled = NO; /* need to lookup DNS */ /* fill address */ self->isAddressFilled = YES; memcpy(self->address, _representation, sizeof(struct sockaddr_in)); if (sockAddr->sin_addr.s_addr != 0) { /* not a wildcard address */ self->isWildcardHost = NO; } else { /* wildcard address */ self->hostName = nil; self->isWildcardHost = YES; self->isHostFilled = YES; /* wildcard host, no DNS lookup ... */ } return self; } - (void)dealloc { [self->hostName release]; if (self->address) free(self->address); [super dealloc]; } /* accessors */ - (NSString *)hostName { if (!self->isHostFilled) [self _fillHost]; return [[self->hostName copy] autorelease]; } - (NSString *)address { #if defined(WIN32) && !defined(__CYGWIN32__) u_long *ia; ia = (u_long *)&(((struct sockaddr_in *)self->address)->sin_addr.s_addr); #else unsigned long ia; ia = (unsigned long) &(((struct sockaddr_in *)self->address)->sin_addr.s_addr); #endif if (self->hostName == nil) /* wildcard */ return nil; if (!self->isAddressFilled) [[self _fillAddress] raise]; { char *ptr = NULL; NSString *str = nil; [systemLock lock]; { ptr = inet_ntoa(*((struct in_addr *)ia)); str = [NSString stringWithCString:ptr]; } [systemLock unlock]; return str; } } - (int)port { /* how to do ? */ if (!self->isAddressFilled) [[self _fillAddress] raise]; return ntohs(((struct sockaddr_in *)self->address)->sin_port); } - (BOOL)isWildcardAddress { if (self->isWildcardHost) return YES; return ([self hostName] == nil) || ([self port] == 0); } /* NGSocketAddress protocol */ - (void *)internalAddressRepresentation { // throws // NGCouldNotResolveHostNameException when a DNS lookup fails if (!self->isAddressFilled) [[self _fillAddress] raise]; return self->address; } - (int)addressRepresentationSize { return [[self domain] addressRepresentationSize]; } - (id)domain { static id domain = nil; if (domain == nil) domain = [[NGInternetSocketDomain domain] retain]; return domain; } /* comparing */ - (NSUInteger)hash { return [self port]; } - (BOOL)isEqualToAddress:(NGInternetSocketAddress *)_otherAddress { if (self == _otherAddress) return YES; if (![[_otherAddress hostName] isEqualToString:[self hostName]]) return NO; if ([_otherAddress port] != [self port]) return NO; return YES; } - (BOOL)isEqual:(id)_object { if (_object == self) return YES; if ([_object class] != [self class]) return NO; return [self isEqualToAddress:_object]; } /* NSCopying */ - (id)copyWithZone:(NSZone *)_zone { // socket addresses are immutable, therefore just retain self return [self retain]; } /* NSCoding */ - (void)encodeWithCoder:(NSCoder *)_encoder { int aPort = [self port]; [_encoder encodeValueOfObjCType:@encode(int) at:&aPort]; [_encoder encodeObject:[self hostName]]; } - (id)initWithCoder:(NSCoder *)_decoder { int aPort; id aHost; [_decoder decodeValueOfObjCType:@encode(int) at:&aPort]; aHost = [_decoder decodeObject]; return [self initWithPort:aPort onHost:aHost]; } /* description */ - (NSString *)stringValue { NSString *name; if ((name = [self hostName]) == nil) name = @"*"; return [NSString stringWithFormat:@"%@:%i", name, [self port]]; } - (NSString *)description { NSMutableString *ms; id tmp; ms = [NSMutableString stringWithCapacity:128]; [ms appendFormat:@"<0x%p[%@]:", self, NSStringFromClass([self class])]; if ((tmp = [self hostName]) != nil) [ms appendFormat:@" host=%@", tmp]; else [ms appendString:@" *host"]; if (!self->isAddressFilled) [ms appendString:@" not-filled"]; else [ms appendFormat:@" port=%d", [self port]]; [ms appendString:@">"]; return ms; } @end /* NGInternetSocketAddress */ @implementation NGActiveSocket(NGInternetActiveSocket) + (id)socketConnectedToPort:(int)_port onHost:(id)_host { // this method calls +socketConnectedToAddress: with an // NGInternetSocketAddress return [self socketConnectedToAddress: [NGInternetSocketAddress addressWithPort:_port onHost:_host]]; } - (BOOL)connectToPort:(int)_port onHost:(id)_host { // this method calls -connectToAddress: with an NGInternetSocketAddress return [self connectToAddress: [NGInternetSocketAddress addressWithPort:_port onHost:_host]]; } @end /* NGActiveSocket(NGInternetActiveSocket) */ SOPE/sope-core/NGStreams/NGNetUtilities.m0000644000000000000000000000523212242733417017115 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NGNetUtilities.h" #include "NGInternetSocketAddress.h" #include "NGLocalSocketAddress.h" #include "common.h" id NGSocketAddressFromString(NSString *_string) { const unsigned char *cstr = (unsigned char *)[_string cString]; if (cstr == NULL) return nil; if ([_string length] < 1) return nil; { const unsigned char *tmp = (unsigned char *)index((char *)cstr, ':'); if (tmp) { // INET socket NSString *hostName = nil; if (((tmp - cstr) == 1) && (*cstr == '*')) hostName = nil; // wildcard host else { hostName = [NSString stringWithCString:(char *)cstr length:(tmp - cstr)]; } // check what comes after colon if (isdigit(tmp[1])) { // a port int port = atoi((char *)tmp + 1); return [NGInternetSocketAddress addressWithPort:port onHost:hostName]; } else { // a service or 'auto' for auto-assigned ports const unsigned char *tmp2; NSString *protocol = @"tcp"; NSString *service; tmp2 = (unsigned char *)index((char *)(tmp + 1), '/'); tmp++; if (tmp2 == NULL) service = [NSString stringWithCString:(char *)tmp]; else { service = [NSString stringWithCString:(char *)tmp length:(tmp2 - tmp)]; protocol = [NSString stringWithCString:(char *)(tmp2 + 1)]; } if ([service isEqualToString:@"auto"]) return [NGInternetSocketAddress addressWithPort:0 onHost:hostName]; return [NGInternetSocketAddress addressWithService:service onHost:hostName protocol:protocol]; } } #if !defined(WIN32) if ([_string isAbsolutePath]) return [NGLocalSocketAddress addressWithPath:_string]; #endif } return nil; } SOPE/sope-core/NGStreams/NGStringTextStream.m0000644000000000000000000001003712242733417017761 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "common.h" #include "NGStringTextStream.h" #include "NGStreamExceptions.h" @implementation NGStringTextStream + (id)textStreamWithString:(NSString *)_string { return [[[self alloc] initWithString:_string] autorelease]; } - (id)initWithString:(NSString *)_string { if ((self = [super init])) { self->string = [_string retain]; self->index = 0; self->isMutable = [_string isKindOfClass:[NSMutableString class]]; } return self; } - (void)dealloc { [self->string release]; [super dealloc]; } /* accessors */ - (NSString *)string { return string; } /* operations */ - (BOOL)close { // releases string [self->string release]; self->string = nil; return YES; } // NGTextInputStream - (unichar)readCharacter { // throws // NGStreamNotOpenException when the stream is not open unsigned currentLength = [string length]; unichar result; if (string == nil) { [NGStreamNotOpenException raiseWithReason: @"tried to read from a string text stream which was closed"]; } if (currentLength == index) [[[NGEndOfStreamException alloc] init] raise]; result = [string characterAtIndex:index]; index++; return result; } // NGExtendedTextInputStream - (NSString *)readLineAsString { // throws // NGStreamNotOpenException when the stream is not open unsigned currentLength = [string length]; NSRange range; if (string == nil) { [NGStreamNotOpenException raiseWithReason: @"tried to read from a string text stream which was closed"]; } if (currentLength == index) //[[[NGEndOfStreamException alloc] init] raise] return nil; range.location = index; range.length = (currentLength - index); range = [string rangeOfString:@"\n" options:NSLiteralSearch range:range]; if (range.length == 0) { // did not found newline NSString *result = [string substringFromIndex:index]; index = currentLength; return result; } else { NSString *result = nil; range.length = (range.location - index); range.location = index; result = [string substringWithRange:range]; index += range.length + 1; return result; } } // NGTextOutputStream - (BOOL)writeCharacter:(unichar)_character { // throws // NGReadOnlyStreamException when the stream is not writeable // NGStreamNotOpenException when the stream is not open if (string == nil) { [NGStreamNotOpenException raiseWithReason: @"tried to write to a string text stream which was closed"]; return NO; } if (!isMutable) { [[[NGReadOnlyStreamException alloc] init] raise]; return NO; } [(NSMutableString *)string appendString: [NSString stringWithCharacters:&_character length:1]]; return YES; } - (BOOL)writeString:(NSString *)_string { // throws // NGReadOnlyStreamException when the stream is not writeable // NGStreamNotOpenException when the stream is not open if (string == nil) { [NGStreamNotOpenException raiseWithReason: @"tried to write to a string text stream which was closed"]; return NO; } if (!isMutable) { [[[NGReadOnlyStreamException alloc] init] raise]; return NO; } [(NSMutableString *)string appendString:_string]; return YES; } - (BOOL)flush { return YES; } @end /* NGStringTextStream */ SOPE/sope-core/NGStreams/libNGStreams.def0000644000000000000000000000375312242733417017110 0ustar rootrootEXPORTS NGPollDescriptor; NGGetDescriptorFlags; NGSetDescriptorFlags; NGAddDescriptorFlag; NGDescriptorSend; NGDescriptorRecv; NGDescriptorIsAtty; NGDescriptorGetTtyName; __objc_class_name_NGBase64Stream; __objc_class_name_NGBufferedStream; __objc_class_name_NGByteBuffer; __objc_class_name_NGByteCountStream; __objc_class_name_NGCTextStream; __objc_class_name_NGCharBuffer; __objc_class_name_NGConcreteStreamFileHandle; __objc_class_name_NGCouldNotCloseStreamException; __objc_class_name_NGCouldNotOpenStreamException; __objc_class_name_NGDataStream; __objc_class_name_NGEndOfStreamException; __objc_class_name_NGFileStream; __objc_class_name_NGFilterStream; __objc_class_name_NGFilterTextStream; __objc_class_name_NGIOAccessException; __objc_class_name_NGIOException; __objc_class_name_NGIOSearchAccessException; __objc_class_name_NGLockingStream; __objc_class_name_NGReadOnlyStreamException; __objc_class_name_NGStream; __objc_class_name_NGStreamCoder; __objc_class_name_NGStreamErrorException; __objc_class_name_NGStreamException; __objc_class_name_NGStreamModeException; __objc_class_name_NGStreamNotOpenException; __objc_class_name_NGStreamPipe; __objc_class_name_NGStreamPipe; __objc_class_name_NGStreamReadErrorException; __objc_class_name_NGStreamSeekErrorException; __objc_class_name_NGStreamWriteErrorException; __objc_class_name_NGStreams; __objc_class_name_NGStringTextStream; __objc_class_name_NGTextStream; __objc_class_name_NGUnknownStreamModeException; __objc_class_name_NGWriteOnlyStreamException; __objc_class_name__NGCTextStreamLineEnumerator; __objc_class_name__NGConcreteFileStreamFileHandle; NGStreamSerializeObjC NGStreamDeserializeObjC NGReadByteFromStream NGSafeReadBytesFromStream NGSafeWriteBytesToStream NGFileReadOnly NGFileWriteOnly NGFileReadWrite NGFileAppend NGFileReadAppend NGIn NGOut NGErr NGTextIn NGTextOut NGTextErr NGInitStdio NGInitTextStdio ;__objc_class_name__NGConcretePipeFileHandle; ;__objc_class_name_NGTaskStream; SOPE/sope-core/NGExtensions/0000755000000000000000000000000012242733417014607 5ustar rootrootSOPE/sope-core/NGExtensions/fhs.make0000644000000000000000000000175512242733417016236 0ustar rootroot# postprocessing # FHS support (this is a hack and is going to be done by gstep-make!) ifneq ($(FHS_INSTALL_ROOT),) FHS_INCLUDE_DIR=$(FHS_INSTALL_ROOT)/include/ FHS_BIN_DIR=$(FHS_INSTALL_ROOT)/bin/ ifeq ($(findstring _64, $(GNUSTEP_TARGET_CPU)), _64) FHS_LIB_DIR=$(FHS_INSTALL_ROOT)/lib64/ else FHS_LIB_DIR=$(FHS_INSTALL_ROOT)/lib/ endif fhs-header-dirs :: $(MKDIRS) $(FHS_INCLUDE_DIR)$(libNGExtensions_HEADER_FILES_INSTALL_DIR) move-headers-to-fhs :: fhs-header-dirs @echo "moving headers to $(FHS_INCLUDE_DIR) .." mv $(GNUSTEP_HEADERS)$(libNGExtensions_HEADER_FILES_INSTALL_DIR)/*.h \ $(FHS_INCLUDE_DIR)$(libNGExtensions_HEADER_FILES_INSTALL_DIR)/ NONFHS_LIBDIR="$(GNUSTEP_LIBRARIES)/$(GNUSTEP_TARGET_LDIR)/" NONFHS_LIBNAME="$(LIBRARY_NAME)$(LIBRARY_NAME_SUFFIX)$(SHARED_LIBEXT)" move-libs-to-fhs :: @echo "moving libs to $(FHS_LIB_DIR) .." mv $(NONFHS_LIBDIR)/$(NONFHS_LIBNAME)* $(FHS_LIB_DIR)/ move-to-fhs :: move-headers-to-fhs move-libs-to-fhs after-install :: move-to-fhs endif SOPE/sope-core/NGExtensions/NGExtensions.m0000644000000000000000000000360012242733417017350 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NGExtensions.h" #include "NGBase64Coding.h" #include "NGBaseTypes.h" #include "NGBitSet.h" #include "NGHashMap.h" #include "NGMemoryAllocation.h" #include "NGStack.h" #include "NGBundleManager.h" #include "NGQuotedPrintableCoding.h" #include "NSArray+enumerator.h" #include "NSData+misc.h" #include "NSException+misc.h" #include "NSObject+Values.h" #include "NSSet+enumerator.h" #include "NSString+Formatting.h" #include "NSString+misc.h" #include "NSDictionary+misc.h" #include "NSCalendarDate+misc.h" @implementation NGExtensions /* statically link Objective-C categories */ extern void __link_NSProcessInfo_misc(void); extern void __link_NSCalendarDate_misc(void); extern void __link_EODataSource_NGExtensions(void); extern void __link_NSString_Formatting(void); extern void __link_NGBase64Coding(void); extern void __link_NGExtensions_NSObjectValues(void); - (void)_staticLinkClasses { __link_NSProcessInfo_misc(); __link_NSCalendarDate_misc(); __link_EODataSource_NGExtensions(); __link_NSString_Formatting(); __link_NGBase64Coding(); __link_NGExtensions_NSObjectValues(); } @end /* NGExtensions */ SOPE/sope-core/NGExtensions/NGRuleEngine.subproj/0000755000000000000000000000000012242733417020554 5ustar rootrootSOPE/sope-core/NGExtensions/NGRuleEngine.subproj/README0000644000000000000000000001605312242733417021441 0ustar rootrootNGRuleEngine ============ This is a rule engine inspired by the "BDRuleEngine" available from bDistributed.com (www.bdistributed.com) which in turn is inspired by the direct to web framework which is part of WebObjects. We have choosen different class names, so that NGExtensions can be used together with the BDRuleEngine framework. It's a nice application of EOControl qualifiers and key-value coding to implement a simple rule evaluation system. It consists of just five small classes: NGRuleAssignment NGRuleKeyAssignment NGRule NGRuleContext NSRuleModel How does it work? ================= The rule engine is an evaluator for a set of rules which map to values. It can be used to make all kinds of actions configurable without being required to write code. Example Ruleset: ( "context.soRequestType='WebDAV' => renderer = 'SoWebDAVRenderer' ; high", "context.soRequestType='XML-RPC' => renderer = 'SoXmlRpcRenderer' ; high", "context.soRequestType='SOAP' => renderer = 'SoSOAPRenderer' ; high", "context.soRequestType='WCAP' => renderer = 'SoWCAPRenderer' ; high", "*true* => renderer = 'SoDefaultRenderer' ; fallback", ) This is a rule from SOPE which selects the render class for SoObjects. As you can see a rule has a left hand side, eg: context.soRequestType='WebDAV' and a right hand side, eg: renderer = 'SoWebDAVRenderer' further control specifiers like the priority of the rule in the set (high) can be attached. The left hand side is just a regular EOQualifier which is evaluated against a rule context (an object of the NGRuleContext class). A rule context is the entry object for all rule processing. To configure rule evaluation, you need to set some variables in the context, those variables are basically the "parameters" of the rule. Eg in the above case we use: [self->dispatcherRules reset]; [self->dispatcherRules takeValue:_rq forKey:@"request"]; [self->dispatcherRules takeValue:[_rq headers] forKey:@"headers"]; [self->dispatcherRules takeValue:[_rq method] forKey:@"method"]; [self->dispatcherRules takeValue:_ctx forKey:@"context"]; 'dispatcherRules' is the NGRuleContext object. Because we reuse the same context for each WORequest, we need to 'reset' the context to remove all old information. As you can see the rule context gets set the 'context' variable which is used in the qualifier - "context.soRequestType='WebDAV'". If this left hand side (LHS) qualifier evaluates to true, the RHS will be run. So lets get to the right hand side. It is the so called "Assignment" and is actually someone similiar to a WOAssociation. The actual operation is triggered by some subclass of NGRuleAssignment in the -fireInContext: method. In the above example the RHS is renderer = 'SoWebDAVRenderer' this says that if the rule context is asked for a value of 'renderer', the assignment will return the 'SoWebDAVRenderer' string constant. Note: the assignment does _not_ set the value in the rule context. TODO: should it set the value in the context? ;-) You can have as many assignment as you like. Assignments are only run if the user asks for a key which is set by the assignment! Now that we have the basics, how do we use the rule context? Here is a small example: NGRuleModel *model; NGRuleContext *context; /* setup */ model = [[NGRuleModel alloc] initWithContentsOfFile:@"myrules.plist"]; context = [NGRuleContext ruleContextWithModel:model]; /* fill in parameters */ [context takeValue:@"10" forKey:@"age"]; /* query values that depend on the parameter */ [context valueForKey:@"color"]; A sample myrules.plist: ( "age < 5 => color = 'white'", "age > 4 => color = 'green'" ) This would return 'green' in the above example (because age = 10 is >4). Note that the cool aspect of the rule context is that the rule evaluation is queried using regular key/value coding methods! This way you can easily bind values to SOPE templates, eg: TableCell: WOGenericContainer { elementName = "td"; bgcolor = rules.color; } This assumes that the component returns a rule context in the 'rules' method. A component setup like this can be easily customized just by changing the rules avoiding the requirement to hack code. Another neat application for rules is the selection of the "next page", that is, to control the flow of a web application. Consider a ruleset like this: ( "document.status = 'saved' => pageName = 'MyReviewPage'", "document.status = 'created' => pageName = 'MyReviewPage'", "document.status = 'reviewed' => pageName = 'MyPublishPage'" ) and code like this: - (id)showNextPage { return [self pageWithName:[rules valueForKey:@"pageName"]]; } This code will automatically determine the correct page to be shown depending on the rules and the state of an object. Eg if you later decide that the publish page should also been selected for saved docuents which are green, just enhance the rule to: ( "document.status = 'saved' => pageName = 'MyReviewPage'", "document.status = 'created' => pageName = 'MyReviewPage'", "document.status = 'reviewed' => pageName = 'MyPublishPage'", "document.status = 'saved' AND document.color = 'green' => pageName = 'MyPublishPage'; priority = high", ) The rule context has a neat shortcut method in case you want to store rules in the defaults system: context = [NGRuleContext ruleContextWithModelInUserDefault:@"MyRules"]; Since rules are often used to customize the behaviour of an application, this is quite useful. Another shortcut method you can use is the evaluation of a ruleset for a set of objects. Eg if you want to get the color of a set of objects with the 'age' property, you can run: colors = [rules valuesForKeyPath:@"color" takingSuccessiveValues:ageObjects forKey:@"document"]; This will walk over the 'ageObjects' array and perform a [rules takeValue:ageObject forKey:@"document"] for each object and add the result of [rules valueForKeyPath:@"color"] to the result array. Finally remember that assignment results do not need to be base values, they can also be complex objects, eg: [rules takeValue:bossObject forKey:@"boss"]; [rules takeValue:secretary forKey:@"secretary"]; contactEMail = [rules valuesForKeyPath:@"contact.email" takingSuccessiveValues:mailObjects forKey:@"mail"]; with the ruleset: ( "mail.priority = 'high' => contact = boss", "mail.priority = 'normal' => contact = secretary", "mail.priority = 'low' => contact = secretary" ) Note that another speciality with the above ruleset is that it uses NGRuleKeyAssignment assignments, that is, it retrieves the value of the assignment from the rule context (the boss or secretary objects previously set as parameters). Priorities ========== You should normally use one of the predefined priorities: - important (override) - very high - high - normal/default - low - very low - fallback If you need fine-grained control, you can use priority numbers which should be between 50 (low) and 150 (high). SOPE/sope-core/NGExtensions/NGRuleEngine.subproj/GNUmakefile0000644000000000000000000000066112242733417022631 0ustar rootroot# GNUstep makefile include ../../../config.make include ../../common.make SUBPROJECT_NAME = NGRuleEngine NGRuleEngine_PCH_FILE = common.h NGRuleEngine_OBJC_FILES = \ NGRule.m \ NGRuleAssignment.m \ NGRuleContext.m \ NGRuleModel.m \ NGRuleParser.m \ ADDITIONAL_INCLUDE_DIRS += -I. -I.. -I../NGExtensions/ -I../.. -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/subproject.make -include GNUmakefile.postamble SOPE/sope-core/NGExtensions/NGRuleEngine.subproj/NGRuleAssignment.m0000644000000000000000000000632112242733417024121 0ustar rootroot/* Copyright (C) 2003-2004 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NGRuleAssignment.h" #include "common.h" @implementation NGRuleAssignment + (id)assignmentWithKeyPath:(NSString *)_kp value:(id)_value { return [[[self alloc] initWithKeyPath:_kp value:_value] autorelease]; } - (id)initWithKeyPath:(NSString *)_kp value:(id)_value { if ((self = [super init])) { self->keyPath = [_kp copy]; self->value = [_value retain]; } return self; } - (id)init { return [self initWithKeyPath:nil value:nil]; } - (void)dealloc { [self->keyPath release]; [self->value release]; [super dealloc]; } /* accessors */ - (void)setKeyPath:(NSString *)_kp { ASSIGNCOPY(self->keyPath, _kp); } - (NSString *)keyPath { return self->keyPath; } - (void)setValue:(id)_value { ASSIGN(self->value, _value); } - (id)value { return self->value; } /* operations */ - (BOOL)isCandidateForKey:(NSString *)_key { if (_key == nil) return YES; // TODO: perform a real keypath check return [self->keyPath isEqualToString:_key]; } - (id)fireInContext:(id)_ctx { // TODO: shouldn't we apply the value on ctx ? return self->value; } /* key/value archiving */ - (id)initWithKeyValueUnarchiver:(EOKeyValueUnarchiver *)_unarchiver { return [self initWithKeyPath:[_unarchiver decodeObjectForKey:@"keyPath"] value:[_unarchiver decodeObjectForKey:@"value"]]; } - (void)encodeWithKeyValueArchiver:(EOKeyValueArchiver *)_archiver { [_archiver encodeObject:[self keyPath] forKey:@"keyPath"]; [_archiver encodeObject:[self value] forKey:@"value"]; } /* description */ - (NSString *)valueStringValue { NSMutableString *ms; if ([self->value isKindOfClass:[NSNumber class]]) return [self->value stringValue]; ms = [NSMutableString stringWithCapacity:64]; [ms appendString:@"\""]; [ms appendString:[self->value stringValue]]; [ms appendString:@"\""]; return ms; } - (NSString *)stringValue { NSMutableString *ms; ms = [NSMutableString stringWithCapacity:64]; [ms appendString:[[self keyPath] description]]; [ms appendString:@" = "]; [ms appendString:[self valueStringValue]]; return ms; } - (NSString *)description { return [self stringValue]; } @end /* NGRuleAssignment */ @implementation NGRuleKeyAssignment /* operations */ - (id)fireInContext:(id)_ctx { // TODO: shouldn't we apply the value on ctx ? return [_ctx valueForKeyPath:[[self value] stringValue]]; } /* description */ - (NSString *)valueStringValue { return [self->value stringValue]; } @end /* NGRuleKeyAssignment */ SOPE/sope-core/NGExtensions/NGRuleEngine.subproj/NGRule.m0000644000000000000000000000677212242733417022102 0ustar rootroot/* Copyright (C) 2003-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NGRule.h" #include "NGRuleAssignment.h" #include "NGRuleParser.h" #include "common.h" #import @implementation NGRule + (id)ruleWithQualifier:(EOQualifier *)_q action:(id)_action priority:(int)_p { return [[[self alloc] initWithQualifier:_q action:_action priority:_p] autorelease]; } + (id)ruleWithQualifier:(EOQualifier *)_q action:(id)_action { return [self ruleWithQualifier:_q action:_action priority:0]; } - (id)initWithString:(NSString *)_s { [self release]; return [[[NGRuleParser sharedRuleParser] parseRuleFromString:_s] retain]; } - (id)initWithPropertyList:(id)_plist { [self release]; return [[[NGRuleParser sharedRuleParser] parseRuleFromPropertyList:_plist] retain]; } - (id)initWithQualifier:(EOQualifier *)_q action:(id)_action priority:(int)_p { if ((self = [super init])) { self->qualifier = [_q retain]; self->action = [_action retain]; self->priority = _p; } return self; } - (id)init { return [self initWithQualifier:nil action:nil priority:0]; } - (void)dealloc { [self->qualifier release]; [self->action release]; [super dealloc]; } /* accessors */ - (void)setQualifier:(EOQualifier *)_q { ASSIGN(self->qualifier, _q); } - (EOQualifier *)qualifier { return self->qualifier; } - (void)setAction:(id)_action { ASSIGN(self->action, _action); } - (id)action { return self->action; } - (void)setPriority:(int)_pri { self->priority = _pri; } - (int)priority { return self->priority; } /* operations */ - (BOOL)isCandidateForKey:(NSString *)_key { id o; if (_key == nil) return YES; o = [self action]; if ([o respondsToSelector:@selector(isCandidateForKey:)]) return [o isCandidateForKey:_key]; return NO; /* action is not an assignment ! */ } - (id)fireInContext:(id)_ctx { return [self->action fireInContext:_ctx]; } /* key/value archiving */ - (id)initWithKeyValueUnarchiver:(EOKeyValueUnarchiver *)_unarchiver { return [self initWithQualifier:[_unarchiver decodeObjectForKey:@"lhs"] action:[_unarchiver decodeObjectForKey:@"rhs"] priority:[_unarchiver decodeIntForKey:@"author"]]; } - (void)encodeWithKeyValueArchiver:(EOKeyValueArchiver *)_archiver { [_archiver encodeInt:[self priority] forKey:@"author"]; [_archiver encodeObject:[self qualifier] forKey:@"lhs"]; [_archiver encodeObject:[self action] forKey:@"rhs"]; } /* representations */ - (NSString *)stringValue { NSString *sq, *sa; sq = [[self qualifier] description]; sa = [[self action] description]; return [NSString stringWithFormat:@"%@ => %@ ; %i", sq, sa, [self priority]]; } - (NSString *)description { return [self stringValue]; } @end /* NGRule(Parsing) */ SOPE/sope-core/NGExtensions/NGRuleEngine.subproj/NGRuleContext.m0000644000000000000000000001213112242733417023431 0ustar rootroot/* Copyright (C) 2003-2006 SKYRIX Software AG Copyright (C) 2006 Helge Hess This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NGRuleContext.h" #include "NGRule.h" #include "NGRuleModel.h" #include "NSObject+Logs.h" #include "common.h" #import @implementation NGRuleContext + (id)ruleContextWithModelInUserDefault:(NSString *)_defName { NGRuleModel *mod; if ((mod = [NGRuleModel ruleModelWithContentsOfUserDefault:_defName]) == nil) return nil; return [self ruleContextWithModel:mod]; } + (id)ruleContextWithModel:(NGRuleModel *)_model { return [[[self alloc] initWithModel:_model] autorelease]; } - (id)initWithModel:(NGRuleModel *)_model { if ((self = [super init])) { [self setModel:_model]; } return self; } - (id)init { return [self initWithModel:nil]; } - (void)dealloc { [self->model release]; [self->storedValues release]; [super dealloc]; } /* accessors */ - (void)setModel:(NGRuleModel *)_model { ASSIGN(self->model, _model); } - (NGRuleModel *)model { return self->model; } /* values */ - (void)takeStoredValue:(id)_value forKey:(NSString *)_key { if (_value) { if (self->storedValues == nil) self->storedValues = [[NSMutableDictionary alloc] initWithCapacity:32]; [self->storedValues setObject:_value forKey:_key]; } else [self->storedValues removeObjectForKey:_key]; } - (id)storedValueForKey:(NSString *)_key { return [self->storedValues objectForKey:_key]; } - (void)takeValue:(id)_value forKey:(NSString *)_key { [self takeStoredValue:_value forKey:_key]; } - (void)reset { [self->storedValues removeAllObjects]; } /* processing */ - (id)inferredValueForKey:(NSString *)_key { NSArray *rules; unsigned i, count; if (self->debugOn) [self debugWithFormat:@"calculate value for key: '%@'", _key]; /* select candidates */ rules = [[self model] candidateRulesForKey:_key]; if (self->debugOn) [self debugWithFormat:@" candidate rules: %@", rules]; /* check qualifiers */ for (i = 0, count = [rules count]; i < count; i++) { NGRule *rule; rule = [rules objectAtIndex:i]; if ([(id)[rule qualifier] evaluateWithObject:self]){ if (self->debugOn) [self debugWithFormat:@" rule %i matches: %@", i, rule]; return [[rule action] fireInContext:self]; } } if (self->debugOn) [self debugWithFormat:@" no rule matched !"]; return nil; } - (NSArray *)allPossibleValuesForKey:(NSString *)_key { NSMutableArray *values; NSArray *rules; unsigned i, count; if (self->debugOn) [self debugWithFormat:@"calculate all values for key: '%@'", _key]; /* select candidates */ rules = [[self model] candidateRulesForKey:_key]; if (self->debugOn) [self debugWithFormat:@" candidate rules: %@", rules]; values = [NSMutableArray arrayWithCapacity:16]; /* check qualifiers */ for (i = 0, count = [rules count]; i < count; i++) { NGRule *rule; rule = [rules objectAtIndex:i]; if ([(id)[rule qualifier] evaluateWithObject:self]){ id v; if (self->debugOn) [self debugWithFormat:@" rule %i matches: %@", i, rule]; v = [[rule action] fireInContext:self]; [values addObject:(v != nil ? v : (id)[NSNull null])]; } } if (self->debugOn) [self debugWithFormat:@" %d rules matched.", [values count]]; return values; } - (id)valueForKey:(NSString *)_key { id v; // TODO: add rule cache? /* look for constants */ if ((v = [self->storedValues objectForKey:_key]) != nil) return v; /* look into rule system */ if ((v = [self inferredValueForKey:_key]) != nil) return v; return nil; } - (NSArray *)valuesForKeyPath:(NSString *)_kp takingSuccessiveValues:(NSArray *)_values forKeyPath:(NSString *)_valkp { NSMutableArray *results; unsigned i, count; count = [_values count]; results = [NSMutableArray arrayWithCapacity:count]; for (i = 0; i < count; i++) { id ruleValue; /* take the value */ [self takeValue:[_values objectAtIndex:i] forKeyPath:_valkp]; /* calculate the rule value */ ruleValue = [self valueForKeyPath:_kp]; [results addObject:(ruleValue != nil ? ruleValue : (id)[NSNull null])]; } return results; } /* debugging */ - (BOOL)isDebuggingEnabled { return self->debugOn; } - (void)setDebugEnabled:(BOOL)_flag { self->debugOn = _flag; } @end /* NGRuleContext */ SOPE/sope-core/NGExtensions/NGRuleEngine.subproj/NGRuleModel.m0000644000000000000000000001225412242733417023053 0ustar rootroot/* Copyright (C) 2003-2004 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NGRuleModel.h" #include "NGRule.h" #include "NGRuleParser.h" #include "EOTrueQualifier.h" #include #import #include "common.h" // TODO: add a candidate cache @implementation NGRuleModel + (id)ruleModelWithPropertyList:(id)_plist { static NGRuleParser *ruleParser = nil; // THREAD if (ruleParser == nil) ruleParser = [[NGRuleParser sharedRuleParser] retain]; return [ruleParser parseRuleModelFromPropertyList:_plist]; } + (id)ruleModelWithContentsOfUserDefault:(NSString *)_defName { id plist; plist = [[NSUserDefaults standardUserDefaults] objectForKey:_defName]; if (plist == nil) return nil; return [self ruleModelWithPropertyList:plist]; } - (id)init { if ((self = [super init])) { self->rules = [[NSMutableArray alloc] initWithCapacity:16]; } return self; } - (id)initWithRules:(NSArray *)_rules { if ((self = [self init])) { [self->rules addObjectsFromArray:_rules]; } return self; } - (id)initWithPropertyList:(id)_plist { [self autorelease]; return [[[self class] ruleModelWithPropertyList:_plist] retain]; } - (id)initWithContentsOfFile:(NSString *)_path { NSString *s; id plist; if ((s = [[NSString alloc] initWithContentsOfFile:_path])) { [self release]; return nil; } plist = [s propertyList]; [s release]; return [self initWithPropertyList:plist]; } - (id)initWithContentsOfUserDefault:(NSString *)_defName { [self autorelease]; return [[[self class] ruleModelWithContentsOfUserDefault:_defName] retain]; } - (id)initWithKeyValueArchiveAtURL:(NSURL *)_url { EOKeyValueUnarchiver *unarchiver; NSDictionary *plist; if ((plist = [NSDictionary dictionaryWithContentsOfURL:_url]) == nil) { [self errorWithFormat:@"Could not read plist at URL: %@", _url]; [self release]; return nil; } unarchiver = [[EOKeyValueUnarchiver alloc] initWithDictionary:plist]; self = [self initWithKeyValueUnarchiver:unarchiver]; [unarchiver release]; unarchiver = nil; return self; } - (void)dealloc { [self->rules release]; [super dealloc]; } /* accessors */ - (void)setRules:(NSArray *)_rules { [self->rules removeAllObjects]; if (_rules != nil) [self->rules addObjectsFromArray:_rules]; } - (NSArray *)rules { return [[self->rules shallowCopy] autorelease]; } - (void)addRule:(NGRule *)_rule { if (_rule == nil) return; [self->rules addObject:_rule]; } - (void)removeRule:(NGRule *)_rule { if (_rule == nil) return; [self->rules removeObject:_rule]; } - (void)addRules:(NSArray *)_rules { if (_rules != nil) [self->rules addObjectsFromArray:_rules]; } /* operations */ static int candidateSort(NGRule *rule1, NGRule *rule2, NGRuleModel *model) { static Class TrueQualClass = Nil; EOQualifier *q1, *q2; register int pri1, pri2; pri1 = [rule1 priority]; pri2 = [rule2 priority]; if (pri1 != pri2) return pri1 > pri2 ? NSOrderedAscending : NSOrderedDescending; /* check number of qualifiers (order on how specific the qualifier is) */ if (TrueQualClass == Nil) TrueQualClass = [EOTrueQualifier class]; q1 = [rule1 qualifier]; q2 = [rule2 qualifier]; pri1 = [q1 isKindOfClass:TrueQualClass] ? - 1 : ([q1 respondsToSelector:@selector(count)] ? [q1 count] : 0); pri2 = [q2 isKindOfClass:TrueQualClass] ? -1 : ([q2 respondsToSelector:@selector(count)] ? [q2 count] : 0); if (pri1 != pri2) return pri1 > pri2 ? NSOrderedAscending : NSOrderedDescending; return NSOrderedSame; } - (NSArray *)candidateRulesForKey:(NSString *)_key { NSMutableArray *candidates; unsigned i, cnt; /* first, find all candidates */ candidates = nil; cnt = [self->rules count]; for (i = 0; i < cnt; i++) { NGRule *rule; rule = [self->rules objectAtIndex:i]; if ([rule isCandidateForKey:_key]) { if (candidates == nil) candidates = [[NSMutableArray alloc] initWithCapacity:cnt]; [candidates addObject:rule]; } } /* sort candidates */ [candidates sortUsingFunction:(void *)candidateSort context:self]; [candidates autorelease]; return candidates; } /* representations */ /* key/value archiving */ - (id)initWithKeyValueUnarchiver:(EOKeyValueUnarchiver *)_unarchiver { return [self initWithRules:[_unarchiver decodeObjectForKey:@"rules"]]; } - (void)encodeWithKeyValueArchiver:(EOKeyValueArchiver *)_archiver { [_archiver encodeObject:[self rules] forKey:@"rules"]; } @end /* NGRuleModel */ SOPE/sope-core/NGExtensions/NGRuleEngine.subproj/NGRuleParser.m0000644000000000000000000002472012242733417023250 0ustar rootroot/* Copyright (C) 2003-2004 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NGRuleParser.h" #include "NGRule.h" #include "NGRuleModel.h" #include "NGRuleAssignment.h" #include "NSObject+Logs.h" #include "NSString+misc.h" #include "NSString+Ext.h" #include "EOTrueQualifier.h" #import #include "common.h" // TODO: proper reports errors in last-exception ! // TODO: improve performance // TODO: parse assignment class? (eg "a = b; (BoolAssignment)") #define RULE_PRIORITY_NORMAL 100 @implementation NGRuleParser static BOOL parseDebugOn = YES; + (void)initialize { parseDebugOn = [[NSUserDefaults standardUserDefaults] boolForKey:@"NGRuleParserDebugEnabled"]; } + (id)sharedRuleParser { static NGRuleParser *parser = nil; // THREAD if (parser == nil) parser = [[NGRuleParser alloc] init]; return parser; } - (id)init { if ((self = [super init])) { self->ruleQuotes = @"'\""; self->ruleEscape = '\\'; self->priorityMapping = [[NSDictionary alloc] initWithObjectsAndKeys: [NSNumber numberWithInt:1000], @"important", [NSNumber numberWithInt:200], @"very high", [NSNumber numberWithInt:150], @"high", [NSNumber numberWithInt:RULE_PRIORITY_NORMAL], @"normal", [NSNumber numberWithInt:RULE_PRIORITY_NORMAL], @"default", [NSNumber numberWithInt:50], @"low", [NSNumber numberWithInt:5], @"very low", [NSNumber numberWithInt:0], @"fallback", nil]; self->boolMapping = [[NSDictionary alloc] initWithObjectsAndKeys: [NSNumber numberWithBool:YES], @"yes", [NSNumber numberWithBool:NO], @"no", [NSNumber numberWithBool:YES], @"true", [NSNumber numberWithBool:NO], @"false", nil]; } return self; } - (void)dealloc { [self->priorityMapping release]; [self->boolMapping release]; [self->ruleQuotes release]; [self->lastException release]; [super dealloc]; } /* accessors */ - (NSException *)lastException { return self->lastException; } /* parsing */ - (NGRule *)parseRuleFromPropertyList:(id)_plist { if (_plist == nil) return nil; if ([_plist isKindOfClass:[NSString class]]) return [self parseRuleFromString:_plist]; [self debugWithFormat: @"cannot deal with plist rule of class '%@': %@", NSStringFromClass([_plist class]), _plist]; return nil; } - (NGRule *)parseRuleFromArray:(NSArray *)_a { /* eg: ( "a>2", "a='3'", 5 ) */ unsigned count; id qpart, apart, ppart; EOQualifier *q; id action; int priority; if (_a == nil) return nil; if ((count = [_a count]) < 2) { [self debugWithFormat:@"invalid rule array: %@", _a]; return nil; } /* extract parts */ qpart = [_a objectAtIndex:0]; apart = [_a objectAtIndex:1]; ppart = count > 2 ? [_a objectAtIndex:2] : nil; /* parse separate strings */ // TODO: handle plists ! q = [self parseQualifierFromString:[qpart stringValue]]; action = [self parseActionFromString:[apart stringValue]]; priority = [self parsePriorityFromString:[ppart stringValue]]; /* create rule */ return [NGRule ruleWithQualifier:q action:action priority:priority]; } - (NGRule *)parseRuleFromString:(NSString *)_s { /* "qualifier => assignment [; prio]" */ NSString *qs, *as, *ps; EOQualifier *q; id action; int priority; BOOL ok; if (_s == nil) return nil; [self debugWithFormat:@"should parse rule: '%@'", _s]; /* split string */ ok = [self splitString:_s intoQualifierString:&qs actionString:&as andPriorityString:&ps]; if (!ok) return nil; [self debugWithFormat:@" splitted: q='%@', as='%@', pri=%@", qs, as, ps]; /* parse separate strings */ q = [self parseQualifierFromString:qs]; action = [self parseActionFromString:as]; priority = [self parsePriorityFromString:ps]; /* create rule */ return [NGRule ruleWithQualifier:q action:action priority:priority]; } - (NGRuleModel *)parseRuleModelFromPropertyList:(id)_plist { if (_plist == nil) return nil; if ([_plist isKindOfClass:[NSString class]]) { NGRule *rule; if ((rule = [self parseRuleFromString:_plist]) == nil) return nil; return [[[NGRuleModel alloc] initWithRules:[NSArray arrayWithObject:rule]] autorelease]; } else if ([_plist isKindOfClass:[NSArray class]]) { NSMutableArray *rules; unsigned i, count; if ((count = [(NSArray *)_plist count]) == 0) return [[[NGRuleModel alloc] init] autorelease]; rules = [NSMutableArray arrayWithCapacity:(count + 1)]; for (i = 0; i < count; i++) { NGRule *rule; rule = [self parseRuleFromPropertyList:[_plist objectAtIndex:i]]; if (rule == nil) { [self debugWithFormat:@"could not parse rule %i in model !", (i + 1)]; return nil; } [rules addObject:rule]; } return [[[NGRuleModel alloc] initWithRules:rules] autorelease]; } else { [self debugWithFormat: @"cannot deal with plist rule-model of class '%@': %@", NSStringFromClass([_plist class]), _plist]; return nil; } } /* parsing of parts */ - (BOOL)splitString:(NSString *)_s intoQualifierString:(NSString **)_qs actionString:(NSString **)_as andPriorityString:(NSString **)_ps { unsigned len; NSRange r; NSString *qs, *as, *ps; if (_qs) *_qs = nil; if (_as) *_as = nil; if (_ps) *_ps = nil; if ((len = [_s length]) == 0) return NO; /* split into qualifier and assignment/prio */ r = [_s rangeOfString:@"=>" skipQuotes:self->ruleQuotes escapedByChar:self->ruleEscape]; if (r.length == 0) { [self debugWithFormat:@"ERROR: missing => in rule '%@'", _s]; return NO; } qs = [[_s substringToIndex:r.location] stringByTrimmingSpaces]; as = [_s substringFromIndex:(r.location + r.length)]; /* split assignment and prio */ r = [as rangeOfString:@";" skipQuotes:self->ruleQuotes escapedByChar:self->ruleEscape]; if (r.length == 0) { /* no priority */ ps = nil; as = [as stringByTrimmingSpaces]; } else { ps = [[as substringFromIndex:(r.location + r.length)] stringByTrimmingSpaces]; as = [[as substringToIndex:r.location] stringByTrimmingSpaces]; } /* return results */ *_qs = qs; *_as = as; *_ps = ps; return YES; } - (EOQualifier *)parseQualifierFromString:(NSString *)_s { if ([_s length] == 0) return nil; _s = [_s stringByTrimmingSpaces]; if ([_s isEqualToString:@"*true*"]) { static EOTrueQualifier *tq = nil; if (tq == nil) tq = [[EOTrueQualifier alloc] init]; return tq; } return [EOQualifier qualifierWithQualifierFormat:_s arguments:nil]; } - (id)parseActionFromString:(NSString *)_s { NSRange r; NSString *key; NSString *valstr; Class AssignmentClass; id value; _s = [_s stringByTrimmingSpaces]; /* split assignment */ r = [_s rangeOfString:@"=" skipQuotes:self->ruleQuotes escapedByChar:self->ruleEscape]; if (r.length == 0) { [self debugWithFormat:@"cannot parse rule action: '%@'", _s]; return nil; } key = [[_s substringToIndex:r.location] stringByTrimmingSpaces]; valstr = [[_s substringFromIndex:(r.location + r.length)] stringByTrimmingSpaces]; /* setup defaults */ AssignmentClass = [NGRuleKeyAssignment class]; value = valstr; /* parse value */ if ([valstr length] > 0) { unichar c1 = [valstr characterAtIndex:0]; id tmp; if (c1 == '"' || c1 == '\'') { /* a quoted, constant string */ NSString *s, *qs; NSRange r; AssignmentClass = [NGRuleAssignment class]; qs = [NSString stringWithCharacters:&c1 length:1]; s = [valstr substringFromIndex:1]; // TODO: perf r = [s rangeOfString:qs]; if (r.length == 0) { [self debugWithFormat: @"quoting of assignment string-value is not closed !"]; value = valstr; } else value = [s substringToIndex:r.location]; } else if (isdigit(c1) || c1 == '-') { AssignmentClass = [NGRuleAssignment class]; value = [NSNumber numberWithInt:[valstr intValue]]; } else if ((tmp=[self->boolMapping objectForKey:[valstr lowercaseString]])) { AssignmentClass = [NGRuleAssignment class]; value = tmp; } else if ([valstr isEqualToString:@"nil"] || [valstr isEqualToString:@"null"]) { AssignmentClass = [NGRuleAssignment class]; value = [NSNull null]; } else if (c1 == '{' || c1 == '(') { AssignmentClass = [NGRuleAssignment class]; value = [valstr propertyList]; } } return [AssignmentClass assignmentWithKeyPath:key value:value]; } - (int)parsePriorityFromString:(NSString *)_s { unichar c1; id num; _s = [_s stringByTrimmingSpaces]; // [self debugWithFormat:@"parse priority: '%@'", _s]; if ([_s length] == 0) return RULE_PRIORITY_NORMAL; c1 = [_s characterAtIndex:0]; if (isdigit(c1) || c1 == '-') return [_s intValue]; if ((num = [self->priorityMapping objectForKey:_s])) return [num intValue]; [self debugWithFormat:@"cannot parse rule priority: '%@'", _s]; return RULE_PRIORITY_NORMAL; } /* debugging */ - (BOOL)isDebuggingEnabled { return parseDebugOn; } @end /* NGRuleParser */ SOPE/sope-core/NGExtensions/NGRuleEngine.subproj/common.h0000644000000000000000000000002712242733417022214 0ustar rootroot#include "../common.h" SOPE/sope-core/NGExtensions/NGRuleEngine.subproj/NGRuleParser.h0000644000000000000000000000461112242733417023240 0ustar rootroot/* Copyright (C) 2003-2004 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGRuleEngine_NGRuleParser_H__ #define __NGRuleEngine_NGRuleParser_H__ #import #import /* NGRuleParser This class parses NGRule objects. The serialization format is: qualifier => assignment [; priority] The qualifier is either the special '*true*' or a serialized EOQualifier and the assignment is a key/value statement, eg "value=blue". We map some special priority "keys": "important" => 1000 "very high" => 200 "high" => 150 "default" => 100 "normal" => 100 "low" => 50 "very low" => 5 "fallback" => 0 */ @class NSException, NSString, NSDictionary; @class EOQualifier; @class NGRule, NGRuleModel; @interface NGRuleParser : NSObject { NSString *ruleQuotes; unichar ruleEscape; NSException *lastException; NSDictionary *priorityMapping; /* maps strings to ints (eg high => 10) */ NSDictionary *boolMapping; /* maps strings to bool (eg false => NO) */ } + (id)sharedRuleParser; /* accessors */ - (NSException *)lastException; /* parsing */ - (NGRule *)parseRuleFromPropertyList:(id)_plist; - (NGRule *)parseRuleFromString:(NSString *)_plist; - (NGRuleModel *)parseRuleModelFromPropertyList:(id)_plist; /* parsing of the individual parts */ - (EOQualifier *)parseQualifierFromString:(NSString *)_s; - (id)parseActionFromString:(NSString *)_s; - (int)parsePriorityFromString:(NSString *)_s; - (BOOL)splitString:(NSString *)_s intoQualifierString:(NSString **)_qs actionString:(NSString **)_as andPriorityString:(NSString **)_ps; @end #endif /* __NGRuleEngine_NGRuleParser_H__ */ SOPE/sope-core/NGExtensions/XmlExt.subproj/0000755000000000000000000000000012242733417017513 5ustar rootrootSOPE/sope-core/NGExtensions/XmlExt.subproj/GNUmakefile0000644000000000000000000000054012242733417021564 0ustar rootroot# GNUstep makefile include ../../../config.make include ../../common.make SUBPROJECT_NAME = XmlExt XmlExt_OBJC_FILES = \ DOMNode+EOQualifier.m ADDITIONAL_INCLUDE_DIRS += \ -I. -I.. \ -I../NGExtensions/ \ -I../../../sope-xml/ \ -I../.. -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/subproject.make -include GNUmakefile.postamble SOPE/sope-core/NGExtensions/XmlExt.subproj/DOMNode+EOQualifier.m0000644000000000000000000000663712242733417023273 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "DOMNode+EOQualifier.h" #import #include "common.h" @interface NSObject(DOMNodeEOQualifier) - (NSArray *)_domChildrenMatchingQualifier:(EOQualifier *)_qualifier; - (NSArray *)_domDescendantsMatchingQualifier:(EOQualifier *)_qualifier includeSelf:(BOOL)_includeSelf; @end @implementation NSObject(DOMNodeEOQualifier) /* this category is used to support DOM ops on any object */ static NSArray *emptyArray = nil; - (NSArray *)_domChildrenMatchingQualifier:(EOQualifier *)_qualifier { id children; unsigned count; if (![(id)self hasChildNodes]) return nil; if ((children = [(id)self childNodes]) == nil) return nil; if ((count = [children count]) == 0) { if (emptyArray == nil) emptyArray = [[NSArray alloc] init]; return emptyArray; } else { NSMutableArray *marray; unsigned i; marray = [NSMutableArray arrayWithCapacity:(count + 1)]; for (i = 0; i < count; i++) { id childNode; if ((childNode = [children objectAtIndex:i])) { if ((_qualifier == nil) || [(id)_qualifier evaluateWithObject:childNode]) [marray addObject:childNode]; } } return [[marray copy] autorelease]; } } - (void)_addDOMDescendantsMatchingQualifier:(EOQualifier *)_qualifier toMutableArray:(NSMutableArray *)_array includeSelf:(BOOL)_includeSelf { id children; unsigned i, count; if (_includeSelf) { if ([(id)_qualifier evaluateWithObject:self]) [_array addObject:self]; } if (![(id)self hasChildNodes]) return; children = [(id)self childNodes]; for (i = 0, count = [children count]; i < count; i++) { [[children objectAtIndex:i] _addDOMDescendantsMatchingQualifier:_qualifier toMutableArray:_array includeSelf:YES]; } } - (NSArray *)_domDescendantsMatchingQualifier:(EOQualifier *)_qualifier includeSelf:(BOOL)_includeSelf { NSMutableArray *marray; marray = [NSMutableArray arrayWithCapacity:16]; [self _addDOMDescendantsMatchingQualifier:_qualifier toMutableArray:marray includeSelf:_includeSelf]; return [[marray copy] autorelease]; } @end /* NSObject(DOMNodeEOQualifier) */ @implementation NGDOMNode(EOQualifier) - (NSArray *)childrenMatchingQualifier:(EOQualifier *)_qualifier { return [self _domChildrenMatchingQualifier:_qualifier]; } - (NSArray *)descendantsMatchingQualifier:(EOQualifier *)_qualifier { return [self _domDescendantsMatchingQualifier:_qualifier includeSelf:NO]; } @end /* NGDOMNode(EOQualifier) */ SOPE/sope-core/NGExtensions/NGFileManagerURL.m0000644000000000000000000001076012242733417017753 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NGFileManagerURL.h" #include "common.h" @interface NGFileManagerURLHandle : NSURLHandle { id fileManager; NSString *path; BOOL shallCache; NSURLHandleStatus status; NSData *cachedData; NSDictionary *cachedProperties; } @end @implementation NGFileManagerURL - (id)initWithPath:(NSString *)_path fileManager:(id)_fm { static BOOL didRegisterHandleClass = NO; if (!didRegisterHandleClass) { [NSURLHandle registerURLHandleClass:[NGFileManagerURLHandle class]]; didRegisterHandleClass = YES; } self->path = [[_fm standardizePath:_path] copy]; self->fileManager = [_fm retain]; return self; } - (void)dealloc { [self->path release]; [self->fileManager release]; [super dealloc]; } /* accessors */ - (id)fileManager { return self->fileManager; } - (NSString *)fragment { return nil; } - (NSString *)host { return nil; } - (NSString *)path { return self->path; } - (NSString *)scheme { return nil; } - (NSString *)user { return nil; } - (NSString *)password { return nil; } - (NSNumber *)port { return nil; } - (NSString *)query { return nil; } - (BOOL)isFileURL { return NO; } @end /* NGFileManagerURL */ @implementation NGFileManagerURLHandle + (BOOL)canInitWithURL:(NSURL *)_url { return [_url isKindOfClass:[NGFileManagerURL class]] ? YES : NO; } - (id)initWithURL:(NSURL *)_url cached:(BOOL)_flag { if (![[self class] canInitWithURL:_url]) { [self release]; return nil; } self->fileManager = [[(NGFileManagerURL *)_url fileManager] retain]; self->path = [[_url path] copy]; self->shallCache = _flag; self->status = NSURLHandleNotLoaded; return self; } - (void)dealloc { [self->cachedData release]; [self->cachedProperties release]; [self->path release]; [self->fileManager release]; [super dealloc]; } - (NSData *)loadInForeground { [self->cachedProperties release]; self->cachedProperties = nil; [self->cachedData release]; self->cachedData = nil; self->cachedData = [[self->fileManager contentsAtPath:self->path] retain]; self->cachedProperties = [[self->fileManager fileAttributesAtPath:self->path traverseLink:YES] copy]; return self->cachedData; } - (void)loadInBackground { [self loadInBackground]; } - (void)flushCachedData { [self->cachedData release]; self->cachedData = nil; [self->cachedProperties release]; self->cachedProperties = nil; } - (NSData *)resourceData { NSData *data; if (self->cachedData) return [[self->cachedData copy] autorelease]; data = [self loadInForeground]; data = [data copy]; if (!self->shallCache) [self flushCachedData]; return [data autorelease]; } - (NSData *)availableResourceData { return [[self->cachedData copy] autorelease]; } - (NSURLHandleStatus)status { return self->status; } - (NSString *)failureReason { if (self->status != NSURLHandleLoadFailed) return nil; return @"loading of URL failed"; } /* properties */ - (id)propertyForKey:(NSString *)_key { if (self->cachedProperties) return [self->cachedProperties objectForKey:_key]; if ([self loadInForeground]) { id value; value = [self->cachedProperties objectForKey:_key]; value = [value retain]; if (!self->shallCache) [self flushCachedData]; return [value autorelease]; } else { [self flushCachedData]; return nil; } } - (id)propertyForKeyIfAvailable:(NSString *)_key { return [self->cachedProperties objectForKey:_key]; } /* writing */ - (BOOL)writeData:(NSData *)_data { [self flushCachedData]; return NO; } @end /* NGFileManagerURLHandle */ SOPE/sope-core/NGExtensions/GNUmakefile0000644000000000000000000000740612242733417016670 0ustar rootroot# GNUstep makefile include ../../config.make include ../common.make ifneq ($(frameworks),yes) LIBRARY_NAME = libNGExtensions else FRAMEWORK_NAME = NGExtensions endif libNGExtensions_PCH_FILE = common.h libNGExtensions_DLL_DEF = libNGExtensions.def libNGExtensions_INTERFACE_VERSION=$(MAJOR_VERSION).$(MINOR_VERSION) libNGExtensions_INSTALL_DIR=$(SOPE_SYSLIBDIR) libNGExtensions_VERSION=$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBMINOR_VERSION) libNGExtensions_HEADER_FILES_DIR = ./NGExtensions libNGExtensions_HEADER_FILES_INSTALL_DIR = /NGExtensions libNGExtensions_HEADER_FILES = \ NGExtensionsDecls.h \ NGExtensions.h \ AutoDefines.h \ IndexFunc.h \ NGBase64Coding.h \ NGBaseTypes.h \ NGBitSet.h \ NGBundleManager.h \ NGCharBuffers.h \ NGCustomFileManager.h \ NGDirectoryEnumerator.h \ NGFileFolderInfoDataSource.h \ NGFileManager.h \ NGFileManagerURL.h \ NGHashMap.h \ NGMemoryAllocation.h \ NGMerging.h \ NGQuotedPrintableCoding.h \ NGStack.h \ NGObjectMacros.h \ NGCalendarDateRange.h \ NGResourceLocator.h \ libNGExtensions_OBJC_FILES = \ NGExtensions.m \ NGBase64Coding.m \ NGBitSet.m \ NGBundleManager.m \ NGCustomFileManager.m \ NGDirectoryEnumerator.m \ NGFileFolderInfoDataSource.m \ NGFileManager.m \ NGFileManager+JS.m \ NGFileManagerURL.m \ NGHashMap.m \ NGMerging.m \ NGQuotedPrintableCoding.m \ NGStack.m \ NGCalendarDateRange.m \ NGResourceLocator.m \ ifeq ($(FOUNDATION_LIB), apple) libNGExtensions_OBJC_FILES += FileObjectHolder.m endif libNGExtensions_SUBPROJECTS = \ FdExt.subproj \ EOExt.subproj \ XmlExt.subproj \ NGRuleEngine.subproj \ NGLogging.subproj \ EOExt_HEADER_FILES = \ EOCacheDataSource.h \ EOCompoundDataSource.h \ EODataSource+NGExtensions.h \ EOFilterDataSource.h \ EOGrouping.h \ EOGroupingSet.h \ EOKeyGrouping.h \ EOKeyMapDataSource.h \ EOQualifier+CtxEval.h \ EOQualifierGrouping.h \ EOTrueQualifier.h \ EOQualifier+plist.h \ EOSortOrdering+plist.h \ EOFetchSpecification+plist.h \ FdExt_HEADER_FILES = \ NSArray+enumerator.h \ NSAutoreleasePool+misc.h \ NSBundle+misc.h \ NSCalendarDate+misc.h \ NSData+gzip.h \ NSData+misc.h \ NSDictionary+misc.h \ NSEnumerator+misc.h \ NSException+misc.h \ NSFileManager+Extensions.h \ NSNull+misc.h \ NSObject+Logs.h \ NSObject+Values.h \ NSProcessInfo+misc.h \ NSRunLoop+FileObjects.h \ NSSet+enumerator.h \ NSString+Ext.h \ NSString+German.h \ NSString+Formatting.h \ NSString+Encoding.h \ NSString+Escaping.h \ NSString+misc.h \ NSURL+misc.h \ NGPropertyListParser.h \ XmlExt_HEADER_FILES = \ DOMNode+EOQualifier.h NGRuleEngine_HEADER_FILES = \ NGRuleEngine.h \ NGRule.h \ NGRuleAssignment.h \ NGRuleContext.h \ NGRuleModel.h \ NGLogging_HEADER_FILES = \ NGLogging.h \ NGLogLevel.h \ NGLogger.h \ NGLoggerManager.h \ NGLogEvent.h \ NGLogEventFormatter.h \ NGLogAppender.h \ NGLogFileHandleAppender.h \ NGLogSyslogAppender.h \ libNGExtensions_HEADER_FILES += \ $(FdExt_HEADER_FILES) \ $(EOExt_HEADER_FILES) \ $(XmlExt_HEADER_FILES) \ $(NGRuleEngine_HEADER_FILES) \ $(NGLogging_HEADER_FILES) # framework support NGExtensions_PCH_FILE = $(libNGExtensions_PCH_FILE) NGExtensions_HEADER_FILES_DIR = NGExtensions NGExtensions_HEADER_FILES = $(libNGExtensions_HEADER_FILES) NGExtensions_OBJC_FILES = $(libNGExtensions_OBJC_FILES) NGExtensions_SUBPROJECTS = $(libNGExtensions_SUBPROJECTS) # building -include GNUmakefile.preamble ifneq ($(FHS_INSTALL_ROOT),) GNUSTEP_HEADERS=$(DESTDIR)$(FHS_INSTALL_ROOT)/include endif ifneq ($(frameworks),yes) include $(GNUSTEP_MAKEFILES)/library.make else include $(GNUSTEP_MAKEFILES)/framework.make endif -include GNUmakefile.postamble SOPE/sope-core/NGExtensions/COPYING0000644000000000000000000006130312242733417015645 0ustar rootroot GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 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. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] 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 Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, 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 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 a program 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. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, 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 companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. 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, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library 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 compile 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) 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. c) 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. d) 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 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. 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 to 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 Library 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 Appendix: 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 Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library 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! SOPE/sope-core/NGExtensions/NGCalendarDateRange.m0000644000000000000000000001773712242733417020515 0ustar rootroot/* Copyright (C) 2004-2007 Marcus Mueller Copyright (C) 2007 Helge Hess This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NGCalendarDateRange.h" #include #include #include "common.h" @implementation NGCalendarDateRange + (id)calendarDateRangeWithStartDate:(NSCalendarDate *)start endDate:(NSCalendarDate *)end { return [[[self alloc] initWithStartDate:start endDate:end] autorelease]; } - (id)initWithStartDate:(NSCalendarDate *)start endDate:(NSCalendarDate *)end { NSAssert(start != nil, @"startDate MUST NOT be nil!"); NSAssert(end != nil, @"endDate MUST NOT be nil!"); if ((self = [super init])) { if ([start compare:end] == NSOrderedAscending) { self->startDate = [start copy]; self->endDate = [end copy]; } else { self->startDate = [end copy]; self->endDate = [start copy]; } } return self; } - (void)dealloc { [self->startDate release]; [self->endDate release]; [super dealloc]; } /* NSCopying */ - (id)copyWithZone:(NSZone *)zone { /* object is immutable */ return [self retain]; } /* accessors */ - (NSCalendarDate *)startDate { return self->startDate; } - (NSCalendarDate *)endDate { return self->endDate; } - (NGCalendarDateRange *)intersectionDateRange:(NGCalendarDateRange *)other { NSCalendarDate *b, *c, *d; if ([self compare:other] == NSOrderedAscending) { b = self->endDate; c = [other startDate]; d = [other endDate]; } else { b = [other endDate]; c = self->startDate; d = self->endDate; } // [a;b[ ?< [c;d[ if ([b compare:c] == NSOrderedAscending) return nil; // no intersection // b ?< d if ([b compare:d] == NSOrderedAscending) { // c !< b && b !< d -> [c;b[ if([c compare:b] == NSOrderedSame) return nil; // no real range, thus return nil! else return [NGCalendarDateRange calendarDateRangeWithStartDate:c endDate:b]; } if([c compare:d] == NSOrderedSame) return nil; // no real range, thus return nil! // b !> d -> [c;d[ return [NGCalendarDateRange calendarDateRangeWithStartDate:c endDate:d]; } - (BOOL)doesIntersectWithDateRange:(NGCalendarDateRange *)_other { // TODO: improve if (_other == nil) return NO; return [self intersectionDateRange:_other] != nil ? YES : NO; } - (NGCalendarDateRange *)unionDateRange:(NGCalendarDateRange *)other { NSCalendarDate *a, *b, *d; if ([self compare:other] == NSOrderedAscending) { a = self->startDate; b = self->endDate; d = [other endDate]; } else { a = [other startDate]; b = [other endDate]; d = self->endDate; } if ([b compare:d] == NSOrderedAscending) return [NGCalendarDateRange calendarDateRangeWithStartDate:a endDate:d]; return [NGCalendarDateRange calendarDateRangeWithStartDate:a endDate:b]; } - (BOOL)containsDate:(NSCalendarDate *)_date { NSComparisonResult result; result = [self->startDate compare:_date]; if (!((result == NSOrderedSame) || (result == NSOrderedAscending))) return NO; result = [self->endDate compare:_date]; if (result == NSOrderedAscending) return NO; return YES; } - (BOOL)containsDateRange:(NGCalendarDateRange *)_range { NSComparisonResult result; result = [self->startDate compare:[_range startDate]]; if (!((result == NSOrderedSame) || (result == NSOrderedAscending))) return NO; result = [self->endDate compare:[_range endDate]]; if (result == NSOrderedAscending) return NO; return YES; } - (NSTimeInterval)duration { return [self->endDate timeIntervalSinceDate:self->startDate]; } /* comparison */ - (BOOL)isEqual:(id)other { if (other == nil) return NO; if (other == self) return YES; if ([other isKindOfClass:self->isa] == NO) return NO; return ([self->startDate isEqual:[other startDate]] && [self->endDate isEqual:[other endDate]]) ? YES : NO; } - (unsigned)hash { return [self->startDate hash] ^ [self->endDate hash]; } - (NSComparisonResult)compare:(NGCalendarDateRange *)other { return [self->startDate compare:[other startDate]]; } /* KVC */ - (id)valueForUndefinedKey:(NSString *)_key { /* eg this is used in OGo on 'dateId' to probe for event objects */ return nil; } /* description */ - (NSString *)description { NSMutableString *description; description = [NSMutableString stringWithCapacity:64]; [description appendFormat:@"<%@[0x%x]: startDate:%@ endDate: ", NSStringFromClass(self->isa), self, self->startDate]; if ([self->startDate isEqual:self->endDate]) [description appendString:@"== startDate"]; else [description appendFormat:@"%@", self->endDate]; [description appendString:@">"]; return description; } @end /* NGCalendarDateRange */ @implementation NSArray(NGCalendarDateRanges) - (NSArray *)arrayByCreatingDateRangesFromObjectsWithStartDateKey:(NSString *)s andEndDateKey:(NSString *)e { NSMutableArray *ma; NSUInteger i, count; count = [self count]; ma = [NSMutableArray arrayWithCapacity:count]; for (i = 0; i < count; i++) { NGCalendarDateRange *daterange; NSCalendarDate *start, *end; id object; object = [self objectAtIndex:i]; start = [object valueForKey:s]; end = [object valueForKey:e]; /* skip invalid data */ if (![start isNotNull]) continue; if (![end isNotNull]) continue; daterange = [[NGCalendarDateRange alloc] initWithStartDate:start endDate:end]; if (daterange) [ma addObject:daterange]; [daterange release]; } return ma; } - (BOOL)dateRangeArrayContainsDate:(NSCalendarDate *)_date { NSUInteger i, count; if (_date == nil) return NO; if ((count = [self count]) == 0) return NO; for (i = 0; i < count; i++) { if ([[self objectAtIndex:i] containsDate:_date]) return YES; } return NO; } - (NSUInteger)indexOfFirstIntersectingDateRange:(NGCalendarDateRange *)_range { NSUInteger i, count; if (_range == nil) return NO; if ((count = [self count]) == 0) return NSNotFound; for (i = 0; i < count; i++) { if ([[self objectAtIndex:i] doesIntersectWithDateRange:_range]) return i; } return NSNotFound; } - (NSArray *)arrayByCompactingContainedDateRanges { // TODO: this is a candidate for unit testing ... // TODO: pretty "slow" algorithm, improve NSMutableArray *ma; NSUInteger i, count; count = [self count]; if (count < 2) return [[self copy] autorelease]; ma = [NSMutableArray arrayWithCapacity:count]; [ma addObject:[self objectAtIndex:0]]; /* add first range */ for (i = 1; i < count; i++) { NGCalendarDateRange *rangeToAdd; NGCalendarDateRange *availRange; NGCalendarDateRange *newRange; NSUInteger idx; rangeToAdd = [self objectAtIndex:i]; idx = [ma indexOfFirstIntersectingDateRange:rangeToAdd]; if (idx == NSNotFound) { /* range not yet covered in array */ [ma addObject:rangeToAdd]; continue; } /* union old range and replace the entry */ availRange = [ma objectAtIndex:idx]; newRange = [availRange unionDateRange:rangeToAdd]; [ma replaceObjectAtIndex:idx withObject:newRange]; } /* Note: we might want to join ranges up to some "closeness" (eg 1s)? */ return [ma sortedArrayUsingSelector:@selector(compare:)]; } @end /* NSArray(NGCalendarDateRanges) */ SOPE/sope-core/NGExtensions/NGHashMap.m0000644000000000000000000006071412242733417016543 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NGHashMap.h" #include "common.h" #if !LIB_FOUNDATION_LIBRARY @interface NSException(SetUI) /* allowed on Jaguar ? */ - (void)setUserInfo:(NSDictionary *)_ui; @end #endif typedef struct _LList { struct _LList *next; struct _LList *last; id object; unsigned int count; } LList; static inline void *initLListElement(id _object, LList* _next) { LList *element = malloc(sizeof(LList)); _object = [_object retain]; element->object = _object; element->next = _next; element->count = 0; return element; } static inline void checkForAddErrorMessage(id _self, id _object, id _key) { NSException *exc; NSDictionary *ui; NSString *r; if (_key == nil) { r = [[NSString alloc] initWithFormat: @"nil key to be added in HashMap with object %@", (_object != nil ? _object : (id)@"")]; ui = [[NSDictionary alloc] initWithObjectsAndKeys: _self, @"map", _key ? _key : (id)@"", @"key", _object ? _object : (id)@"", @"object", nil]; exc = [NSException exceptionWithName:NSInvalidArgumentException reason:r userInfo:ui]; [r release]; r = nil; [ui release]; ui = nil; [exc raise]; } if (_object == nil) { r = [[NSString alloc] initWithFormat: @"nil object to be added in HashMap for key %@", _key ? _key : (id)@""]; ui = [[NSDictionary alloc] initWithObjectsAndKeys: _self, @"map", _key ? _key : (id)@"", @"key", _object ? _object : (id)@"", @"object", nil]; exc = [NSException exceptionWithName:NSInvalidArgumentException reason:r userInfo:ui]; [r release]; r = nil; [ui release]; ui = nil; [exc raise]; } } static inline void checkForRemoveErrorMessage(id _self, id _object, id _key) { NSException *exc; NSDictionary *ui; NSString *r; if (_object != nil && _key != nil) return; r = [[NSString alloc] initWithFormat: @"nil object to be removed in HashMap for key %@", _key ? _key : (id)@""]; ui = [[NSDictionary alloc] initWithObjectsAndKeys: _self, @"map", _key ? _key : (id)@"", @"key", _object ? _object : (id)@"", @"object", nil]; exc = [NSException exceptionWithName:NSInvalidArgumentException reason:r userInfo:ui]; [ui release]; ui = nil; [r release]; r = nil; [exc raise]; } static inline void raiseInvalidArgumentExceptionForNilKey(id _self) { NSException *exc = nil; exc = [NSException exceptionWithName:NSInvalidArgumentException reason:@"key is nil" userInfo:[NSDictionary dictionaryWithObject:_self forKey:@"map"]]; [exc raise]; } @interface _NGHashMapObjectEnumerator : NSEnumerator { NSEnumerator *keys; NSEnumerator *elements; NGHashMap *hashMap; } - (id)initWithHashMap:(NGHashMap *)_hashMap; - (id)nextObject; @end @interface _NGHashMapObjectForKeyEnumerator : NSEnumerator { LList *element; NGHashMap *map; } - (id)initWithHashMap:(NGHashMap *)_hashMap andKey:(id)_key; - (id)nextObject; @end @interface _NGHashMapKeyEnumerator : NSEnumerator { NSMapEnumerator enumerator; NGHashMap *map; } - (id)initWithHashMap:(NGHashMap *)_hashMap; - (id)nextObject; @end // ************************* NGHashMap ************************* @interface NGHashMap(private) - (LList *)__structForKey:(id)_key; - (NSMapEnumerator)__keyEnumerator; - (void)__removeAllObjectsForKey:(id)_key; - (void)__removeAllObjects; @end static Class NSArrayClass = Nil; @implementation NGHashMap + (void)initialize { NSArrayClass = [NSArray class]; } /* final methods */ static inline void _removeAllObjectsInList(LList *list) { while (list) { register LList *element; [list->object release]; element = list; list = list->next; if (element) free(element); } } static inline LList *__structForKey(NGHashMap *self, id _key) { if (_key == nil) raiseInvalidArgumentExceptionForNilKey(self); #if DEBUG NSCAssert(self->table, @"missing table .."); #endif return (LList *)NSMapGet(self->table, (void *)_key); } static inline unsigned __countObjectsForKey(NGHashMap *self, id _key) { LList *list = NULL; return (list = __structForKey(self, _key)) ? list->count : 0; } /* methods */ + (id)hashMap { return [[[self alloc] init] autorelease]; } + (id)hashMapWithHashMap:(NGHashMap *)_hashMap { return [[[self alloc] initWithHashMap:_hashMap] autorelease]; } + (id)hashMapWithObjects:(NSArray *)_objects forKey:(id)_key { return [[[self alloc] initWithObjects:_objects forKey:_key] autorelease]; } + (id)hashMapWithDictionary:(NSDictionary *)_dict { return [[[self alloc] initWithDictionary:_dict] autorelease]; } - (id)init { return [self initWithCapacity:0]; } - (id)initWithCapacity:(NSUInteger)_size { if ((self = [super init])) { self->table = NSCreateMapTableWithZone(NSObjectMapKeyCallBacks, NSNonOwnedPointerMapValueCallBacks, _size * 4/3 ,NULL); NSAssert1(self->table, @"missing table for hashmap of size %d ..", _size); } return self; } - (id)initWithHashMap:(NGHashMap *)_hashMap { NSEnumerator *keys = nil; id key = nil; LList *list = NULL; LList *newList = NULL; LList *oldList = NULL; if ((self = [self initWithCapacity:[_hashMap count]])) { keys = [_hashMap keyEnumerator]; while ((key = [keys nextObject])) { list = [_hashMap __structForKey:key]; newList = initLListElement(list->object,NULL); newList->count = list->count; NSMapInsert(self->table,key,newList); while (list->next) { oldList = newList; list = list->next; newList = initLListElement(list->object,NULL); oldList->next = newList; } } } return self; } - (id)initWithObjects:(NSArray *)_objects forKey:(id)_key { LList *root = NULL; LList *element = NULL; LList *pred = NULL; int count = 0; int i = 0; if (( self = [self initWithCapacity:1])) { count = [_objects count]; if (count == 0) return self; root = initLListElement([_objects objectAtIndex:0], NULL); pred = root; for (i = 1; i < count; i++) { element = initLListElement([_objects objectAtIndex:i], NULL); pred->next = element; pred = element; } root->count = i; NSMapInsert(self->table,_key, root); } NSAssert(self->table, @"missing table for hashmap .."); return self; } - (id)initWithDictionary:(NSDictionary *)_dictionary { if (![self isKindOfClass:[NGMutableHashMap class]]) { self = [self autorelease]; self = [[NGMutableHashMap allocWithZone:[self zone]] initWithCapacity:[_dictionary count]]; } else self = [self initWithCapacity:[_dictionary count]]; if (self) { NSEnumerator *keys; id key; keys = [_dictionary keyEnumerator]; while ((key = [keys nextObject])) { [(NGMutableHashMap *)self setObject:[_dictionary objectForKey:key] forKey:key]; } } NSAssert(self->table, @"missing table for hashmap .."); return self; } - (void)dealloc { if (self->table) { NSMapEnumerator mapenum; id key = nil, value = nil; mapenum = [self __keyEnumerator]; while (NSNextMapEnumeratorPair(&mapenum, (void **)&key, (void **)&value)) _removeAllObjectsInList((LList *)value); NSFreeMapTable(self->table); self->table = NULL; } [super dealloc]; } /* removing */ - (void)__removeAllObjectsForKey:(id)_key { _removeAllObjectsInList(__structForKey(self, _key)); NSMapRemove(self->table, _key); } - (void)__removeAllObjects { NSEnumerator *keys = nil; id key = nil; keys = [self keyEnumerator]; while ((key = [keys nextObject])) _removeAllObjectsInList(__structForKey(self, key)); NSResetMapTable(self->table); } /* equality */ - (NSUInteger)hash { return [self count]; } - (BOOL)isEqual:(id)anObject { if (self == anObject) return YES; if (![anObject isKindOfClass:[NGHashMap class]]) return NO; return [self isEqualToHashMap:anObject]; } - (BOOL)isEqualToHashMap:(NGHashMap *)_other { NSEnumerator *keyEnumerator = nil; id key = nil; LList *selfList = NULL; LList *otherList = NULL; if (_other == self) return YES; if ([self count] != [_other count]) return NO; keyEnumerator = [self keyEnumerator]; while ((key = [keyEnumerator nextObject])) { if (__countObjectsForKey(self, key) != [_other countObjectsForKey:key]) return NO; selfList = __structForKey(self, key); otherList = [_other __structForKey:key]; while (selfList) { if (![selfList->object isEqual:otherList->object]) return NO; selfList = selfList->next; otherList = otherList->next; } } return YES; } - (id)objectForKey:(id)_key { LList *list; if (!(list = __structForKey(self, _key))) return nil; if (list->next) { NSLog(@"WARNING[%s] more than one element for key %@ objects: %@, " @"return first object", __PRETTY_FUNCTION__, _key, [self objectsForKey:_key]); } return list->object; } - (NSArray *)objectsForKey:(id)_key { NSArray *array = nil; NSEnumerator *objectEnum = nil; id object = nil; id *objects = NULL; unsigned int i = 0; if ((objectEnum = [self objectEnumeratorForKey:_key]) == nil) return nil; objects = calloc(__countObjectsForKey(self, _key) + 1, sizeof(id)); for (i = 0; (object = [objectEnum nextObject]); i++) objects[i] = object; array = [NSArrayClass arrayWithObjects:objects count:i]; if (objects) free(objects); return array; } - (id)objectAtIndex:(NSUInteger)_index forKey:(id)_key { LList *list = NULL; if (!(list = __structForKey(self, _key))) return nil; if ((_index < list->count) == 0) { [NSException raise:NSRangeException format:@"index %d out of range for key %@ of length %d", _index, _key, list->count]; return nil; } while (_index--) list = list->next; return list->object; } - (NSArray *)allKeys { NSArray *array = nil; NSEnumerator *keys; id *objects; id object; int i; objects = calloc([self count] + 1, sizeof(id)); keys = [self keyEnumerator]; for(i = 0; (object = [keys nextObject]); i++) objects[i] = object; array = [[NSArrayClass alloc] initWithObjects:objects count:i]; if (objects) free (objects); return [array autorelease]; } - (NSArray *)allObjects { NSEnumerator *keys = nil; id object = nil; NSMutableArray *mArray = nil; NSArray *result = nil; mArray = [[NSMutableArray alloc] init]; keys = [self keyEnumerator]; while ((object = [keys nextObject])) [mArray addObjectsFromArray:[self objectsForKey:object]]; result = [mArray copy]; [mArray release]; mArray = nil; return [result autorelease]; } - (NSUInteger)countObjectsForKey:(id)_key { return __countObjectsForKey(self, _key); } - (NSEnumerator *)keyEnumerator { return [[[_NGHashMapKeyEnumerator alloc] initWithHashMap:self] autorelease]; } - (NSEnumerator *)objectEnumerator { return [[[_NGHashMapObjectEnumerator alloc] initWithHashMap:self] autorelease]; } - (NSEnumerator *)objectEnumeratorForKey:(id)_key { if (_key == nil) raiseInvalidArgumentExceptionForNilKey(self); return [[[_NGHashMapObjectForKeyEnumerator alloc] initWithHashMap:self andKey:_key] autorelease]; } - (NSDictionary *)asDictionaryWithArraysForValues:(BOOL)arraysOnly { NSDictionary *dict = nil; NSEnumerator *keys; id key; id *dicObj; id *dicKeys; int cntKey; keys = [self keyEnumerator]; cntKey = [self count]; dicObj = calloc(cntKey + 1, sizeof(id)); dicKeys = calloc(cntKey + 1, sizeof(id)); for (cntKey = 0; (key = [keys nextObject]); ) { id object = nil; LList *list; if ((list = __structForKey(self, key)) == NULL) { NSLog(@"ERROR(%s): did not find key '%@' in hashmap: %@", __PRETTY_FUNCTION__, key, self); continue; } if (list->next) { id *objects = NULL; int cntObj = 0; objects = calloc(list->count + 1, sizeof(id)); { cntObj = 0; while (list) { objects[cntObj++] = list->object; list = list->next; } object = [NSArray arrayWithObjects:objects count:cntObj]; } if (objects) free(objects); objects = NULL; } else { if (arraysOnly) { object = [NSArray arrayWithObject:list->object ]; } else { object = list->object; } } dicObj[cntKey] = object; dicKeys[cntKey++] = key; } dict = [[NSDictionary alloc] initWithObjects:dicObj forKeys:dicKeys count:cntKey]; if (dicObj) free(dicObj); dicObj = NULL; if (dicKeys) free(dicKeys); dicKeys = NULL; return [dict autorelease]; } - (NSDictionary *)asDictionary { return [ self asDictionaryWithArraysForValues: NO ]; } - (NSDictionary *)asDictionaryWithArraysForValues { return [ self asDictionaryWithArraysForValues: YES ]; } - (id)propertyList { NSDictionary *dict = nil; NSEnumerator *keys = nil; id key; id *dicObj = NULL; id *dicKeys = NULL; int cntKey = 0; keys = [self keyEnumerator]; cntKey = [self count]; dicObj = calloc(cntKey + 1, sizeof(id)); dicKeys = calloc(cntKey + 1, sizeof(id)); for (cntKey = 0; (key = [keys nextObject]); ) { id object = nil; LList *list = NULL; list = __structForKey(self, key); if (list->next) { id *objects = NULL; int cntObj = 0; objects = calloc(list->count + 1, sizeof(id)); { cntObj = 0; while (list) { objects[cntObj++] = list->object; list = list->next; } object = [NSArrayClass arrayWithObjects:objects count:cntObj]; } if (objects) free(objects); objects = NULL; } else object = list->object; dicObj[cntKey] = object; dicKeys[cntKey] = key; cntKey++; } dict = [[[NSDictionary alloc] initWithObjects:dicObj forKeys:dicKeys count:cntKey] autorelease]; if (dicObj) free(dicObj); dicObj = NULL; if (dicKeys) free(dicKeys); dicKeys = NULL; return dict; } /* description */ - (NSString *)description { return [[self propertyList] description]; } - (NSUInteger)count { return self->table ? NSCountMapTable(table) : 0; } /* NSCopying */ - (id)copyWithZone:(NSZone *)_zone { return [[NGHashMap allocWithZone:_zone] initWithHashMap:self]; } - (id)mutableCopyWithZone:(NSZone *)_zone { return [[NGMutableHashMap allocWithZone:_zone] initWithHashMap:self]; } /* */ - (NSMapEnumerator)__keyEnumerator { return NSEnumerateMapTable(table); } - (LList *)__structForKey:(id)_key { return __structForKey(self, _key); } /* NSCoding */ - (void)encodeWithCoder:(NSCoder *)_encoder { unsigned keyCount = [self count]; NSMapEnumerator mapenum = [self __keyEnumerator]; id key = nil; LList *value = NULL; [_encoder encodeValueOfObjCType:@encode(unsigned) at:&keyCount]; while (NSNextMapEnumeratorPair(&mapenum, (void **)&key, (void **)&value)) { unsigned valueCount = value ? value->count : 0; unsigned outCount = 0; // debugging [_encoder encodeObject:key]; [_encoder encodeValueOfObjCType:@encode(unsigned) at:&valueCount]; while (value) { [_encoder encodeObject:value->object]; value = value->next; outCount++; } NSAssert(valueCount == outCount, @"didn't encode enough value objects"); } } - (id)initWithCoder:(NSCoder *)_decoder { NGMutableHashMap *map = [[NGMutableHashMap alloc] init]; unsigned keyCount; unsigned cnt; [_decoder decodeValueOfObjCType:@encode(unsigned) at:&keyCount]; for (cnt = 0; cnt < keyCount; cnt++) { unsigned valueCount = 0, cnt2 = 0; id key = nil; key = [_decoder decodeObject]; [_decoder decodeValueOfObjCType:@encode(unsigned) at:&valueCount]; for (cnt2 = 0; cnt2 < valueCount; cnt2++) { id value = [_decoder decodeObject]; [map addObject:value forKey:key]; } } self = [self initWithHashMap:map]; [map release]; map = nil; return self; } @end /* NGHashMap */ // ************************* NGMutableHashMap ****************** @implementation NGMutableHashMap + (id)hashMapWithCapacity:(NSUInteger)_numItems { return [[[self alloc] initWithCapacity:_numItems] autorelease]; } - (id)init { return [self initWithCapacity:0]; } /* inserting objects */ - (void)insertObject:(id)_object atIndex:(NSUInteger)_index forKey:(id)_key { [self insertObjects:&_object count:1 atIndex:_index forKey:_key]; } - (void)insertObjects:(NSArray *)_objects atIndex:(NSUInteger)_index forKey:(id)_key { id *objects = NULL; int i = 0; int cntI = 0; cntI = [_objects count]; objects = calloc(cntI + 1, sizeof(id)); for (i = 0 ; i < cntI; i++) objects[i] = [_objects objectAtIndex:i]; [self insertObjects:objects count:cntI atIndex:_index forKey:_key]; if (objects) free(objects); } - (void)insertObjects:(id*)_objects count:(NSUInteger)_count atIndex:(NSUInteger)_index forKey:(id)_key { id object = nil; LList *root = NULL; LList *element = NULL; unsigned i = 0; if (_count == 0) return; checkForAddErrorMessage(self, _objects[0],_key); if ((root = [self __structForKey:_key]) == NULL) { if (_index > 0) { [NSException raise:NSRangeException format:@"index %d out of range in map 0x%p", _index, self]; return; } root = initLListElement(_objects[0], NULL); root->count = _count; NSMapInsert(self->table, _key, root); } else { if (!(_index < root->count)) { [NSException raise:NSRangeException format:@"index %d out of range in map 0x%p length %d", _index, self, root->count]; return; } root->count += _count; if (_index == 0) { element = initLListElement(_objects[0],NULL); object = element->object; element->next = root->next; element->object = root->object; root->object = object; root->next = element; } else { while (--_index) root = root->next; element = initLListElement(_objects[0], NULL); element->next = root->next; root->next = element; root = root->next; } } for (i = 1; i < _count; i++) { checkForAddErrorMessage(self, _objects[i], _key); element = initLListElement(_objects[i], NULL); element->next = root->next; root->next = element; root = element; } } /* adding objects */ - (void)addObjects:(id*)_objects count:(NSUInteger)_count forKey:(id)_key { LList *root = NULL; LList *element = NULL; unsigned i = 0; if (_count == 0) return; checkForAddErrorMessage(self, _objects[0],_key); if ((root = [self __structForKey:_key]) == NULL) { root = initLListElement(_objects[0], NULL); root->count = _count; root->last = root; NSMapInsert(self->table, _key, root); } else { root->count += _count; element = initLListElement(_objects[0], NULL); root->last->next = element; root->last = element; } for (i = 1; i < _count; i++) { checkForAddErrorMessage(self, _objects[i], _key); element = initLListElement(_objects[i], NULL); root->last->next = element; root->last = element; } } - (void)addObject:(id)_object forKey:(id)_key { checkForAddErrorMessage(self, _object,_key); [self addObjects:&_object count:1 forKey:_key]; } - (void)addObjects:(NSArray *)_objects forKey:(id)_key { id *objects = NULL; int i = 0; int cntI = 0; cntI = [_objects count]; objects = malloc((cntI + 1) * sizeof(id)); for (i = 0 ; i < cntI; i++) objects[i] = [_objects objectAtIndex:i]; [self addObjects:objects count:cntI forKey:_key]; free(objects); } /* setting objects */ - (void)setObject:(id)_object forKey:(id)_key { checkForAddErrorMessage(self, _object, _key); [self removeAllObjectsForKey:_key]; [self addObjects:&_object count:1 forKey:_key]; } - (void)setObjects:(NSArray *)_objects forKey:(id)_key { checkForAddErrorMessage(self, _objects, _key); [self removeAllObjectsForKey:_key]; [self addObjects:_objects forKey:_key]; } /* removing objects */ - (void)removeAllObjects { [self __removeAllObjects]; } - (void)removeAllObjectsForKey:(id)_key { [self __removeAllObjectsForKey:_key]; } - (void)removeAllObjects:(id)_object forKey:(id)_key { LList *list = NULL; LList *root = NULL; LList *oldList = NULL; unsigned int cnt = 0; checkForRemoveErrorMessage(self, _object, _key); if (!(root = [self __structForKey:_key])) return; while ([root->object isEqual:_object]) { [root->object release]; if (root->next == NULL) { if (root) free(root); root = NULL; NSMapRemove(self->table,_key); break; } else { list = root->next; root->next = list->next; root->object = list->object; root->count--; if (list) free(list); list = NULL; } } if (root) { list = root; while (list->next) { oldList = list; list = list->next; if ([list->object isEqual:_object]) { cnt++; oldList->next = list->next; if (list) free(list); list = oldList; } } root->count -= cnt; } } - (void)removeAllObjectsForKeys:(NSArray *)_keyArray { register int index = 0; for (index = [_keyArray count]; index > 0;) [self removeAllObjectsForKey:[_keyArray objectAtIndex:--index]]; } @end /* NGMutableHashMap */ // ************************* Enumerators ****************** @implementation _NGHashMapKeyEnumerator - (id)initWithHashMap:(NGHashMap *)_hashMap { self->map = [_hashMap retain]; self->enumerator = [_hashMap __keyEnumerator]; return self; } - (void)dealloc { [self->map release]; [super dealloc]; } - (id)nextObject { id key, value; return NSNextMapEnumeratorPair(&self->enumerator,(void**)&key, (void**)&value) ? key : nil; } @end /* _NGHashMapKeyEnumerator */ @implementation _NGHashMapObjectEnumerator - (id)initWithHashMap:(NGHashMap *)_hashMap { self->keys = [[_hashMap keyEnumerator] retain]; self->hashMap = [_hashMap retain]; self->elements = nil; return self; } - (void)dealloc { [self->keys release]; [self->hashMap release]; [self->elements release]; [super dealloc]; } - (id)nextObject { id object; id key; if ((object = [self->elements nextObject])) return object; if ((key = [self->keys nextObject])) { ASSIGN(self->elements, [self->hashMap objectEnumeratorForKey:key]); object = [self->elements nextObject]; } return object; } @end /* _NGHashMapObjectEnumerator */ @implementation _NGHashMapObjectForKeyEnumerator - (id)initWithHashMap:(NGHashMap *)_hashMap andKey:(id)_key { element = [_hashMap __structForKey:_key]; self->map = [_hashMap retain]; return self; } - (void)dealloc { [self->map release]; [super dealloc]; } - (id)nextObject { id object; if (element == NULL) return nil; object = element->object; element = element->next; return object; } @end /* _NGHashMapObjectForKeyEnumerator */ SOPE/sope-core/NGExtensions/NGCustomFileManager.m0000644000000000000000000003377412242733417020575 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include "common.h" typedef struct { NSString *sourcePath; NSString *absolutePath; NSString *path; NGCustomFileManagerInfo *info; id fileManager; } NGCustomFMPath; @interface NGCustomFileManager(Helpers) - (NGCustomFMPath)_resolvePath:(NSString *)_path; - (BOOL)_boolDo:(SEL)_sel onPath:(NSString *)_path; - (BOOL)_boolDo:(SEL)_sel onPath:(NSString *)_path handler:(id)_handler; - (id)_do:(SEL)_sel onPath:(NSString *)_path; @end @implementation NGCustomFileManager /* customization */ - (NSString *)makeAbsolutePath:(NSString *)_path { if ([_path isAbsolutePath]) return _path; return [[self currentDirectoryPath] stringByAppendingPathComponent:_path]; } - (NGCustomFileManagerInfo *)fileManagerInfoForPath:(NSString *)_path { return nil; } /* common ops */ - (NGCustomFMPath)_resolvePath:(NSString *)_path { NGCustomFMPath p; p.sourcePath = _path; p.absolutePath = [self makeAbsolutePath:_path]; p.info = [self fileManagerInfoForPath:_path]; p.path = [p.info rewriteAbsolutePath:p.absolutePath]; p.fileManager = [p.info fileManager]; return p; } - (BOOL)_boolDo:(SEL)_sel onPath:(NSString *)_path { NGCustomFMPath p; BOOL (*op)(id,SEL,NSString *); if (_sel == NULL) return NO; p = [self _resolvePath:_path]; if ((_path = p.path) == nil) return NO; if ((op = (void *)[p.fileManager methodForSelector:_sel]) == NULL) return NO; return op(p.fileManager, _sel, _path); } - (BOOL)_boolDo:(SEL)_sel onPath:(NSString *)_path handler:(id)_handler { NGCustomFMPath p; BOOL (*op)(id,SEL,NSString *,id); if (_sel == NULL) return NO; p = [self _resolvePath:_path]; if ((_path = p.path) == nil) return NO; if ((op = (void *)[p.fileManager methodForSelector:_sel]) == NULL) return NO; return op(p.fileManager, _sel, _path, _handler); } - (id)_do:(SEL)_sel onPath:(NSString *)_path { NGCustomFMPath p; id (*op)(id,SEL,NSString *); if (_sel == NULL) return NO; p = [self _resolvePath:_path]; if ((_path = p.path) == nil) return NO; if ((op = (void *)[p.fileManager methodForSelector:_sel]) == NULL) return NO; return op(p.fileManager, _sel, _path); } /* directory operations */ - (BOOL)changeCurrentDirectoryPath:(NSString *)_path { BOOL isDir = NO; if ((_path = [self makeAbsolutePath:_path]) == nil) return NO; if (![self fileExistsAtPath:_path isDirectory:&isDir]) return NO; if (!isDir) return NO; ASSIGNCOPY(self->cwd, _path); return YES; } - (NSString *)currentDirectoryPath { return self->cwd; } - (BOOL)createDirectoryAtPath:(NSString *)_path attributes:(NSDictionary *)_ats { NGCustomFMPath p; p = [self _resolvePath:_path]; if (p.path == nil) return NO; return [p.fileManager createDirectoryAtPath:p.path attributes:_ats]; } /* file operations */ - (BOOL)copyPath:(NSString *)_s toPath:(NSString *)_d handler:(id)_handler { NGCustomFileManagerInfo *sinfo, *dinfo; if ((_s = [self makeAbsolutePath:_s]) == nil) return NO; if ((_d = [self makeAbsolutePath:_d]) == nil) return NO; if ((sinfo = [self fileManagerInfoForPath:_s]) == nil) return NO; if ((dinfo = [self fileManagerInfoForPath:_d]) == nil) return NO; _s = [sinfo rewriteAbsolutePath:_s]; _d = [dinfo rewriteAbsolutePath:_d]; if ([sinfo isEqual:dinfo]) /* same filemanager */ return [[sinfo fileManager] copyPath:_s toPath:_d handler:_handler]; /* operation between different filemanagers ... */ return NO; } - (BOOL)movePath:(NSString *)_s toPath:(NSString *)_d handler:(id)_handler { NGCustomFileManagerInfo *sinfo, *dinfo; if ((_s = [self makeAbsolutePath:_s]) == nil) return NO; if ((_d = [self makeAbsolutePath:_d]) == nil) return NO; if ((sinfo = [self fileManagerInfoForPath:_s]) == nil) return NO; if ((dinfo = [self fileManagerInfoForPath:_d]) == nil) return NO; _s = [sinfo rewriteAbsolutePath:_s]; _d = [dinfo rewriteAbsolutePath:_d]; if ([sinfo isEqual:dinfo]) /* same filemanager */ return [[sinfo fileManager] movePath:_s toPath:_d handler:_handler]; /* operation between different filemanagers ... */ return NO; } - (BOOL)linkPath:(NSString *)_s toPath:(NSString *)_d handler:(id)_handler { NGCustomFileManagerInfo *sinfo, *dinfo; if ((_s = [self makeAbsolutePath:_s]) == nil) return NO; if ((_d = [self makeAbsolutePath:_d]) == nil) return NO; if ((sinfo = [self fileManagerInfoForPath:_s]) == nil) return NO; if ((dinfo = [self fileManagerInfoForPath:_d]) == nil) return NO; _s = [sinfo rewriteAbsolutePath:_s]; _d = [dinfo rewriteAbsolutePath:_d]; if ([sinfo isEqual:dinfo]) /* same filemanager */ return [[sinfo fileManager] linkPath:_s toPath:_d handler:_handler]; /* operation between different filemanagers ... */ return NO; } - (BOOL)removeFileAtPath:(NSString *)_path handler:(id)_handler { return [self _boolDo:_cmd onPath:_path handler:_handler]; } - (BOOL)createFileAtPath:(NSString *)_path contents:(NSData *)_contents attributes:(NSDictionary *)_attributes { NGCustomFMPath p; p = [self _resolvePath:_path]; if (p.path == nil) return NO; return [p.fileManager createFileAtPath:p.path contents:_contents attributes:_attributes]; } /* getting and comparing file contents */ - (NSData *)contentsAtPath:(NSString *)_path { return [self _do:_cmd onPath:_path]; } - (BOOL)contentsEqualAtPath:(NSString *)_path1 andPath:(NSString *)_path2 { NGCustomFileManagerInfo *info1, *info2; if ((_path1 = [self makeAbsolutePath:_path1]) == nil) return NO; if ((_path2 = [self makeAbsolutePath:_path2]) == nil) return NO; if ((info1 = [self fileManagerInfoForPath:_path1]) == nil) return NO; if ((info2 = [self fileManagerInfoForPath:_path2]) == nil) return NO; _path1 = [info1 rewriteAbsolutePath:_path1]; _path2 = [info2 rewriteAbsolutePath:_path2]; if ([info1 isEqual:info2]) /* same filemanager */ return [[info1 fileManager] contentsEqualAtPath:_path1 andPath:_path2]; /* operation between different filemanagers ... */ return NO; } /* determining access to files */ - (BOOL)fileExistsAtPath:(NSString *)_path { return [self _boolDo:_cmd onPath:_path]; } - (BOOL)fileExistsAtPath:(NSString *)_path isDirectory:(BOOL *)_isDirectory { NGCustomFMPath p; p = [self _resolvePath:_path]; if (p.path == nil) return NO; return [p.fileManager fileExistsAtPath:p.path isDirectory:_isDirectory]; } - (BOOL)isReadableFileAtPath:(NSString *)_path { return [self _boolDo:_cmd onPath:_path]; } - (BOOL)isWritableFileAtPath:(NSString *)_path { return [self _boolDo:_cmd onPath:_path]; } - (BOOL)isExecutableFileAtPath:(NSString *)_path { return [self _boolDo:_cmd onPath:_path]; } - (BOOL)isDeletableFileAtPath:(NSString *)_path { return [self _boolDo:_cmd onPath:_path]; } /* Getting and setting attributes */ - (NSDictionary *)fileAttributesAtPath:(NSString *)_p traverseLink:(BOOL)_flag{ NGCustomFMPath p; p = [self _resolvePath:_p]; if (p.path == nil) return NO; /* special link handling required ??? */ return [p.fileManager fileAttributesAtPath:p.path traverseLink:_flag]; } - (NSDictionary *)fileSystemAttributesAtPath:(NSString *)_p { return [self _do:_cmd onPath:_p]; } - (BOOL)changeFileAttributes:(NSDictionary *)_attributes atPath:(NSString *)_p{ NGCustomFMPath p; p = [self _resolvePath:_p]; if (p.path == nil) return NO; return [p.fileManager changeFileAttributes:_attributes atPath:p.path]; } /* discovering directory contents */ - (NSArray *)directoryContentsAtPath:(NSString *)_path { /* this returns relative path's, can be passed back */ return [self _do:_cmd onPath:_path]; } - (NSDirectoryEnumerator *)enumeratorAtPath:(NSString *)_path { /* this needs to be wrapped ! */ return nil; } - (NSArray *)subpathsAtPath:(NSString *)_path { /* this returns relative path's, can be passed back */ return [self _do:_cmd onPath:_path]; } /* symbolic-link operations */ - (BOOL)createSymbolicLinkAtPath:(NSString *)_p pathContent:(NSString *)_dpath{ /* should that process the link-path somehow ??? */ NGCustomFMPath p; p = [self _resolvePath:_p]; if (p.path == nil) return NO; return [p.fileManager createSymbolicLinkAtPath:p.path pathContent:_dpath]; } - (NSString *)pathContentOfSymbolicLinkAtPath:(NSString *)_path { /* should that process the link-path somehow ??? */ return [self _do:_cmd onPath:_path]; } /* feature check */ - (BOOL)supportsVersioningAtPath:(NSString *)_path { return [self _boolDo:_cmd onPath:_path]; } - (BOOL)supportsLockingAtPath:(NSString *)_path { return [self _boolDo:_cmd onPath:_path]; } - (BOOL)supportsFolderDataSourceAtPath:(NSString *)_path { return [self _boolDo:_cmd onPath:_path]; } - (BOOL)supportsFeature:(NSString *)_featureURI atPath:(NSString *)_path { NGCustomFMPath p; p = [self _resolvePath:_path]; if (p.path == nil) return NO; return [p.fileManager supportsFeature:_featureURI atPath:p.path]; } /* writing */ - (BOOL)writeContents:(NSData *)_content atPath:(NSString *)_path { NGCustomFMPath p; p = [self _resolvePath:_path]; if (p.path == nil) return NO; return [p.fileManager writeContents:_content atPath:p.path]; } /* global-IDs */ - (EOGlobalID *)globalIDForPath:(NSString *)_path { NGCustomFileManagerInfo *info; if ((_path = [self makeAbsolutePath:_path]) == nil) return NO; if ((info = [self fileManagerInfoForPath:_path]) == nil) return NO; if (![info supportsGlobalIDs]) return nil; if ((_path = [info rewriteAbsolutePath:_path]) == nil) return NO; return [[info fileManager] globalIDForPath:_path]; } - (NSString *)pathForGlobalID:(EOGlobalID *)_gid { return nil; } /* trash */ - (BOOL)supportsTrashFolderAtPath:(NSString *)_path { return [self _boolDo:_cmd onPath:_path]; } - (NSString *)trashFolderForPath:(NSString *)_path { return NO; } @end /* NGCustomFileManager */ @implementation NGCustomFileManager(NGFileManagerVersioning) /* versioning */ - (BOOL)checkoutFileAtPath:(NSString *)_path handler:(id)_handler { return [self _boolDo:_cmd onPath:_path handler:_handler]; } - (BOOL)releaseFileAtPath:(NSString *)_path handler:(id)_handler { return [self _boolDo:_cmd onPath:_path handler:_handler]; } - (BOOL)rejectFileAtPath:(NSString *)_path handler:(id)_handler { return [self _boolDo:_cmd onPath:_path handler:_handler]; } - (BOOL)checkoutFileAtPath:(NSString *)_path version:(NSString *)_version handler:(id)_handler { NGCustomFMPath p; p = [self _resolvePath:_path]; if (p.path == nil) return NO; return [p.fileManager checkoutFileAtPath:p.path version:_version handler:_handler]; } /* versioning data */ - (NSString *)lastVersionAtPath:(NSString *)_path { return [self _do:_cmd onPath:_path]; } - (NSArray *)versionsAtPath:(NSString *)_path { return [self _do:_cmd onPath:_path]; } - (NSData *)contentsAtPath:(NSString *)_path version:(NSString *)_version { NGCustomFMPath p; p = [self _resolvePath:_path]; if (p.path == nil) return NO; return [p.fileManager contentsAtPath:p.path version:_version]; } - (NSDictionary *)fileAttributesAtPath:(NSString *)_path traverseLink:(BOOL)_followLink version:(NSString *)_version { NGCustomFMPath p; p = [self _resolvePath:_path]; if (p.path == nil) return NO; /* do something special to symlink ??? */ return [p.fileManager fileAttributesAtPath:p.path traverseLink:_followLink version:_version]; } @end /* NGCustomFileManager(NGFileManagerVersioning) */ @implementation NGCustomFileManager(NGFileManagerLocking) - (BOOL)lockFileAtPath:(NSString *)_path handler:(id)_handler { return [self _boolDo:_cmd onPath:_path handler:_handler]; } - (BOOL)unlockFileAtPath:(NSString *)_path handler:(id)_handler { return [self _boolDo:_cmd onPath:_path handler:_handler]; } - (BOOL)isFileLockedAtPath:(NSString *)_path { return [self _boolDo:_cmd onPath:_path]; } /* access rights */ - (BOOL)isLockableFileAtPath:(NSString *)_path { return [self _boolDo:_cmd onPath:_path]; } - (BOOL)isUnlockableFileAtPath:(NSString *)_path { return [self _boolDo:_cmd onPath:_path]; } @end /* NGCustomFileManager(NGFileManagerLocking) */ @implementation NGCustomFileManager(NGFileManagerDataSources) /* datasources (work on folders) */ - (EODataSource *)dataSourceAtPath:(NSString *)_path { return [self _do:_cmd onPath:_path]; } - (EODataSource *)dataSource { return [self dataSourceAtPath:[self currentDirectoryPath]]; } @end /* NGCustomFileManager(NGFileManagerDataSources) */ @implementation NGCustomFileManagerInfo - (id)initWithCustomFileManager:(NGCustomFileManager *)_master fileManager:(id)_fm { self->master = _master; self->fileManager = [_fm retain]; return self; } - (id)init { return [self initWithCustomFileManager:nil fileManager:nil]; } - (void)dealloc { [self->fileManager release]; [super dealloc]; } - (void)resetMaster { self->master = nil; } /* accessors */ - (NGCustomFileManager *)master { return self->master; } - (id)fileManager { return self->fileManager; } /* operations */ - (NSString *)rewriteAbsolutePath:(NSString *)_path { return _path; } /* capabilities */ - (BOOL)supportsGlobalIDs { return [self->fileManager respondsToSelector:@selector(globalIDForPath:)]; } @end /* NGCustomFileManagerInfo */ SOPE/sope-core/NGExtensions/NGStack.m0000644000000000000000000001626112242733417016265 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "common.h" #include "NGStack.h" #include "NGMemoryAllocation.h" @interface _NGConcreteStackEnumerator : NSEnumerator { NGStack *stack; // for retain id *trace; unsigned toGo; BOOL downWard; // top=>down } - (id)initWithStack:(NGStack *)_stack trace:(id *)_ptr count:(int)_size topDown:(BOOL)_downWard; - (id)nextObject; @end @implementation NGStack + (id)stackWithCapacity:(NSUInteger)_capacity { return [[[self alloc] initWithCapacity:_capacity] autorelease]; } + (id)stack { return [[[self alloc] init] autorelease]; } + (id)stackWithArray:(NSArray *)_array { return [[[self alloc] initWithArray:_array] autorelease]; } - (id)init { return [self initWithCapacity:256]; } - (id)initWithCapacity:(NSUInteger)_capacity { if ((self = [super init])) { stackPointer = 0; capacity = (_capacity > 0) ? _capacity : 16; stack = NGMalloc(sizeof(id) * capacity); } return self; } - (id)initWithArray:(NSArray *)_array { register unsigned int count = [_array count]; if ((self = [self initWithCapacity:(count + 1)])) { unsigned cnt; for (cnt = 0; cnt < count; cnt++) [self push:[_array objectAtIndex:cnt]]; } return self; } - (void)dealloc { if (self->stack) { [self clear]; NGFree(self->stack); } [super dealloc]; } /* sizing */ - (void)_increaseStack { if (capacity > 256) capacity += 256; else capacity *= 2; stack = NGRealloc(stack, sizeof(id) * capacity); } /* state */ - (NSUInteger)capacity { return capacity; } - (NSUInteger)stackPointer { return stackPointer; } - (NSUInteger)count { return stackPointer; } - (BOOL)isEmpty { return (stackPointer == 0); } /* operations */ - (void)push:(id)_obj { stackPointer++; if (stackPointer >= capacity) [self _increaseStack]; stack[stackPointer] = [_obj retain]; } - (id)pop { id obj = stack[stackPointer]; if (stackPointer <= 0) { [[[NGStackException alloc] initWithName:@"StackException" reason:@"tried to pop an object from an empty stack !" userInfo:nil] raise]; } stack[stackPointer] = nil; stackPointer--; return [obj autorelease]; } - (void)clear { unsigned cnt; for (cnt = 1; cnt <= stackPointer; cnt++) { #if !LIB_FOUNDATION_BOEHM_GC [stack[cnt] release]; #endif stack[cnt] = nil; } stackPointer = 0; } /* elements */ - (id)elementAtTop { return (stackPointer == 0) ? nil : stack[stackPointer]; } - (id)elementAtBottom { return (stackPointer == 0) ? nil : stack[1]; } - (NSEnumerator *)topDownEnumerator { if (stackPointer == 0) return nil; return [[[_NGConcreteStackEnumerator alloc] initWithStack:self trace:&(stack[stackPointer]) count:stackPointer topDown:YES] autorelease]; } - (NSEnumerator *)bottomUpEnumerator { if (stackPointer == 0) return nil; return [[[_NGConcreteStackEnumerator alloc] initWithStack:self trace:&(stack[1]) count:stackPointer topDown:NO] autorelease]; } /* NSCoding */ - (Class)classForCoder { return [NGStack class]; } - (void)encodeWithCoder:(NSCoder *)_encoder { unsigned cnt; [_encoder encodeValueOfObjCType:@encode(NSUInteger) at:&capacity]; [_encoder encodeValueOfObjCType:@encode(NSUInteger) at:&stackPointer]; for (cnt = 1; cnt <= stackPointer; cnt++) { id obj = stack[cnt]; [_encoder encodeObject:obj]; } } - (id)initWithCoder:(NSCoder *)_decoder { int tmpCapacity; int tmpStackPointer; [_decoder decodeValueOfObjCType:@encode(NSUInteger) at:&tmpCapacity]; [_decoder decodeValueOfObjCType:@encode(NSUInteger) at:&tmpStackPointer]; self = [self initWithCapacity:tmpCapacity]; { register int cnt; for (cnt = 1; cnt <= tmpStackPointer; cnt++) { id obj = [_decoder decodeObject]; stack[cnt] = [obj retain]; } stackPointer = tmpStackPointer; } return self; } /* copying */ - (id)copyWithZone:(NSZone *)_zone { register NGStack *newStack = nil; register unsigned cnt; newStack = [[NGStack allocWithZone:(_zone ? _zone : NSDefaultMallocZone())] initWithCapacity:[self stackPointer]]; for (cnt = 1; cnt <= stackPointer; cnt++) [newStack push:stack[cnt]]; return newStack; } /* description */ - (NSString *)description { return [NSString stringWithFormat: @"<%@[0x%p] capacity=%u SP=%u count=%u content=%s>", NSStringFromClass([self class]), self, [self capacity], [self stackPointer], [self count], [[[self toArray] description] cString]]; } - (NSArray *)toArray { register NSMutableArray *array = nil; register unsigned cnt; array = [[NSMutableArray alloc] initWithCapacity:stackPointer]; for (cnt = 1; cnt <= stackPointer; cnt++) [array addObject:stack[cnt]]; return [array autorelease]; } @end /* NGStack */ @implementation _NGConcreteStackEnumerator - (id)initWithStack:(NGStack *)_stack trace:(id *)_ptr count:(int)_size topDown:(BOOL)_downWard { stack = [_stack retain]; trace = _ptr; toGo = _size; downWard = _downWard; return self; } - (void)dealloc { [self->stack release]; trace = NULL; [super dealloc]; } - (id)nextObject { id result = nil; if (toGo == 0) return nil; toGo--; result = *trace; if (downWard) trace--; // top=>bottom (downward) else trace++; // bottom=>top (upward) return result; } @end /* NGStack */ @implementation NGStackException @end /* NGStackException */ @implementation NSMutableArray(StackImp) /* state */ - (NSUInteger)stackPointer { return ([self count] - 1); } - (BOOL)isEmpty { return ([self count] == 0) ? YES : NO; } /* operations */ - (void)push:(id)_obj { [self addObject:_obj]; } - (id)pop { unsigned lastIdx = ([self count] - 1); if (lastIdx >= 0) { id element = [self objectAtIndex:lastIdx]; [self removeObjectAtIndex:lastIdx]; return element; } else { [[[NGStackException alloc] initWithName:@"StackException" reason:@"tried to pop an object from an empty stack !" userInfo:nil] raise]; return nil; } } - (void)clear { [self removeAllObjects]; } /* elements */ - (id)elementAtTop { return [self lastObject]; } - (NSEnumerator *)topDownEnumerator { return [self reverseObjectEnumerator]; } - (NSEnumerator *)bottomUpEnumerator { return [self objectEnumerator]; } @end /* NSMutableArray(NGStack) */ void __link_NGExtensions_NGStack() { __link_NGExtensions_NGStack(); } SOPE/sope-core/NGExtensions/NGDirectoryEnumerator.m0000644000000000000000000001754712242733417021236 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NGDirectoryEnumerator.h" #import #include "common.h" @interface NGDirectoryEnumerator(PrivateMethods) - (void)recurseIntoDirectory:(NSString *)_path relativeName:(NSString *)_name; - (void)backtrack; - (void)findNextFile; @end @interface NGDirEntry : NSObject { @public id fileManager; NSString *path; NSEnumerator *e; } - (id)initWithFileManager:(id)_fm path:(NSString *)_path; - (NSString *)readdir; @end @implementation NGDirectoryEnumerator - (id)initWithFileManager:(id)_fm directoryPath:(NSString *)_path recurseIntoSubdirectories:(BOOL)_recurse followSymlinks:(BOOL)_follow prefixFiles:(BOOL)_prefix { self->fileManager = _fm ? [_fm retain] : [[NSFileManager defaultManager] retain]; self->pathStack = [[NSMutableArray alloc] init]; self->enumStack = [[NSMutableArray alloc] init]; self->flags.isRecursive = _recurse; self->flags.isFollowing = _follow; self->topPath = [_path copy]; [self recurseIntoDirectory:_path relativeName:@""]; return self; } - (id)initWithDirectoryPath:(NSString *)_path recurseIntoSubdirectories:(BOOL)_recurse followSymlinks:(BOOL)_follow prefixFiles:(BOOL)_prefix { return [self initWithFileManager:nil directoryPath:_path recurseIntoSubdirectories:_recurse followSymlinks:_follow prefixFiles:_prefix]; } - (id)initWithFileManager:(id)_fm { return [self initWithFileManager:_fm directoryPath:@"/" recurseIntoSubdirectories:YES followSymlinks:NO prefixFiles:YES]; } - (id)initWithFileManager:(id)_fm directoryPath:(NSString *)_path { return [self initWithFileManager:_fm directoryPath:_path recurseIntoSubdirectories:YES followSymlinks:NO prefixFiles:YES]; } - (void)dealloc { while ([self->pathStack count]) [self backtrack]; [self->pathStack release]; [self->enumStack release]; [self->currentFileName release]; [self->currentFilePath release]; [self->topPath release]; [super dealloc]; } /* accessors */ - (id)fileManager { return self->fileManager; } /* operations */ - (NSDictionary *)directoryAttributes { return [self->fileManager fileAttributesAtPath:self->topPath traverseLink:self->flags.isFollowing]; } - (NSDictionary *)fileAttributes { return [self->fileManager fileAttributesAtPath:self->currentFilePath traverseLink:self->flags.isFollowing]; } - (void)skipDescendents { if ([self->pathStack count]) [self backtrack]; } /* enumerator */ - (id)nextObject { [self findNextFile]; return self->currentFileName; } /* internals */ - (void)recurseIntoDirectory:(NSString *)_path relativeName:(NSString *)name { /* recurses into directory `path' - pushes relative path (relative to root of search) on pathStack - pushes system dir enumerator on enumPath */ NGDirEntry *dir; //NSLog(@"RECURSE INTO: %@", _path); dir = [[NGDirEntry alloc] initWithFileManager:self->fileManager path:_path]; if (dir) { [pathStack addObject:name]; [enumStack addObject:dir]; } } - (void)backtrack { /* backtracks enumeration to the previous dir - pops current dir relative path from pathStack - pops system dir enumerator from enumStack - sets currentFile* to nil */ //NSLog(@"BACKTRACK: %@", [self->pathStack lastObject]); [self->enumStack removeLastObject]; [self->pathStack removeLastObject]; [self->currentFileName release]; self->currentFileName = nil; [self->currentFilePath release]; self->currentFilePath = nil; } - (void)findNextFile { /* finds the next file according to the top enumerator - if there is a next file it is put in currentFile - if the current file is a directory and if isRecursive calls recurseIntoDirectory:currentFile - if the current file is a symlink to a directory and if isRecursive and isFollowing calls recurseIntoDirectory:currentFile - if at end of current directory pops stack and attempts to find the next entry in the parent - sets currentFile to nil if there are no more files to enumerate */ NGDirEntry *dir; [self->currentFileName release]; self->currentFileName = nil; [self->currentFilePath release]; self->currentFilePath = nil; while ([self->pathStack count]) { NSString *dname; NSString *dtype; dir = [enumStack lastObject]; if ((dname = [dir readdir]) == nil) { /* If we reached the end of this directory, go back to the upper one */ [self backtrack]; continue; } /* Skip "." and ".." directory entries */ if ([dname isEqualToString:@"."]) continue; if ([dname isEqualToString:@".."]) continue; /* Name of current file */ self->currentFileName = [[[pathStack lastObject] stringByAppendingPathComponent:dname] copy]; /* Full path of current file */ self->currentFilePath = [[self->topPath stringByAppendingPathComponent:self->currentFileName] copy]; dtype = [[self->fileManager fileAttributesAtPath:self->currentFilePath traverseLink:self->flags.isFollowing] objectForKey:NSFileType]; // do not follow links if (!flags.isFollowing) { if ([dtype isEqualToString:NSFileTypeSymbolicLink]) /* if link then return it as link */ break; } /* Follow links - check for directory */ if ([dtype isEqualToString:NSFileTypeDirectory] && self->flags.isRecursive) { [self recurseIntoDirectory:self->currentFilePath relativeName:self->currentFileName]; } break; } } - (NSString *)description { NSMutableString *ms; ms = [NSMutableString stringWithCapacity:128]; [ms appendFormat:@"<%@[0x%p]: ", NSStringFromClass([self class]), self]; [ms appendFormat:@" dir='%@'", self->topPath]; [ms appendFormat:@" cname='%@'", self->currentFileName]; [ms appendFormat:@" cpath='%@'", self->currentFilePath]; [ms appendString:@">"]; return ms; } @end /* NGDirectoryEnumerator */ @implementation NGDirEntry - (id)initWithFileManager:(id)_fm path:(NSString *)_p{ self->fileManager = [_fm retain]; self->path = [_p copy]; return self; } - (void)dealloc { [self->e release]; [self->path release]; [self->fileManager release]; [super dealloc]; } /* operations */ - (NSString *)readdir { NSString *s; if (self->e == nil) { self->e = [[[self->fileManager directoryContentsAtPath:self->path] sortedArrayUsingSelector: @selector(compare:)] objectEnumerator]; self->e = [self->e retain]; } s = [self->e nextObject]; // [self logWithFormat:@"readdir: %@", s]; return s; } @end /* NGDirEntry */ SOPE/sope-core/NGExtensions/FdExt.subproj/0000755000000000000000000000000012242733417017304 5ustar rootrootSOPE/sope-core/NGExtensions/FdExt.subproj/NSNull+misc.m0000644000000000000000000001425312242733417021571 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NSNull+misc.h" #include "common.h" #if LIB_FOUNDATION_LIBRARY || GNUSTEP_BASE_LIBRARY #if __GNU_LIBOBJC__ >= 20100911 # include #else # include # include # include #endif # ifndef GNUSTEP # import # endif #else # import #endif @implementation NSNull(misc) static int _doAbort = -1; static inline BOOL doAbort(void) { if (_doAbort == -1) { _doAbort = [[NSUserDefaults standardUserDefaults] boolForKey:@"NSNullAbortOnMessage"] ? 1 : 0; } return _doAbort ? YES : NO; } - (BOOL)isNotNull { return NO; } - (BOOL)isNotEmpty { return NO; } - (BOOL)isNull { #if DEBUG NSLog(@"WARNING(%s): called deprecated -isNull on NSNull (use -isNotNull) !", __PRETTY_FUNCTION__); if (doAbort()) abort(); #endif return YES; } - (NSString *)stringValue { #if DEBUG && 0 NSLog(@"WARNING(%s): " @"NSNull -stringValue returns empty string.", __PRETTY_FUNCTION__); if (doAbort()) abort(); #endif return @""; } - (double)doubleValue { #if DEBUG && 0 NSLog(@"WARNING(%s): " @"NSNull -doubleValue returns 0.0.", __PRETTY_FUNCTION__); if (doAbort()) abort(); #endif return 0.0; } - (unsigned int)length { #if DEBUG NSLog(@"WARNING(%s): " @"called NSNull -length (returns 0) !!!", __PRETTY_FUNCTION__); if (doAbort()) abort(); #endif return 0; } - (unsigned int)count { #if DEBUG NSLog(@"WARNING(%s): " @"called NSNull -count (returns 0) !!!", __PRETTY_FUNCTION__); if (doAbort()) abort(); #endif return 0; } - (BOOL)isEqualToString:(NSString *)_s { /* Note: I think we can keep this as a regular method */ return _s == (id)self || _s == nil ? YES : NO; } - (BOOL)hasPrefix:(NSString *)_s { /* Note: I think we can keep this as a regular method */ return _s == (id)self || _s == nil ? YES : NO; } - (BOOL)hasSuffix:(NSString *)_s { /* Note: I think we can keep this as a regular method */ return _s == (id)self || _s == nil ? YES : NO; } - (unichar)characterAtIndex:(unsigned int)_idx { #if DEBUG NSLog(@"WARNING(%s): " @"called NSNull -characterAtIndex:%d - returning 0!", __PRETTY_FUNCTION__, _idx); if (doAbort()) abort(); #endif return 0; } /* key-value coding */ - (void)takeValue:(id)_value forKey:(NSString *)_key { /* do nothing */ } - (id)valueForKey:(NSString *)_key { if ([_key isEqualToString:@"isNotNull"]) { static NSNumber *noNum = nil; if (noNum == nil) noNum = [NSNumber numberWithBool:NO]; return noNum; } if ([_key isEqualToString:@"isNull"]) { static NSNumber *yesNum = nil; if (yesNum == nil) yesNum = [NSNumber numberWithBool:YES]; return yesNum; } /* do nothing */ return nil; } /* forwarding ... */ #if !GNU_RUNTIME - (BOOL)respondsToSelector:(SEL)_sel { /* fake that we have a selector */ return YES; } - (NSString *)descriptionWithLocale:(id)_locale indent:(int)_indent { return @""; } - (NSString *)descriptionWithLocale:(id)_locale { return @""; } #endif - (void)forwardInvocation:(NSInvocation *)_invocation { NSMethodSignature *sig; NSLog(@"ERROR(%s): called selector %@ on NSNull !", __PRETTY_FUNCTION__, NSStringFromSelector([_invocation selector])); if (doAbort()) abort(); if ((sig = [_invocation methodSignature])) { const char *ret; if ((ret = [sig methodReturnType])) { switch (*ret) { case _C_INT: { int v = 0; [_invocation setReturnValue:&v]; break; } case _C_UINT: { unsigned int v = 0; [_invocation setReturnValue:&v]; break; } case _C_ID: case _C_CLASS: { id v = nil; [_invocation setReturnValue:&v]; break; } default: NSLog(@" didn't set return value for type '%s'", ret); break; } } else NSLog(@" no method return type in signature %@", sig); } else NSLog(@" no method signature in invocation %@", _invocation); } @end /* NSNull(misc) */ @implementation NSObject(NSNullMisc) - (BOOL)isNotNull { return YES; } - (BOOL)isNotEmpty { return [self isNotNull]; } - (BOOL)isNull { #if DEBUG NSLog(@"%s: WARNING, called -isNull on NSObject (use -isNotNull) !", __PRETTY_FUNCTION__); #endif return NO; } @end /* NSObject(NSNullMisc) */ @implementation NSString(NSNullMisc) - (BOOL)isNotEmpty { unsigned i, len; if ((len = [self length]) == 0) return NO; // TODO: just check the first char for performance ... // But: a single space should be treated as emtpy, since this is very common // in SQL (Sybase in special) for (i = 0; i < len; i++) { if (!isspace([self characterAtIndex:i])) return YES; } return NO; } @end /* NSString(NSNullMisc) */ @implementation NSArray(NSNullMisc) - (BOOL)isNotEmpty { return [self count] == 0 ? NO : YES; } @end /* NSArray(NSNullMisc) */ @implementation NSSet(NSNullMisc) - (BOOL)isNotEmpty { return [self count] == 0 ? NO : YES; } @end /* NSSet(NSNullMisc) */ @implementation NSDictionary(NSNullMisc) - (BOOL)isNotEmpty { return [self count] == 0 ? NO : YES; } @end /* NSDictionary(NSNullMisc) */ @implementation NSData(NSNullMisc) - (BOOL)isNotEmpty { return [self length] == 0 ? NO : YES; } @end /* NSData(NSNullMisc) */ SOPE/sope-core/NGExtensions/FdExt.subproj/NSCalendarDate+matrix.m0000644000000000000000000000672612242733417023545 0ustar rootroot/* Copyright (C) 2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NSCalendarDate+misc.h" #include "common.h" @implementation NSCalendarDate(CalMatrix) static BOOL debugCalMatrix = NO; - (NSArray *)calendarMatrixWithStartDayOfWeek:(short)_caldow onlyCurrentMonth:(BOOL)_onlyThisMonth { // Note: we keep clock time! NSAutoreleasePool *pool; NSCalendarDate *firstInMonth; NSArray *matrix; NSArray *weeks[8] = { nil, nil, nil, nil, nil, nil, nil, nil }; NSCalendarDate *week[8] = { nil, nil, nil, nil, nil, nil, nil, nil }; unsigned firstDoW, numDaysInLastMonth, i, j, curday, curweek, curmonth; /* all the date operations use autorelease, so we wrap it in a pool */ pool = [[NSAutoreleasePool alloc] init]; if (debugCalMatrix) NSLog(@"calmatrix for: %@", self); firstInMonth = [[self firstDayOfMonth] beginOfDay]; firstDoW = [firstInMonth dayOfWeek]; curmonth = [firstInMonth monthOfYear]; numDaysInLastMonth = (firstDoW < _caldow) ? (firstDoW + 7 - _caldow) : (firstDoW - _caldow); if (debugCalMatrix) { NSLog(@" LAST: %d FIRST-DOW: %d START-DOW: %d", numDaysInLastMonth, firstDoW, _caldow); } /* first week */ if (_onlyThisMonth) { j = 0; /* this is the position where first week days are added */ } else { /* add dates from last month */ for (i = numDaysInLastMonth; i > 0; i--) { week[numDaysInLastMonth - i] = [firstInMonth dateByAddingYears:0 months:0 days:-i]; } j = numDaysInLastMonth; } week[j] = firstInMonth; j++; for (i = numDaysInLastMonth + 1; i < 7; i++, j++) { week[j] = [firstInMonth dateByAddingYears:0 months:0 days:(i - numDaysInLastMonth)]; } curday = 7 - numDaysInLastMonth; curweek = 1; if (debugCalMatrix) NSLog(@" current day after 1st week: %d, week: %d", curday, curweek); /* finish first week */ weeks[0] = [[NSArray alloc] initWithObjects:week count:j]; /* follow up weeks */ while (curweek < 7) { BOOL foundNewMonth = NO; for (i = 0; i < 7; i++, curday++) { week[i] = [firstInMonth dateByAddingYears:0 months:0 days:curday]; if (!foundNewMonth && curday > 27) { foundNewMonth = ([week[i] monthOfYear] != curmonth) ? YES : NO; if (foundNewMonth && _onlyThisMonth) break; } } if (i > 0) { weeks[curweek] = [[NSArray alloc] initWithObjects:week count:i]; curweek++; } if (foundNewMonth) break; } /* build final matrix */ matrix = [[NSArray alloc] initWithObjects:weeks count:curweek]; for (i = 0; i < 8; i++) { [weeks[i] release]; weeks[i] = nil; } if (debugCalMatrix) NSLog(@"matrix for %@: %@", self, matrix); [pool release]; return [matrix autorelease]; } @end /* NSCalendarDate(CalMatrix) */ SOPE/sope-core/NGExtensions/FdExt.subproj/NSException+misc.m0000644000000000000000000000533312242733417022614 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NSException+misc.h" #import #include "common.h" @implementation NSObject(NSExceptionNGMiscellaneous) - (BOOL)isException { return NO; } - (BOOL)isExceptionOrNull { return NO; } @end /* NSObject(NSExceptionNGMiscellaneous) */ @implementation NSNull(NSExceptionNGMiscellaneous) - (BOOL)isException { return NO; } - (BOOL)isExceptionOrNull { return YES; } @end /* NSNull(NSExceptionNGMiscellaneous) */ @implementation NSException(NGMiscellaneous) - (BOOL)isException { return YES; } - (BOOL)isExceptionOrNull { return YES; } - (id)initWithReason:(NSString *)_reason { return [self initWithReason:_reason userInfo:nil]; } - (id)initWithReason:(NSString *)_reason userInfo:(id)_userInfo { return [self initWithName:NSStringFromClass([self class]) reason:_reason userInfo:_userInfo]; } - (id)initWithFormat:(NSString *)_format,... { NSString *tmp = nil; va_list ap; if (_format == nil) NSLog(@"ERROR(%s): missing format!", __PRETTY_FUNCTION__); va_start(ap, _format); tmp = [[NSString alloc] initWithFormat: _format ? _format : (NSString *)@"Exception" arguments:ap]; va_end(ap); self = [self initWithReason:tmp userInfo:nil]; [tmp release]; tmp = nil; return self; } /* NSCopying */ - (id)copyWithZone:(NSZone *)_zone { // TODO: should make a real copy? return [self retain]; } @end /* NSException(NGMiscellaneous) */ #if COCOA_Foundation_LIBRARY || NeXT_Foundation_LIBRARY @implementation NSException (NGLibFoundationCompatibility) - (void)setReason:(NSString *)_reason { [_reason retain]; [self->reason release]; self->reason = _reason; } @end #elif GNUSTEP_BASE_LIBRARY @implementation NSException (NGLibFoundationCompatibility) - (void)setReason:(NSString *)_reason { [_reason retain]; [self->_e_reason release]; self->_e_reason = _reason; } @end #endif void __link_NGExtensions_NSExceptionMisc() { __link_NGExtensions_NSExceptionMisc(); } SOPE/sope-core/NGExtensions/FdExt.subproj/NSAutoreleasePool+misc.m0000644000000000000000000000760412242733417023764 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import "common.h" #import "NSAutoreleasePool+misc.h" #if defined(LIB_FOUNDATION_LIBRARY) BOOL __autoreleaseEnableRetainRemove = NO; #if !LIB_FOUNDATION_BOEHM_GC @implementation NSAutoreleasePool(misc) // retain/remove check + (void)enableRetainRemove:(BOOL)enable { __autoreleaseEnableRetainRemove = enable; } + (NSAutoreleasePool *)findReleasingPoolForObject:(id)_obj { NSAutoreleasePool *pool = nil; for (pool = [self defaultPool]; pool; pool = pool->parentPool) { NSAutoreleasePoolChunk *ch; int i; for (ch = pool->firstChunk; ch; ch = ch->next) { for (i = 0; i < ch->used; i++) { if (ch->objects[i] == _obj) return pool; } } //if ([pool doesReleaseObject:_obj]) // return pool; } return nil; } + (BOOL)retainAutoreleasedObject:(id)_obj { register NSAutoreleasePool *pool = nil; for (pool = [self defaultPool]; pool; pool = pool->parentPool) { register NSAutoreleasePoolChunk *ch; register int i; for (ch = pool->firstChunk; ch; ch = ch->next) { for (i = 0; i < ch->used; i++) { if (ch->objects[i] == _obj) { ch->objects[i] = nil; return YES; } } } //if ([pool doesReleaseObject:_obj]) // return pool; } return NO; } - (BOOL)retainAutoreleasedObject:(id)_obj { NSAutoreleasePoolChunk *ch; int i; for (ch = firstChunk; ch; ch = ch->next) { for (i = 0; i < ch->used; i++) { if (ch->objects[i] == _obj) { ch->objects[i] = nil; return YES; } } } return NO; } @end @implementation NSObject(RC) - (oneway void)release { #if BUILD_libFoundation_DLL && defined(__WIN32__) extern __declspec(dllimport) BOOL __autoreleaseEnableCheck; #else extern BOOL __autoreleaseEnableCheck; #endif // check if retainCount is Ok if (__autoreleaseEnableCheck) { unsigned int toCome = [NSAutoreleasePool autoreleaseCountForObject:self]; if (toCome + 1 > [self retainCount]) { NSLog(@"Release[0x%p<%@>] release check for object %@ " @"has %d references " @"and %d pending calls to release in autorelease pools\n", self, NSStringFromClass([self class]), self, [self retainCount], toCome); NSLog(@" description='%@'", [self description]); abort(); // core dump for debugging return; } } if (NSExtraRefCount(self) == 1) [self dealloc]; else NSDecrementExtraRefCountWasZero(self); } - (id)retain { extern BOOL __autoreleaseEnableRetainRemove; if (__autoreleaseEnableRetainRemove) { if ([NSAutoreleasePool retainAutoreleasedObject:self]) { NSLog(@"retained autoreleased object .."); return self; } } NSIncrementExtraRefCount(self); return self; } @end #endif // !LIB_FOUNDATION_BOEHM_GC #endif // defined(LIB_FOUNDATION_LIBRARY) void __link_NSAutoreleasePool_misc(void) { __link_NSAutoreleasePool_misc(); } SOPE/sope-core/NGExtensions/FdExt.subproj/NSString+misc.m0000644000000000000000000002107612242733417022126 0ustar rootroot/* Copyright (C) 2000-2008 SKYRIX Software AG Copyright (C) 2006-2008 Helge Hess This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NSString+misc.h" #include "common.h" @interface NSStringVariableBindingException : NSException @end @implementation NSStringVariableBindingException @end @implementation NSObject(StringBindings) - (NSString *)valueForStringBinding:(NSString *)_key { if (_key == nil) return nil; return [[self valueForKeyPath:_key] stringValue]; } @end /* NSObject(StringBindings) */ @implementation NSString(misc) - (NSSet *)bindingVariables { unsigned len, pos = 0; unichar *wbuf = NULL; NSMutableSet *result = nil; result = [NSMutableSet setWithCapacity:16]; len = [self length]; wbuf = malloc(sizeof(unichar) * (len + 4)); [self getCharacters:wbuf]; while (pos < len) { unsigned startPos; if (pos + 1 == len) { /* last entry */ if (wbuf[pos] == '$') { /* found $ without end-char */ [[[NSStringVariableBindingException alloc] initWithFormat:@"did not find end of variable for string %@", self] raise]; } break; } if (wbuf[pos] != '$') { pos++; continue; } if (wbuf[pos + 1] == '$') { /* found $$ --> ignore*/ pos += 2; continue; } /* process binding */ startPos = pos; pos += 2; /* wbuf[pos + 1] != '$' */ while (pos < len) { if (wbuf[pos] != '$') pos++; else break; } if (pos == len) { /* end of string was reached */ [[[NSStringVariableBindingException alloc] initWithFormat:@"did not find end of variable for string %@", self] raise]; } else { NSString *key = nil; key = [[NSString alloc] initWithCharacters:(unichar *)wbuf + startPos + 1 length:(pos - startPos - 1)]; [result addObject:key]; [key release]; } pos++; } if (wbuf != NULL) { free(wbuf); wbuf = NULL; } return [[result copy] autorelease]; } - (NSString *)stringByReplacingVariablesWithBindings:(id)_bindings stringForUnknownBindings:(NSString *)_unknown { unsigned len, pos = 0; unichar *wbuf = NULL; NSMutableString *str = nil; str = [self mutableCopy]; len = [str length]; wbuf = malloc(sizeof(unichar) * (len + 4)); [self getCharacters:wbuf]; while (pos < len) { if (pos + 1 == len) { /* last entry */ if (wbuf[pos] == '$') { /* found $ without end-char */ [[[NSStringVariableBindingException alloc] initWithFormat:@"did not find end of variable for string %@", self] raise]; } break; } if (wbuf[pos] == '$') { if (wbuf[pos + 1] == '$') { /* found $$ --> $ */ [str deleteCharactersInRange:NSMakeRange(pos, 1)]; if (wbuf != NULL) { free(wbuf); wbuf = NULL; } len = [str length]; wbuf = malloc(sizeof(unichar) * (len + 4)); [str getCharacters:wbuf]; } else { unsigned startPos = pos; pos += 2; /* wbuf[pos + 1] != '$' */ while (pos < len) { if (wbuf[pos] != '$') pos++; else break; } if (pos == len) { /* end of string was reached */ [[[NSStringVariableBindingException alloc] initWithFormat:@"did not find end of variable for string %@", self] raise]; } else { NSString *key; NSString *value; key = [[NSString alloc] initWithCharacters:(wbuf + startPos + 1) length:(pos - startPos - 1)]; if ((value = [_bindings valueForStringBinding:key]) == nil) { if (_unknown == nil) { [[[NSStringVariableBindingException alloc] initWithFormat:@"did not find binding for " @"name %@ in binding-dictionary %@", [key autorelease], _bindings] raise]; } else value = _unknown; } [key release]; key = nil; [str replaceCharactersInRange: NSMakeRange(startPos, pos - startPos + 1) withString:value]; if (wbuf != NULL) { free(wbuf); wbuf = NULL; } len = [str length]; wbuf = malloc(sizeof(unichar) * (len + 4)); [str getCharacters:wbuf]; pos = startPos - 1 + [value length]; } } } pos++; } if (wbuf != NULL) { free(wbuf); wbuf = NULL; } { id tmp = str; str = [str copy]; [tmp release]; tmp = nil; } return [str autorelease]; } - (NSString *)stringByReplacingVariablesWithBindings:(id)_bindings { return [self stringByReplacingVariablesWithBindings:_bindings stringForUnknownBindings:nil]; } @end /* NSString(misc) */ @implementation NSString(FilePathVersioningMethods) /* "/path/file.txt;1" */ - (NSString *)pathVersion { NSRange r; r = [self rangeOfString:@";"]; if (r.length > 0) { return ([self length] > r.location) ? [self substringFromIndex:(r.location + r.length)] : (NSString *)@""; } return nil; } - (NSString *)stringByDeletingPathVersion { NSRange r; r = [self rangeOfString:@";"]; return (r.length > 0) ? [self substringToIndex:r.location] : self; } - (NSString *)stringByAppendingPathVersion:(NSString *)_version { return [[self stringByAppendingString:@";"] stringByAppendingString:_version]; } @end /* NSString(FilePathMethodsVersioning) */ @implementation NSString(NGScanning) - (NSRange)rangeOfString:(NSString *)_s skipQuotes:(NSString *)_quotes escapedByChar:(unichar)_escape { // TODO: speed ... // TODO: check correctness with invalid input ! static NSRange notFound = { 0, 0 }; NSCharacterSet *quotes; unsigned i, len, slen; unichar sc; if ((slen = [_s length]) == 0) return notFound; if ((len = [self length]) < slen) /* to short */ return notFound; if ([_quotes length] == 0) _quotes = @"'\""; quotes = [NSCharacterSet characterSetWithCharactersInString:_quotes]; sc = [_s characterAtIndex:0]; for (i = 0; i < len; i++) { unichar c; c = [self characterAtIndex:i]; if (c == sc) { /* start search section */ if (slen == 1) return NSMakeRange(i, 1); if ([[self substringFromIndex:i] hasPrefix:_s]) return NSMakeRange(i, slen); } else if ([quotes characterIsMember:c]) { /* skip quotes */ i++; c = [self characterAtIndex:i]; for (; i < len && ![quotes characterIsMember:c]; i++) { c = [self characterAtIndex:i]; if (c == _escape) { i++; /* skip next char (eg \') */ continue; } } } } return notFound; } - (NSRange)rangeOfString:(NSString *)_s skipQuotes:(NSString *)_quotes { return [self rangeOfString:_s skipQuotes:_quotes escapedByChar:'\\']; } @end /* NSString(NGScanning) */ @implementation NSString(MailQuoting) - (NSString *)stringByApplyingMailQuoting { NSString *s; unsigned i, len, nl; unichar *sourceBuf, *targetBuf; if ((len = [self length]) == 0) return @""; sourceBuf = malloc((len + 4) * sizeof(unichar)); [self getCharacters:sourceBuf]; for (nl = 0, i = 0; i < len; i++) { if (sourceBuf[i] == '\n') nl++; } if (nl == 0) { if (sourceBuf) free(sourceBuf); return [@"> " stringByAppendingString:self]; } targetBuf = malloc((len + 8 + (nl * 3)) * sizeof(unichar)); targetBuf[0] = '>'; targetBuf[1] = ' '; nl = 2; for (i = 0; i < len; i++) { targetBuf[nl] = sourceBuf[i]; nl++; if (sourceBuf[i] == '\n' && (i + 1 != len)) { targetBuf[nl] = '>'; nl++; targetBuf[nl] = ' '; nl++; } } s = [[NSString alloc] initWithCharacters:targetBuf length:nl]; if (targetBuf) free(targetBuf); if (sourceBuf) free(sourceBuf); return [s autorelease]; } @end /* NSString(MailQuoting) */ // linking void __link_NSString_misc(void) { __link_NSString_misc(); } SOPE/sope-core/NGExtensions/FdExt.subproj/GNUmakefile0000644000000000000000000000206412242733417021360 0ustar rootroot# GNUstep makefile include ../../../config.make include ../../common.make SUBPROJECT_NAME = FdExt FdExt_PCH_FILE = common.h FdExt_OBJC_FILES = \ NSArray+enumerator.m \ NSAutoreleasePool+misc.m \ NSBundle+misc.m \ NSCalendarDate+misc.m \ NSCalendarDate+matrix.m \ NSData+gzip.m \ NSData+misc.m \ NSDictionary+KVC.m \ NSDictionary+misc.m \ NSEnumerator+misc.m \ NSException+misc.m \ NSFileManager+Extensions.m \ NSNull+misc.m \ NSObject+Logs.m \ NSObject+Values.m \ NSProcessInfo+misc.m \ NSRunLoop+FileObjects.m \ NSSet+enumerator.m \ NSString+Ext.m \ NSString+Encoding.m \ NSString+Escaping.m \ NSString+Formatting.m \ NSString+misc.m \ NSString+HTMLEscaping.m \ NSString+XMLEscaping.m \ NSString+URLEscaping.m \ NSString+German.m \ NSURL+misc.m \ NGPropertyListParser.m \ ADDITIONAL_INCLUDE_DIRS += -I. -I../NGExtensions/ -I.. -I../.. ifeq ($(iseries),yes) ADDITIONAL_CPPFLAGS += -DISERIES=1 endif -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/subproject.make -include GNUmakefile.postamble SOPE/sope-core/NGExtensions/FdExt.subproj/NSRunLoop+FileObjects.m0000644000000000000000000000723612242733417023516 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // Created by Helge Hess on Mon Mar 11 2002. #if !LIB_FOUNDATION_LIBRARY #include #include "NSRunLoop+FileObjects.h" #include "FileObjectHolder.h" #import #import #include "common.h" NSString *NSFileObjectBecameActiveNotificationName = @"NSFileObjectBecameActiveNotification"; #if GNUSTEP_BASE_LIBRARY @interface NSObject(FileObjectWatcher) < RunLoopEvents > @end @implementation NSObject(FileObjectWatcher) - (NSDate *)timedOutEvent:(void *)_fdData type: (RunLoopEventType)_type forMode: (NSString *)_mode { NSLog(@"%s: timed out ...", __PRETTY_FUNCTION__); return nil; } - (void)receivedEvent:(void *)_fdData type:(RunLoopEventType)_type extra:(void *)_extra forMode:(NSString *)_mode { NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; [nc postNotificationName:NSFileObjectBecameActiveNotificationName object:self]; } @end /* NSObject(FileObjectWatcher) */ #endif @implementation NSRunLoop(FileObjects) #if GNUSTEP_BASE_LIBRARY /* implement using -addEvent:type:watcher:forMode: */ - (void)addFileObject:(id)_fileObject activities:(NSUInteger)_activities forMode:(NSString *)_mode { NSInteger evType = 0; _fileObject = RETAIN(_fileObject); [self addEvent:(void *) ((NSInteger) [_fileObject fileDescriptor]) type:evType watcher:_fileObject forMode:_mode]; } - (void)removeFileObject:(id)_fileObject forMode:(NSString *)_mode { int evType = 0; _fileObject = AUTORELEASE(_fileObject); [self removeEvent:(void *) ((NSInteger) [_fileObject fileDescriptor]) type:evType forMode:_mode all:NO]; } #else /* eg MacOSX Foundation ... */ static NSMutableArray *activeHandles = nil; - (void)addFileObject:(id)_fileObject activities:(unsigned int)_activities forMode:(NSString *)_mode { FileObjectHolder *fo; if (activeHandles == nil) activeHandles = [[NSMutableArray alloc] init]; fo = [[FileObjectHolder alloc] initWithFileObject:_fileObject activities:_activities mode:_mode]; [activeHandles addObject:fo]; [fo wait]; [fo release]; } - (FileObjectHolder *)_findHolderForObject:(id)_fileObject { NSEnumerator *e; FileObjectHolder *fo; if (activeHandles == nil) return NULL; e = [activeHandles objectEnumerator]; while ((fo = [e nextObject])) { if ([fo fileObject] == _fileObject) break; } return fo; } - (void)removeFileObject:(id)_fileObject forMode:(NSString *)_mode { FileObjectHolder *fo; if ((fo = [self _findHolderForObject:_fileObject]) == nil) { NSLog(@"found no holder for fileobject %@ ...", _fileObject); return; } [fo retain]; [activeHandles removeObject:fo]; [fo stopWaiting]; [fo release]; } #endif /* !GNUSTEP_BASE_LIBRARY */ @end /* NSRunLoop(FileObjects) */ #endif /* !LIB_FOUNDATION_LIBRARY */ SOPE/sope-core/NGExtensions/FdExt.subproj/NSString+HTMLEscaping.m0000644000000000000000000001535212242733417023411 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NSString+misc.h" #include "common.h" @implementation NSString(HTMLEscaping) - (NSString *)stringByEscapingHTMLStringUsingCharacters { register unsigned i, len, j; register unichar *chars, *buf; unsigned escapeCount; if ((len = [self length]) == 0) return @""; chars = malloc((len + 3) * sizeof(unichar)); [self getCharacters:chars]; /* check for characters to escape ... */ for (i = 0, escapeCount = 0; i < len; i++) { switch (chars[i]) { case '&': case '"': case '<': case '>': escapeCount++; break; default: if (chars[i] > 127) escapeCount++; break; } } if (escapeCount == 0 ) { /* nothing to escape ... */ if (chars) free(chars); return [[self copy] autorelease]; } buf = calloc((len + 5) + (escapeCount * 8), sizeof(unichar)); for (i = 0, j = 0; i < len; i++) { switch (chars[i]) { /* escape special chars */ case '&': buf[j] = '&'; j++; buf[j] = 'a'; j++; buf[j] = 'm'; j++; buf[j] = 'p'; j++; buf[j] = ';'; j++; break; case '"': buf[j] = '&'; j++; buf[j] = 'q'; j++; buf[j] = 'u'; j++; buf[j] = 'o'; j++; buf[j] = 't'; j++; buf[j] = ';'; j++; break; case '<': buf[j] = '&'; j++; buf[j] = 'l'; j++; buf[j] = 't'; j++; buf[j] = ';'; j++; break; case '>': buf[j] = '&'; j++; buf[j] = 'g'; j++; buf[j] = 't'; j++; buf[j] = ';'; j++; break; case 223: /* ß */ buf[j] = '&'; j++; buf[j] = 's'; j++; buf[j] = 'z'; j++; buf[j] = 'l'; j++; buf[j] = 'i'; j++; buf[j] = 'g'; j++; buf[j] = ';'; j++; break; // TODO: this is missing a LOT? case 252: /* ü */ buf[j] = '&'; j++; buf[j] = 'u'; j++; buf[j] = 'u'; j++; buf[j] = 'm'; j++; buf[j] = 'l'; j++; buf[j] = ';'; j++; break; case 220: /* Ü */ buf[j] = '&'; j++; buf[j] = 'U'; j++; buf[j] = 'u'; j++; buf[j] = 'm'; j++; buf[j] = 'l'; j++; buf[j] = ';'; j++; break; case 228: /* ä */ buf[j] = '&'; j++; buf[j] = 'a'; j++; buf[j] = 'u'; j++; buf[j] = 'm'; j++; buf[j] = 'l'; j++; buf[j] = ';'; j++; break; case 196: /* Ä */ buf[j] = '&'; j++; buf[j] = 'A'; j++; buf[j] = 'u'; j++; buf[j] = 'm'; j++; buf[j] = 'l'; j++; buf[j] = ';'; j++; break; case 246: /* ö */ buf[j] = '&'; j++; buf[j] = 'o'; j++; buf[j] = 'u'; j++; buf[j] = 'm'; j++; buf[j] = 'l'; j++; buf[j] = ';'; j++; break; case 214: /* Ö */ buf[j] = '&'; j++; buf[j] = 'O'; j++; buf[j] = 'u'; j++; buf[j] = 'm'; j++; buf[j] = 'l'; j++; buf[j] = ';'; j++; break; default: /* escape big chars */ if (chars[i] > 127) { unsigned char nbuf[16]; unsigned int k; sprintf((char *)nbuf, "&#%i;", (int)chars[i]); for (k = 0; nbuf[k] != '\0'; k++) { buf[j] = nbuf[k]; j++; } } else { /* nothing to escape */ buf[j] = chars[i]; j++; } break; } } self = [NSString stringWithCharacters:buf length:j]; if (chars) free(chars); if (buf) free(buf); return self; } - (NSString *)stringByEscapingHTMLAttributeValueUsingCharacters { register unsigned i, len, j; register unichar *chars, *buf; unsigned escapeCount; if ((len = [self length]) == 0) return @""; chars = malloc((len + 3) * sizeof(unichar)); [self getCharacters:chars]; /* check for characters to escape ... */ for (i = 0, escapeCount = 0; i < len; i++) { switch (chars[i]) { case '&': case '"': case '<': case '>': case '\t': case '\n': case '\r': escapeCount++; break; default: if (chars[i] > 127) escapeCount++; break; } } if (escapeCount == 0 ) { /* nothing to escape ... */ if (chars) free(chars); return [[self copy] autorelease]; } buf = calloc((len + 3) + (escapeCount * 8), sizeof(unichar)); for (i = 0, j = 0; i < len; i++) { switch (chars[i]) { /* escape special chars */ case '&': buf[j] = '&'; j++; buf[j] = 'a'; j++; buf[j] = 'm'; j++; buf[j] = 'p'; j++; buf[j] = ';'; j++; break; case '"': buf[j] = '&'; j++; buf[j] = 'q'; j++; buf[j] = 'u'; j++; buf[j] = 'o'; j++; buf[j] = 't'; j++; buf[j] = ';'; j++; break; case '<': buf[j] = '&'; j++; buf[j] = 'l'; j++; buf[j] = 't'; j++; buf[j] = ';'; j++; break; case '>': buf[j] = '&'; j++; buf[j] = 'g'; j++; buf[j] = 't'; j++; buf[j] = ';'; j++; break; case '\t': buf[j] = '&'; j++; buf[j] = '#'; j++; buf[j] = '9'; j++; buf[j] = ';'; j++; break; case '\n': buf[j] = '&'; j++; buf[j] = '#'; j++; buf[j] = '1'; j++; buf[j] = '0'; j++; buf[j] = ';'; j++; break; case '\r': buf[j] = '&'; j++; buf[j] = '#'; j++; buf[j] = '1'; j++; buf[j] = '3'; j++; buf[j] = ';'; j++; break; default: /* escape big chars */ if (chars[i] > 127) { unsigned char nbuf[16]; unsigned int k; sprintf((char *)nbuf, "&#%i;", (int)chars[i]); for (k = 0; nbuf[k] != '\0'; k++) { buf[j] = nbuf[k]; j++; } } else { /* nothing to escape */ buf[j] = chars[i]; j++; } break; } } self = [NSString stringWithCharacters:buf length:j]; if (chars) free(chars); if (buf) free(buf); return self; } - (NSString *)stringByEscapingHTMLString { return [self stringByEscapingHTMLStringUsingCharacters]; } - (NSString *)stringByEscapingHTMLAttributeValue { return [self stringByEscapingHTMLAttributeValueUsingCharacters]; } @end /* NSString(HTMLEscaping) */ SOPE/sope-core/NGExtensions/FdExt.subproj/NGPropertyListParser.m0000644000000000000000000011646112242733417023555 0ustar rootroot/* Copyright (C) 2000-2008 SKYRIX Software AG Copyright (C) 2008 Helge Hess This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #if !LIB_FOUNDATION_LIBRARY //#define HAVE_MMAP #ifdef HAVE_MMAP #include #include #include #include #endif #include #import "common.h" #import "NGPropertyListParser.h" #import "NGMemoryAllocation.h" //#import "NSObjectMacros.h" //#import "NSException.h" #import #define NoZone NULL @interface NSException(UsedPrivates) /* may break on Panther? */ - (void)setUserInfo:(NSDictionary *)_ui; - (void)setReason:(NSString *)_reason; @end static NSString *_parseString (NSZone *_zone, const unsigned char *_buffer, unsigned *_idx, unsigned _len, NSException **_exception); static NSDictionary *_parseDict (NSZone *_zone, const unsigned char *_buffer, unsigned *_idx, unsigned _len, NSException **_exception); static NSArray *_parseArray (NSZone *_zone, const unsigned char *_buffer, unsigned *_idx, unsigned _len, NSException **_exception); static NSData *_parseData (NSZone *_zone, const unsigned char *_buffer, unsigned *_idx, unsigned _len, NSException **_exception); static id _parseProperty(NSZone *_zone, const unsigned char *_buffer, unsigned *_idx, unsigned _len, NSException **_exception); static NSDictionary *_parseStrings(NSZone *_zone, const unsigned char *_buffer, unsigned *_idx, unsigned _len, NSException **_exception); // public functions NSString *NGParseStringFromBuffer(const unsigned char *_buffer, unsigned _len) { NSString *result = nil; NSException *exception = nil; unsigned idx = 0; if (_len >= 2) { if (_buffer[0] == 0xFE && _buffer[1] == 0xFF) { NSLog(@"WARNING(%s): tried to parse Unicode string (FE/FF) ...", __PRETTY_FUNCTION__); return nil; } else if (_buffer[0] == 0xFF && _buffer[1] == 0xFE) { NSLog(@"WARNING(%s): tried to parse Unicode string (FF/FE) ...", __PRETTY_FUNCTION__); return nil; } } result = [_parseString(NoZone, _buffer, &idx, _len, &exception) autorelease]; [exception raise]; return result; } NSArray *NGParseArrayFromBuffer(const unsigned char *_buffer, unsigned _len) { NSArray *result = nil; NSException *exception = nil; unsigned idx = 0; if (_len >= 2) { if (_buffer[0] == 0xFE && _buffer[1] == 0xFF) { NSLog(@"WARNING(%s): tried to parse Unicode array (FE/FF) ...", __PRETTY_FUNCTION__); return nil; } else if (_buffer[0] == 0xFF && _buffer[1] == 0xFE) { NSLog(@"WARNING(%s): tried to parse Unicode array (FF/FE) ...", __PRETTY_FUNCTION__); return nil; } } result = [_parseArray(NoZone, _buffer, &idx, _len, &exception) autorelease]; [exception raise]; return result; } NSDictionary *NGParseDictionaryFromBuffer(const unsigned char *_buffer, unsigned _len) { NSDictionary *result = nil; NSException *exception = nil; unsigned idx = 0; if (_len >= 2) { if (_buffer[0] == 0xFE && _buffer[1] == 0xFF) { NSLog(@"WARNING(%s): tried to parse Unicode dict (FE/FF) ...", __PRETTY_FUNCTION__); return nil; } else if (_buffer[0] == 0xFF && _buffer[1] == 0xFE) { NSLog(@"WARNING(%s): tried to parse Unicode dict (FF/FE) ...", __PRETTY_FUNCTION__); return nil; } } result = [_parseDict(NoZone, _buffer, &idx, _len, &exception) autorelease]; [exception raise]; return result; } NSString *NGParseStringFromData(NSData *_data) { return NGParseStringFromBuffer([_data bytes], [_data length]); } NSArray *NGParseArrayFromData(NSData *_data) { return NGParseArrayFromBuffer([_data bytes], [_data length]); } NSDictionary *NGParseDictionaryFromData(NSData *_data) { return NGParseDictionaryFromBuffer([_data bytes], [_data length]); } NSString *NGParseStringFromString(NSString *_str) { // TODO: Unicode return NGParseStringFromBuffer((unsigned char *)[_str cString], [_str cStringLength]); } NSArray *NGParseArrayFromString(NSString *_str) { // TODO: Unicode return NGParseArrayFromBuffer((unsigned char *)[_str cString], [_str cStringLength]); } NSDictionary *NGParseDictionaryFromString(NSString *_str) { // TODO: Unicode return NGParseDictionaryFromBuffer((unsigned char *)[_str cString], [_str cStringLength]); } id NGParsePropertyListFromBuffer(const unsigned char *_buffer, unsigned _len) { id result = nil; NSException *exception = nil; unsigned idx = 0; if (_len >= 2) { if (_buffer[0] == 0xFE && _buffer[1] == 0xFF) { NSLog(@"WARNING(%s): tried to parse Unicode plist (FE/FF) ...", __PRETTY_FUNCTION__); return nil; } else if (_buffer[0] == 0xFF && _buffer[1] == 0xFE) { NSLog(@"WARNING(%s): tried to parse Unicode plist (FF/FE) ...", __PRETTY_FUNCTION__); return nil; } } result = [_parseProperty(NoZone, _buffer, &idx, _len, &exception) autorelease]; [exception raise]; return result; } id NGParsePropertyListFromData(NSData *_data) { return NGParsePropertyListFromBuffer([_data bytes], [_data length]); } id NGParsePropertyListFromString(NSString *_string) { return NGParsePropertyListFromBuffer((unsigned char *)[_string cString], [_string cStringLength]); } id NGParsePropertyListFromFile(NSString *_path) { #ifdef HAVE_MMAP NSException *exception = nil; int fd = 0; id result = nil; fd = open([_path cString], O_RDONLY); if (fd != -1) { struct stat statInfo; if (fstat(fd, &statInfo) == 0) { void *mem = NULL; mem = mmap(0, statInfo.st_size, PROT_READ, MAP_SHARED, fd, 0); if ((mem != MAP_FAILED) || (mem == NULL)) { NS_DURING { unsigned idx = 0; result = _parseProperty(nil, mem, &idx, statInfo.st_size, &exception); } NS_HANDLER { result = nil; exception = [localException retain]; } NS_ENDHANDLER; munmap(mem, statInfo.st_size); mem = NULL; } else { NSLog(@"Could not map file %@ into virtual memory !", _path); } } else { NSLog(@"File %@ could not be mapped !", _path); } close(fd); } else { NSLog(@"File %@ does not exist !", _path); } [result autorelease]; if (exception) [exception raise]; return result; #else NSData *data = [NSData dataWithContentsOfFile:_path]; if (data) { return NGParsePropertyListFromData(data); } else { NSLog(@"%s: Could not parse plist file %@ !", __PRETTY_FUNCTION__, _path); return nil; } #endif } NSDictionary *NGParseStringsFromBuffer(const unsigned char *_buffer, unsigned _len) { NSDictionary *result = nil; NSException *exception = nil; unsigned idx = 0; result = [_parseStrings(NoZone, _buffer, &idx, _len, &exception) autorelease]; [exception raise]; return result; } NSDictionary *NGParseStringsFromData(NSData *_data) { return NGParseStringsFromBuffer([_data bytes], [_data length]); } NSDictionary *NGParseStringsFromString(NSString *_string) { return NGParseStringsFromBuffer((unsigned char *)[_string cString], [_string cStringLength]); } NSDictionary *NGParseStringsFromFile(NSString *_path) { #ifdef HAVE_MMAP struct stat statInfo; NSException *exception = nil; int fd = 0; id result = nil; fd = open([_path cString], O_RDONLY); if (fd != -1) { if (fstat(fd, &statInfo) == 0) { void *mem = NULL; mem = mmap(0, statInfo.st_size, PROT_READ, MAP_SHARED, fd, 0); if (mem != MAP_FAILED) { NS_DURING { unsigned idx = 0; result = _parseStrings(nil, mem, &idx, statInfo.st_size, &exception); } NS_HANDLER { exception = [localException retain]; result = nil; } NS_ENDHANDLER; munmap(mem, statInfo.st_size); mem = NULL; } else NSLog(@"Could not map file %@ into virtual memory !", _path); } else { NSLog(@"File %@ could not be mapped !", _path); } close(fd); } else { NSLog(@"File %@ does not exist !", _path); } [result autorelease]; [exception raise]; return result; #else NSData *data = [NSData dataWithContentsOfFile:_path]; if (data) return NGParseStringsFromData(data); else { NSLog(@"%s: Could not parse strings file %@ !", __PRETTY_FUNCTION__, _path); return nil; } #endif } /* ******************* implementation ******************** */ static inline BOOL _isBreakChar(char _c) { switch (_c) { case ' ': case '\t': case '\n': case '\r': case '/': case '=': case ';': case ',': case '{': case '(': case '"': case '<': case '}': case ')': case '>': return YES; default: return NO; } } static inline int _valueOfHexChar(char _c) { switch (_c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': return (_c - 48); // 0-9 (ascii-char)'0' - 48 => (int)0 case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': return (_c - 55); // A-F, A=10..F=15, 'A'=65..'F'=70 case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': return (_c - 87); // a-f, a=10..F=15, 'a'=97..'f'=102 default: return -1; } } static inline BOOL _isHexDigit(char _c) { switch (_c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': return YES; default: return NO; } } static inline int _numberOfLines(const unsigned char *_buffer, unsigned _lastIdx) { register int pos, lineCount = 1; for (pos = 0; (pos < _lastIdx) && (_buffer[pos] != '\0'); pos++) { if (_buffer[pos] == '\n') lineCount++; } return lineCount; } static NSException *_makeException(NSException *_exception, const unsigned char *_buffer, unsigned _idx, unsigned _len, NSString *_text) { NSMutableDictionary *ui = nil; NSException *exception = nil; int numLines = _numberOfLines(_buffer, _idx); BOOL atEof = (_idx >= _len) ? YES : NO; if (_exception != nil) // error resulted from a previous error (exception already set) return _exception; _text = atEof ? [NSString stringWithFormat:@"Unexpected end: %@", _text] : [NSString stringWithFormat:@"Syntax error in line %i: %@", numLines,_text]; // user info { ui = [[NSMutableDictionary alloc] initWithCapacity:8]; [ui setObject:[NSNumber numberWithInt:numLines] forKey:@"line"]; [ui setObject:[NSNumber numberWithInt:_len] forKey:@"size"]; [ui setObject:[NSNumber numberWithInt:_idx] forKey:@"position"]; /* if (_len > 0) [ui setObject:[NSString stringWithCString:_buffer length:_len] forKey:@"text"]; if (!atEof && (_idx > 0)) { [ui setObject:[NSString stringWithCString:_buffer length:_idx] forKey:@"consumedText"]; } */ if (!atEof && (_idx > 0)) { register unsigned pos; const unsigned char *startPos, *endPos; for (pos = _idx; (pos >= 0) && (_buffer[pos] != '\n'); pos--) ; startPos = &(_buffer[pos + 1]); for (pos = _idx; ((pos < _len) && (_buffer[pos] != '\n')); pos++) ; endPos = &(_buffer[pos - 1]); if (startPos < endPos) { NSString *s; s = [[NSString alloc] initWithCString:(char *)startPos length:(endPos - startPos)]; if (s != nil) { [ui setObject:s forKey:@"lastLine"]; [s release]; } else { NSLog(@"ERROR(%s): could not get last-line!", __PRETTY_FUNCTION__); } } else NSLog(@"startPos=0x%p endPos=0x%p", startPos, endPos); } } exception = [NSException exceptionWithName:@"SyntaxErrorException" reason:_text userInfo:ui]; [ui release]; ui = nil; return exception; } static BOOL _skipComments(const unsigned char *_buffer, unsigned *_idx, unsigned _len, BOOL _skipSpaces, NSException **_exception) { register unsigned pos = *_idx; BOOL lookAgain; if (pos >= _len) return NO; do { // until all comments are filtered .. lookAgain = NO; if ((_buffer[pos] == '/') && (pos + 1 < _len)) { if (_buffer[pos + 1] == '/') { // single line comments pos += 2; // skip '//' // search for '\n' .. while ((pos < _len) && (_buffer[pos] != '\n')) pos++; if ((pos < _len) && (_buffer[pos] == '\n')) { pos++; // skip newline, otherwise EOF was reached lookAgain = YES; } } else if (_buffer[pos + 1] == '*') { /* multiline comments */ BOOL commentIsClosed = NO; pos += 2; // skip '/*' do { // search for '*/' while ((pos < _len) && (_buffer[pos] != '*')) pos++; if (pos + 1 >= _len) // did not find '*' or not enough left for '/' break; pos++; // skip '*' if (_buffer[pos] != '/') // missing slash in '*/' continue; commentIsClosed = YES; pos++; // skip '/' lookAgain = YES; break; // leave loop } while (pos < _len); if (!commentIsClosed) { // EOF found, comment was not closed *_exception = _makeException(*_exception, _buffer, *_idx, _len, @"comment was not closed (expected '*/')"); return NO; } } } else if (_skipSpaces && isspace((int)_buffer[pos])) { pos++; lookAgain = YES; } } while (lookAgain && (pos < _len)); // store position .. *_idx = pos; //NSLog(@"skipped comments, now at '%s'", &(_buffer[*_idx])); return (pos < _len); } static NSString *_parseString(NSZone *_zone, const unsigned char *_buffer, unsigned *_idx, unsigned _len, NSException **_exception) { // skip comments and spaces if (!_skipComments(_buffer, _idx, _len, YES, _exception)) { // EOF reached during comment-skipping *_exception = _makeException(*_exception, _buffer, *_idx, _len, @"did not find a string !"); return nil; } if (_buffer[*_idx] == '"') { // a quoted string register unsigned pos = *_idx; register unsigned len = 0; unsigned startPos = pos + 1; BOOL containsEscaped = NO; pos++; // skip starting quote // loop until closing quote while ((_buffer[pos] != '"') && (pos < _len)) { if (_buffer[pos] == '\\') { containsEscaped = YES; pos++; // skip following char if (pos == _len) { *_exception = _makeException(*_exception, _buffer, *_idx, _len, @"escape in quoted string not finished !"); return nil; } } pos++; len++; } if (pos == _len) { // syntax error, quote not closed *_idx = pos; *_exception = _makeException(*_exception, _buffer, *_idx, _len, @"quoted string not closed (expected '\"')"); return nil; } pos++; // skip closing quote *_idx = pos; // store pointer pos = 0; if (len == 0) { // empty string return @""; } else if (containsEscaped) { register unsigned pos2; char *str = NGMallocAtomic(len + 1); id ostr = nil; NSCAssert(len > 0, @"invalid length .."); for (pos = startPos, pos2 = 0; _buffer[pos] != '"'; pos++, pos2++) { //NSLog(@"char=%c pos=%i pos2=%i", _buffer[pos], pos2); if (_buffer[pos] == '\\') { pos++; switch (_buffer[pos]) { case 'a': str[pos2] = '\a'; break; case 'b': str[pos2] = '\b'; break; case 'f': str[pos2] = '\f'; break; case 'n': str[pos2] = '\n'; break; case 't': str[pos2] = '\t'; break; case 'v': str[pos2] = '\v'; break; case '\\': str[pos2] = '\\'; break; default: str[pos2] = _buffer[pos]; break; } } else { str[pos2] = _buffer[pos]; } } str[pos2] = '\0'; NSCAssert(pos2 == len, @"invalid unescape .."); ostr = [[NSString allocWithZone:_zone] initWithCString:str length:len]; NGFree(str); str = NULL; return ostr; } else { NSCAssert(len > 0, @"invalid length .."); return [[NSString allocWithZone:_zone] initWithCString:(char*)&(_buffer[startPos]) length:len]; } } else { // an unquoted string, may not be zero chars long ! register unsigned pos = *_idx; register unsigned len = 0; unsigned startPos = pos; // loop until break char while (!_isBreakChar(_buffer[pos]) && (pos < _len)) { pos++; len++; } if (len == 0) { // was not a string .. *_exception = _makeException(*_exception, _buffer, *_idx, _len, @"did not find a string !"); return nil; } else { *_idx = pos; return [[NSString allocWithZone:_zone] initWithCString:(char*)&(_buffer[startPos]) length:len]; } } } static NSData *_parseData(NSZone *_zone, const unsigned char *_buffer, unsigned *_idx, unsigned _len, NSException **_exception) { if (!_skipComments(_buffer, _idx, _len, YES, _exception)) { // EOF reached during comment-skipping *_exception = _makeException(*_exception, _buffer, *_idx, _len, @"did not find a data (expected '<') !"); return nil; } if (_buffer[*_idx] != '<') { // it's not a data that's follows *_exception = _makeException(*_exception, _buffer, *_idx, _len, @"did not find a data (expected '<') !"); return nil; } else { register unsigned pos = *_idx + 1; register unsigned len = 0; unsigned endPos = 0; NSMutableData *data = nil; *_idx += 1; // skip '<' if (!_skipComments(_buffer, _idx, _len, YES, _exception)) { *_exception = _makeException(*_exception, _buffer, *_idx, _len, @"data was not closed (expected '>') .."); return nil; // EOF } if (_buffer[*_idx] == '>') { // empty data *_idx += 1; // skip '>' return [[NSData allocWithZone:_zone] init]; } // count significant chars while ((_buffer[pos] != '>') && (pos < _len)) { if ((_buffer[pos] == ' ') || (_buffer[pos] == '\t')) ; else if (_isHexDigit(_buffer[pos])) len++; else { *_idx = pos; *_exception = _makeException(*_exception, _buffer, *_idx, _len, @"invalid char in data property"); return nil; // abort } pos++; } if (pos == _len) { *_idx = pos; *_exception = _makeException(*_exception, _buffer, *_idx, _len, @"data was not closed (expected '>')"); return nil; // EOF } endPos = pos; // store position of closing '>' // if odd, then add one byte for trailing nibble len = (len % 2 == 1) ? len / 2 + 1 : len / 2; data = [[NSMutableData allocWithZone:_zone] initWithLength:len]; // now copy bytes .. { register unsigned i; register unsigned pending = -1; char *buf = [data mutableBytes]; for (pos = *_idx, i = 0; (pos < endPos) && (i < len); pos++) { int value = _valueOfHexChar(_buffer[pos]); if (value != -1) { if (pending == -1) pending = value; else { value = value * 16 + pending; pending = -1; buf[i] = value; i++; } } } if (pending != -1) { // was odd, now add the trailer .. NSCAssert(i < len, @"invalid length .."); buf[i] = pending * 16; } } // update global position *_idx = endPos + 1; // endPos + 1 (*endPos == '>', 1 => skips '>') return data; } } static NSDictionary *_parseDict(NSZone *_zone, const unsigned char *_buffer, unsigned *_idx, unsigned _len, NSException **_exception) { if (!_skipComments(_buffer, _idx, _len, YES, _exception)) { // EOF reached during comment-skipping *_exception = _makeException(*_exception, _buffer, *_idx, _len, @"did not find dictionary (expected '{')"); return nil; } if (_buffer[*_idx] != '{') { // it's not a dict that's follows *_exception = _makeException(*_exception, _buffer, *_idx, _len, @"did not find dictionary (expected '{')"); return nil; } else { NSMutableDictionary *result = nil; id key = nil; id value = nil; BOOL didFail = NO; *_idx += 1; // skip '{' if (!_skipComments(_buffer, _idx, _len, YES, _exception)) { *_exception = _makeException(*_exception, _buffer, *_idx, _len, @"dictionary was not closed (expected '}')"); return nil; // EOF } if (_buffer[*_idx] == '}') { // an empty dictionary *_idx += 1; // skip the '}' return [[NSDictionary allocWithZone:_zone] init]; } result = [[NSMutableDictionary allocWithZone:_zone] init]; do { key = nil; value = nil; if (!_skipComments(_buffer, _idx, _len, YES, _exception)) { *_exception = _makeException(*_exception, _buffer, *_idx, _len, @"dictionary was not closed (expected '}')"); didFail = YES; break; // unexpected EOF } if (_buffer[*_idx] == '}') { // dictionary closed *_idx += 1; // skip the '}' break; } // read key property key = _parseProperty(_zone, _buffer, _idx, _len, _exception); if (key == nil) { // syntax error if (*_exception == nil) { *_exception = _makeException(*_exception, _buffer, *_idx, _len, @"got nil-key in dictionary .."); } didFail = YES; break; } /* The following parses: (comment|space)* '=' (comment|space)* */ if (!_skipComments(_buffer, _idx, _len, YES, _exception)) { *_exception = _makeException(*_exception, _buffer, *_idx, _len, @"expected '=' after key in dictionary"); didFail = YES; break; // unexpected EOF } // no we need a '=' assignment if (_buffer[*_idx] != '=') { *_exception = _makeException(*_exception, _buffer, *_idx, _len, @"expected '=' after key in dictionary"); didFail = YES; break; } *_idx += 1; // skip '=' if (!_skipComments(_buffer, _idx, _len, YES, _exception)) { *_exception = _makeException(*_exception, _buffer, *_idx, _len, @"expected value after key '=' in dictionary"); didFail = YES; break; // unexpected EOF } // read value property value = _parseProperty(_zone, _buffer, _idx, _len, _exception); if (value == nil) { // syntax error if (*_exception == nil) { *_exception = _makeException(*_exception, _buffer, *_idx, _len, @"got nil-value in dictionary"); } didFail = YES; break; } NSCAssert(key, @"invalid key .."); NSCAssert(value, @"invalid value .."); [result setObject:value forKey:key]; // release key and value [key release]; key = nil; [value release]; value = nil; // read trailing ';' if available if (!_skipComments(_buffer, _idx, _len, YES, _exception)) { *_exception = _makeException(*_exception, _buffer, *_idx, _len, @"dictionary was not closed (expected '}')"); didFail = YES; break; // unexpected EOF } if (_buffer[*_idx] == ';') { *_idx += 1; // skip ';' } else { // no ';' at end of pair, only allowed at end of dictionary if (!_skipComments(_buffer, _idx, _len, YES, _exception)) { *_exception = _makeException(*_exception, _buffer, *_idx, _len, @"dictionary was not closed (expected '}')"); didFail = YES; break; // unexpected EOF } if (_buffer[*_idx] != '}') { // dictionary was not closed *_exception = _makeException(*_exception, _buffer, *_idx, _len, @"key-value pair without ';' at the end"); didFail = YES; break; } } } while ((*_idx < _len) && (result != nil) && !didFail); if (didFail) { [key release]; key = nil; [value release]; value = nil; [result release]; result = nil; return nil; } else return result; } } static NSArray *_parseArray(NSZone *_zone, const unsigned char *_buffer, unsigned *_idx, unsigned _len, NSException **_exception) { if (!_skipComments(_buffer, _idx, _len, YES, _exception)) { // EOF reached during comment-skipping *_exception = _makeException(*_exception, _buffer, *_idx, _len, @"did not find array (expected '(')"); return nil; } if (_buffer[*_idx] != '(') { // it's not an array that's follows *_exception = _makeException(*_exception, _buffer, *_idx, _len, @"did not find array (expected '(')"); return nil; } else { NSMutableArray *result = nil; id element = nil; *_idx += 1; // skip '(' if (!_skipComments(_buffer, _idx, _len, YES, _exception)) { *_exception = _makeException(*_exception, _buffer, *_idx, _len, @"array was not closed (expected ')')"); return nil; // EOF } if (_buffer[*_idx] == ')') { // an empty array *_idx += 1; // skip the ')' return [[NSArray allocWithZone:_zone] init]; } result = [[NSMutableArray allocWithZone:_zone] init]; do { element = _parseProperty(_zone, _buffer, _idx, _len, _exception); if (element == nil) { *_exception = _makeException(*_exception, _buffer, *_idx, _len, @"expected element in array"); [result release]; result = nil; break; } [result addObject:element]; [element release]; element = nil; if (!_skipComments(_buffer, _idx, _len, YES, _exception)) { *_exception = _makeException(*_exception, _buffer, *_idx, _len, @"array was not closed (expected ')' or ',')"); [result release]; result = nil; break; } if (_buffer[*_idx] == ')') { // closed array *_idx += 1; // skip ')' break; } else if (_buffer[*_idx] == ',') { // next element *_idx += 1; // skip ',' if (!_skipComments(_buffer, _idx, _len, YES, _exception)) { *_exception = _makeException(*_exception, _buffer, *_idx, _len, @"array was not closed (expected ')')"); [result release]; result = nil; break; } if (_buffer[*_idx] == ')') { // closed array, like this '(1,2,)' *_idx += 1; // skip ')' break; } } else { // syntax error *_exception = _makeException(*_exception, _buffer, *_idx, _len, @"expected ')' or ',' after array element"); [result release]; result = nil; break; } } while ((*_idx < _len) && (result != nil)); return result; } } static id _parseProperty(NSZone *_zone, const unsigned char *_buffer, unsigned *_idx, unsigned _len, NSException **_exception) { id result = nil; if (!_skipComments(_buffer, _idx, _len, YES, _exception)) { // no property found return nil; // EOF } switch (_buffer[*_idx]) { case '"': // quoted string result = _parseString(_zone, _buffer, _idx, _len, _exception); break; case '{': // dictionary result = _parseDict(_zone, _buffer, _idx, _len, _exception); break; case '(': // array result = _parseArray(_zone, _buffer, _idx, _len, _exception); break; case '<': // data result = _parseData(_zone, _buffer, _idx, _len, _exception); break; default: // an unquoted string result = _parseString(_zone, _buffer, _idx, _len, _exception); break; } return result; } static NSDictionary *_parseStrings(NSZone *_zone, const unsigned char *_buffer, unsigned *_idx, unsigned _len, NSException **_exception) { NSMutableDictionary *result = nil; id key = nil; id value = nil; BOOL didFail = NO; result = [[NSMutableDictionary allocWithZone:_zone] init]; while ((*_idx < _len) && (result != nil) && !didFail) { key = nil; value = nil; if (!_skipComments(_buffer, _idx, _len, YES, _exception)) break; // expected EOF // read key string key = _parseString(_zone, _buffer, _idx, _len, _exception); if (key == nil) { // syntax error if (*_exception == nil) { *_exception = _makeException(*_exception, _buffer, *_idx, _len, @"got nil-key in string table .."); } didFail = YES; break; } /* The following parses: (comment|space)* '=' (comment|space)* */ if (!_skipComments(_buffer, _idx, _len, YES, _exception)) { *_exception = _makeException(*_exception, _buffer, *_idx, _len, @"expected '=' after key in string table"); didFail = YES; break; // unexpected EOF } // no we need a '=' assignment if (_buffer[*_idx] != '=') { *_exception = _makeException(*_exception, _buffer, *_idx, _len, @"expected '=' after key in string table"); didFail = YES; break; } *_idx += 1; // skip '=' if (!_skipComments(_buffer, _idx, _len, YES, _exception)) { *_exception = _makeException(*_exception, _buffer, *_idx, _len, @"expected value after key in string table"); didFail = YES; break; // unexpected EOF } // read value string value = _parseString(_zone, _buffer, _idx, _len, _exception); if (value == nil) { // syntax error if (*_exception == nil) { *_exception = _makeException(*_exception, _buffer, *_idx, _len, @"got nil-value after key in string table"); } didFail = YES; break; } NSCAssert(key, @"invalid key .."); NSCAssert(value, @"invalid value .."); [result setObject:value forKey:key]; // release key and value [key release]; key = nil; [value release]; value = nil; // read trailing ';' if available if (!_skipComments(_buffer, _idx, _len, YES, _exception)) break; // expected EOF if (_buffer[*_idx] == ';') { *_idx += 1; // skip ';' } } if (didFail) { [key release]; key = nil; [value release]; value = nil; [result release]; result = nil; return nil; } else return result; } // ******************** categories ******************** #import #import #import #import @implementation NSArray(NGPropertyListParser) + (id)skyArrayWithContentsOfFile:(NSString *)_path { volatile id plist = nil; NSString *format = @"%@: Caught exception %@ with reason %@ "; NS_DURING { plist = NGParsePropertyListFromFile(_path); if (![plist isKindOfClass:[NSArray class]]) plist = nil; } NS_HANDLER { NSLog(format, self, [localException name], [localException reason]); plist = nil; } NS_ENDHANDLER; return plist; } - (id)skyInitWithContentsOfFile:(NSString *)_path { NSArray *plist = [NSArray arrayWithContentsOfFile:_path]; if (plist) return [self initWithArray:plist]; else { [self autorelease]; return nil; } } @end /* NSArray(NGPropertyListParser) */ @implementation NSDictionary(NGPropertyListParser) + (id)skyDictionaryWithContentsOfFile:(NSString *)_path { volatile id plist = nil; NSString *format = @"%@: Caught exception %@ with reason %@ "; NS_DURING { plist = NGParsePropertyListFromFile(_path); if (![plist isKindOfClass:[NSDictionary class]]) plist = nil; } NS_HANDLER { NSLog(format, self, [localException name], [localException reason]); plist = nil; } NS_ENDHANDLER; return plist; } - (id)skyInitWithContentsOfFile:(NSString *)_path { NSDictionary *plist = [NSDictionary dictionaryWithContentsOfFile:_path]; if (plist) return [self initWithDictionary:plist]; else { [self autorelease]; return nil; } } @end /* NSDictionary(NGPropertyListParser) */ #else /* LIB_FOUNDATION_LIBRARY */ #import #import #import #import @implementation NSArray(NGPropertyListParser) + (id)skyArrayWithContentsOfFile:(NSString *)_path { return [self arrayWithContentsOfFile:_path]; } - (id)skyInitWithContentsOfFile:(NSString *)_path { [self release]; return [[[self class] skyArrayWithContentsOfFile:_path] retain]; } @end /* NSArray(NGPropertyListParser) */ @implementation NSDictionary(NGPropertyListParser) + (id)skyDictionaryWithContentsOfFile:(NSString *)_path { return [self dictionaryWithContentsOfFile:_path]; } - (id)skyInitWithContentsOfFile:(NSString *)_path { [self release]; return [[[self class] skyDictionaryWithContentsOfFile:_path] retain]; } @end /* NSDictionary(NGPropertyListParser) */ #endif /* LIB_FOUNDATION_LIBRARY */ /* Local Variables: c-basic-offset: 4 tab-width: 8 End: */ SOPE/sope-core/NGExtensions/FdExt.subproj/NSDictionary+KVC.m0000644000000000000000000000245612242733417022456 0ustar rootroot/* Copyright (C) 2000-2008 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #if GNUSTEP_BASE_LIBRARY #import "common.h" #import "NSDictionary+KVC.h" @implementation NSDictionary(KVC) // TODO: it should be addressed to gnustep-base - (id)valueForUndefinedKey:(NSString *)key { return nil; } - (id)handleQueryWithUnboundKey:(NSString *)key { return nil; } - (void)setValue:(id)value forUndefinedKey:(NSString *)key { return; } - (void)handleTakeValue:(id)value forUnboundKey:(NSString *)key { return; } @end /* NSDictionary(KVC) */ void __link_NSDictionary_KVC() { __link_NSDictionary_KVC(); } #endif SOPE/sope-core/NGExtensions/FdExt.subproj/NSObject+Logs.m0000644000000000000000000001133512242733417022034 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NSObject+Logs.h" #include "NGLoggerManager.h" #include "NGLogger.h" #include "common.h" @implementation NSObject(NGLogs) static Class StringClass = Nil; static inline Class NSStringClass(void) { if (StringClass == Nil) StringClass = [NSString class]; return StringClass; } - (BOOL)isDebuggingEnabled { #if DEBUG return YES; #else return NO; #endif } - (id)logger { static NSMapTable *loggerForClassMap = NULL; static NGLoggerManager *lm = nil; NGLogger *logger; if (!loggerForClassMap) { loggerForClassMap = NSCreateMapTable(NSNonOwnedPointerMapKeyCallBacks, NSNonRetainedObjectMapValueCallBacks, 200); lm = [NGLoggerManager defaultLoggerManager]; } logger = NSMapGet(loggerForClassMap, self->isa); if (!logger) { logger = [lm loggerForClass:self->isa]; NSMapInsert(loggerForClassMap, self->isa, logger); } return logger; } - (id)debugLogger { return [self logger]; } - (NSString *)loggingPrefix { /* improve perf ... */ return [NSStringClass() stringWithFormat:@"<0x%p[%@]>", self, NSStringFromClass([self class])]; } - (void)debugWithFormat:(NSString *)_fmt arguments:(va_list)_va { #if DEBUG NGLogger *logger; NSString *msg, *msg2; /* This does some fancy formatting and calls [NGLogger logLevel:message:] * thereby bypassing the logLevel check normally done in the logger. * So we must do it here */ logger = [self debugLogger]; if ((![self isDebuggingEnabled]) || ([logger logLevel] < NGLogLevelDebug)) return; msg = [[NSStringClass() alloc] initWithFormat:_fmt arguments:_va]; msg2 = [[NSStringClass() alloc] initWithFormat: @"<%@>D %@", [self loggingPrefix], msg]; [logger logLevel:NGLogLevelDebug message:msg2]; [msg2 release]; [msg release]; #else # warning debug is disabled, debugWithFormat wont print anything .. #endif } - (void)logWithFormat:(NSString *)_fmt arguments:(va_list)_va { NGLogger *logger; NSString *msg; logger = [self logger]; if (![logger isLogInfoEnabled]) return; msg = [[NSStringClass() alloc] initWithFormat:_fmt arguments:_va]; [logger logWithFormat:@"%@ %@", [self loggingPrefix], msg]; [msg release]; } - (void)warnWithFormat:(NSString *)_fmt arguments:(va_list)_va { NGLogger *logger; NSString *msg; logger = [self logger]; if (![logger isLogWarnEnabled]) return; msg = [[NSStringClass() alloc] initWithFormat:_fmt arguments:_va]; [logger warnWithFormat:@"%@ %@", [self loggingPrefix], msg]; [msg release]; } - (void)errorWithFormat:(NSString *)_fmt arguments:(va_list)_va { NGLogger *logger; NSString *msg; logger = [self logger]; if (![logger isLogErrorEnabled]) return; msg = [[NSStringClass() alloc] initWithFormat:_fmt arguments:_va]; [logger errorWithFormat:@"%@ %@", [self loggingPrefix], msg]; [msg release]; } - (void)fatalWithFormat:(NSString *)_fmt arguments:(va_list)_va { NGLogger *logger; NSString *msg; logger = [self logger]; if (![logger isLogFatalEnabled]) return; msg = [[NSStringClass() alloc] initWithFormat:_fmt arguments:_va]; [logger fatalWithFormat:@"%@ %@", [self loggingPrefix], msg]; [msg release]; } - (void)debugWithFormat:(NSString *)_fmt, ... { va_list ap; va_start(ap, _fmt); [self debugWithFormat:_fmt arguments:ap]; va_end(ap); } - (void)logWithFormat:(NSString *)_fmt, ... { va_list ap; va_start(ap, _fmt); [self logWithFormat:_fmt arguments:ap]; va_end(ap); } - (void)warnWithFormat:(NSString *)_fmt, ... { va_list ap; va_start(ap, _fmt); [self warnWithFormat:_fmt arguments:ap]; va_end(ap); } - (void)errorWithFormat:(NSString *)_fmt, ... { va_list ap; va_start(ap, _fmt); [self errorWithFormat:_fmt arguments:ap]; va_end(ap); } - (void)fatalWithFormat:(NSString *)_fmt, ... { va_list ap; va_start(ap, _fmt); [self fatalWithFormat:_fmt arguments:ap]; va_end(ap); } @end /* NSObject(NGLogs) */ SOPE/sope-core/NGExtensions/FdExt.subproj/NSProcessInfo+misc.m0000644000000000000000000002145612242733417023114 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NSProcessInfo+misc.h" #include "common.h" #include #if !LIB_FOUNDATION_LIBRARY && !GNUSTEP_BASE_LIBRARY # import #endif @implementation NSProcessInfo(misc) /* arguments */ - (NSArray *)argumentsWithoutDefaults { NSMutableArray *ma; NSArray *a; unsigned count, i; BOOL foundDefault; a = [self arguments]; if ((count = [a count]) == 0) return nil; if (count == 1) return a; ma = [NSMutableArray arrayWithCapacity:count]; [ma addObject:[a objectAtIndex:0]]; // tool name for (i = 1, foundDefault = NO; i < count; i++) { NSString *arg; arg = [a objectAtIndex:i]; if ([arg hasPrefix:@"-"] && ([arg length] > 1)) { /* a default .. */ i++; /* consume value */ foundDefault = YES; continue; } [ma addObject:arg]; } return foundDefault ? (NSArray *)ma : a; } /* create temp file name */ - (NSString *)temporaryFileName:(NSString *)_prefix { static int cnt = 0; NSString *s; cnt++; s = [NSString stringWithFormat: @"%04X%X%02X.tmp", getpid(), time(NULL), cnt]; return [_prefix stringByAppendingString:s]; } - (NSString *)temporaryFileName { NSString *prefix; prefix = [@"/tmp/" stringByAppendingPathComponent:[self processName]]; return [self temporaryFileName:prefix]; } /* return process-id (pid on Unix) */ - (id)processId { int pid; #if defined(__MINGW32__) pid = (int)GetCurrentProcessId(); #else pid = (int)getpid(); #endif return [NSNumber numberWithInt:pid]; } - (NSString *)procDirectoryPathForProcess { NSString *p; BOOL isDir; p = [@"/proc/" stringByAppendingString:[[self processId] stringValue]]; if (![[NSFileManager defaultManager] fileExistsAtPath:p isDirectory:&isDir]) return nil; return isDir ? p : (NSString *)nil; } - (NSDictionary *)procStatusDictionary { NSMutableDictionary *dict; NSString *procStatusPath; NSString *s; NSEnumerator *lines; NSString *line; procStatusPath = [[self procDirectoryPathForProcess] stringByAppendingPathComponent:@"status"]; s = [[NSString alloc] initWithContentsOfFile:procStatusPath]; if (s == nil) return nil; dict = [NSMutableDictionary dictionaryWithCapacity:32]; lines = [[s componentsSeparatedByString:@"\n"] objectEnumerator]; while ((line = [lines nextObject])) { NSString *key; NSRange r; id value; r = [line rangeOfString:@":"]; if (r.length == 0) continue; key = [line substringToIndex:r.location]; value = [[line substringFromIndex:(r.location + r.length)] stringByTrimmingSpaces]; if (value == nil) value = [NSNull null]; [dict setObject:value forKey:key]; } return [[dict copy] autorelease]; } static NSNumber *_int(int i) __attribute__((unused)); static NSNumber *_uint(unsigned int i) __attribute__((unused)); static NSNumber *_int(int i) { return [NSNumber numberWithInt:i]; } static NSNumber *_uint(unsigned int i) { return [NSNumber numberWithUnsignedInt:i]; } #define NG_GET_PROC_INFO \ FILE *fh;\ char pp[256];\ int res;\ int pid, ppid, pgrp, session, tty, tpgid;\ unsigned int flags, minflt, cminflt, majflt, cmajflt;\ int utime, stime, cutime, cstime, counter;\ unsigned char comm[256];\ char state = 0;\ int priority, starttime;\ unsigned int timeout, itrealvalue, vsize, rss, rlim, startcode, endcode;\ unsigned int startstack, kstkesp, kstkeip;\ int signal, blocked, sigignore, sigcatch;\ unsigned int wchan;\ \ pid = getpid();\ snprintf(pp, 255, "/proc/%i/stat", pid);\ fh = fopen(pp, "r");\ if (fh == NULL)\ res = -1;\ else\ res = fscanf(fh,\ "%d %255s %c %d %d %d %d %d "\ "%u %u %u %u %u "\ "%d %d %d %d %d "\ "%d %u %u %d "\ "%u %u %u %u %u"\ "%u %u %u "\ "%d %d %d %d "\ "%u"\ ,\ &pid, &(comm[0]), &state, &ppid, &pgrp, &session, &tty, \ &tpgid,\ &flags, &minflt, &cminflt, &majflt, &cmajflt,\ &utime, &stime, &cutime, &cstime, &counter,\ &priority, &timeout, &itrealvalue, &starttime,\ &vsize, &rss, &rlim, &startcode, &endcode,\ &startstack, &kstkesp, &kstkeip,\ &signal, &blocked, &sigignore, &sigcatch,\ &wchan\ );\ fclose(fh); fh = NULL; - (unsigned int)virtualMemorySize { #ifdef __linux__ NG_GET_PROC_INFO; return vsize; #else return 0; #endif } - (unsigned int)residentSetSize { #ifdef __linux__ NG_GET_PROC_INFO; return rss; #else return 0; #endif } - (unsigned int)residentSetSizeLimit { #ifdef __linux__ NG_GET_PROC_INFO; return rlim; #else return 0; #endif } - (NSDictionary *)procStatDictionary { #ifdef __linux__ /* see 'man 5 proc' */ NSMutableDictionary *dict; NG_GET_PROC_INFO; if (res > 0) { dict = [NSMutableDictionary dictionaryWithCapacity:res]; if (res > 0) [dict setObject:_int(pid) forKey:@"pid"]; if (res > 1) [dict setObject:[NSString stringWithCString:(char *)comm] forKey:@"comm"]; if (res > 2) [dict setObject:[NSString stringWithCString:&state length:1] forKey:@"state"]; if (res > 3) [dict setObject:_int(ppid) forKey:@"ppid"]; if (res > 4) [dict setObject:_int(pgrp) forKey:@"pgrp"]; if (res > 5) [dict setObject:_int(session) forKey:@"session"]; if (res > 6) [dict setObject:_int(tty) forKey:@"tty"]; if (res > 7) [dict setObject:_int(tpgid) forKey:@"tpgid"]; if (res > 8) [dict setObject:_uint(flags) forKey:@"flags"]; if (res > 9) [dict setObject:_uint(minflt) forKey:@"minflt"]; if (res > 10) [dict setObject:_uint(cminflt) forKey:@"cminflt"]; if (res > 11) [dict setObject:_uint(majflt) forKey:@"majflt"]; if (res > 12) [dict setObject:_uint(cmajflt) forKey:@"cmajflt"]; if (res > 13) [dict setObject:_int(utime) forKey:@"utime"]; if (res > 14) [dict setObject:_int(stime) forKey:@"stime"]; if (res > 15) [dict setObject:_int(cutime) forKey:@"cutime"]; if (res > 16) [dict setObject:_int(cstime) forKey:@"cstime"]; if (res > 17) [dict setObject:_int(counter) forKey:@"counter"]; if (res > 18) [dict setObject:_int(priority) forKey:@"priority"]; if (res > 19) [dict setObject:_uint(timeout) forKey:@"timeout"]; if (res > 20) [dict setObject:_uint(itrealvalue) forKey:@"itrealvalue"]; if (res > 21) [dict setObject:_int(starttime) forKey:@"starttime"]; if (res > 22) [dict setObject:_uint(vsize) forKey:@"vsize"]; if (res > 23) [dict setObject:_uint(rss) forKey:@"rss"]; if (res > 24) [dict setObject:_uint(rlim) forKey:@"rlim"]; if (res > 25) [dict setObject:_uint(startcode) forKey:@"startcode"]; if (res > 26) [dict setObject:_uint(endcode) forKey:@"endcode"]; if (res > 27) [dict setObject:_uint(startstack) forKey:@"startstack"]; if (res > 28) [dict setObject:_uint(kstkesp) forKey:@"kstkesp"]; if (res > 29) [dict setObject:_uint(kstkeip) forKey:@"kstkeip"]; if (res > 30) [dict setObject:_int(signal) forKey:@"signal"]; if (res > 31) [dict setObject:_int(blocked) forKey:@"blocked"]; if (res > 32) [dict setObject:_int(sigignore) forKey:@"sigignore"]; if (res > 33) [dict setObject:_int(sigcatch) forKey:@"sigcatch"]; if (res > 34) [dict setObject:_uint(wchan) forKey:@"wchan"]; return dict; } else { NSLog(@"%s: couldn't scan /proc-info ...", __PRETTY_FUNCTION__); dict = nil; } return [[dict copy] autorelease]; #else return nil; #endif } @end /* NSProcessInfo(misc) */ // linking void __link_NSProcessInfo_misc(void) { __link_NSProcessInfo_misc(); } SOPE/sope-core/NGExtensions/FdExt.subproj/NSDictionary+misc.m0000644000000000000000000000350212242733417022757 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import "common.h" #import "NSDictionary+misc.h" @implementation NSDictionary(misc) - (NSDictionary *)dictionaryByExchangingKeysAndValues { NSDictionary *reverse; NSArray *oKeys; unsigned i, len; id *keys, *values; oKeys = [self allKeys]; if ((len = [oKeys count]) == 0) return [[self copy] autorelease]; keys = calloc(len + 10, sizeof(id)); values = calloc(len + 10, sizeof(id)); for (i = 0; i < len; i++) { values[i] = [oKeys objectAtIndex:i]; keys[i] = [self objectForKey:values[i]]; } reverse = [[NSDictionary alloc] initWithObjects:values forKeys:keys count:len]; free(keys); free(values); return [reverse autorelease]; } @end /* NSDictionary(misc) */ @implementation NSMutableDictionary(misc) - (void)removeObjectsForKeysV:(id)_firstKey, ... { va_list ap; va_start(ap, _firstKey); while (_firstKey) { [self removeObjectForKey:_firstKey]; _firstKey = va_arg(ap, id); } va_end(ap); } @end /* NSMutableDictionary(misc) */ void __link_NSDictionary_misc() { __link_NSDictionary_misc(); } SOPE/sope-core/NGExtensions/FdExt.subproj/NSBundle+misc.m0000644000000000000000000000301512242733417022062 0ustar rootroot/* Copyright (C) 2004-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import "common.h" #import "NSBundle+misc.h" #ifndef LIB_FOUNDATION_LIBRARY @implementation NSBundle(misc) - (NSString*)pathForResource:(NSString*)name ofType:(NSString*)ext inDirectory:(NSString*)directory forLocalizations:(NSArray*)localizationNames { if(!localizationNames) { return [self pathForResource:name ofType:ext inDirectory:directory]; } else { unsigned i, count; count = [localizationNames count]; for(i = 0; i < count; i++) { NSString *lname, *path; lname = [localizationNames objectAtIndex:i]; path = [self pathForResource:name ofType:ext inDirectory:directory forLocalization:lname]; if(path) return path; } } return nil; } @end /* NSBundle(misc) */ #endif SOPE/sope-core/NGExtensions/FdExt.subproj/NSString+Ext.m0000644000000000000000000001317312242733417021732 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NSString+Ext.h" #include "common.h" #include @implementation NSString(GSAdditions) - (NSString *)stringWithoutPrefix:(NSString *)_prefix { return ([self hasPrefix:_prefix]) ? [self substringFromIndex:[_prefix length]] : (NSString *)[[self copy] autorelease]; } - (NSString *)stringWithoutSuffix:(NSString *)_suffix { return ([self hasSuffix:_suffix]) ? [self substringToIndex:([self length] - [_suffix length])] : (NSString *)[[self copy] autorelease]; } - (NSString *)stringByTrimmingLeadWhiteSpaces { // should check 'whitespaceAndNewlineCharacterSet' .. unsigned len; if ((len = [self length]) > 0) { unichar *buf; unsigned idx; buf = calloc(len + 1, sizeof(unichar)); [self getCharacters:buf]; for (idx = 0; (idx < len) && (buf[idx] == 32); idx++) ; self = [NSString stringWithCharacters:&(buf[idx]) length:(len - idx)]; free(buf); return self; } else return [[self copy] autorelease]; } - (NSString *)stringByTrimmingTailWhiteSpaces { // should check 'whitespaceAndNewlineCharacterSet' .. unsigned len; if ((len = [self length]) > 0) { unichar *buf; unsigned idx; buf = calloc(len + 1, sizeof(unichar)); [self getCharacters:buf]; for (idx = (len - 1); (idx >= 0) && (buf[idx] == 32); idx--) ; self = [NSString stringWithCharacters:buf length:(idx + 1)]; free(buf); return self; } else return [[self copy] autorelease]; } - (NSString *)stringByTrimmingWhiteSpaces { return [[self stringByTrimmingTailWhiteSpaces] stringByTrimmingLeadWhiteSpaces]; } #ifndef GNUSTEP - (NSString *)stringByReplacingString:(NSString *)_orignal withString:(NSString *)_replacement { /* very slow solution .. */ if ([self rangeOfString:_orignal].length == 0) return [[self copy] autorelease]; return [[self componentsSeparatedByString:_orignal] componentsJoinedByString:_replacement]; } - (NSString *)stringByTrimmingLeadSpaces { unsigned len; if ((len = [self length]) > 0) { unichar *buf; unsigned idx; buf = calloc(len + 1, sizeof(unichar)); [self getCharacters:buf]; for (idx = 0; (idx < len) && isspace(buf[idx]); idx++) ; self = [NSString stringWithCharacters:&(buf[idx]) length:(len - idx)]; free(buf); return self; } else return [[self copy] autorelease]; } - (NSString *)stringByTrimmingTailSpaces { unsigned len; if ((len = [self length]) > 0) { unichar *buf; unsigned idx; buf = calloc(len + 1, sizeof(unichar)); [self getCharacters:buf]; for (idx = (len - 1); (idx >= 0) && isspace(buf[idx]); idx--) ; self = [NSString stringWithCharacters:buf length:(idx + 1)]; free(buf); return self; } else return [[self copy] autorelease]; } - (NSString *)stringByTrimmingSpaces { return [[self stringByTrimmingTailSpaces] stringByTrimmingLeadSpaces]; } #endif @end /* NSString(GSAdditions) */ #if !GNUSTEP @implementation NSMutableString(GNUstepCompatibility) - (void)trimLeadSpaces { [self setString:[self stringByTrimmingLeadSpaces]]; } - (void)trimTailSpaces { [self setString:[self stringByTrimmingTailSpaces]]; } - (void)trimSpaces { [self setString:[self stringByTrimmingSpaces]]; } @end /* NSMutableString(GNUstepCompatibility) */ #endif /* !GNUSTEP */ @implementation NSString(lfNSURLUtilities) - (BOOL)isAbsoluteURL { NSRange r; unsigned i; if ([self hasPrefix:@"mailto:"]) return YES; if ([self hasPrefix:@"javascript:"]) return YES; r = [self rangeOfString:@"://"]; if (r.length == 0) { if ([self hasPrefix:@"file:"]) return YES; return NO; } if ([self hasPrefix:@"/"]) return NO; for (i = 0; i < r.location; i++) { if (!isalpha([self characterAtIndex:i])) return NO; } return YES; } - (NSString *)urlScheme { unsigned i, count; unichar c = 0; if ((count = [self length]) == 0) return nil; for (i = 0; i < count; i++) { c = [self characterAtIndex:i]; if (!isalpha(c)) break; } if ((c != ':') || (i < 1)) return nil; return [self substringToIndex:i]; } @end /* NSString(lfNSURLUtilities) */ #if !LIB_FOUNDATION_LIBRARY @implementation NSString(KVCCompatibility) - (id)valueForUndefinedKey:(NSString *)_key { NSLog(@"WARNING: tried to access undefined KVC key '%@' on str object: %@", _key, self); return nil; } @end #endif SOPE/sope-core/NGExtensions/FdExt.subproj/NSObject+Values.m0000644000000000000000000001035612242733417022371 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include "NSObject+Values.h" #include "common.h" @implementation NSObject(NGValues) - (BOOL)boolValue { // this returns always YES (the id != nil) return YES; } - (signed char)charValue { return (char)[self intValue]; } - (unsigned char)unsignedCharValue { return (unsigned char)[self intValue]; } - (signed short)shortValue { return (short)[self intValue]; } - (unsigned short)unsignedShortValue { return (unsigned short)[self unsignedIntValue]; } - (signed int)intValue { return [[self stringValue] intValue]; } - (unsigned int)unsignedIntValue { return (unsigned int)[self intValue]; } - (signed long)longValue { return (long)[self intValue]; } - (unsigned long)unsignedLongValue { return (unsigned long)[self unsignedIntValue]; } - (signed long long)longLongValue { return [[self stringValue] longLongValue]; } - (unsigned long long)unsignedLongLongValue { return [[self stringValue] unsignedLongLongValue]; } - (float)floatValue { return [[self stringValue] floatValue]; } - (double)doubleValue { return [[self stringValue] doubleValue]; } - (NSString *)stringValue { return [self description]; } @end /* NSObject(Values) */ @implementation NSString(NGValues) + (NSString *) stringWithUnsignedLongLong: (unsigned long long)value { return [NSString stringWithFormat: @"0x%.16"PRIx64, value]; } - (BOOL)boolValue { unsigned len; unichar c1; if ((len = [self length]) == 0) return NO; switch (len) { case 1: c1 = [self characterAtIndex:0]; if (c1 == '1') return YES; return NO; case 2: // NO, no (this is false in any case ;-) return NO; case 3: c1 = [self characterAtIndex:0]; if (c1 != 'Y' && c1 != 'y') return NO; if ([@"YES" isEqualToString:self]) return YES; if ([@"yes" isEqualToString:self]) return YES; break; case 4: c1 = [self characterAtIndex:0]; if (c1 != 'T' && c1 != 't') return NO; if ([@"TRUE" isEqualToString:self]) return YES; if ([@"true" isEqualToString:self]) return YES; break; case 5: // FALSE, false (this is false in any case ;-) return NO; } return NO; } - (NSString *)stringValue { return self; } - (unsigned char)unsignedCharValue { /* Note: this is a hack to support bool values with KVC operations. Problem is, that bools in Objective-C have no own type code and the runtime will use uchar to represent a bool. Note: there are platforms where int as used as the BOOL base type? */ register unsigned len; register unichar c1; if ((len = [self length]) == 0) return 0; c1 = [self characterAtIndex:0]; if (!isdigit(c1)) { switch (len) { case 2: // NO, no (this is false in any case ;-) break; case 3: c1 = [self characterAtIndex:0]; if (c1 != 'Y' && c1 != 'y') return NO; if ([@"YES" isEqualToString:self]) return YES; if ([@"yes" isEqualToString:self]) return YES; break; case 4: c1 = [self characterAtIndex:0]; if (c1 != 'T' && c1 != 't') return NO; if ([@"TRUE" isEqualToString:self]) return YES; if ([@"true" isEqualToString:self]) return YES; break; } } return [self intValue]; } - (unsigned long long)unsignedLongLongValue { return strtoull([self lossyCString], NULL, 0); } @end /* NSString(Values) */ void __link_NGExtensions_NSObjectValues(void) { /* required for static linking */ __link_NGExtensions_NSObjectValues(); } SOPE/sope-core/NGExtensions/FdExt.subproj/NSSet+enumerator.m0000644000000000000000000000577512242733417022651 0ustar rootroot/* Copyright (C) 2000-2006 SKYRIX Software AG Copyright (C) 2006 Helge Hess This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NSSet+enumerator.h" #include "common.h" @implementation NSSet(enumerator) - (id)initWithObjectsFromEnumerator:(NSEnumerator *)_enumerator { NSMutableSet *set = nil; set = [[NSMutableSet alloc] initWithObjectsFromEnumerator:_enumerator]; self = [self initWithSet:set]; [set release]; set = nil; return self; } /* mapping */ - (NSArray *)mappedArrayUsingSelector:(SEL)_selector { NSArray *array; NSSet *set; if ((set = [self mappedSetUsingSelector:_selector]) == nil) return nil; array = [[NSArray alloc] initWithObjectsFromEnumerator:[set objectEnumerator]]; return [array autorelease]; } - (NSArray *)mappedArrayUsingSelector:(SEL)_selector withObject:(id)_object { NSArray *array; NSSet *set; if ((set = [self mappedSetUsingSelector:_selector withObject:_object])== nil) return nil; array = [[NSArray allocWithZone:[self zone]] initWithObjectsFromEnumerator:[set objectEnumerator]]; return [array autorelease]; } - (NSSet *)mappedSetUsingSelector:(SEL)_selector { NSMutableSet *set; NSEnumerator *e; id object; set = [NSMutableSet setWithCapacity:[self count]]; e = [self objectEnumerator]; while ((object = [e nextObject]) != nil) { object = [object performSelector:_selector]; [set addObject:(object != nil ? object : (id)[NSNull null])]; } return set; } - (NSSet *)mappedSetUsingSelector:(SEL)_selector withObject:(id)_object { NSMutableSet *set; NSEnumerator *e; id object; set = [NSMutableSet setWithCapacity:[self count]]; e = [self objectEnumerator]; while ((object = [e nextObject]) != nil) { object = [object performSelector:_selector withObject:_object]; [set addObject:(object != nil ? object : (id)[NSNull null])]; } return set; } @end /* NSSet(enumerator) */ @implementation NSMutableSet(enumerator) - (id)initWithObjectsFromEnumerator:(NSEnumerator *)_enumerator { if ((self = [self init]) != nil) { id obj; while ((obj = [_enumerator nextObject]) != nil) [self addObject:obj]; } return self; } @end /* NSMutableSet(enumerator) */ void __link_NGExtensions_NSSetEnumerator() { __link_NGExtensions_NSSetEnumerator(); } SOPE/sope-core/NGExtensions/FdExt.subproj/NSString+URLEscaping.m0000644000000000000000000002066212242733417023307 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NSString+misc.h" #include "common.h" /* TODO: support new Panther API?: - (NSString *)stringByAddingPercentEscapesUsingEncoding:(NSStringEncoding)e - (NSString *)stringByReplacingPercentEscapesUsingEncoding:(NSStringEncoding)e */ @implementation NSString(URLEscaping) static int useUTF8Encoding = -1; static inline BOOL doUseUTF8Encoding(void) { if (useUTF8Encoding == -1) { NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; useUTF8Encoding = [ud boolForKey:@"NGUseUTF8AsURLEncoding"] ? 1 : 0; if (useUTF8Encoding) NSLog(@"Note: Using UTF-8 as URL encoding in NGExtensions."); } return useUTF8Encoding ? YES : NO; } static inline BOOL isUrlAlpha(unsigned char _c) { return (((_c >= 'a') && (_c <= 'z')) || ((_c >= 'A') && (_c <= 'Z'))) ? YES : NO; } static inline BOOL isUrlDigit(unsigned char _c) { return ((_c >= '0') && (_c <= '9')) ? YES : NO; } static inline BOOL isUrlSafeChar(unsigned char _c) { switch (_c) { case '$': case '-': case '_': case '.': #if 0 /* see OGo bug #1260, required for forms */ case '+': #endif case '@': // TODO: not a safe char?! return YES; default: return NO; } } static inline BOOL isUrlExtraChar(unsigned char _c) { switch (_c) { case '!': case '*': case '"': case '\'': case '|': case ',': return YES; } return NO; } static inline BOOL isUrlEscapeChar(unsigned char _c) { return (_c == '%') ? YES : NO; } static inline BOOL isUrlReservedChar(unsigned char _c) { switch (_c) { case '=': case ';': case '/': case '#': case '?': case ':': case ' ': return YES; } return NO; } static inline BOOL isUrlXalpha(unsigned char _c) { if (isUrlAlpha(_c)) return YES; if (isUrlDigit(_c)) return YES; if (isUrlSafeChar(_c)) return YES; if (isUrlExtraChar(_c)) return YES; if (isUrlEscapeChar(_c)) return YES; return NO; } static inline BOOL isUrlHexChar(unsigned char _c) { if (isUrlDigit(_c)) return YES; if ((_c >= 'a') && (_c <= 'f')) return YES; if ((_c >= 'A') && (_c <= 'F')) return YES; return NO; } static inline BOOL isUrlAlphaNum(unsigned char _c) { return (isUrlAlpha(_c) || isUrlDigit(_c)) ? YES : NO; } static inline BOOL isToBeEscaped(unsigned char _c) { return (isUrlAlphaNum(_c) || (_c == '_') || isUrlSafeChar(_c)) ? NO : YES; } static void NGEscapeUrlBuffer(const unsigned char *_source, unsigned char *_dest, unsigned srclen) { register const unsigned char *src = (void*)_source; register unsigned i; for (i = 0; i < srclen; i++, src++) { #if 0 // explain! if (*src == ' ') { // a ' ' becomes a '+' *_dest = '+'; _dest++; } #endif if (!isToBeEscaped(*src)) { *_dest = *src; _dest++; } else { // any other char is escaped .. *_dest = '%'; _dest++; sprintf((char *)_dest, "%02X", (unsigned)*src); _dest += 2; } } *_dest = '\0'; } static inline int _valueOfHexChar(register unichar _c) { switch (_c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': return (_c - 48); // 0-9 (ascii-char)'0' - 48 => (int)0 case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': return (_c - 55); // A-F, A=10..F=15, 'A'=65..'F'=70 case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': return (_c - 87); // a-f, a=10..F=15, 'a'=97..'f'=102 default: return -1; } } static inline BOOL _isHexDigit(register unichar _c) { switch (_c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': return YES; default: return NO; } } static void NGUnescapeUrlBuffer(const unsigned char *_source, unsigned char *_dest) { BOOL done = NO; while (!done && (*_source != '\0')) { char c = *_source; //if (c == '+') // '+' stands for a space // *_dest = ' '; if (c == '%') { _source++; c = *_source; if (c == '\0') { *_dest = '%'; done = YES; } else if (_isHexDigit(c)) { // hex-escaped char, like '%F3' int decChar = _valueOfHexChar(c); _source++; c = *_source; decChar = decChar * 16 + _valueOfHexChar(c); *_dest = (unsigned char)decChar; } else // escaped char, like '%%' -> '%' *_dest = c; } else // char passed through *_dest = c; _dest++; _source++; } *_dest = '\0'; } - (BOOL)containsURLEscapeCharacters { register unsigned i, len; register unichar (*charAtIdx)(id,SEL,unsigned); if ((len = [self length]) == 0) return NO; charAtIdx = (void*)[self methodForSelector:@selector(characterAtIndex:)]; for (i = 0; i < len; i++) { if (charAtIdx(self, @selector(characterAtIndex:), i) == '%') return YES; } return NO; } - (BOOL)containsURLInvalidCharacters { register NSUInteger i, len; const char *utf8String; utf8String = [self UTF8String]; len = strlen (utf8String); for (i = 0; i < len; i++) { if (isToBeEscaped(utf8String[i])) return YES; } return NO; } - (NSString *)stringByUnescapingURL { /* Input is a URL string - per definition ASCII(?!), like "hello%98%88.txt" output is a unicode string (never longer than the input) Note that the input itself is in some encoding! That is, the input is turned into a buffer eg containing UTF-8 and needs to be converted into a unicode string. */ unsigned len; char *cstr; char *buffer = NULL; NSString *s; if (![self containsURLEscapeCharacters]) /* scan for '%' */ return [[self copy] autorelease]; if ((len = [self cStringLength]) == 0) return @""; cstr = malloc(len + 10); [self getCString:cstr]; /* this is OK, a URL is always in ASCII! */ cstr[len] = '\0'; buffer = malloc(len + 4); NGUnescapeUrlBuffer((unsigned char *)cstr, (unsigned char *)buffer); if (doUseUTF8Encoding()) { /* OK, the input is considered UTF-8 encoded in a string */ s = [[NSString alloc] initWithUTF8String:buffer]; /* We fallback to ISO-8859-1 here, as this method totally ignores the charset */ if (!s) s = [[NSString alloc] initWithCString:buffer encoding: NSISOLatin1StringEncoding]; if (buffer != NULL) free(buffer); buffer = NULL; } else { s = [[NSString alloc] initWithCStringNoCopy:buffer length:strlen(buffer) freeWhenDone:YES]; } if (cstr != NULL) free(cstr); cstr = NULL; return [s autorelease]; } - (NSString *)stringByEscapingURL { unsigned len; NSString *s; NSData *data; char *buffer = NULL; NSStringEncoding encoding; if ((len = [self length]) == 0) return @""; if (![self containsURLInvalidCharacters]) // needs to be escaped ? return [[self copy] autorelease]; // steps: // a) encode into a data buffer! (eg UTF8 or ISO) // b) encode that buffer into URL encoding // c) create an ASCII string from that encoding = (doUseUTF8Encoding() ? NSUTF8StringEncoding : NSISOLatin1StringEncoding); if ((data = [self dataUsingEncoding:encoding]) == nil) return nil; if ((len = [data length]) == 0) return @""; buffer = malloc(len * 3 + 2); NGEscapeUrlBuffer([data bytes], (unsigned char *)buffer, len); /* the following assumes that the default-encoding is ASCII compatible */ s = [[NSString alloc] initWithBytesNoCopy:buffer length:strlen(buffer) encoding:NSASCIIStringEncoding freeWhenDone:YES]; return [s autorelease]; } @end /* NSString(URLEscaping) */ SOPE/sope-core/NGExtensions/FdExt.subproj/NSURL+misc.m0000644000000000000000000002676212242733417021331 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NSURL+misc.h" #include "common.h" static BOOL debugURLProcessing = NO; @implementation NSURL(misc) - (NSString *)pathWithCorrectTrailingSlash { #if COCOA_Foundation_LIBRARY || NeXT_Foundation_LIBRARY /* At least on OSX 10.3 the -path method missing the trailing slash, eg: http://localhost:20000/dbd.woa/so/localhost/ gives: /dbd.woa/so/localhost */ NSString *p; if ((p = [self path]) == nil) return nil; if ([p hasSuffix:@"/"]) return p; if (![[self absoluteString] hasSuffix:@"/"]) return p; /* so we are running into the bug ... */ return [p stringByAppendingString:@"/"]; #else return [self path]; #endif } - (NSString *)stringByAddingFragmentAndQueryToPath:(NSString *)_path { NSString *lFrag, *lQuery; if ([self isFileURL]) return _path; lFrag = [self fragment]; lQuery = [self query]; if ((lFrag != nil) || (lQuery != nil)) { NSMutableString *ms; ms = [NSMutableString stringWithCapacity:([_path length] + 32)]; [ms appendString:_path]; if (lFrag) { [ms appendString:@"#"]; [ms appendString:lFrag]; } if (lQuery) { [ms appendString:@"?"]; [ms appendString:lQuery]; } return ms; } else return _path; } - (NSString *)stringValueRelativeToURL:(NSURL *)_base { /* Sample: self: http://localhost:20000/dbd.woa/so/localhost/Databases/A base: http://localhost:20000/dbd.woa/so/localhost/ => Databases/A Note: on Panther Foundation the -path misses the trailing slash! */ NSString *relPath; if (_base == self || _base == nil) { relPath = [self pathWithCorrectTrailingSlash]; relPath = [relPath urlPathRelativeToSelf]; relPath = [self stringByAddingFragmentAndQueryToPath:relPath]; if (debugURLProcessing) { NSLog(@"%s: no base or base is self => '%@'", __PRETTY_FUNCTION__, relPath); } return relPath; } /* check whether we are already marked relative to _base .. */ if ([self baseURL] == _base) { NSString *p; p = [self relativePath]; #if COCOA_Foundation_LIBRARY || NeXT_Foundation_LIBRARY /* see -pathWithCorrectTrailingSlash for bug description ... */ if (![p hasSuffix:@"/"]) { if ([[self absoluteString] hasSuffix:@"/"]) p = [p stringByAppendingString:@"/"]; } #endif p = [self stringByAddingFragmentAndQueryToPath:p]; if (debugURLProcessing) { NSLog(@"%s: url base and _base match => '%@'", __PRETTY_FUNCTION__, p); } return p; } /* check whether we are in the same path namespace ... */ if (![self isInSameNamespaceWithURL:_base]) { /* need to return full URL */ relPath = [self absoluteString]; if (debugURLProcessing) { NSLog(@"%s: url is in different namespace from base => '%@'", __PRETTY_FUNCTION__, relPath); } return relPath; } relPath = [[self pathWithCorrectTrailingSlash] urlPathRelativeToPath:[_base pathWithCorrectTrailingSlash]]; if (debugURLProcessing) { NSLog(@"%s: path '%@', base-path '%@' => rel '%@'", __PRETTY_FUNCTION__, [self path], [_base path], relPath); } relPath = [self stringByAddingFragmentAndQueryToPath:relPath]; if (debugURLProcessing) { NSLog(@"%s: same namespace, but no direct relative (%@, base %@) => '%@'", __PRETTY_FUNCTION__, [self absoluteString], [_base absoluteString], relPath); } return relPath; } static BOOL isEqual(id o1, id o2) { if (o1 == o2) return YES; if (o1 == nil || o2 == nil) return NO; return [o1 isEqual:o2]; } - (BOOL)isInSameNamespaceWithURL:(NSURL *)_url { if (_url == nil) return NO; if (_url == self) return YES; if ([self isFileURL] && [_url isFileURL]) return YES; if ([self baseURL] == _url) return YES; if ([_url baseURL] == self) return YES; if (![[self scheme] isEqualToString:[_url scheme]]) return NO; if (!isEqual([self host], [_url host])) return NO; if (!isEqual([self port], [_url port])) return NO; if (!isEqual([self user], [_url user])) return NO; return YES; } @end /* NSURL */ @implementation NSString(URLPathProcessing) - (NSString *)urlPathRelativeToSelf { /* eg: "/a/b/c.html" should resolve to: "c.html" Directories are a bit more difficult, eg: "/a/b/c/" is resolved to "../c/" */ NSString *p; NSString *lp; /* /SOGo/so/X/Mail/Y/INBOX/withsubdirs/ ..//SOGo/so/X/Mail/Y/INBOX/withsubdirs// */ p = self; lp = [p lastPathComponent]; if (![p hasSuffix:@"/"]) return lp; return [[@"../" stringByAppendingString:lp] stringByAppendingString:@"/"]; } - (NSString *)urlPathRelativeToRoot { NSString *p; p = self; if ([p isEqualToString:@"/"]) /* don't know better ... what is root-relative-to-root ? */ return @"/"; if ([p length] == 0) { NSLog(@"%s: invalid path (length 0), using /: %@", __PRETTY_FUNCTION__, self); return @"/"; } /* this is the same like the absolute path, only without a leading "/" .. */ return [p characterAtIndex:0] == '/' ? [p substringFromIndex:1] : p; } static NSString *calcRelativePathOfChildURL(NSString *self, NSString *_base) { /* the whole base URI is prefix of our URI: case a) b: "/a/b/c" s: "/a/b/c/d" >: "c/d" case b) b: "/a/b/c/" s: "/a/b/c/d" >: "d" case c) b: "/a/b/c" s: "/a/b/ccc/d" >: "ccc/d" b=s is already catched above and s is guaranteed to be longer than b. */ unsigned blen; NSString *result; if (debugURLProcessing) NSLog(@"%s: has base as prefix ...", __PRETTY_FUNCTION__); blen = [_base length]; if ([_base characterAtIndex:(blen - 1)] == '/') { /* last char of 'b' is '/' => case b) */ result = [self substringFromIndex:blen]; } else { /* last char of 'b' is not a slash (either case a) or case c)), both are handled in the same way (search last / ...) */ NSRange r; r = [_base rangeOfString:@"/" options:NSBackwardsSearch]; if (r.length == 0) { NSLog(@"%s: invalid base, found no '/': '%@' !", __PRETTY_FUNCTION__, _base); result = self; } else { /* no we have case b) ... */ result = [self substringFromIndex:(r.location + 1)]; } } return result; } - (NSString *)commonDirPathPrefixWithString:(NSString *)_other { // TODO: the implementation can probably be optimized a _LOT_ /* eg "/home/images/" vs "/home/index.html" => "/home/", _not_ "/home/i" ! */ NSString *s; unsigned len; NSRange r; if (_other == self) return self; s = [self commonPrefixWithString:_other options:0]; len = [s length]; if (len == 0) return s; if ([s characterAtIndex:(len - 1)] == '/') return s; r = [s rangeOfString:@"/" options:NSBackwardsSearch]; if (r.length == 0) /* hm, can't happen? */ return nil; return [s substringToIndex:(r.location + r.length)];; } static NSString *calcRelativePathOfNonChildURL(NSString *self, NSString *_base) { unsigned numSlashes; NSString *result; NSString *prefix; NSString *suffix; unsigned plen; prefix = [self commonDirPathPrefixWithString:_base]; plen = [prefix length]; suffix = [self substringFromIndex:plen]; numSlashes = 0; if (debugURLProcessing) { NSLog(@"%s: does not have base as prefix, common '%@'\n" @" self='%@'\n" @" base='%@'\n" @" suffix='%@'", __PRETTY_FUNCTION__, prefix, self, _base, suffix); } if (plen == 0) { NSLog(@"%s: invalid strings, no common prefix ...: '%@' and '%@' !", __PRETTY_FUNCTION__, self, _base); return self; } if (plen == 1) { /* common prefix is root. That is, nothing in common: b: "/a/b" s: "/l" >: "../l" b: "/a/b/" s: "/l" >: "../../l" (number of slashes without root * "..", then the trailer?) */ unsigned i, len; len = [_base length]; if ([prefix characterAtIndex:0] != '/') { NSLog(@"%s: invalid strings, common prefix '%@' is not '/': " @"'%@' and '%@' !", __PRETTY_FUNCTION__, self, _base, prefix); } for (i = 1 /* skip root */; i < len; i++) { if ([_base characterAtIndex:i] == '/') numSlashes++; } } else { /* base: /dev/en/projects/bsd/index.html self: /dev/en/macosx/ => ../../macosx/ */ NSString *basesuffix; unsigned i, len; basesuffix = [_base substringFromIndex:plen]; len = [basesuffix length]; for (i = 0; i < len; i++) { if ([basesuffix characterAtIndex:i] == '/') numSlashes++; } } if (debugURLProcessing) NSLog(@"%s: slashes: %d", __PRETTY_FUNCTION__, numSlashes); /* optimization for some depths */ switch (numSlashes) { case 0: /* no slashes in base: b:/a, s:/images/a => images/a */ result = suffix; break; case 1: /* one slash in base: b:/a/, s:/images/a => ../images/a, etc */ result = [@"../" stringByAppendingString:suffix]; break; case 2: result = [@"../../" stringByAppendingString:suffix]; break; case 3: result = [@"../../../" stringByAppendingString:suffix]; break; case 4: result = [@"../../../../" stringByAppendingString:suffix]; break; case 5: result = [@"../../../../../" stringByAppendingString:suffix];break; default: { NSMutableString *ms; unsigned i; ms = [NSMutableString stringWithCapacity:(numSlashes * 3)]; for (i = 0; i < numSlashes; i++) [ms appendString:@"../"]; [ms appendString:suffix]; result = ms; break; } } if (debugURLProcessing) NSLog(@"%s: => '%@'", __PRETTY_FUNCTION__, result); return result; } - (NSString *)urlPathRelativeToPath:(NSString *)_base { /* This can be used for URLs in the same namespace. It should never return an absolute path (it only does in error conditions). */ // TODO: the implementation can probably be optimized a _LOT_ if (_base == nil || [_base length] == 0) { NSLog(@"%s: invalid base (nil or length 0), using absolute path '%@' ...", __PRETTY_FUNCTION__, self); return self; } if ([_base isEqualToString:@"/"]) return [self urlPathRelativeToRoot]; if ([_base isEqualToString:self]) return [self urlPathRelativeToSelf]; if (debugURLProcessing) NSLog(@"%s: %@ relative to %@ ...", __PRETTY_FUNCTION__, self, _base); if ([self hasPrefix:_base]) return calcRelativePathOfChildURL(self, _base); return calcRelativePathOfNonChildURL(self, _base); } @end /* NSString(URLPathProcessing) */ SOPE/sope-core/NGExtensions/FdExt.subproj/NSData+gzip.m0000644000000000000000000001204512242733417021543 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NSData+gzip.h" #include "common.h" #ifdef Assert # undef Assert #endif #include #ifndef DEF_MEM_LEVEL /* zutil.h */ # if MAX_MEM_LEVEL >= 8 # define DEF_MEM_LEVEL 8 # else # define DEF_MEM_LEVEL MAX_MEM_LEVEL # endif # define OS_CODE 0x07 /* TODO: probably need to adjust that ... */ #endif #undef Assert @implementation NSData(gzip) - (NSData *)gzip { return [self gzipWithLevel:Z_DEFAULT_COMPRESSION]; } static inline void putLong(uLong x, NSMutableData *data, IMP addBytes) { int n; for (n = 0; n < 4; n++) { unsigned char c = (int)(x & 0xff); addBytes(data, @selector(appendBytes:length:), &c, 1); x >>= 8; } } - (NSData *)gzipWithLevel:(int)_level { NSMutableData *data = nil; int errorCode = 0; unsigned len = [self length]; void *src = (void *)[self bytes]; IMP addBytes = NULL; char outBuf[4096]; z_stream out; uLong crc; NSAssert1((_level >= NGGZipMinimalCompression && _level <= NGGZipMaximalCompression) || (_level == Z_DEFAULT_COMPRESSION), @"invalid compression level %i (0-9)", _level); data = [NSMutableData dataWithCapacity: (len / 10 < 128) ? len : len / 10]; addBytes = [data methodForSelector:@selector(appendBytes:length:)]; out.zalloc = (alloc_func)NULL; out.zfree = (free_func)NULL; out.opaque = (voidpf)NULL; out.next_out = (Byte*)&outBuf; out.avail_out = sizeof(outBuf); out.next_in = Z_NULL; out.avail_in = 0; errorCode = Z_OK; crc = crc32(0L, Z_NULL, 0); errorCode = deflateInit2(&out, _level, Z_DEFLATED, -MAX_WBITS, DEF_MEM_LEVEL, 0); // windowBits is passed <0 to suppress zlib header if (errorCode != Z_OK) { NSLog(@"ERROR: could not init deflate !"); return nil; } { // add gzip header char buf[10] = { 0x1f, 0x8b, // magic Z_DEFLATED, 0, // flags 0, 0, 0, 0, // time 0, OS_CODE // flags }; addBytes(data, @selector(appendBytes:length:), &buf, 10); } { // gz_write out.next_in = src; out.avail_in = len; while (out.avail_in > 0) { if (out.avail_out == 0) { out.next_out = (void *)&outBuf; // reset buffer position addBytes(data, @selector(appendBytes:length:), &outBuf, sizeof(outBuf)); out.avail_out = sizeof(outBuf); } errorCode = deflate(&out, Z_NO_FLUSH); if (errorCode != Z_OK) { NSLog(@"ERROR: could not deflate chunk !"); if (out.state) deflateEnd(&out); return nil; } } crc = crc32(crc, src, len); } { // gz_flush BOOL done = NO; out.next_in = NULL; out.avail_in = 0; // should be zero already anyway for (;;) { len = sizeof(outBuf) - out.avail_out; if (len > 0) { addBytes(data, @selector(appendBytes:length:), &outBuf, len); out.next_out = (void *)&outBuf; out.avail_out = sizeof(outBuf); } if (done) break; errorCode = deflate(&out, Z_FINISH); // deflate has finished flushing only when it hasn't used up // all the available space in the output buffer: done = (out.avail_out != 0 || errorCode == Z_STREAM_END); if (errorCode != Z_OK && errorCode != Z_STREAM_END) break; } if (errorCode != Z_STREAM_END) { NSLog(@"ERROR: flush failed."); if (out.state) deflateEnd(&out); return nil; } } { // write trailer (checksum and filesize) putLong(crc, data, addBytes); putLong(out.total_in, data, addBytes); } if (out.state) deflateEnd(&out); return data; } - (NSData *)compress { return [self compressWithLevel: 3]; } - (NSData *)compressWithLevel: (int) level { NSData *result; Bytef *destBuffer; unsigned long destLen; int rc; destLen = [self length]; destBuffer = NSZoneMalloc (NULL, destLen); rc = compress2 (destBuffer, &destLen, [self bytes], destLen, level); if (rc == Z_OK) result = [NSData dataWithBytesNoCopy: destBuffer length: destLen freeWhenDone: YES]; else result = nil; return result; } @end void __link_NSData_gzip(void) { __link_NSData_gzip(); } SOPE/sope-core/NGExtensions/FdExt.subproj/NSString+Encoding.m0000644000000000000000000002011712242733417022714 0ustar rootroot/* Copyright (C) 2000-2007 SKYRIX Software AG Copyright (C) 2007 Helge Hess This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include "common.h" #if NeXT_Foundation_LIBRARY || COCOA_Foundation_LIBRARY # import #else # include # import #endif #if GNUSTEP_BASE_LIBRARY #import #endif // TODO: should move different implementations to different files ... #if NeXT_Foundation_LIBRARY || COCOA_Foundation_LIBRARY @interface NSString(Encoding_PrivateAPI) + (NSStringEncoding)stringEncodingForEncodingNamed:(NSString *)encoding; @end @implementation NSString(Encoding) + (NSStringEncoding)stringEncodingForEncodingNamed:(NSString *)_encoding { CFStringEncoding cfEncoding; if(_encoding == nil) return 0; _encoding = [_encoding lowercaseString]; cfEncoding = CFStringConvertIANACharSetNameToEncoding((CFStringRef)_encoding); if(cfEncoding == kCFStringEncodingInvalidId) return 0; return CFStringConvertEncodingToNSStringEncoding(cfEncoding); } + (NSString *)stringWithData:(NSData *)_data usingEncodingNamed:(NSString *)_encoding { NSStringEncoding encoding; encoding = [NSString stringEncodingForEncodingNamed:_encoding]; return [[[NSString alloc] initWithData:_data encoding:encoding] autorelease]; } - (NSData *)dataUsingEncodingNamed:(NSString *)_encoding { NSStringEncoding encoding; encoding = [NSString stringEncodingForEncodingNamed:_encoding]; return [self dataUsingEncoding:encoding]; } @end /* NSString(Encoding) */ #else /* ! NeXT_Foundation_LIBRARY */ @implementation NSString(Encoding) #if GNUSTEP_BASE_LIBRARY + (NSStringEncoding)stringEncodingForEncodingNamed:(NSString *)_encoding { return [GSMimeDocument encodingFromCharset:_encoding]; } #endif #if LIB_FOUNDATION_LIBRARY + (NSStringEncoding)stringEncodingForEncodingNamed:(NSString *)_encoding { NSString *s = [_encoding lowercaseString]; unsigned len = [s length]; if (s == nil) return 0; switch(len) { case 4: if ([s isEqualToString:@"utf8"]) return NSUTF8StringEncoding; break; case 5: if ([s isEqualToString:@"utf-8"]) return NSUTF8StringEncoding; if ([s isEqualToString:@"ascii"]) return NSASCIIStringEncoding; break; case 6: if ([s isEqualToString:@"latin1"]) return NSISOLatin1StringEncoding; if ([s isEqualToString:@"latin9"]) return NSISOLatin9StringEncoding; break; case 10: if ([s isEqualToString:@"iso-8859-1"]) return NSISOLatin1StringEncoding; break; case 11: if ([s isEqualToString:@"iso-8859-15"]) return NSISOLatin9StringEncoding; break; } NSLog(@"%s: could not derive NSStringEncoding from name: '%@'", _encoding); return 0; } #endif #ifdef __linux__ #if __BYTE_ORDER == __LITTLE_ENDIAN static NSString *unicharEncoding = @"UCS-2LE"; #else static NSString *unicharEncoding = @"UCS-2BE"; #endif /* __BYTE_ORDER */ #else static NSString *unicharEncoding = @"UCS-2-INTERNAL"; #endif static int IconvLogEnabled = -1; static void checkDefaults(void) { NSUserDefaults *ud; if (IconvLogEnabled == -1) { ud = [NSUserDefaults standardUserDefaults]; IconvLogEnabled = [ud boolForKey:@"IconvLogEnabled"]?1:0; NSLog(@"Note: using '%@' on Linux.", unicharEncoding); } } static char *iconv_wrapper(id self, char *_src, unsigned _srcLen, NSString *_fromEncode, NSString *_toEncode, unsigned *outLen_) { iconv_t type; size_t inbytesleft, outbytesleft, write, outlen; const char *fromEncode, *toEncode; char *inbuf, *outbuf, *tm; checkDefaults(); if (IconvLogEnabled) { [self logWithFormat:@"FromEncode: %@; ToEncode: %@", _fromEncode, _toEncode]; } _fromEncode = [_fromEncode uppercaseString]; _toEncode = [_toEncode uppercaseString]; if (0 && [_fromEncode isEqualToString:_toEncode]) { outlen = _srcLen; outbuf = calloc(sizeof(char), outlen+1); memcpy(outbuf, _src, _srcLen); *outLen_ = outlen; return outbuf; } fromEncode = [_fromEncode cString]; toEncode = [_toEncode cString]; type = iconv_open(toEncode, fromEncode); inbuf = NULL; outbuf = NULL; if ((type == (iconv_t)-1)) { [self logWithFormat:@"%s: Could not handle iconv encoding. FromEncoding:%@" @" to encoding:%@", __PRETTY_FUNCTION__, _fromEncode, _toEncode]; goto CLEAR_AND_RETURN; } inbytesleft = _srcLen; inbuf = _src; outlen = inbytesleft * 3; outbuf = calloc(outlen + 1, sizeof(char));; tm = outbuf; outbytesleft = outlen; write = iconv(type, &inbuf, &inbytesleft, &tm, &outbytesleft); if (write == (size_t)-1) { if (errno == EILSEQ) { [self logWithFormat:@"Got invalid multibyte sequence. ToEncode: %@" @" FromEncode: %@.", _toEncode, _fromEncode]; if (IconvLogEnabled) { [self logWithFormat:@"ByteSequence:\n%s\n", _src]; } goto CLEAR_AND_RETURN; } else if (errno == EINVAL) { [self logWithFormat:@"Got incomplete multibyte sequence. ToEncode: %@" @" FromEncode: %@", _toEncode, _fromEncode]; if (IconvLogEnabled) [self logWithFormat:@"ByteSequence:\n%s\n", _src]; } else if (errno == E2BIG) { [self logWithFormat: @"Got to small outputbuffer (inbytesleft=%d, outbytesleft=%d, " @"outlen=%d). ToEncode: %@ FromEncode: %@", inbytesleft, outbytesleft, outlen, _toEncode, _fromEncode]; if (IconvLogEnabled) [self logWithFormat:@"ByteSequence:\n%s\n", _src]; goto CLEAR_AND_RETURN; } else { [self logWithFormat:@"Got unexpected error. ToEncode: %@" @" FromEncode: %@", _toEncode, _fromEncode]; goto CLEAR_AND_RETURN; } } #if DEBUG_ICONV NSLogL(@"outlen %d outbytesleft %d", outlen, outbytesleft); #endif if (type) iconv_close(type); *outLen_ = outlen - outbytesleft; return outbuf; CLEAR_AND_RETURN: if (type && (type != (iconv_t)-1)) iconv_close(type); if (outbuf) { free(outbuf); outbuf = NULL; } return NULL; } + (NSString *)stringWithData:(NSData *)_data usingEncodingNamed:(NSString *)_encoding { void *inbuf, *res; unsigned len, inbufLen; NSString *result; if (![_encoding length]) return nil; inbufLen = [_data length]; inbuf = calloc(sizeof(char), inbufLen + 4); [_data getBytes:inbuf]; result = nil; res = iconv_wrapper(self, inbuf, inbufLen, _encoding, unicharEncoding, &len); if (res) { result = [[NSString alloc] initWithCharacters:res length:(len / 2)]; free(res); res = NULL; } if (inbuf) free(inbuf); inbuf = NULL; return [result autorelease]; } - (NSData *)dataUsingEncodingNamed:(NSString *)_encoding { unichar *chars; char *res; unsigned inputLen, resLen; NSData *data; if (![_encoding length]) return nil; data = nil; inputLen = [self length]; chars = calloc(sizeof(unichar), inputLen + 4); [self getCharacters:chars]; res = iconv_wrapper(self, (char *)chars, inputLen*2, unicharEncoding, _encoding, &resLen); if (res) data = [NSData dataWithBytes:res length:resLen]; if (chars) free(chars); chars = NULL; return data; } @end /* NSString(Encoding) */ #endif /* ! NeXT_Foundation_LIBRARY */ SOPE/sope-core/NGExtensions/FdExt.subproj/NSString+XMLEscaping.m0000644000000000000000000000740412242733417023304 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NSString+misc.h" #include "common.h" @implementation NSString(XMLEscaping) - (NSString *)stringByEscapingXMLStringUsingCharacters { register unsigned i, len, j; register unichar *chars, *buf; unsigned escapeCount; if ((len = [self length]) == 0) return @""; chars = malloc((len + 3) * sizeof(unichar)); [self getCharacters:chars]; /* check for characters to escape ... */ for (i = 0, escapeCount = 0; i < len; i++) { switch (chars[i]) { case '&': case '"': case '<': case '>': escapeCount++; break; default: if (chars[i] > 127) escapeCount++; break; } } if (escapeCount == 0 ) { /* nothing to escape ... */ if (chars) free(chars); return [[self copy] autorelease]; } buf = malloc(((len + 3) * sizeof(unichar)) + (escapeCount * 8 * sizeof(unichar))); for (i = 0, j = 0; i < len; i++) { switch (chars[i]) { /* escape special chars */ case '&': buf[j] = '&'; j++; buf[j] = 'a'; j++; buf[j] = 'm'; j++; buf[j] = 'p'; j++; buf[j] = ';'; j++; break; case '"': buf[j] = '&'; j++; buf[j] = 'q'; j++; buf[j] = 'u'; j++; buf[j] = 'o'; j++; buf[j] = 't'; j++; buf[j] = ';'; j++; break; case '<': buf[j] = '&'; j++; buf[j] = 'l'; j++; buf[j] = 't'; j++; buf[j] = ';'; j++; break; case '>': buf[j] = '&'; j++; buf[j] = 'g'; j++; buf[j] = 't'; j++; buf[j] = ';'; j++; break; default: /* escape big chars */ if (chars[i] > 127) { unsigned char nbuf[16]; unsigned int k; sprintf((char *)nbuf, "&#%i;", (int)chars[i]); for (k = 0; nbuf[k] != '\0'; k++) { buf[j] = nbuf[k]; j++; } } else { /* nothing to escape */ buf[j] = chars[i]; j++; } break; } } self = [NSString stringWithCharacters:buf length:j]; if (chars) free(chars); if (buf) free(buf); return self; } - (NSString *)stringByEscapingXMLString { return [self stringByEscapingXMLStringUsingCharacters]; } - (NSString *)stringByEscapingXMLAttributeValue { return [self stringByEscapingHTMLAttributeValue]; } /* XML FQNs */ - (BOOL)xmlIsFQN { if ([self length] == 0) return NO; return [self characterAtIndex:0] == '{' ? YES : NO; } - (NSString *)xmlNamespaceURI { NSRange r; r = [self rangeOfString:@"}" options:(NSLiteralSearch | NSBackwardsSearch)]; if (r.length == 0) return nil; if ([self characterAtIndex:0] != '{') return nil; r.length = (r.location - 1); r.location = 1; return [self substringWithRange:r]; } - (NSString *)xmlLocalName { NSRange r; r = [self rangeOfString:@"}" options:(NSLiteralSearch | NSBackwardsSearch)]; if (r.length == 0) return nil; if ([self characterAtIndex:0] != '{') return nil; return [self substringFromIndex:(r.location + r.length)]; } @end /* NSString(XMLEscaping) */ SOPE/sope-core/NGExtensions/FdExt.subproj/NSCalendarDate+misc.m0000644000000000000000000004066412242733417023173 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NSCalendarDate+misc.h" #include "common.h" #include #define NUMBER_OF_SECONDS_IN_DAY (24 * 60 * 60) @implementation NSCalendarDate(misc) + (NSCalendarDate *)mondayOfWeek:(int)_weekNumber inYear:(int)_year timeZone:(NSTimeZone *)_tz { NSCalendarDate *janFirst; janFirst = [NSCalendarDate dateWithYear:_year month:1 day:1 hour:0 minute:0 second:0 timeZone:_tz]; return [janFirst mondayOfWeek:_weekNumber]; } - (NSCalendarDate *)mondayOfWeek:(int)_weekNumber { NSCalendarDate *mondayOfWeek; short lastWeek; mondayOfWeek = [self firstMondayAndLastWeekInYear:&lastWeek]; if (_weekNumber == 1) return mondayOfWeek; return [mondayOfWeek dateByAddingYears:0 months:0 days:(7 * (_weekNumber - 1))]; } + (NSArray *)mondaysOfYear:(int)_year timeZone:(NSTimeZone *)_tz { NSCalendarDate *janFirst; janFirst = [NSCalendarDate dateWithYear:_year month:1 day:1 hour:0 minute:0 second:0 timeZone:_tz]; return [janFirst mondaysOfYear]; } - (NSArray *)mondaysOfYear { NSArray *array; NSMutableArray *mondays; NSCalendarDate *mondayOfWeek; short lastWeek; int i; mondayOfWeek = [self firstMondayAndLastWeekInYear:&lastWeek]; mondays = [[NSMutableArray alloc] initWithCapacity:55]; for (i = 0; i < lastWeek; i++) { #if 0 // hh: can someone explain this ?! if (i > 0) { mondayOfWeek = [mondayOfWeek addYear:0 month:0 day:7 hour:0 minute:0 second:0]; } mondayOfWeek = [[mondayOfWeek copy] autorelease]; [mondays addObject:mondayOfWeek]; #else NSCalendarDate *tmp; tmp = [mondayOfWeek dateByAddingYears:0 months:0 days:(i * 7)]; [mondays addObject:tmp]; #endif } array = [mondays copy]; [mondays release]; return [array autorelease]; } - (NSCalendarDate *)firstMondayAndLastWeekInYear:(short *)_lastWeek { NSTimeZone *tz; int currentYear; short lastWeek; NSCalendarDate *janFirst; NSCalendarDate *silvester; NSCalendarDate *mondayOfWeek; tz = [self timeZone]; currentYear = [self yearOfCommonEra]; if ([self weekOfYear] == 53) { NSCalendarDate *nextJanFirst = nil; nextJanFirst = [NSCalendarDate dateWithYear:(currentYear + 1) month:1 day:1 hour:0 minute:0 second:0 timeZone:tz]; if ([nextJanFirst weekOfYear] == 1) currentYear++; } janFirst = [NSCalendarDate dateWithYear:currentYear month:1 day:1 hour:0 minute:0 second:0 timeZone:tz]; silvester = [NSCalendarDate dateWithYear:currentYear month:12 day:31 hour:23 minute:59 second:59 timeZone:tz]; lastWeek = [silvester weekOfYear]; if (lastWeek == 53) { NSCalendarDate *nextJanFirst = nil; nextJanFirst = [NSCalendarDate dateWithYear:currentYear+1 month:1 day:1 hour:0 minute:0 second:0 timeZone:tz]; if ([nextJanFirst weekOfYear] == 1) lastWeek = 52; } if ([janFirst weekOfYear] != 1) { mondayOfWeek = [janFirst mondayOfWeek]; #if NeXT_Foundation_LIBRARY || COCOA_Foundation_LIBRARY mondayOfWeek = [mondayOfWeek dateByAddingYears:0 months:0 days:7 hours:0 minutes:0 seconds:0]; #else mondayOfWeek = [mondayOfWeek addYear:0 month:0 day:7 hour:0 minute:0 second:0]; #endif } else { mondayOfWeek = [janFirst mondayOfWeek]; } if (_lastWeek) *_lastWeek = lastWeek; return mondayOfWeek; } - (NSCalendarDate *)firstDayOfMonth { NSTimeInterval tv; NSCalendarDate *first; int dayOfMonth; NSTimeZone *tz; dayOfMonth = [self dayOfMonth]; tz = [self timeZone]; tv = (1 - dayOfMonth) * NUMBER_OF_SECONDS_IN_DAY; tv = [self timeIntervalSince1970] + tv; first = [NSCalendarDate dateWithTimeIntervalSince1970:tv]; [first setTimeZone:tz]; return first; } - (NSCalendarDate *)lastDayOfMonth { int offset = [self numberOfDaysInMonth] - [self dayOfMonth]; return [self dateByAddingYears:0 months:0 days:offset]; } - (int)numberOfDaysInMonth { static int leapYearMonths[12] = {31,29,31,30,31,30,31,31,30,31,30,31}; static int nonLeapYearMonths[12] = {31,28,31,30,31,30,31,31,30,31,30,31}; int *numberOfDaysInMonth = [self isInLeapYear] ? leapYearMonths : nonLeapYearMonths; return numberOfDaysInMonth[[self monthOfYear] - 1]; } - (BOOL)isInLeapYear { unsigned year = [self yearOfCommonEra]; return (((year % 4) == 0) && ((year % 100) != 0)) || ((year % 400) == 0); } - (int)weekOfMonth { /* returns 1-6 */ int dayOfMonth; int weekOfYear; int firstWeekOfYear; dayOfMonth = [self dayOfMonth]; /* 1-31 */ if (dayOfMonth == 1) return 1; /* could be done smarter (by calculating on dayOfWeek) */ weekOfYear = [self weekOfYear]; firstWeekOfYear = [[self firstDayOfMonth] weekOfYear]; return (weekOfYear - firstWeekOfYear + 1); } - (int)weekOfYear { static int whereToStart[] = { 6, 7, 8, 9, 10, 4, 5 }; NSCalendarDate *janFirst; int year, day, weekOfYear; NSTimeZone *tz; year = [self yearOfCommonEra]; day = [self dayOfYear] - 1; tz = [self timeZone]; janFirst = [NSCalendarDate dateWithYear:year month:1 day:1 hour:0 minute:0 second:0 timeZone:tz]; weekOfYear = (day + whereToStart[[janFirst dayOfWeek]]) / 7; if (weekOfYear == 0) { NSCalendarDate *silvesterLastYear; silvesterLastYear = [NSCalendarDate dateWithYear:(year - 1) month:12 day:31 hour:0 minute:0 second:0 timeZone:tz]; return [silvesterLastYear weekOfYear]; } #if 0 if (weekOfYear == 53) { NSCalendarDate *nextJanFirst = nil; int janYear = year + 1; int janDay; int week; nextJanFirst = [NSCalendarDate dateWithYear:janYear month:1 day:1 hour:0 minute:0 second:0 timeZone:[self timeZone]]; janDay = [nextJanFirst dayOfYear]; week = (janDay + whereToStart[[nextJanFirst dayOfWeek]]) / 7; if (week == 1) return 52; } #endif return weekOfYear; } - (short)numberOfWeeksInYear { NSCalendarDate *silvester; NSCalendarDate *dayOfLastWeek; NSTimeZone *tz; short currentYear; currentYear = [self yearOfCommonEra]; tz = [self timeZone]; silvester = [NSCalendarDate dateWithYear:currentYear month:12 day:31 hour:23 minute:59 second:59 timeZone:tz]; dayOfLastWeek = [silvester dateByAddingYears:0 months:0 days:-3 hours:0 minutes:0 seconds:0]; return [dayOfLastWeek weekOfYear]; } - (NSCalendarDate *)mondayOfWeek { NSTimeInterval tv; NSCalendarDate *monday; int dayOfWeek; NSTimeZone *tz; dayOfWeek = [self dayOfWeek]; tz = [self timeZone]; if (dayOfWeek == 0) dayOfWeek = 7; // readjust Sunday tv = (1 - dayOfWeek) * NUMBER_OF_SECONDS_IN_DAY; tv = [self timeIntervalSince1970] + tv; monday = [NSCalendarDate dateWithTimeIntervalSince1970:tv]; [monday setTimeZone:tz]; return monday; } - (NSCalendarDate *)beginOfDay { NSTimeZone *tz; tz = [self timeZone]; return [NSCalendarDate dateWithYear:[self yearOfCommonEra] month: [self monthOfYear] day: [self dayOfMonth] hour:0 minute:0 second:0 timeZone: tz]; } - (NSCalendarDate *)endOfDay { NSTimeZone *tz; tz = [self timeZone]; return [NSCalendarDate dateWithYear:[self yearOfCommonEra] month: [self monthOfYear] day: [self dayOfMonth] hour:23 minute:59 second:59 timeZone: tz]; } - (BOOL)isDateOnSameDay:(NSCalendarDate *)_date { if ([self dayOfYear] != [_date dayOfYear]) return NO; if ([self yearOfCommonEra] != [_date yearOfCommonEra]) return NO; return YES; } - (BOOL)isDateInSameWeek:(NSCalendarDate *)_date { if ([self weekOfYear] != [_date weekOfYear]) return NO; if ([self yearOfCommonEra] != [_date yearOfCommonEra]) return NO; return YES; } - (BOOL)isToday { NSCalendarDate *d; BOOL result; d = [[NSCalendarDate alloc] init]; [d setTimeZone:[self timeZone]]; result = [self isDateOnSameDay:d]; [d release]; return result; } - (BOOL)isForenoon { return [self hourOfDay] >= 12 ? NO : YES; } - (BOOL)isAfternoon { return [self hourOfDay] >= 12 ? YES : NO; } - (NSCalendarDate *)yesterday { return [self dateByAddingYears:0 months:0 days:-1 hours:0 minutes:0 seconds:0]; } - (NSCalendarDate *)tomorrow { return [self dateByAddingYears:0 months:0 days:1 hours:0 minutes:0 seconds:0]; } - (NSCalendarDate *)lastYear { return [self dateByAddingYears:-1 months:0 days:0 hours:0 minutes:0 seconds:0]; } - (NSCalendarDate *)nextYear { return [self dateByAddingYears:1 months:0 days:0 hours:0 minutes:0 seconds:0]; } - (NSCalendarDate *)hour:(int)_hour minute:(int)_minute second:(int)_second { NSTimeZone *tz; tz = [self timeZone]; return [NSCalendarDate dateWithYear:[self yearOfCommonEra] month: [self monthOfYear] day: [self dayOfMonth] hour:_hour minute:_minute second:_second timeZone: tz]; } - (NSCalendarDate *)hour:(int)_hour minute:(int)_minute { return [self hour:_hour minute:_minute second:0]; } /* Y2K support */ - (NSCalendarDate *)y2kDate { NSCalendarDate *newDate; int year; year = [self yearOfCommonEra]; if (year >= 70 && year < 135) { newDate = [[NSCalendarDate alloc] initWithYear:(year + 1900) month:[self monthOfYear] day:[self dayOfMonth] hour:[self hourOfDay] minute:[self minuteOfHour] second:[self secondOfMinute] timeZone:[self timeZone]]; } else if (year >= 0 && year < 70) { newDate = [[NSCalendarDate alloc] initWithYear:(year + 2000) month:[self monthOfYear] day:[self dayOfMonth] hour:[self hourOfDay] minute:[self minuteOfHour] second:[self secondOfMinute] timeZone:[self timeZone]]; } else newDate = [self retain]; return [newDate autorelease]; } - (NSCalendarDate *)dateByAddingYears:(int)_years months:(int)_months days:(int)_days { #if 0 /* this expects that NSCalendarDate accepts invalid days, like 2000-02-31 */ int newYear, newMonth, newDay; newYear = [self yearOfCommonEra] + _years; newMonth = [self monthOfYear] + _months; newDay = [self dayOfMonth] + _days; // this doesn't check month overflow !! return [NSCalendarDate dateWithYear:newYear month:newMonth day:newDay hour:[self hourOfDay] minute:[self minuteOfHour] second:[self secondOfMinute] timeZone:[self timeZone]]; #else // but this does it return [self dateByAddingYears:_years months:_months days:_days hours:0 minutes:0 seconds:0]; #endif } /* calculate easter ... */ - (NSCalendarDate *)easterOfYear { /* algorithm taken from: http://www.uni-bamberg.de/~ba1lw1/fkal.html#Algorithmus */ int y; unsigned m, n; int a, b, c, d, e; unsigned easterMonth, easterDay; y = [self yearOfCommonEra]; if ((y > 1699) && (y < 1800)) { m = 23; n = 3; } else if ((y > 1799) && (y < 1900)) { m = 23; n = 4; } else if ((y > 1899) && (y < 2100)) { m = 24; n = 5; } else if ((y > 2099) && (y < 2200)) { m = 24; n = 6; } else return nil; a = y % 19; b = y % 4; c = y % 7; d = (19 * a + m) % 30; e = (2 * b + 4 * c + 6 * d + n) % 7; easterMonth = 3; easterDay = 22 + d + e; if (easterDay > 31) { easterDay -= 31; easterMonth = 4; if (easterDay == 26) easterDay = 19; if ((easterDay == 25) && (d == 28) && (a > 10)) easterDay = 18; } return [NSCalendarDate dateWithYear:y month:easterMonth day:easterDay hour:0 minute:0 second:0 timeZone:[self timeZone]]; } #if !LIB_FOUNDATION_LIBRARY - (id)valueForUndefinedKey:(NSString *)_key { NSLog(@"WARNING: tried to access undefined KVC key '%@' on date object: %@", _key, self); return nil; } #endif /* Oct. 15, 1582 */ #define IGREG (15+31L*(10+12L*1582)) - (long)julianNumber { long jul; int ja, jy, jm, year, month, day; year = [self yearOfCommonEra]; month = [self monthOfYear]; day = [self dayOfMonth]; jy = year; if (jy == 0) return 0; if (jy < 0) jy++; if (month > 2) jm = month + 1; else { jy--; jm = month + 13; } jul = (long) (floor(365.25 * jy) + floor(30.6001 * jm) + day + 1720995); if (day + 31L * (month + 12L * year) >= IGREG) { ja = (int)(0.01 * jy); jul += 2 - ja + (int) (0.25 * ja); } return jul; } + (NSCalendarDate *)dateForJulianNumber:(long)_jn { long ja, jalpha, jb, jc, jd, je; unsigned day, month, year; if (_jn >= IGREG) { jalpha = (long)(((float) (_jn - 1867216) - 0.25) / 36524.25); ja = _jn + 1 + jalpha - (long)(0.25 * jalpha); } else { ja = _jn; } jb = ja + 1524; jc = (long)(6680.0 + ((float)(jb - 2439870) - 122.1) / 365.25); jd = (long)(365 * jc + (0.25 * jc)); je = (long)((jb - jd) / 30.6001); day = jb - jd - (long)(30.6001 * je); month = je - 1; if (month > 12) month -= 12; year = jc - 4715; if (month > 2) year--; if (year <= 0) year--; return [NSCalendarDate dateWithYear:year month:month day:day hour:12 minute:0 second:0 timeZone:nil]; } @end /* NSCalendarDate(misc) */ @implementation NSString(FuzzyDayOfWeek) - (int)dayOfWeekInEnglishOrGerman { NSString *s; unichar c1; unsigned len; if ((len = [self length]) == 0) return -1; if (isdigit([self characterAtIndex:0])) return [self intValue]; if (len < 2) /* need at least two chars */ return -1; s = [self lowercaseString]; c1 = [s characterAtIndex:1]; switch ([s characterAtIndex:0]) { case 'm': // Monday, Montag, Mittwoch return (c1 == 'i') ? 3 /* Wednesday */ : 1 /* Monday */; case 't': // Tuesday, Thursday return (c1 == 'u') ? 2 /* Tuesday */ : 4 /* Thursday */; case 'f': // Friday, Freitag return 5 /* Friday */; case 's': // Saturday, Sunday, Samstag, Sonntag, Sonnabend if (c1 == 'a') return 6; /* Saturday */ if (c1 == 'o' && [s hasPrefix:@"sonna"]) return 6; /* Sonnabend */ return 0 /* Sunday */; case 'w': // Wed return 3 /* Wednesday */; } return -1; } @end /* NSString(FuzzyDayOfWeek) */ /* static linking */ void __link_NSCalendarDate_misc(void) { __link_NSCalendarDate_misc(); } SOPE/sope-core/NGExtensions/FdExt.subproj/NSFileManager+Extensions.m0000644000000000000000000001110012242733417024221 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NSFileManager+Extensions.h" #include "NGFileFolderInfoDataSource.h" #import #include "common.h" @interface NSFileManagerGlobalID : EOGlobalID < NSCopying > { @public NSString *path; } @end // TODO: support -lastException // TODO: add stuff like -dictionaryAtPath:, -arrayAtPath:, -propertyListAtPath: @implementation NSFileManager(ExtendedFileManagerImp) /* directories */ - (BOOL)createDirectoriesAtPath:(NSString *)_p attributes:(NSDictionary *)_a { unsigned i, count; NSArray *pc; BOOL isDir; if ([_p length] == 0) return NO; if ([self fileExistsAtPath:_p isDirectory:&isDir]) return isDir; pc = [_p pathComponents]; if ((count = [pc count]) == 0) return YES; for (i = 0; i < count; i++) { NSString *fp; NSRange r; r.location = 0; r.length = i + 1; fp = [NSString pathWithComponents:[pc subarrayWithRange:r]]; if ([self fileExistsAtPath:fp isDirectory:&isDir]) { if (!isDir) /* exists, but is a file */ return NO; continue; } if (![self createDirectoryAtPath:fp attributes:_a]) /* failed to create */ return NO; } return YES; } /* path modifications */ - (NSString *)standardizePath:(NSString *)_path { if (![_path isAbsolutePath]) _path = [[self currentDirectoryPath] stringByAppendingPathComponent:_path]; return [_path stringByStandardizingPath]; } - (NSString *)resolveSymlinksInPath:(NSString *)_path { return [_path stringByResolvingSymlinksInPath]; } - (NSString *)expandTildeInPath:(NSString *)_path { return [_path stringByExpandingTildeInPath]; } /* feature check */ - (BOOL)supportsVersioningAtPath:(NSString *)_path { return NO; } - (BOOL)supportsLockingAtPath:(NSString *)_path { return NO; } - (BOOL)supportsFolderDataSourceAtPath:(NSString *)_path { return YES; } - (BOOL)supportsFeature:(NSString *)_featureURI atPath:(NSString *)_path { if ([_featureURI isEqualToString:NGFileManagerFeature_DataSources]) return YES; return NO; } /* writing */ - (BOOL)writeContents:(NSData *)_content atPath:(NSString *)_path { return [_content writeToFile:_path atomically:YES]; } /* global-IDs */ - (EOGlobalID *)globalIDForPath:(NSString *)_path { NSFileManagerGlobalID *gid; _path = [self standardizePath:_path]; gid = [[NSFileManagerGlobalID alloc] init]; gid->path = [_path copy]; return [gid autorelease]; } - (NSString *)pathForGlobalID:(EOGlobalID *)_gid { NSFileManagerGlobalID *gid; if (![_gid isKindOfClass:[NSFileManagerGlobalID class]]) /* not a gid we can handle ... */ return nil; gid = (NSFileManagerGlobalID *)_gid; return gid->path; } /* datasources (work on folders) */ - (EODataSource *)dataSourceAtPath:(NSString *)_path { return [[[NGFileFolderInfoDataSource alloc] initWithFolderPath:_path] autorelease]; } - (EODataSource *)dataSource { return [self dataSourceAtPath:[self currentDirectoryPath]]; } /* trash */ - (BOOL)supportsTrashFolderAtPath:(NSString *)_path { return NO; } - (NSString *)trashFolderForPath:(NSString *)_path { return nil; } - (BOOL)trashFileAtPath:(NSString *)_path handler:(id)_handler { // TODO: support trashfolder on MacOSX ? return NO; } @end /* NSFileManager(ExtendedFileManagerImp) */ @implementation NSFileManagerGlobalID - (void)dealloc { [self->path release]; [super dealloc]; } /* NSCopying */ - (id)copyWithZone:(NSZone *)_zone { /* global IDs are immutable, so we can return an retained object ... */ return [self retain]; } /* description */ - (NSString *)description { NSMutableString *ms = [NSMutableString stringWithCapacity:32]; [ms appendFormat:@"<0x%p[%@]", self, NSStringFromClass([self class])]; [ms appendFormat:@" path=%@", self->path]; [ms appendString:@">"]; return ms; } @end /* NSFileManagerGlobalID */ SOPE/sope-core/NGExtensions/FdExt.subproj/NSData+misc.m0000644000000000000000000000253712242733417021532 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import "common.h" #import "NSData+misc.h" @implementation NSData(misc) - (BOOL)hasPrefix:(NSData *)_data { return [self hasPrefixBytes:[_data bytes] length:[_data length]]; } - (BOOL)hasPrefixBytes:(const void *)_bytes length:(unsigned)_len { if (_len > [self length]) return NO; else { const unsigned char *ownBytes = [self bytes]; register unsigned i; for (i = 0; i < _len; i++) { if (((unsigned char *)_bytes)[i] != ownBytes[i]) return NO; } return YES; } } @end /* NSData(misc) */ void __link_NSData_misc() { __link_NSData_misc(); } SOPE/sope-core/NGExtensions/FdExt.subproj/NSArray+enumerator.m0000644000000000000000000001002412242733417023153 0ustar rootroot/* Copyright (C) 2000-2008 SKYRIX Software AG Copyright (C) 2008 Helge Hess This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NSArray+enumerator.h" #include "common.h" @implementation NSArray(enumerator) - (id)initWithObjectsFromEnumerator:(NSEnumerator *)_enumerator { NSMutableArray *array = nil; array = [[NSMutableArray alloc] initWithObjectsFromEnumerator:_enumerator]; self = [self initWithArray:array]; [array release]; array = nil; return self; } /* mapping */ - (NSArray *)mappedArrayUsingSelector:(SEL)_selector { int i, count = [self count]; id objects[count]; IMP objAtIndex; if (_selector == NULL) return self; objAtIndex = [self methodForSelector:@selector(objectAtIndex:)]; for (i = 0; i < count; i++) { objects[i] = objAtIndex(self, @selector(objectAtIndex:), i); objects[i] = [objects[i] performSelector:_selector]; if (objects[i] == nil) objects[i] = [NSNull null]; } return [NSArray arrayWithObjects:objects count:count]; } - (NSArray *)mappedArrayUsingSelector:(SEL)_selector withObject:(id)_object { int i, count = [self count]; id objects[count]; IMP objAtIndex; if (_selector == NULL) return self; objAtIndex = [self methodForSelector:@selector(objectAtIndex:)]; for (i = 0; i < count; i++) { objects[i] = [objAtIndex(self, @selector(objectAtIndex:), i) performSelector:_selector withObject:_object]; if (objects[i] == nil) objects[i] = [NSNull null]; } return [NSArray arrayWithObjects:objects count:count]; } - (NSSet *)mappedSetUsingSelector:(SEL)_selector { return [NSSet setWithArray:[self mappedArrayUsingSelector:_selector]]; } - (NSSet *)mappedSetUsingSelector:(SEL)_selector withObject:(id)_object { return [NSSet setWithArray:[self mappedArrayUsingSelector:_selector withObject:_object]]; } #if !LIB_FOUNDATION_LIBRARY - (NSArray *)map:(SEL)_sel { unsigned int index, count; id array; count = [self count]; array = [NSMutableArray arrayWithCapacity:count]; for (index = 0; index < count; index++) { [array insertObject:[[self objectAtIndex:index] performSelector:_sel] atIndex:index]; } return array; } - (NSArray *)map:(SEL)_sel with:(id)_arg { unsigned int index, count; id array; count = [self count]; array = [NSMutableArray arrayWithCapacity:count]; for (index = 0; index < count; index++) { [array insertObject:[[self objectAtIndex:index] performSelector:_sel withObject:_arg] atIndex:index]; } return array; } #endif @end /* NSArray(enumerator) */ @implementation NSMutableArray(enumerator) - (id)initWithObjectsFromEnumerator:(NSEnumerator *)_enumerator { #if NeXT_Foundation_LIBRARY || COCOA_Foundation_LIBRARY NSMutableArray *ma = [[NSMutableArray alloc] initWithCapacity:64]; id obj; while ((obj = [_enumerator nextObject])) [ma addObject:obj]; self = [self initWithArray:ma]; [ma release]; ma = nil; return self; #else if ((self = [self init]) != nil) { id obj = nil; // Does not work on Cocoa because we only have NSCFArray over there ... while ((obj = [_enumerator nextObject])) [self addObject:obj]; } return self; #endif } @end /* NSMutableArray(enumerator) */ void __link_NGExtensions_NSArrayEnumerator() { __link_NGExtensions_NSArrayEnumerator(); } SOPE/sope-core/NGExtensions/FdExt.subproj/common.h0000644000000000000000000000002712242733417020744 0ustar rootroot#include "../common.h" SOPE/sope-core/NGExtensions/FdExt.subproj/NSEnumerator+misc.m0000644000000000000000000000717412242733417023004 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import "NSEnumerator+misc.h" #import #import #include "common.h" @interface _NGFilterEnumerator : NSEnumerator { NSEnumerator *source; } + (NSEnumerator *)filterEnumeratorWithSource:(NSEnumerator *)_e; - (NSEnumerator *)source; @end @interface _NGQualifierFilterEnumerator : _NGFilterEnumerator { EOQualifier *q; } - (void)setQualifier:(EOQualifier *)_q; - (EOQualifier *)qualifier; @end @interface _NGSelFilterEnumerator : _NGFilterEnumerator { SEL sel; id arg; } - (void)setSelector:(SEL)_s; - (SEL)selector; - (void)setArgument:(id)_arg; - (id)argument; @end @implementation NSEnumerator(misc) - (NSEnumerator *)filterWithQualifier:(EOQualifier *)_qualifier { id e; e = [_NGQualifierFilterEnumerator filterEnumeratorWithSource:self]; [e setQualifier:_qualifier]; return e; } - (NSEnumerator *)filterWithQualifierString:(NSString *)_s { EOQualifier *q; q = [EOQualifier qualifierWithQualifierFormat:_s]; return [self filterWithQualifier:q]; } - (NSEnumerator *)filterWithSelector:(SEL)_selector withObject:(id)_argument { id e; e = [_NGSelFilterEnumerator filterEnumeratorWithSource:self]; [e setSelector:_selector]; [e setArgument:_argument]; return e; } @end /* NSEnumerator(misc) */ @implementation _NGFilterEnumerator - (id)initWithSource:(NSEnumerator *)_e { self->source = [_e retain]; return self; } - (void)dealloc { [self->source release]; [super dealloc]; } + (NSEnumerator *)filterEnumeratorWithSource:(NSEnumerator *)_e { return [[(_NGFilterEnumerator *)[self alloc] initWithSource:_e] autorelease]; } - (NSEnumerator *)source { return self->source; } - (id)nextObject { return [self->source nextObject]; } @end /* _NGFilterEnumerator */ @implementation _NGQualifierFilterEnumerator - (void)dealloc { [self->q release]; [super dealloc]; } - (void)setQualifier:(EOQualifier *)_q { ASSIGN(self->q, _q); } - (EOQualifier *)qualifier { return self->q; } - (id)nextObject { while (YES) { id obj; if ((obj = [self->source nextObject]) == nil) return nil; if (self->q == nil) return obj; if ([(id)self->q evaluateWithObject:obj]) return obj; } } @end /* _NGQualifierFilterEnumerator */ @implementation _NGSelFilterEnumerator - (void)dealloc { [self->arg release]; [super dealloc]; } - (void)setSelector:(SEL)_s { self->sel = _s; } - (SEL)selector { return self->sel; } - (void)setArgument:(id)_arg { ASSIGN(self->arg, _arg); } - (id)argument { return self->arg; } - (id)nextObject { while (YES) { id obj; BOOL (*m)(id,SEL,id); if ((obj = [self->source nextObject]) == nil) return nil; if ((m = (void *)[obj methodForSelector:self->sel]) == NULL) continue; if (m(obj, self->sel, self->arg)) return obj; } } @end /* _NGSelFilterEnumerator */ SOPE/sope-core/NGExtensions/FdExt.subproj/NSString+German.m0000644000000000000000000001420312242733417022376 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NSString+German.h" #include "common.h" @implementation NSString(German) - (BOOL)doesContainGermanUmlauts { register unsigned i, len; if ((len = [self length]) == 0) return NO; for (i = 0; i < len; i++) { switch ([self characterAtIndex:i]) { case 252: /* ü */ case 220: /* Ü */ case 228: /* ä */ case 196: /* Ä */ case 246: /* ö */ case 214: /* Ö */ case 223: /* ß */ return YES; } } return NO; } - (NSString *)stringByReplacingGermanUmlautsWithTwoCharsAndSzWith:(unichar)_c { /* a^ => ae, o^ => oe, u^ => ue, A^ => Ae, O^ => Oe, O^ => Ue s^ => sz or ss (_sz arg) */ unsigned i, len, rlen; unichar *buf; NSString *s; if ((len = [self length]) == 0) return @""; buf = calloc((len * 2) + 3, sizeof(unichar)); for (i = 0, rlen = 0; i < len; i++) { // TODO register unichar c; c = [self characterAtIndex:i]; switch (c) { case 252: /* ue */ buf[rlen] = 'u'; rlen++; buf[rlen] = 'e'; rlen++; break; case 220: /* Ue */ buf[rlen] = 'U'; rlen++; buf[rlen] = 'e'; rlen++; break; case 228: /* ae */ buf[rlen] = 'a'; rlen++; buf[rlen] = 'e'; rlen++; break; case 196: /* Ae */ buf[rlen] = 'A'; rlen++; buf[rlen] = 'e'; rlen++; break; case 246: /* oe */ buf[rlen] = 'o'; rlen++; buf[rlen] = 'e'; rlen++; break; case 214: /* Oe */ buf[rlen] = 'O'; rlen++; buf[rlen] = 'e'; rlen++; break; case 223: /* ss or sz */ // TODO buf[rlen] = 's'; rlen++; buf[rlen] = _c; rlen++; break; default: /* copy char and continue */ buf[rlen] = c; rlen++; break; } } s = (rlen > len) ? [[NSString alloc] initWithCharacters:buf length:rlen] : [self copy]; if (buf) free(buf); return [s autorelease]; } - (NSString *)stringByReplacingGermanUmlautsWithTwoChars { // default sz mapping is "ss" (like Hess ;-) return [self stringByReplacingGermanUmlautsWithTwoCharsAndSzWith:'s']; } - (NSString *)stringByReplacingTwoCharEncodingsOfGermanUmlauts { /* ae => a^, oe => o^, ue => u^, Ae => A^, Oe => O^, Ue => U^ sz => s^ ss => s^ */ unsigned i, len, rlen; NSString *s; unichar *buf; BOOL didReplace; if ((len = [self length]) == 0) return @""; if (len == 1) return [[self copy] autorelease]; buf = calloc(len + 3, sizeof(unichar)); [self getCharacters:buf]; // Note: we can reuse that buffer! for (i = 0, rlen = 0, didReplace = NO; i < len; i++) { register unichar c, cn; c = buf[i]; if ((i + 1) >= len) { buf[rlen] = c; rlen++; break; // end, found last char (so can't be a sequence) } cn = buf[i + 1]; if ((c=='a' || c=='A' || c=='u' || c=='U' || c=='o' || c=='O')&&cn=='e') { /* an umlaut sequence */ switch (c) { case 'a': buf[rlen] = 228; break; case 'A': buf[rlen] = 196; break; case 'o': buf[rlen] = 246; break; case 'O': buf[rlen] = 214; break; case 'u': buf[rlen] = 252; break; case 'U': buf[rlen] = 220; break; } rlen++; i++; // skip sequence char didReplace = YES; } else if (c == 's' && (cn == 's' || cn == 'z')) { /* a sz sequence */ buf[rlen] = 223; rlen++; i++; // skip sequence char didReplace = YES; } else { /* regular char, copy */ buf[rlen] = c; rlen++; } } s = didReplace ? [[NSString alloc] initWithCharacters:buf length:rlen] : [self copy]; if (buf) free(buf); return [s autorelease]; } - (NSArray *)germanUmlautVariantsOfString { /* The ^ is used to signal the single character umlaut to avoid non-ASCII source code. Note: we can only do a limited set of transformations! Eg you can only mix umlauts *OR* the "ue", "oe" variants! Q: what about names which contain encoded umlauts *and* the same sequence as a regular part of the name! For example "Neuendoerf". string with umlauts (two variants, ss and sz): a^ => ae o^ => oe u^ => ue A^ => Ae O^ => Oe O^ => Ue s^ => sz & ss string with umlaut workaround (three variants due to sz/ss): ae => a^ oe => o^ ue => u^ Ae => A^ Oe => O^ Ue => U^ sz => s^ & sz // ? ss => s^ & ss // ? */ NSString *s1, *s2; unsigned len; if ((len = [self length]) == 0) return [NSArray arrayWithObjects:@"", nil]; if ([self doesContainGermanUmlauts]) { s1 = [self stringByReplacingGermanUmlautsWithTwoCharsAndSzWith:'s']; s2 = [self stringByReplacingGermanUmlautsWithTwoCharsAndSzWith:'z']; if ([s2 isEqualToString:s1] || [s2 isEqualToString:self]) s2 = nil; if ([s1 isEqualToString:self]) s1 = s2; return [NSArray arrayWithObjects:self, s1, s2, nil]; } if (len < 2) // a sequence would have at least 2 chars return [NSArray arrayWithObjects:self, nil]; s1 = [self stringByReplacingTwoCharEncodingsOfGermanUmlauts]; if ([self isEqualToString:s1]) /* nothing was replaced */ return [NSArray arrayWithObjects:self, nil]; return [NSArray arrayWithObjects:self, s1, nil]; } @end /* NSString(German) */ SOPE/sope-core/NGExtensions/FdExt.subproj/NSString+Escaping.m0000644000000000000000000000637112242733417022725 0ustar rootroot/* Copyright (C) 2000-2008 SKYRIX Software AG Copyright (C) 2008 Helge Hess This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include "common.h" @implementation NSString(Escaping) - (NSString *)stringByApplyingCEscaping { // Unicode! unichar *src; unichar *buffer; int len, pos, srcIdx; NSString *s; if ((len = [self length]) == 0) return @""; src = malloc(sizeof(unichar) * (len + 2)); [self getCharacters:src]; src[len] = 0; // zero-terminate buffer = malloc(sizeof(unichar) * ((len * 2) + 1)); for (pos = 0, srcIdx = 0; srcIdx < len; pos++, srcIdx++) { switch (src[srcIdx]) { case '\n': buffer[pos] = '\\'; pos++; buffer[pos] = 'n'; break; case '\r': buffer[pos] = '\\'; pos++; buffer[pos] = 'r'; break; case '\t': buffer[pos] = '\\'; pos++; buffer[pos] = 't'; break; default: buffer[pos] = src[srcIdx]; break; } } buffer[pos] = '\0'; s = [NSString stringWithCharacters:buffer length:pos]; if (buffer != NULL) { free(buffer); buffer = NULL; } if (src != NULL) { free(src); src = NULL; } return s; } - (NSString *)stringByEscapingCharactersFromSet:(NSCharacterSet *)_escSet usingStringEscaping:()_esc { NSMutableString *safeString; unsigned length; NSRange prevRange, escRange; NSRange todoRange; BOOL needsEscaping; length = [self length]; prevRange = NSMakeRange(0, length); escRange = [self rangeOfCharacterFromSet:_escSet options:0 range:prevRange]; needsEscaping = escRange.length > 0 ? YES : NO; if (!needsEscaping) return self; /* cheap */ safeString = [NSMutableString stringWithCapacity:length]; do { NSString *s; prevRange.length = escRange.location - prevRange.location; if (prevRange.length > 0) [safeString appendString:[self substringWithRange:prevRange]]; s = [_esc stringByEscapingString:[self substringWithRange:escRange]]; if (s != nil) [safeString appendString:s]; prevRange.location = NSMaxRange(escRange); todoRange.location = prevRange.location; todoRange.length = length - prevRange.location; escRange = [self rangeOfCharacterFromSet:_escSet options:0 range:todoRange]; } while(escRange.length > 0); if (todoRange.length > 0) [safeString appendString:[self substringWithRange:todoRange]]; return safeString; } @end /* NSString(Escaping) */ SOPE/sope-core/NGExtensions/FdExt.subproj/NSString+Formatting.m0000644000000000000000000004445212242733417023310 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "common.h" #include "NSString+Formatting.h" #include "NGMemoryAllocation.h" #if 0 #if !ISERIES # ifndef USE_VA_LIST_PTR # define USE_VA_LIST_PTR 1 # endif #else # define USE_VA_LIST_PTR 0 #endif // format // %|[justification]|[fieldwidth]|[precision]|formatChar // %[-]{digit}*[.{digit}*]conv static const char *formatChars = "diouxX" // integers "feEgG" // double "c" // int arg -> uchar "s" // string "@" // object "$" // string object ; static const char *formatAttrs = "#0- +,"; static const char *formatConv = "hlLqZ"; static Class StrClass = Nil; typedef enum { DEFAULT_TYPE = 0, SHORT_TYPE, LONG_TYPE, VERY_LONG_TYPE } NGFormatType; // implementation static inline NSString * wideString(const char *str, int width, char fillChar, BOOL isRightAligned) { unsigned char *tmp; register int cnt; int len; if (StrClass == Nil) StrClass = [NSString class]; if (width <= 0) return str ? [StrClass stringWithCString:str] : nil; if ((len = strlen(str)) >= width) return str ? [StrClass stringWithCString:str] : nil; tmp = malloc(width + 2); if (isRightAligned) { // right aligned for (cnt = 0; cnt < (width - len); cnt++) tmp[cnt] = fillChar; strncpy(tmp + (width - len), str, len); tmp[width] = '\0'; } else { // left aligned for (cnt = len; cnt < width; cnt++) tmp[cnt] = fillChar; strncpy(tmp, str, len); tmp[cnt] = '\0'; } return [[[StrClass alloc] initWithCStringNoCopy:tmp length:strlen(tmp) freeWhenDone:YES] autorelease]; } static inline NSString *xsSimpleFormatObject(char *fmt, id _value, NSString *_ds) { /* formats an object value in an simple format (this is only the '%{mods}{type}' part of a real format string !) The method to get the value of the object is determined by the {type} of the Format, eg: i becomes intValue, @ becomes description .. the decimal point in float-strings can be replaced by the _ds String. To do this, the result of the Format is scanned for '.' and _ds is expanded for this. */ int fmtLen = strlen(fmt); char fmtChar = fmt[fmtLen - 1]; NGFormatType typeMode = DEFAULT_TYPE; int width = -1; int prec = -1; BOOL alignRight = YES; char *pos = fmt + 1; char *tmp; if (StrClass == Nil) StrClass = [NSString class]; while (index(formatAttrs, *pos)) { if (*pos == '-') alignRight = NO; pos++; } /* width */ tmp = pos; while (isdigit((int)*pos)) pos++; if (tmp != pos) { char old = *pos; *pos = '\0'; width = atoi(tmp); *pos = old; } /* prec */ if (*pos == '.') { pos++; tmp = pos; while (isdigit((int)*pos)) pos++; if (tmp != pos) { char old = *pos; *pos = '\0'; prec = atoi(tmp); *pos = old; } } /* conversion */ if (index(formatConv, *pos)) { switch (*pos) { case 'h': typeMode = SHORT_TYPE; pos++; break; case 'l': typeMode = LONG_TYPE; pos++; if (*pos == 'l') { // long-long typeMode = VERY_LONG_TYPE; pos++; } break; case 'L': case 'q': typeMode = VERY_LONG_TYPE; pos++; break; } } if (index("diouxX", fmtChar)) { char buf[128]; int len = -1; switch (typeMode) { case SHORT_TYPE: { unsigned short int i = [(NSNumber *)_value unsignedShortValue]; len = sprintf(buf, fmt, i); break; } case LONG_TYPE: { unsigned long int i = [(NSNumber *)_value unsignedLongValue]; len = sprintf(buf, fmt, i); break; } case VERY_LONG_TYPE: { long long i = [(NSNumber *)_value unsignedLongLongValue]; len = sprintf(buf, fmt, i); break; } default: { unsigned int i = [(NSNumber *)_value unsignedIntValue]; len = sprintf(buf, fmt, i); break; } } return (len >= 0) ? [StrClass stringWithCString:buf length:len] : nil; } if (fmtChar == 'c') { char buf[64]; int i = [(NSNumber *)_value unsignedCharValue]; int len; len = sprintf(buf, fmt, (unsigned char)i); return (len > 0) ? [StrClass stringWithCString:buf length:len] : nil; } if (fmtChar == 'C') { // TODO: implement correctly /* 16bit unichar value */ char buf[64]; int i, len; /* TODO: evil hack */ fmt[fmtLen - 1] = 'c'; i = [(NSNumber *)_value unsignedCharValue]; len = sprintf(buf, fmt, (unsigned char)i); return (len > 0) ? [StrClass stringWithCString:buf length:len] : nil; } if (index("feEgG", fmtChar)) { unsigned char buf[256]; unsigned len; if (typeMode == VERY_LONG_TYPE) { long double i = [(NSNumber *)_value doubleValue]; len = sprintf(buf, fmt, i); } else { double i = [(NSNumber *)_value doubleValue]; len = sprintf(buf, fmt, i); } if (len >= 0) { NSMutableString *result; unsigned int cnt; char *ptr = buf; unsigned int bufCount = 0; if (_ds == nil) return [StrClass stringWithCString:buf length:len]; result = [NSMutableString stringWithCapacity:len + [_ds cStringLength]]; for (cnt = 0; cnt < len; cnt++) { if (buf[cnt] == '.') { if (bufCount > 0) { NSString *s; // TODO: cache selector s = [[StrClass alloc] initWithCString:ptr length:bufCount]; if (s) [result appendString:s]; [s release]; } if (_ds) [result appendString:_ds]; ptr = &(buf[cnt + 1]); bufCount = 0; } else { bufCount++; } if (bufCount > 0) { NSString *s; // TODO: cache selector s = [[StrClass alloc] initWithCString:ptr length:bufCount]; if (s) [result appendString:s]; [s release]; } return result; } } else return nil; } else { switch (fmtChar) { case 's': case 'S': { /* TODO: implement 'S', current mech is evil hack */ unsigned len; char *buffer = NULL; id result; if (_value == nil) return wideString("", width, ' ', alignRight); len = [(NSString *)_value cStringLength]; buffer = malloc(len + 10); [_value getCString:buffer]; buffer[len] = '\0'; result = wideString(buffer, width, ' ', alignRight); free(buffer); return result; } case '@': { id obj = _value; NSString *dstr = obj ? [obj description] : @""; char *buffer = NULL; unsigned len; if (dstr == nil) return wideString("", width, ' ', alignRight); len = [dstr cStringLength]; buffer = malloc(len + 10); [dstr getCString:buffer]; buffer[len] = '\0'; dstr = wideString(buffer, width, ' ', alignRight); free(buffer); return dstr; } case '$': { id obj = _value; NSString *dstr; char *cstr; dstr = obj ? [obj stringValue] : @""; cstr = (char *)[dstr cString]; if (cstr == NULL) cstr = ""; return wideString(cstr, width, ' ', alignRight); } default: fprintf(stderr, "WARNING(%s): unknown printf format used: '%s'\n", __PRETTY_FUNCTION__, fmt); break; } } return nil; } #if USE_VA_LIST_PTR static inline NSString *handleFormat(char *fmt, int fmtLen, va_list *_ap) { #else static inline NSString *handleFormat(char *fmt, int fmtLen, va_list _ap) { #endif char fmtChar; char typeMode = DEFAULT_TYPE; int width = -1; int prec = -1; BOOL alignRight = YES; char *pos = fmt + 1; char *tmp; if (StrClass == Nil) StrClass = [NSString class]; if (fmtLen == 0) return @""; fmtChar = fmt[fmtLen - 1]; while (index(formatAttrs, *pos)) { if (*pos == '-') alignRight = NO; pos++; } /* width */ tmp = pos; while (isdigit((int)*pos)) pos++; if (tmp != pos) { char old = *pos; *pos = '\0'; width = atoi(tmp); *pos = old; } /* prec */ if (*pos == '-') { pos++; tmp = pos; while (isdigit((int)*pos)) pos++; if (tmp != pos) { char old = *pos; *pos = '\0'; prec = atoi(tmp); *pos = old; } } /* conversion */ if (index(formatConv, *pos)) { switch (*pos) { case 'h': typeMode = SHORT_TYPE; pos++; break; case 'l': typeMode = LONG_TYPE; pos++; if (*pos == 'l') { // long-long typeMode = VERY_LONG_TYPE; pos++; } break; case 'L': case 'q': typeMode = VERY_LONG_TYPE; pos++; break; } } #if HEAVY_DEBUG && 0 printf(" width=%i prec=%i\n", width, prec); fflush(stdout); #endif if (index("diouxX", fmtChar)) { char buf[128]; int len = -1; switch (typeMode) { case SHORT_TYPE: { #if USE_VA_LIST_PTR unsigned short int i = va_arg(*_ap, int); #else unsigned short int i = va_arg(_ap, int); #endif len = sprintf(buf, fmt, i); break; } case LONG_TYPE: { #if USE_VA_LIST_PTR unsigned long int i = va_arg(*_ap, unsigned long int); #else unsigned long int i = va_arg(_ap, unsigned long int); #endif len = sprintf(buf, fmt, i); break; } case VERY_LONG_TYPE: { #if USE_VA_LIST_PTR long long i = va_arg(*_ap, long long); #else long long i = va_arg(_ap, long long); #endif len = sprintf(buf, fmt, i); break; } default: { #if USE_VA_LIST_PTR unsigned int i = va_arg(*_ap, unsigned int); #else unsigned int i = va_arg(_ap, unsigned int); #endif len = sprintf(buf, fmt, i); break; } } return (len >= 0) ? [StrClass stringWithCString:buf length:len] : nil; } if (fmtChar == 'c') { char buf[64]; #if USE_VA_LIST_PTR int i = va_arg(*_ap, int); #else int i = va_arg(_ap, int); #endif int len; if (i == 0) return @"<'\\0'-char>"; len = sprintf(buf, fmt, (unsigned char)i); #if HEAVY_DEBUG && 0 xsprintf("got format %s char %i made %s len %i\n", fmt, i, buf, len); #endif if (len == 0) return nil; return [StrClass stringWithCString:buf length:len]; } if (fmtChar == 'C') { /* 16bit unichar */ char buf[64]; #if USE_VA_LIST_PTR int i = va_arg(*_ap, int); #else int i = va_arg(_ap, int); #endif int len; if (i == 0) return @"<'\\0'-unichar>"; /* TODO: implement properly, evil hack */ fmt[fmtLen - 1] = 'c'; len = sprintf(buf, fmt, (unsigned char)i); #if HEAVY_DEBUG && 0 xsprintf("got format %s unichar %i made %s len %i\n", fmt, i, buf, len); #endif if (len == 0) return nil; return [StrClass stringWithCString:buf length:len]; } if (index("feEgG", fmtChar)) { char buf[256]; int len; if (typeMode == VERY_LONG_TYPE) { #if USE_VA_LIST_PTR long double i = va_arg(*_ap, long double); #else long double i = va_arg(_ap, long double); #endif len = sprintf(buf, fmt, i); } else { #if USE_VA_LIST_PTR double i = va_arg(*_ap, double); #else double i = va_arg(_ap, double); #endif len = sprintf(buf, fmt, i); } return (len >= 0) ? [StrClass stringWithCString:buf length:len] : nil; } { id result = nil; switch (fmtChar) { case 's': case 'S': /* unicode char array */ case '@': case '$': { char *cstr = NULL; BOOL owned = NO; if (fmtChar == 's') { #if USE_VA_LIST_PTR cstr = va_arg(*_ap, char *); #else cstr = va_arg(_ap, char *); #endif } else { #if USE_VA_LIST_PTR id obj = va_arg(*_ap, id); #else id obj = va_arg(_ap, id); #endif if (obj == nil) cstr = ""; else { NSString *d; if ((d = (fmtChar == '@') ?[obj description]:[obj stringValue])) { unsigned len = [d cStringLength]; cstr = NGMalloc(len + 1); [d getCString:cstr]; cstr[len] = '\0'; owned = YES; } } } if (cstr == NULL) cstr = ""; result = wideString(cstr, width, ' ', alignRight); if (owned) NGFree(cstr); break; } default: fprintf(stderr, "WARNING(%s): unknown printf format used: '%s'\n", __PRETTY_FUNCTION__, fmt); break; } return result; } return nil; } static inline NSString *_stringWithCFormat(const char *_format, va_list _ap) { const char *firstPercent; NSMutableString *result; if (StrClass == Nil) StrClass = [NSString class]; firstPercent = index(_format, '%'); #if 0 fprintf(stderr, "OWN: format='%s'\n", _format); fflush(stderr); #endif // first check whether there are any '%' in the format .. if (firstPercent == NULL) { // no formatting contained in _format return [StrClass stringWithCString:_format]; } result = [NSMutableString stringWithCapacity:256]; if ((firstPercent - _format) > 0) { NSString *s; s = [[StrClass alloc] initWithCString:_format length:(firstPercent - _format)]; if (s) [result appendString:s]; [s release]; _format = firstPercent; } while (*_format != '\0') { // until end of format string if (*_format == '%') { // found formatting character _format++; // skip '%' if (*_format == '%') { // was a quoted '%' [result appendString:@"%"]; _format++; } else { // check format char extFmt[16]; char *pos = extFmt; extFmt[0] = '%'; pos++; while ((*_format != '\0') && (index(formatChars, *_format) == NULL)) { *pos = *_format; _format++; pos++; } *pos = *_format; _format++; pos++; *pos = '\0'; // printf("handling ext format '%s'\n", extFmt); fflush(stdout); /* hack for iSeries port, ix86 seems to copy va_list iSeries don`t like pointers to va_list */ { NSString *s; #if USE_VA_LIST_PTR s = handleFormat(extFmt, strlen(extFmt), &_ap); #else s = handleFormat(extFmt, strlen(extFmt), _ap); #endif if (s) [result appendString:s]; } } } else { // normal char const char *start = _format; // remember start NSString *s; _format++; // skip found char // further increase format until '\0' or '%' while ((*_format != '\0') && (*_format != '%')) _format++; s = [[StrClass alloc] initWithCString:start length:(_format - start)]; if (s) [result appendString:s]; [s release]; } } return result; } @implementation NSString(XSFormatting) + (id)stringWithCFormat:(const char *)_format arguments:(va_list)_ap { return [self stringWithString:_stringWithCFormat(_format, _ap)]; } + (id)stringWithFormat:(NSString *)_format arguments:(va_list)_ap { unsigned len; char *cfmt; id s; len = [_format cStringLength] + 1; cfmt = malloc(len + 1); [_format getCString:cfmt]; cfmt[len] = '\0'; s = [self stringWithString:_stringWithCFormat(cfmt, _ap)]; free(cfmt); return s; } + (id)stringWithCFormat:(const char *)_format, ... { id result = nil; va_list ap; va_start(ap, _format); result = [self stringWithString:_stringWithCFormat(_format, ap)]; va_end(ap); return result; } + (id)stringWithFormat:(NSString *)_format, ... { id result = nil; unsigned len; char *cfmt; va_list ap; len = [_format cStringLength]; cfmt = malloc(len + 1); [_format getCString:cfmt]; cfmt[len] = '\0'; va_start(ap, _format); result = [self stringWithString:_stringWithCFormat(cfmt, ap)]; va_end(ap); free(cfmt); return result; } - (id)initWithFormat:(NSString *)_format arguments:(va_list)_ap { unsigned len; char *cfmt; len = [_format cStringLength]; cfmt = malloc(len + 1); [_format getCString:cfmt]; cfmt[len] = '\0'; self = [self initWithString:_stringWithCFormat(cfmt, _ap)]; free(cfmt); return self; } @end /* NSString(XSFormatting) */ @implementation NSMutableString(XSFormatting) - (void)appendFormat:(NSString *)_format arguments:(va_list)_ap { unsigned len; NSString *s; char *cfmt; len = [_format cStringLength]; cfmt = malloc(len + 4); [_format getCString:cfmt]; cfmt[len] = '\0'; s = _stringWithCFormat(cfmt, _ap); if (cfmt) free(cfmt); if (s) [self appendString:s]; } - (void)appendFormat:(NSString *)_format, ... { unsigned len; char *cfmt; NSString *s; va_list ap; len = [_format cStringLength]; cfmt = malloc(len + 4); [_format getCString:cfmt]; cfmt[len] = '\0'; va_start(ap, _format); s = _stringWithCFormat(cfmt, ap); va_end(ap); if (cfmt) free(cfmt); if (s) [self appendString:s]; } @end /* NSMutableString(XSFormatting) */ #endif // var args wrappers int xs_sprintf(char *str, const char *format, ...) { va_list ap; int result; va_start(ap, format); result = xs_vsprintf(str, format, ap); va_end(ap); return result; } int xs_snprintf(char *str, size_t size, const char *format, ...) { va_list ap; int result; va_start(ap, format); result = xs_vsnprintf(str, size, format, ap); va_end(ap); return result; } /* static linking */ void __link_NSString_Formatting(void) { __link_NSString_Formatting(); } SOPE/sope-core/NGExtensions/NGExtensions-Info.plist0000644000000000000000000000135212242733417021142 0ustar rootroot CFBundleDevelopmentRegion English CFBundleExecutable NGExtensions CFBundleGetInfoString CFBundleIdentifier org.OpenGroupware.SOPE.core.NGExtensions CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType FMWK CFBundleShortVersionString CFBundleSignature ???? CFBundleVersion 4.5 SOPE/sope-core/NGExtensions/NGFileManager.m0000644000000000000000000001767012242733417017377 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NGFileManager.h" #include "NGFileManagerURL.h" #include "NSObject+Logs.h" #include "common.h" @implementation NGFileManager static BOOL logPathOps = NO; - (id)init { if ((self = [super init])) { self->cwd = @"/"; } return self; } - (void)dealloc { [self->cwd release]; [super dealloc]; } /* path modifications */ - (NSString *)standardizePath:(NSString *)_path { NSMutableArray *rpc; NSArray *pc; unsigned i, pcn; NSString *result; if (logPathOps) [self logWithFormat:@"standardize: %@", _path]; pc = [_path pathComponents]; if ((pcn = [pc count]) == 0) return _path; if (logPathOps) { [self logWithFormat:@" components: %@", [pc componentsJoinedByString:@" => "]]; } rpc = [NSMutableArray arrayWithCapacity:pcn]; for (i = 0; i < pcn; i++) { NSString *p; p = [pc objectAtIndex:i]; if ([p isEqualToString:@"/"]) { /* found root */ [rpc removeAllObjects]; [rpc addObject:@"/"]; } else if ([p isEqualToString:@"."]) { /* found current directory */ /* '.' can always be removed, right ??? ... */ } else if ([p isEqualToString:@".."]) { /* found parent directory */ if (i == 0) /* relative path starting with '..' */ [rpc addObject:p]; else { /* remove last path component .. */ unsigned count; if ((count = [rpc count]) > 0) [rpc removeObjectAtIndex:(count - 1)]; } } else if ([p isEqualToString:@""]) { /* ignore empty strings */ } else { /* usual path */ [rpc addObject:p]; } } if (logPathOps) { [self logWithFormat:@" new components: %@", [rpc componentsJoinedByString:@" => "]]; } result = [NSString pathWithComponents:rpc]; if ([result length] == 0) return _path; if (logPathOps) [self logWithFormat:@" standardized: %@", result]; return result; } - (NSString *)resolveSymlinksInPath:(NSString *)_path { return _path; } - (NSString *)expandTildeInPath:(NSString *)_path { return _path; } /* directory operations */ - (BOOL)changeCurrentDirectoryPath:(NSString *)_path { BOOL isDir; if (![self fileExistsAtPath:_path isDirectory:&isDir]) return NO; if (!isDir) return NO; ASSIGNCOPY(self->cwd, _path); return YES; } - (NSString *)currentDirectoryPath { return self->cwd; } - (BOOL)createDirectoryAtPath:(NSString *)_path attributes:(NSDictionary *)_ats { return NO; } /* file operations */ - (BOOL)copyPath:(NSString *)_s toPath:(NSString *)_d handler:(id)_handler { return NO; } - (BOOL)movePath:(NSString *)_s toPath:(NSString *)_d handler:(id)_handler { return NO; } - (BOOL)linkPath:(NSString *)_s toPath:(NSString *)_d handler:(id)_handler { return NO; } - (BOOL)removeFileAtPath:(NSString *)_path handler:(id)_handler { return NO; } - (BOOL)createFileAtPath:(NSString *)_path contents:(NSData *)_contents attributes:(NSDictionary *)_attributes { return NO; } /* getting and comparing file contents */ - (NSData *)contentsAtPath:(NSString *)_path { return nil; } - (BOOL)contentsEqualAtPath:(NSString *)_path1 andPath:(NSString *)_path2 { NSData *data1, *data2; data1 = [self contentsAtPath:_path1]; data2 = [self contentsAtPath:_path2]; if (data1 == data2) return YES; if (data1 == nil || data2 == nil) return NO; return [data1 isEqual:data2]; } /* determining access to files */ - (BOOL)fileExistsAtPath:(NSString *)_path { BOOL dummy = NO; return [self fileExistsAtPath:_path isDirectory:&dummy]; } - (BOOL)fileExistsAtPath:(NSString *)_path isDirectory:(BOOL*)_isDirectory { return NO; } - (BOOL)isReadableFileAtPath:(NSString *)_path { return NO; } - (BOOL)isWritableFileAtPath:(NSString *)_path { return NO; } - (BOOL)isExecutableFileAtPath:(NSString *)_path { return NO; } - (BOOL)isDeletableFileAtPath:(NSString *)_path { return NO; } /* Getting and setting attributes */ - (NSDictionary *)fileAttributesAtPath:(NSString *)_p traverseLink:(BOOL)_flag{ return nil; } - (NSDictionary *)fileSystemAttributesAtPath:(NSString *)_p { return nil; } - (BOOL)changeFileAttributes:(NSDictionary *)_attributes atPath:(NSString *)_p{ return NO; } /* discovering directory contents */ - (NSArray *)directoryContentsAtPath:(NSString *)_path { return nil; } - (NSDirectoryEnumerator *)enumeratorAtPath:(NSString *)_path { return nil; } - (NSArray *)subpathsAtPath:(NSString *)_path { return nil; } /* symbolic-link operations */ - (BOOL)createSymbolicLinkAtPath:(NSString *)_p pathContent:(NSString *)_dpath{ return NO; } - (NSString *)pathContentOfSymbolicLinkAtPath:(NSString *)_path { return nil; } /* feature check */ - (BOOL)supportsVersioningAtPath:(NSString *)_path { return [self supportsFeature:NGFileManagerFeature_Versioning atPath:_path]; } - (BOOL)supportsLockingAtPath:(NSString *)_path { return [self supportsFeature:NGFileManagerFeature_Locking atPath:_path]; } - (BOOL)supportsFolderDataSourceAtPath:(NSString *)_path { return [self supportsFeature:NGFileManagerFeature_DataSources atPath:_path]; } - (BOOL)supportsFeature:(NSString *)_featureURI atPath:(NSString *)_path { return NO; } /* writing */ - (BOOL)writeContents:(NSData *)_content atPath:(NSString *)_path { return NO; } /* global-IDs */ - (EOGlobalID *)globalIDForPath:(NSString *)_path; { return nil; } - (NSString *)pathForGlobalID:(EOGlobalID *)_gid { return nil; } /* trash */ - (BOOL)supportsTrashFolderAtPath:(NSString *)_path { return NO; } - (NSString *)trashFolderForPath:(NSString *)_path { return nil; } - (BOOL)trashFileAtPath:(NSString *)_path handler:(id)_handler { NSString *trash, *destPath; BOOL isDir; unsigned i; NSString *tmp; if (![self supportsTrashFolderAtPath:_path]) return NO; if ([(trash = [self trashFolderForPath:_path]) length] == 0) return NO; if ([_path hasPrefix:trash]) /* path already is in trash ... */ return YES; /* ensure that the trash folder is existent */ if ([self fileExistsAtPath:trash isDirectory:&isDir]) { if (!isDir) { NSLog(@"%s: '%@' exists, but isn't a folder !", __PRETTY_FUNCTION__, trash); return NO; } } else { /* trash doesn't exist yet */ if (![self createDirectoryAtPath:trash attributes:nil]) { NSLog(@"%s: couldn't create trash folder '%@' !", __PRETTY_FUNCTION__, trash); return NO; } } /* construct trash path for target ... */ destPath = [trash stringByAppendingPathComponent: [_path lastPathComponent]]; tmp = destPath; i = 0; while ([self fileExistsAtPath:tmp]) { i++; tmp = [destPath stringByAppendingFormat:@"%d", i]; if (i > 40) { NSLog(@"%s: too many files named similiar to '%@' in trash folder '%@'", __PRETTY_FUNCTION__, destPath, trash); return NO; } } destPath = tmp; /* move to trash */ if (![self movePath:_path toPath:destPath handler:_handler]) return NO; return YES; } /* URLs */ - (NSURL *)urlForPath:(NSString *)_path { return [[[NGFileManagerURL alloc] initWithPath:_path fileManager:self] autorelease]; } @end /* NGFileManager */ SOPE/sope-core/NGExtensions/SxCore-NGExtensions.graffle0000644000000000000000000012063412242733417021732 0ustar rootroot CanvasColor w 1.000000e+00 ColumnAlign 0 ColumnSpacing 5.400000e+01 GraphDocumentVersion 2 GraphicsList Bounds {{5.66667, 9.66667}, {176, 36}} Class ShapedGraphic FitText YES ID 1681 Shape Rectangle Style fill Draws NO shadow Draws NO stroke Draws NO Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica-BoldOblique;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\i\b\fs48 \cf0 NGExtensions} Class Group Graphics Class Group Graphics Bounds {{531, 72}, {135, 18}} Class ShapedGraphic ID 1677 Shape RoundedRectangle Style fill Color b 5.000000e-01 g 1.000000e+00 r 1.000000e+00 Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NSBundle} Bounds {{531, 108}, {135, 18}} Class ShapedGraphic ID 1678 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGExtensions/NGBundleManager.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGBundle} Class LineGraphic Head ID 1678 ID 1679 Points {598.5, 90} {598.5, 108} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 1677 ID 1676 Bounds {{531, 36}, {135, 18}} Class ShapedGraphic ID 1680 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGExtensions/NGBundleManager.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGBundleManager} ID 1675 Class Group Graphics Bounds {{603, 504}, {63, 18}} Class ShapedGraphic ID 1669 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGExtensions/NGBitSet.h Shape Rectangle Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica-Oblique;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\i\fs24 \cf0 NGBitSet} Bounds {{522, 504}, {63, 18}} Class ShapedGraphic ID 1670 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGExtensions/NGBitSet.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGBitSet} Bounds {{603, 468}, {63, 18}} Class ShapedGraphic ID 1671 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGExtensions/NGStack.h Shape Rectangle Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica-Oblique;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\i\fs24 \cf0 NGStack} Bounds {{522, 468}, {63, 18}} Class ShapedGraphic ID 1672 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGExtensions/NGStack.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGStack} Class LineGraphic Head ID 1670 ID 1673 Points {603, 513} {585, 513} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 1669 Class LineGraphic Head ID 1672 ID 1674 Points {603, 477} {585, 477} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 1671 ID 1668 Bounds {{198, 279}, {144, 18}} Class ShapedGraphic ID 1667 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGExtensions/NGFileManager.h Shape Rectangle Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica-Oblique;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\i\fs24 \cf0 NGFileManager} Bounds {{36, 324}, {144, 18}} Class ShapedGraphic ID 1666 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGExtensions/NGCustomFileManager.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGCustomFileManager} Bounds {{36, 279}, {144, 18}} Class ShapedGraphic ID 1665 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGExtensions/NGFileManager.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGFileManager} Class LineGraphic Head ID 1665 ID 1664 Points {198, 288} {180, 288} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 1667 Class LineGraphic Head ID 1666 ID 1663 Points {108, 297} {108, 324} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 1665 Class Group Graphics Bounds {{198, 243}, {126, 18}} Class ShapedGraphic ID 1661 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGExtensions/NGFileManagerURL.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGFileManagerURL} Bounds {{198, 207}, {126, 18}} Class ShapedGraphic ID 1662 Shape RoundedRectangle Style fill Color b 5.000000e-01 g 1.000000e+00 r 1.000000e+00 Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NSURL} ID 1660 Bounds {{531, 180}, {135, 18}} Class ShapedGraphic ID 1659 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGByteBuffer.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGByteBuffer} Class Group Graphics Bounds {{99, 495}, {126, 18}} Class ShapedGraphic ID 1652 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGExtensions/EOGroupingSet.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 EOGroupingSet} Bounds {{27, 468}, {126, 18}} Class ShapedGraphic ID 1653 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGExtensions/EOQualifierGrouping.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 EOQualifierGrouping} Bounds {{99, 432}, {126, 18}} Class ShapedGraphic ID 1654 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGExtensions/EOGrouping.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 EOGrouping} Bounds {{171, 468}, {126, 18}} Class ShapedGraphic ID 1655 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGExtensions/EOKeyGrouping.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 EOKeyGrouping} Class LineGraphic Head ID 1652 ID 1656 Points {162, 450} {162, 495} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 1654 Class LineGraphic Head ID 1653 ID 1657 Points {144, 450} {108, 468} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 1654 Class LineGraphic Head ID 1655 ID 1658 Points {180, 450} {216, 468} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 1654 ID 1651 Bounds {{531, 153}, {135, 18}} Class ShapedGraphic ID 1650 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGStreams/NGStreams/NGCharBuffer.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGCharBuffer} Class Group Graphics Bounds {{36, 243}, {144, 18}} Class ShapedGraphic ID 1648 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGExtensions/NGDirectoryEnumerator.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGDirectoryEnumerator} Bounds {{36, 207}, {144, 18}} Class ShapedGraphic ID 1649 Shape RoundedRectangle Style fill Color b 5.000000e-01 g 1.000000e+00 r 1.000000e+00 Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NSEnumerator} ID 1647 Bounds {{27, 99}, {171, 18}} Class ShapedGraphic ID 1646 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGExtensions/EOCompoundDataSource.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 EOCompoundDataSource} Bounds {{117, 135}, {171, 18}} Class ShapedGraphic ID 1645 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGExtensions/EOCacheDataSource.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 EOCacheDataSource} Bounds {{234, 99}, {171, 18}} Class ShapedGraphic ID 1644 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGExtensions/EOFilterDataSource.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 EOFilterDataSource} Bounds {{126, 54}, {171, 18}} Class ShapedGraphic ID 1643 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/EOControl/EODataSource.h Shape RoundedRectangle Style fill Color b 5.000000e-01 g 1.000000e+00 r 1.000000e+00 Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 EODataSource} Class LineGraphic Head ID 1646 ID 1642 Points {191.7, 72} {132.3, 99} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 1643 Class LineGraphic Head ID 1645 ID 1641 Points {210.5, 72} {203.5, 135} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 1643 Class LineGraphic Head ID 1644 ID 1640 Points {233.1, 72} {297.9, 99} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 1643 Bounds {{198, 324}, {171, 18}} Class ShapedGraphic ID 1639 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGExtensions/NGFileFolderInfoDataSource.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGFileFolderInfoDataSource} Class LineGraphic Head ID 1639 ID 1638 Points {213.9, 72} {281.1, 324} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 1643 Bounds {{531, 207}, {135, 18}} Class ShapedGraphic ID 1637 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGExtensions/NGMD5Generator.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGMD5Generator} Bounds {{522, 441}, {144, 18}} Class ShapedGraphic ID 1636 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGExtensions/NGStack.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGStackException} Class Group Graphics Bounds {{540, 315}, {126, 18}} Class ShapedGraphic ID 1634 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGExtensions/NGCString.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGMutableCString} Bounds {{540, 279}, {126, 18}} Class ShapedGraphic ID 1635 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGExtensions/NGCString.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGCString} ID 1633 Bounds {{315, 441}, {162, 18}} Class ShapedGraphic ID 1632 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGExtensions/NGCustomFileManager.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGCustomFileManagerInfo} Class Group Graphics Bounds {{522, 360}, {144, 18}} Class ShapedGraphic ID 1630 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGExtensions/NGHashMap.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGHashMap} Bounds {{522, 396}, {144, 18}} Class ShapedGraphic ID 1631 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-core-42/NGExtensions/NGHashMap.h Shape RoundedRectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NGMutableHashMap} ID 1629 Class LineGraphic Head ID 1661 ID 1628 Points {261, 225} {261, 243} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 1662 Class LineGraphic Head ID 1648 ID 1627 Points {108, 225} {108, 243} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 1649 Class LineGraphic Head ID 1634 ID 1626 Points {603, 297} {603, 315} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 1635 Class LineGraphic Head ID 1631 ID 1625 Points {594, 378} {594, 396} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 1630 GridInfo HPages 1 ImageCounter 1 IsPalette NO Layers Lock NO Name Layer 1 Print YES View YES LayoutInfo AutoAdjust YES HierarchicalOrientation 0 MagneticFieldCenter {0, 0} MagnetsEnabled YES PageBreakColor w 3.333333e-01 PageBreaks YES PageSetup BAt0eXBlZHN0cmVhbYED6IQBQISEhAtOU1ByaW50SW5mbwGEhAhOU09iamVjdACFkoSE hBNOU011dGFibGVEaWN0aW9uYXJ5AISEDE5TRGljdGlvbmFyeQCUhAFpEpKEhIQITlNT dHJpbmcBlIQBKxBOU0pvYkRpc3Bvc2l0aW9uhpKEmZkPTlNQcmludFNwb29sSm9ihpKE mZkOTlNCb3R0b21NYXJnaW6GkoSEhAhOU051bWJlcgCEhAdOU1ZhbHVlAJSEASqEhAFm nSSGkoSZmQtOU1BhcGVyTmFtZYaShJmZBkxldHRlcoaShJmZD05TUHJpbnRBbGxQYWdl c4aShJ2chIQBc54AhpKEmZkNTlNSaWdodE1hcmdpboaShJ2cn50khpKEmZkITlNDb3Bp ZXOGkoSdnISEAVOfAYaShJmZD05TU2NhbGluZ0ZhY3RvcoaShJ2chIQBZKABhpKEmZkL TlNGaXJzdFBhZ2WGkoSdnKmfAYaShJmZFE5TVmVydGljYWxQYWdpbmF0aW9uhpKEnZyk ngCGkoSZmRVOU0hvcml6b25hbFBhZ2luYXRpb26GkoSdnKSeAIaShJmZFk5TSG9yaXpv bnRhbGx5Q2VudGVyZWSGkoSdnKSeAYaShJmZDE5TTGVmdE1hcmdpboaShJ2cn50khpKE mZkNTlNPcmllbnRhdGlvboaShJ2cpJ4BhpKEmZkZTlNQcmludFJldmVyc2VPcmllbnRh dGlvboaSo5KEmZkKTlNMYXN0UGFnZYaShJ2chJeXgn////+GkoSZmQtOU1RvcE1hcmdp boaShJ2cn50khpKEmZkUTlNWZXJ0aWNhbGx5Q2VudGVyZWSGkrSShJmZC05TUGFwZXJT aXplhpKEnpyEhAx7X05TU2l6ZT1mZn2hgQMYgQJkhoaG RowAlign 0 RowSpacing 9.000000e+00 VPages 1 WindowInfo Frame {{104, 118}, {794, 751}} VisibleRegion {{-159, -179}, {1038.67, 898.667}} Zoom 0.75 SOPE/sope-core/NGExtensions/COPYRIGHT0000644000000000000000000000010612242733417016077 0ustar rootrootCopyright (C) 2000-2005 SKYRIX Software AG Contact: info@skyrix.com SOPE/sope-core/NGExtensions/FileObjectHolder.m0000644000000000000000000001134512242733417020135 0ustar rootroot/* Copyright (C) 2002-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "FileObjectHolder.h" #include "NSRunLoop+FileObjects.h" #import #import #import #include "common.h" @implementation FileObjectHolder - (id)initWithFileObject:(id)_object activities:(int)_activities mode:(NSString *)_mode { if (_object == nil) { [self release]; return nil; } self->fileObject = [_object retain]; self->fd = [_object fileDescriptor]; self->activities = _activities; self->mode = [_mode copy]; self->fileHandle = [[NSFileHandle alloc] initWithFileDescriptor:self->fd closeOnDealloc:NO]; NSAssert(self->fileHandle, @"couldn't create filehandle ..."); [[self notificationCenter] addObserver:self selector:@selector(_dataAvailable:) name:NSFileHandleDataAvailableNotification object:self->fileHandle]; [[self notificationCenter] addObserver:self selector:@selector(_acceptAvailable:) name:NSFileHandleConnectionAcceptedNotification object:self->fileHandle]; return self; } - (void)dealloc { if (self->waitActive) [[self notificationCenter] removeObserver:self]; [self->mode release]; [self->fileHandle release]; [self->fileObject release]; [super dealloc]; } /* accessors */ - (int)fileDescriptor { return self->fd; } - (NSFileHandle *)fileHandle { return self->fileHandle; } - (id)fileObject { return self->fileObject; } - (int)activities { return self->activities; } - (NSString *)mode { return self->mode; } - (NSArray *)modes { return [NSArray arrayWithObject:[self mode]]; } /* notifications */ - (NSNotificationCenter *)notificationCenter { return [NSNotificationCenter defaultCenter]; } - (void)handleException:(NSException *)_exception { NSLog(@"%s: catched: %@", __PRETTY_FUNCTION__, _exception); } - (void)_dataAvailable:(NSNotification *)_notification { if ([_notification object] != self->fileHandle) { NSLog(@"%s: notification object %@ does not match file handle %@", __PRETTY_FUNCTION__, [_notification object], self->fileHandle); return; } if (![self->fileObject isOpen]) { //NSLog(@"file object is closed ..."); return; } NS_DURING { self->waitActive = NO; [self wait]; [[self notificationCenter] postNotificationName:NSFileObjectBecameActiveNotificationName object:self->fileObject]; } NS_HANDLER [self handleException:localException]; NS_ENDHANDLER; } - (void)_acceptAvailable:(NSNotification *)_notification { NSLog(@"accept available ..."); if ([_notification object] != self->fileHandle) { NSLog(@"%s: notification object %@ does not match file handle %@", __PRETTY_FUNCTION__, [_notification object], self->fileHandle); return; } [[self notificationCenter] postNotificationName:NSFileObjectBecameActiveNotificationName object:self->fileObject]; } /* operations */ - (void)wait { if (self->waitActive) return; if (![self->fileObject isOpen]) return; self->waitActive = YES; #if 0 /* use accept for passive fileobjects ?, wait seems to work too ... :-) */ if ([self->fileObject isPassive]) { NSLog(@"add passive %@ ..", self->fileObject); // => this also accepts the connection :-( [self->fileHandle acceptConnectionInBackgroundAndNotifyForModes: [self modes]]; } else #endif [self->fileHandle waitForDataInBackgroundAndNotifyForModes:[self modes]]; } - (void)stopWaiting { } /* equality */ - (BOOL)isEqualToFileObjectHolder:(FileObjectHolder *)_other { if (self->fd != _other->fd) return NO; if (![self->mode isEqualToString:_other->mode]) return NO; if (![self->fileObject isEqual:_other->fileObject]) return NO; return YES; } - (BOOL)isEqual:(id)_other { if (_other == self) return YES; if (_other == nil) return NO; if ([_other class] != [self class]) return NO; return [self isEqualToFileObjectHolder:_other]; } /* description */ @end /* FileObject */ SOPE/sope-core/NGExtensions/ChangeLog0000644000000000000000000015367112242733417016376 0ustar rootroot2013-06-20 Jean Raby * NSObject+Logs.m (debugWithFormat:arguments:): check current logLevel value before calling [NGLogger logLevel:message:] This squelches debug message at lower log levels 2010-10-08 Wolfgang Sourdeau * NGBase64Coding.m (-[NSString dataByDecodingBase64]): free "dest" only when the decoding has failed, since the NSData object absorbs it anyway. 2010-10-07 Wolfgang Sourdeau * NGBase64Coding.m (-[NSString stringByEncodingBase64]): we treat the input string as utf8, which is a superset of ascii anyway, instead of using the default cstring encoding. Removed some useless calls to NSAssert. The result string is encoded in NSASCIIStringEncoding. In short, the output is now always a base64-encoded utf-8 string. (-[NSData stringByEncodingBase64]): same as the above. (-[NSString stringByDecodingBase64]): reverse of the above but assume the input string is in utf-8 and then in iso-latin-1, instead of the default cstring encoding. (-[NSData stringByDecodingBase64]): same as the above. 2010-08-11 Wolfgang Sourdeau * NGBase64Coding.m (-[NSString dataByDecodingBase64]): make use of -length rather than -[NSString lengthOfBytesUsingEncoding: NSISOLatin1StringEncoding] to avoid a crash within GNUstep. 2010-07-16 Wolfgang Sourdeau * NGBase64Coding.m (-dataByDecodingBase64) (-stringByDecodingBase64, -stringByEncodingBase64): make use of -[NSString lengthOfBytesUsingEncoding: NSISOLatin1StringEncoding] rather than -[... cStringLength] to avoid a crash within GNUstep. The latter is deprecated anyway... 2010-01-30 Wolfgang Sourdeau * NGRuleEngine.subproj/NGRuleModel.m (-candidateRulesForKey:): return an autoreleased array to avoid leaks. 2009-03-24 Wolfgang Sourdeau * NGQuotedPrintableCoding.m: encode '_' as '=5F', so that it is not decoded as a space (v4.7.203) 2009-03-24 Wolfgang Sourdeau * NGCalendarDateRange.m ([NGCalendarDateRange -dealloc]): release endDate and startDate. (v4.7.202) 2008-03-11 Helge Hess * FdExt.subproj/NSArray+enumerator.m: fixed for MacOS 10.5 (v4.7.201) 2008-02-21 Helge Hess * FdExt.subproj/NSString+Escaping.m: fixed a free() bug introduced in the unichar conversion of v4.7.197 (v4.7.200) 2008-02-21 Helge Hess * FdExt.subproj/NGPropertyListParser.m: fixed NSException not to use -setUserInfo: (v4.7.199) 2008-02-11 Helge Hess * EOExt.subproj/EOGlobalID+Ext.m: explicitly include NSString.h to please GNUstep (v4.7.198) 2008-02-09 Helge Hess * v4.7.197 * FdExt.subproj/NSString+misc.m: rewrote -bindingVariables and stringByReplacingVariablesWithBindings:stringForUnknownBindings: to use unichar (needs testing, might be buggy) * NGQuotedPrintableCoding.m: rewritten to use -dataUsingEncoding: methods instead of working on -cString buffers (Note: encoding selection is dubious) * FdExt.subproj/NSString+Escaping.m: rewrote -stringByApplyingCEscaping to work on unichars * added EOExt.subproj/EOGlobalID+Ext.m category to streamline KVC on non-lF environments 2007-12-03 Helge Hess * NGExtensions/NSString+Formatting.h: replaced usage of deprecated -getCString: method on MacOS 10.4 and later (v4.7.196) 2007-07-31 Marcus Mueller * FdExt.subproj/NSMethodSignature+misc.m: added warning and bogus implementation of -objCTypes for Leopard (v4.7.195) 2007-05-31 Helge Hess * FdExt.subproj/NSString+Encoding.m: added gnustep-base and libFoundation implementations for [NSString +stringEncodingForEncodingNamed:] (v4.7.194) 2007-05-28 Helge Hess * NGCalendarDateRange.m: return nil for undefined KVC keys (v4.7.193) 2007-04-17 Helge Hess * NGExtensions/NSString+Ext.h: expose a few GNUstep NSString extensions (v4.7.192) 2006-11-19 Helge Hess * v4.5.191 * NGRuleEngine.subproj/NGRuleContext.m: allow keypathes in rule values, not just keys * FdExt.subproj/NSString+misc.m: fixed a quote-skipping issue 2006-11-16 Helge Hess * EOExt.subproj/EOCacheDataSource.m: the NSTimer of the datasource does not retain the datasource anymore to avoid keeping them around w/o any other refers (fixes a buserror on MacOS) (v4.5.190) 2006-11-02 Helge Hess * NGQuotedPrintableCoding.m: added NSData method to decode QP as per RFC 2045: -dataByDecodingQuotedPrintableTransferEncoding, related to OGo bug #1753 (v4.5.189) 2006-07-24 Helge Hess * NGBundleManager.m: fixed a minor 64bit printing issue (v4.5.188) 2006-07-05 Helge Hess * NGResourceLocator.m: added FHS_INSTALL_ROOT to lookup path (v4.5.187) 2006-07-04 Helge Hess * NGBundleManager.m: added more debug logs which can be triggered using NGBundleManagerDebugEnabled (v4.5.186) * 64bit fixes (v4.5.185) 2006-07-03 Helge Hess * v4.5.184 * NGHashMap.m: improved memory management with exceptions * FdExt.subproj/NSSet+enumerator.m: code cleanups * use %p for pointer formats, fixed gcc 4.1 warnings 2006-05-16 Marcus Mueller * *.h, *m: changed EOControl related includes into imports to enable compilation against MulleEOF (v4.5.183) 2006-02-20 Helge Hess * NGBundleManager.m: minor code cleanups (v4.5.182) 2006-01-22 Helge Hess * FdExt.subproj/NGPropertyListParser.m (_skipComments): fixed a bug when parsing comments which contain stars (v4.5.181) 2005-12-13 Helge Hess * NGQuotedPrintableCoding.m (NGDecodeQuotedPrintable): properly decode underscore as 0x20 (as per RFC 2047 4.2) (v4.5.180) 2005-11-21 Helge Hess * NGExtensions/NSObject+Values.h: added NGBaseTypeValues protocol to be able to refer to the statically typed 'signed' set of basetypes (v4.5.179) 2005-11-17 Helge Hess * FdExt.subproj/NSObject+Values.m: explicitly mark signed values as such (most importantly char) (v4.5.178) * FdExt.subproj/NSCalendarDate+misc.m: include math.h to avoid a floor warning (v4.5.177) 2005-10-05 Helge Hess * FdExt.subproj/NSNull+misc.m: added -isNotEmpty to NSSet (v4.5.176) 2005-09-28 Helge Hess * FdExt.subproj/NSNull+misc.m: added -isNotEmpty to NSData (v4.5.175) 2005-09-14 Helge Hess * NGBundleManager.m: avoid an autorelease call in class lookup, added some lookup hacks for Tiger Foundation (v4.5.174) 2005-08-26 Helge Hess * added common.h files to support PCH compilation of subprojects (just include the parent common.h and are not required for Xcode builds) (v4.5.173) 2005-08-20 Helge Hess * EOExt.subproj: code cleanups, added a README.txt (v4.5.172) 2005-08-19 Helge Hess * added method to calculate a calendar matrix for a date representing a month (-calendarMatrixWithStartDayOfWeek:onlyCurrentMonth:), added a method to turn an English/German string into a day-of-a-week number (0=Sun-6=Sat) (v4.5.171) 2005-08-07 Helge Hess * NGExtensions.xcodeproj: moved NGRuleParser.h from source to header section 2005-08-04 Helge Hess * NGRuleEngine.subproj/NGRuleModel.m: added EOKeyValueArchiving, added method to load from such an archive, added -addRules: to add a set of rules (v4.5.170) 2005-08-04 Helge Hess * NGRuleEngine.subproj/NGRuleContext.m: added new method -allPossibleValuesForKey: to calculate all possible values for a given key, not just the first matching one (v4.5.169) 2005-08-04 Helge Hess * EOFilterDataSource.m, EOCompoundDataSource.m: code cleanups (v4.5.168) 2005-08-03 Helge Hess * added EOKeyValueArchiving support to NGRuleEngine objects (v4.5.167) 2005-07-22 Helge Hess * FdExt.subproj/NSException+misc.m: added -isException and -isExceptionOrNull methods to NSObject to check whether a given object is an exception (v4.5.166) 2005-07-20 Helge Hess * FdExt.subproj/NSNull+misc.m: fixed a stupid bug in -isNotEmpty (v4.5.165) * FdExt.subproj/NSNull+misc.m: added -isNotEmpty for NSArray and NSDictionary (return YES in case they have no elements) (v4.5.164) 2005-07-19 Helge Hess * FdExt.subproj/NSString+misc.m: use -valueForKeyPath: instead of -valueForKey: to retrieve string binding patterns (might give issues in case you had keys with dots inside before) (v4.5.163) 2005-07-18 Helge Hess * FdExt.subproj/NSNull+misc.m: added -isNotEmpty to all objects. Its similiar to -isNotNull but also checks for strings composed of just spaces (v4.5.162) 2005-07-11 Helge Hess * NGResourceLocator.m: added -description, added method -lookupAllFilesWithExtension:doReturnFullPath: to discover all available files in a search hierarchy (v4.5.161) 2005-05-20 Helge Hess * moved NGStringScanEnumerator to Recycler (was not in makefile) 2005-05-03 Helge Hess * fixed gcc 4.0 warnings (v4.5.160) * XmlExt.subproj/DOMNode+EOQualifier.m: reworked for new DOM (v4.5.159) 2005-04-24 Helge Hess * fixed gcc 4.0 warnings (v4.5.158) 2005-04-04 Marcus Mueller * FdExt.subproj/NSObject+Logs.m: fixed previously broken implementation of -logger which now has an NSMapTable for class <-> logger lookup. (v4.5.157) 2005-03-17 Helge Hess * v4.5.156 * NGBundleManager.m: implemented -classesProvidedByBundle: * NGRuleEngine.subproj/NGRuleParser.m: fixed parsing of array and dictionary plist rule values 2005-03-07 Helge Hess * NGExtensions/NGObjectMacros.h: fixed ASSIGN, ASSIGNCOPY macros to avoid an unset LHS as requested by Stephane (v4.5.155) 2005-03-02 Marcus Mueller * NGCalendarDateRange.m: Bugfix for -containsDate: (v4.5.154) 2005-03-01 Helge Hess * NGBundleManager.m (-pathForResource:ofType:inDirectory:languages:): changed resource lookup to look in Contents/Resources or Resources depending on the Foundation library when no inDirectory: has been given (v4.5.153) 2005-02-23 Helge Hess * FdExt.subproj/NSNull+misc.m: added -hasPrefix: / -hasSuffix:, should fix OGo bug #1080 (v4.5.152) 2005-02-21 Helge Hess * FdExt.subproj/NSString+URLEscaping.m: changed to escape '+' chars in URLs - this is required since the same methods are used for forms which treat spaces as "+" (OGo bug #1260) (v4.5.151) 2005-02-17 Helge Hess * NGBundleManager.m: added some debugging code, minor code cleanups (v4.5.150) 2005-02-15 Helge Hess * NGObjCRuntime.m: fixed some issue with the last commit (v4.5.149) 2005-02-14 Helge Hess * NGObjCRuntime.m: decoupled some varargs processing (v4.5.148) 2005-02-14 Helge Hess * NGExtensions/NGCalendarDateRange.h: fixed header file for MacOSX (v4.5.147) 2005-02-14 Helge Hess * NGBase64Coding.m: added method -dataByEncodingBase64WithLineLength: to support the fix for OGo bug #1228 (v4.5.146) 2005-02-12 Marcus Mueller * NGCalendarDateRange.[hm]: new method -duration (v4.5.145) 2005-02-09 Marcus Mueller * FdExt.subproj/NSCalendarDate+misc.m: Julian number <-> date conversion methods (v4.5.144) 2005-02-09 Helge Hess * FdExt.subproj/NSString+misc.m: do not quote the last newline if the newline is the last char in the string (v4.5.143) 2005-02-08 Helge Hess * FdExt.subproj/NSString+misc.m: added new method -stringByApplyingMailQuoting for placing "> " in front of each line contained in the string (v4.5.142) 2005-01-09 Helge Hess * NGExtensions/AutoDefines.h, common.h: fixed defines on MacOSX (fixes OGo bug #912 (v4.5.141) 2004-12-16 Marcus Mueller * NGCalendarDateRange.[hm]: new convenience method -containsDateRange: (v4.5.140) 2004-12-14 Marcus Mueller * NGExtensions.xcode: minor fixes and updated 2004-12-05 Helge Hess * EOFilterDataSource.m, EOCacheDataSource.m: minor code cleanups (v4.5.139) 2004-11-24 Helge Hess * FdExt.subproj/NSObject+Logs.m: fixed debug logging to be compatible with existing code (v4.5.138) * NGBundleManager.m: subminor code cleanups (v4.5.137) 2004-11-19 Marcus Mueller * NGLogging: updated - API considered stable now. NOTE: "make distclean" is required this time. (v4.5.136) 2004-11-19 Helge Hess * v4.5.135 * FdExt.subproj/NSObject+Logs.m: fixed a bug in default logger creation (incorrect static variable) * NGLogging: fixed bug in console appender, increased speed, avoid different logger objects for each class 2004-11-18 Marcus Mueller * v4.5.134 * NGLogging: updated * NGExtensions/NSObject+Logs.h, FdExt.subproj/NSObject+Logs.m: changed existing implementation to use NGLogging by default. Added some more methods to support different log levels. Also added -logger and -debugLogger which are used to provide the default loggers for the desired purpose. * FdExt.subproj/NGBundleManager.m: fixed wrong include 2004-11-17 Helge Hess * NGBundleManager.m: fixed a bug in the bundle type check when the cached bundle is NSNull (v4.5.133) 2004-11-17 Marcus Mueller * NGLogging: updated (v4.5.132) * NGLogging: updated (v4.5.131) 2004-11-17 Matthew Joyce * NGBundleManager.m: check whether bundle is nil prior running a type check (v4.5.130) 2004-11-13 Helge Hess * NGBundleManager.m: some code cleanups (v4.5.129) 2004-11-12 Helge Hess * NGLogging: code cleanup (v4.5.128) 2004-11-12 Marcus Mueller * GNUmakefile: added NGLogging.subproj (v4.5.127) 2004-11-01 Helge Hess * branched 4.3 to 4.4 and 4.5 2004-10-21 Helge Hess * FdExt.subproj/NSString+URLEscaping.m: removed '&' as an URL safe char (v4.3.126) 2004-10-15 Marcus Mueller * FdExt.subproj/NSString+Escaping.m: minor code cleanups, removed a superfluous statement (v4.3.125) 2004-10-15 Helge Hess * FdExt.subproj/NSString+Escaping.m: minor code cleanups, removed a superflous if() condition (v4.3.124) 2004-10-14 Marcus Mueller * v4.3.123 * FdExt.subproj/NSString+Escaping.m, NGExtensions/NSString+Escaping.h: new category and protocol to do generic escaping. The category is Unicode safe and optimized for performance. * FdExt.subproj/NSString+misc.m, NGExtensions/NSString+misc.h: moved -stringByApplyingCEscaping to new NSString+Escaping. 2004-10-11 Matthew Joyce * FdExt.subproj/NSCalendarDate+misc.m: fixed -isAfternoon (all dates were reported as forenoon) (v4.3.122) 2004-10-08 Helge Hess * FdExt.subproj/NSString+URLEscaping.m: do not escape URL safe chars (fixes a WebDAV issue with Cadaver) (v4.3.121) 2004-10-04 Marcus Mueller * NGExtensions.xcode: updated to the current build version 2004-10-03 Helge Hess * FdExt.subproj/NSURL+misc.m: fixed URL processing in some edge case (v4.3.120) 2004-10-02 Helge Hess * NGQuotedPrintableCoding.m: minor code cleanups (v4.3.119) 2004-10-01 Helge Hess * FdExt.subproj/NSException+misc.m: check whether nil is being passed in as the exception format (v4.3.118) 2004-09-27 Helge Hess * NGBundleManager.m: removed a warning on MacOSX (v4.3.117) 2004-09-23 Marcus Mueller * NGExtensions.xcode: added NGResourceLocator class 2004-09-23 Helge Hess * added NGResourceLocator class (v4.2.116) * moved NGCString to Recycler (was not compiled since v4.2.93) 2004-09-21 Marcus Mueller * NGExtensions.xcode: Fixed dependencies to resemble the make process more closely. Our aim should be to stick to the make process as closely as possible, so we shouldn't introduce dependencies in non-toplevel projects. * NGExtensions.xcode: minor fix 2004-09-20 Marcus Mueller * v4.3.115 * NGExtensions/NSBundle+misc.h, FdExt.subproj/NSBundle+misc.m: new NSBundle method -pathForResource:ofType:inDirectory:forLocalizations: * NGExtensions/NGExtensions.h: added NSBundle+misc.h to the public headers 2004-09-06 Helge Hess * FdExt.subproj/NSFileManager+Extensions.m: added new method: -createDirectoriesAtPath:attributes: (comparable to mkdirs) (v4.3.114) * NGBundleManager.m: changed bundle resource lookup to check loaded bundles before scanning the NGBundlePath resources (is faster and fixes an issue with a bundle loaded but not in the search path) (v4.3.113) 2004-09-05 Helge Hess * v4.3.112 * NGBundleManager.m: code cleanups, added -setBundleSearchPaths: and -bundleSearchPaths to allow bundle path modifications from code * NGHashMap.m: removed libFoundation specific exception handling, the same exceptions are now thrown for all runtimes 2004-08-30 Helge Hess * NGBundleManager.m: fixed yet another bug in NGBundleManager path lookup (v4.3.111) 2004-08-29 Helge Hess * NGBundleManager.m: fixed an issue when running without GNUstep environment (v4.3.110) * v4.3.109 * NGBundleManager.m: look for bundles in GNUSTEP_PATHPREFIX_LIST and GNUSTEP_PATHLIST * added hack to install the project in FHS locations - the library, its headers, the tools and the resources will be installed in FHS_INSTALL_ROOT if specified (eg make FHS_INSTALL_ROOT=/usr/local) 2004-08-29 Marcus Mueller * NGExtensions.xcode: various fixes for project settings 2004-08-26 Helge Hess * FdExt.subproj/NSURL+misc.m: fixed some URL processing methods (v4.3.108) 2004-08-25 Marcus Mueller * NGCalendarDateRange.m: properly fixed intersectionDateRange: to not return pseudo-ranges. (v4.3.107) 2004-08-23 Marcus Mueller * v4.3.106 * NGCalendarDateRange.m: changed -containsDate: in a way that the range is treated as a half-open interval (including startDate, excluding endDate). * v4.3.105 * NGExtensions.xcode: new Xcode project * NGStringScanEnumerator.m: compile bugfix * NGExtensions-Info.plist: new version and bundle identifier 2004-08-20 Helge Hess * XmlExt.subproj/GNUmakefile: added include path for "inline" SOPE 4.3 compilation (v4.3.104) * moved to SOPE 4.3 (v4.3.103) 2004-08-16 Helge Hess * NGCalendarDateRange.m: added range category on NSArray, added some methods to daterange (v4.2.102) 2004-08-16 Marcus Mueller * added NGCalendarDateRange class (v4.2.101) 2004-07-26 Helge Hess * FdExt.subproj/NSObject+Values.m([NSString -unsignedCharValue]): added a specific implementation for NSString to support KVC bool operations (because BOOL values are represented as 'unsigned char' values at runtime, [self takeValue:@"YES" ...] coercion did fail for bool methods) (v4.2.100) 2004-07-22 Helge Hess * EOExt.subproj/EOKeyMapDataSource.m: fixed a gcc 3.4 warning (v4.2.99) 2004-07-14 Helge Hess * FdExt.subproj/NSString+Encoding.m: improved error logs in case an iconv buffer is too small (v4.2.98) 2004-06-27 Helge Hess * NGExtensions/FdExt.subproj/NGPropertyListParser.m: minor cleanups to log messages (v4.2.97) 2004-06-22 Helge Hess * v4.2.96 * FdExt.subproj/NSArray+enumerator.m: fixed a bug with array capacity initialization (used an uninitialized variable leading to a virtual memory exhausted on gstep-base) * FdExt.subproj/NGPropertyListParser.m (_makeException): be more tolerant about nil results in NSString creation (fixes an exception with gstep-base) 2004-06-17 Helge Hess * FdExt.subproj/NSURL+misc.m: add a hack to work around a bug in NSURL on Cocoa Foundation, added a lot of debug logs (v4.2.95) 2004-06-10 Helge Hess * NGObjCRuntime.m: fixed hack for dynamic class loading with gcc 3.4 (type signature of the privates changed or is more strictly checked) (v4.2.94) * v4.2.93 * GNUmakefile: removed NGCString from compilation * NGExtensions/NGExtensions.h: do not include NGCString.h 2004-06-09 Helge Hess * NGExtensions/GNUmakefile.preamble: added prebinding (v4.2.92) 2004-06-08 Helge Hess * FdExt.subproj: include NGPropertyListParser categories when compiling for libFoundation (v4.2.91) * v4.2.90 * GNUmakefile.preamble: fixed path to DOM library, added explicit dependency to SaxObjC for MacOSX * NGBundleManager.m: logging can now be enabled using the NGBundleManagerDebugEnabled default, some code cleanups 2004-06-07 Helge Hess * NGExtensions/NSString+misc.[hm]: improved, now works with any object which supports KVC (v4.2.89) 2004-06-07 Helge Hess * NGBundleManager.m: fixed gcc 3.4 warnings (v4.2.88) 2004-06-05 Stephane Corthesy * NGBundleManager.m(-bundleForClass:): added basic support for classes defined in frameworks (v4.2.87) 2004-06-03 Helge Hess * NGObjCRuntime.m: added a hack to make NGObjCRuntime.m compile with gcc 3.4.0 (v4.2.86) 2004-06-01 Marcus Mueller * NGExtensions/NSCalendarDate+misc.h, FdExt.subproj/NSCalendarDate+misc.m: new method -(BOOL)isInLeapYear, utilized by rewritten -(int)numberOfDaysInMonth. -(NSCalendarDate *)lastDayOfMonth uses -(int)numberOfDaysInMonth now instead of the other way round as before. -lastDayOfMonth turned out to be non-portable to gnustep-base, the new implementation works with all foundation and is far more time/memory efficient. (v4.2.85) 2004-05-17 Helge Hess * FdExt.subproj/NSNull+misc.m: added 'NSNullAbortOnMessage' default to enable abort()'s if a message is sent to NSNull (useful for debugging NSNull issues on MacOSX (v4.2.84) 2004-05-09 Helge Hess * NGObjCRuntime.m: fixed a bug in GNU runtime method addition, added a class enumerator for the GNU runtime (v4.2.83) * NGObjCRuntime.m: added an implementation of +addMethods for the Apple runtime (v4.2.82) 2004-05-05 Marcus Mueller * GNUmakefile.preamble: added support for building with GNUSTEP_BUILD_DIR environment variable set for recent gnustep-make package. (v4.2.81) 2004-05-04 Marcus Mueller * EOExt.subproj/EOSortOrdering+plist.m: fixed wrong mappings for case insensitive sortOrderings (v4.2.80) 2004-05-01 Marcus Mueller * v4.2.79 * EOExt.subproj/EOSortOrdering+plist.m: fixed wrong key argument to initWithKey:selector: in initWithDictionary:. * EOExt.subproj/EOFetchSpecification+plist.m: testing for respondsToSelector(objectEnumerator) matches dictionaries as well, resulting in improper behavior. Narrowed to testing for kind of NSArray now. 2004-05-01 Helge Hess * NGObjCRuntime.m: improved support for Apple runtime (v4.2.78) 2004-04-07 Jean-Alexis Montignies * NGHashMap: added because used in NGObjWeb -asDictionaryWithArraysForValues (v4.2.77) 2004-04-07 Helge Hess * NGExtensions/NSString+Encoding.h: exported +stringEncodingForEncodingNamed: on Cocoa (v4.2.76) 2004-04-01 Helge Hess * NGHashMap: some code cleanups, made the code a bit more fault tolerant (check for some NULL references, as suggest by Jean-Alexis Montignies), fixed missing class in header file (v4.2.75) 2004-03-24 Helge Hess * FdExt: added NSString+German category which contains some methods to deal with ASCII representations of German umlauts (useful for some searches) (v4.2.74) 2004-03-22 Helge Hess * v4.2.73 * FdExt.subproj/NSString+HTMLEscaping.m: added escaping for some missing umlauts * FdExt.subproj/NSObject+Values.m: minor speed optimization to NSString -boolValue 2004-03-15 Helge Hess * EOExt: moved in property list initializer methods from EOControl (to make them available for GDL2) 2004-03-14 Helge Hess * NGBundleManager.m: print an error log if we were unable to get the system NSUserDefaults object, as it currently happens with gstep-base, added a hack not to create the NGBundleManager if the NSUserDefaults object could not be retrieved (v4.2.71) 2004-03-13 Helge Hess * EOFilterDataSource: code cleanups, added -description method (v4.2.70) 2004-03-11 Helge Hess * NGBundleManager.m: disabled a debug log (v4.2.69) 2004-03-10 Donald Duck * NGBundleManager.m: print a warning if the NGBundlePath default is not configured (v4.2.68) 2004-03-08 Helge Hess * FdExt.subproj/NSException+misc.m: added a -copyWithZone: method, as used by the XML-RPC client (v4.2.67) 2004-03-01 Helge Hess * FdExt.subproj/NSException+misc.m: added a -setReason: implementation for gnustep-base - thanks to chunsj for pointing that out (v4.2.66) 2004-02-24 Helge Hess * FdExt.subproj/NSNull+misc.m: added -descriptionWithLocale: on MacOSX (v4.2.65) 2004-02-23 Helge Hess * FdExt.subproj/NSNull+misc.m: added -descriptionWithLocale: for Cocoa Foundation (v4.2.65) * FdExt.subproj/NSNull+misc.m: added various "ignore that" methods for MacOSX: -isEqualToString:, -characterAtIndex:, -descriptionWithLocale:indent:, added -respondsToSelector: (always returns YES on MacOSX) - Note: this is to be considered a workaround, we need to find out, why OGo calls such methods on NSString with Cocoa Foundation (v4.2.64) 2004-02-19 Helge Hess * FdExt.subproj/NSCalendarDate+misc.m, NSString+Ext.m: added KVC default handlers for Cocoa Foundation (avoids some exceptions, libFoundation is much more tolerant regarding missing KVC keys than Cocoa) (v4.2.63) 2004-02-13 Helge Hess * v4.2.62 * NGBundleManager.m: do not report missing resources on MacOSX (reduced debug level) * FdExt.subproj/NSArray+enumerator.m: added implementation of -map:... (to be considered deprecated ...) for the MacOSX port 2004-02-12 Helge Hess * NGBundleManager.m: disabled class-hook debugging on OSX (v4.2.61) 2004-02-10 Helge Hess * NGStack.m: fixed minor compilation warning on OSX (v4.2.60) 2004-02-08 Helge Hess * FdExt.subproj/NSString+Encoding.m: cleanups, use ucs-2-internal instead of ucs-2 on non-Linux platforms and detect platform byte ordering and use ucs-2le or ucs-2be depending on that - should fix OGo bugs #580 (does not fix #145) (v4.2.59) 2004-01-23 Helge Hess * FdExt.subproj/NSFileManager+Extensions.m: renamed category to ExtendedFileManagerImp to avoid gcc warnings (v4.2.58) 2003-12-28 Helge Hess * NGBundleManager.m: minor cleanups (v4.2.57) 2003-11-30 Helge Hess * FdExt.subproj/NSString+misc.m, FdExt.subproj/NSMethodSignature+misc.m: applied some minor patches for gstep-base provided by chunsj@embian.com (v4.2.56) 2003-11-20 Helge Hess * FdExt.subproj/NSString+URLEscaping.m: added UTF-8 URL escaping (v4.2.55) * v4.2.54 * NSString+URLEscaping.m: added default 'NGUseUTF8AsURLEncoding' to unescape URL strings as UTF-8 entities. This is usually the right thing to do for WebDAV servers like ZideStore. Note that encoding is still always done in ISO-Latin-1 (to be fixed) * FdExt.subproj/NSString+misc.m: moved the various string escaping implementations (URL, HTML and XML) into separate NSString categories 2003-11-09 Helge Hess * FdExt.subproj/NSString+Formatting.m: minor speed and MacOSX compatibility improvements (v4.2.53) 2003-10-27 Helge Hess * NGBase64Coding.m: bad day, fixed the new -dataByDecodingBase64 (v4.2.52) * NGBase64Coding.m: added -dataByDecodingBase64 to NSString, since a base64 string can (of course!) contain zero bytes. -stringByDecodingBase64 now returns nil if it encounteres such a situation (v4.2.51) * NGBase64Coding.m: fixed a major bug in the base64 encoding (which did not handle empty values properly!) (v4.2.50) 2003-10-15 Helge Hess * v4.2.49 * FdExt.subproj/NSException+misc.m: fixed ZNeK's setReason: implementation for gstep-make * moved NGPropertyListParser.h to NGExtensions and made it a public header 2003-10-13 Helge Hess * compile and link NGPropertyListParser in case we are not on libFoundation, compile and link FileObjectHolder on Cocoa (v4.2.48) 2003-10-11 Marcus Mueller * FdExt.subproj/NSException+misc.m: Provided implementation for setReason: (as needed with COCOA_Foundation_LIBRARY) and provided interface declaration in case of GNUSTEP_BASE_LIBRARY. (v4.2.47) 2003-09-07 Marcus Mueller * v4.2.46 * NGBundleManager.m, NGHashMap.m, NGObjCRuntime.m, NGStack.m, EOExt.subproj/EOQualifier+CtxEval.m, FdExt.subproj/NSNull+misc.m, FdExt.subproj/NSProcessInfo+misc.m, FdExt.subproj/NSString+misc.m: Fixed outdated references to FoundationExt and pointed to NGExtensions where appropriate. Also, added defines for NeXT_RUNTIME. * EOExt.subproj/EOKeyMapDataSource.m: Fixed problem with method not returning value when not void. 2003-09-06 Helge Hess * v4.2.45 * NGExtensions.h: do not include FoundationExt but NGObjectMacros.h instead * added NGObjectMacros.h which contains the RC macros * FdExt.subproj/NSString+Formatting.m: cache the NSString class object, use less autorelease, fixed a nil-parameter bug on MacOSX, added some hacks to implement unicode format scanning (v4.2.44) 2003-09-06 Marcus Mueller * v4.2.43 * GNUmakefile.preamble: added iconv to the list of necessary libraries on FreeBSD (4.x/5.x) * FdExt.subproj/NSString+Encoding.m: do not use iconv on Apple, instead use CoreFoundation's CFStringConvertIANACharSetNameToEncoding() 2003-07-18 Helge Hess * v4.2.42 * FdExt.subproj/NSData+gzip.m: removed dependency on zutil.h, patch provided by Filip Van Raemdonck * NGHashMap.m, NSNull+misc.m: fixed gstep-base compilation problems, patch provided by Filip Van Raemdonck Wed Jul 16 16:03:47 2003 Jan Reichmann * FdExt.subproj/NSString+Formatting.m: use ISERIES/USE_VA_LIST_PTR defines to handle va_list structures (v4.2.41) Wed Jul 16 15:00:16 2003 Jan Reichmann * FdExt.subproj/NSString+Formatting.m: fixed a bug regarding iSeries port, copy va_list structure before give it to a function and read one argument from the original va_list (v4.2.40) Tue Jul 15 21:09:26 2003 Jan Reichmann * FdExt.subproj/NSString+Formatting.m: replace *va_list function arguments with va_list (iSeries port) (v4.2.39) Mon Jul 14 18:21:55 2003 Jan Reichmann * NGBundleManager.m: cache bundle using name.extension instead of name only (v4.2.38) 2003-06-23 Helge Hess * NGFileManager.m: ignore empty strings during path standardization (reason for publisher bug 1778) (v4.2.37) 2003-06-06 Jan Reichmann * NSString+Encoding.m: added a category to encode/decode string from arbitary encoding formats using libiconv (v4.2.36) 2003-05-26 Helge Hess * updated MacOSX port, some smaller modification to compile without FoundationExt (exceptions, memory allocation, plist parsing) (v4.2.35) 2003-05-19 Helge Hess * v4.2.34 * NGRuleEngine.subproj/NGRuleContext.m: added a flag to enable debugging on a per-context base, added some logging * NGRuleEngine.subproj/NGRuleModel.m: during sorting of rules also consider how specific a qualifier is (by calling -count on the qualifier) * v4.2.33 * NGRuleEngine: fixed default priorities * NGRuleEngine/NGRuleParser: fixed bug in rule-model parsing, added a "reset" method to reset stored variables * NGRuleContext: added some constructors (v4.2.32) 2003-05-16 Helge Hess * NGRuleEngine: added parsing of rule-models (v4.2.31) * v4.2.30 * EOExt.subproj/NSArray+EOGrouping.m: fixed a bug introduced by clean ups in v4.2.26 * EOExt: added EOTrueQualifier (used in rule system for *true*) * added simple NGRule parser 2003-05-15 Helge Hess * FdExt.subproj/NSString+misc.m: added a new scanning method, -rangeOfString:skipQuotes:escapedByChar: for easier parsing of common quoted languages (v4.2.29) 2003-05-14 Helge Hess * moved headers to "NGExtensions" subdirectory (v4.2.28) * started to add NGRuleEngine, a KVC/EOQualifier based evaluation system (v4.2.27) * cleaned up source organization, created three subprojects, FdExt, EOExt and XmlExt for Foundation, EOControl and skyrix-xml additions (v4.2.26) 2003-04-09 GNUstep User * fixed unsigned/signed warnings for gcc 3.3 (v4.2.25) * NSProcessInfo+misc.m: small fix for gstep-base (use -stringByTrimmingSpaces instead of ..WhiteSpaces..) (v4.2.24) 2003-04-01 GNUstep User * NGObjCRuntime.m: added a hack for GNUstep Base with the incomplete FoundationExt library (v4.2.23) 2003-04-01 Helge Hess * added compilation support for GNUstep base (v4.2.22) 2003-03-14 Helge Hess * NSString+misc.m: do not encode umlaut entities in XML output (v4.2.21) 2003-03-09 Helge Hess * NGBase64Coding.m: added -stringByEncodingBase64 and -stringByDecodingBase64 to NSData (v4.2.20) Tue Mar 4 13:53:40 2003 Jan Reichmann * GNUmakefile, NGFileManager+JS.m: add JS functions (copied from NGJavaScript/Core+JS/NGFileManager+JS.m) (bug 712) (v4.2.19) Tue Feb 4 11:56:34 2003 * NGHashMap.m: disable throwing exception in objectForKey: if more than one object exsist, print out a warning only (bug 981) (v4.2.18) Fri Jan 17 16:43:13 2003 Martin Hoerning * NSCalendarDate+misc.m ([NSCalendarDate -dateByAddingYears:months:days:]): fixed month overflow (bug 871) (v4.2.17) 2003-01-10 Helge Hess * NGBundleManager.m: do not print a warning if the principal class of a bundle could not be found (since the bundle might have none ...) and use the NGBundle class as the default handler (v4.2.16) 2003-01-07 Helge Hess * v4.2.15 * changes for improved compilation on MacOSX, replaced RETAIN macros with methods * common.h: does not include anything from FoundationExt (required includes were moved to the .m files) Fri Dec 27 10:42:11 2002 Helge Hess * fixed Copyright headers in most files (v4.2.14) Mon Dec 23 15:34:51 2002 Helge Hess * NSObject+Logs.m: print a warning if DEBUG is disabled (v4.2.13) * NSFileManager+Extensions.m: correctly implement NGFileManager (some trash related fixes) 2002-11-25 Helge Hess * NSString+misc.m: added some methods for processing fully qualified XML names (v4.2.12) 2002-11-22 Helge Hess * EOKeyMapDataSource.m: finished EOKeyMapDataSource (v4.2.11) * EOKeyMapDataSource.m: started EOKeyMapDataSource (v4.2.10) * EOCacheDataSource.m: tiny code cleanups 2002-11-15 Helge Hess * NSURL+misc.m: fixed an index bug in URL string processing (v4.2.9) 2002-10-30 Helge Hess * NSDictionary+misc: added a method -dictionaryByExchangingKeysAndValues to reverse the mapping of a dictionary (v4.2.8) 2002-10-21 Helge Hess * NGStringScanEnumerator.m: properly clear data when being passed an empty NSData (v4.2.7) Thu Oct 17 16:18:49 2002 Helge Hess * added Bjoern's excellent NGStringScanEnumerator for scanning binaries for printable strings (useful for extracting version information of executables that have no --version support ..) (v4.2.6) 2002-09-30 Helge Hess * NSEnumerator+misc.m, NSProcessInfo+misc.m: removed some compilation warnings (v4.2.5) Fri Aug 30 11:40:59 2002 Jan Reichmann * NGQuotedPrintableCoding.m: (Suse Bug 18600) fixed 'Soft line Breaks'-Bug (v4.2.4) 2002-08-15 Helge Hess * NSFileManager+Extensions.m: added support for GlobalIDs, make relative pathes absolute before calling standarizePath (v4.2.3) 2002-07-12 Helge Hess * moved tools/tests to skyrix-core/samples 2002-05-31 Helge Hess * NGBundleManager.m: changed to work with gstep-base library 2002-05-23 Helge Hess * moved from Skyrix-dev-42 repository to skyrix-core (v4.2.2) Fri May 17 14:51:13 2002 Helge Hess * added NSData+gzip category from NGZlib Thu May 2 15:21:00 2002 Helge Hess * added NSURL+misc for handling relative NSURLs Thu May 2 13:38:11 2002 Helge Hess * made some modifications to support gstep-base Mon Apr 29 11:35:31 2002 Helge Hess * NSProcessInfo+misc.m: added convenience methods: -argumentsWithoutDefaults Tue Apr 16 13:13:05 2002 Helge Hess * NSString+misc.m: fixed bug with HTML escaping \n \r etc Tue Feb 12 21:04:16 2002 Helge Hess * NSObject+Values.m: the -stringValue of NSMutableString now returns an immutable copy * added DOM extensions Sat Feb 9 12:25:57 2002 Helge Hess * added object logging methods Wed Feb 6 11:54:04 2002 Helge Hess * NSProcessInfo+misc.m: added -temporaryFileName Mon Jan 7 15:33:41 2002 Helge Hess * NGBundleManager.m: use a set for resource lookup to avoid duplicates Mon Dec 17 15:19:23 2001 Helge Hess * NGFileManager.m: added -trashFileAtPath:handler: method Tue Nov 27 19:30:29 2001 Helge Hess * NGBundleManager: made NGBundle class public * NSProcessInfo+misc.m: speed optimized /proc processing ... Thu Nov 22 10:48:29 2001 Helge Hess * NSCalendarDate+misc.m: added method for calculation of easter Tue Nov 6 12:06:49 2001 Helge Hess * removed NGFileManager*Tools from Sascha, too many dependencies on SkyProject ... Tue Nov 6 12:00:11 2001 Helge Hess * added NGFileManager*Tools from Sascha Thu Oct 18 15:34:13 2001 Helge Hess * NSNull+misc.m: added forwarding code to catch unknown selectors Tue Oct 16 16:34:25 2001 Helge Hess * EOQualifier+CtxEval.m ([NSArray -filteredArrayUsingQualifier:context:]): return empty array instead of nil if no object matches Mon Oct 15 15:59:42 2001 Helge Hess * NSNull+misc.m: implemented KVC for NSNull ... Mon Oct 15 15:33:52 2001 Helge Hess * NSNull+misc.m: added -count,-length implementations to improve stability against typing bugs (calls get logged using NSLog) Tue Aug 28 11:32:06 2001 Helge Hess * NSString+misc.m: added Unicode support to HTML escaping * NSString+misc.h: added methods to do HTML escaping Mon Aug 20 17:59:49 2001 Helge Hess * EOCompoundDataSource.m: fixed bug: remove from notification center in -dealloc * EOFilterDataSource.m ([NSDictionary -flattenedArrayWithHint:andKeys:]): fixed allocation bug (missing -autorelease) Fri Aug 17 12:47:07 2001 Helge Hess * added NSProcessInfo+misc for querying the /proc filesystem Fri Aug 10 13:31:28 2001 Helge Hess * added NGFileManager class Thu Aug 9 13:49:30 2001 Helge Hess * NSString+misc.m (NGUnescapeUrlBuffer): added URL escaping/unescaping Tue Jul 31 11:27:46 2001 Martin Spindler * EOFilterDataSource.m: can handle groupings now Tue Jul 10 11:56:18 2001 Helge Hess * NSCalendarDate+misc.m(firstMondayAndLastWeekInYear:): do not dump core if passed NULL 2001-06-26 Helge Hess * removed NGNil, NGArchiver * moved to SkyDev41 Wed May 30 14:47:11 2001 Helge Hess * EOFilterDataSource.m: completed Thu May 10 11:23:57 2001 Helge Hess * NGBundleManager.m: improved error handling Mon Apr 30 10:44:02 2001 Helge Hess * EOCacheDataSource.m: added -description Thu Apr 19 11:58:57 2001 Jan Reichmann * EOCompoundDataSource.m: insert mh bugfix (return empty array instead of nil); fixed sources notification bug Tue Apr 10 13:15:38 2001 Helge Hess * NGFileManager.h: completed NGFileManager protocol Mon Mar 26 12:29:14 2001 Helge Hess * added NSNull+misc with -isNotNull Thu Mar 8 16:51:31 2001 Helge Hess * EOKeyGrouping.m: fixed bug with 'nil' in -addObject: Tue Feb 13 10:51:03 2001 Helge Hess * EOGrouping.m: added -setGroupings/-groupings to EOFetchSpecification Tue Feb 13 10:31:29 2001 Helge Hess * fixed bugs in grouping stuff Tue Feb 6 18:18:48 2001 Martin Spindler * NSArray+Grouping.[hm], EO*Grouping.[hm]: added Mon Jan 29 15:36:07 2001 Helge Hess * NSFileManager+Extensions.m: added trash-folder support Wed Jan 24 19:35:43 2001 Jan Reichmann * NSString+misc.[mh]: add FilePathVersioningMethods Wed Jan 24 19:35:00 2001 Jan Reichmann * NSFileManager+Extensions.h: add fileAttributesAtPath:traverseLink: version: Tue Jan 23 18:04:35 2001 Helge Hess * EOQualifier+CtxEval.m: fixed bug in parameter countin Thu Jan 18 17:04:07 2001 Helge Hess * NSFileManager+Extensions: changed feature-check methods Tue Jan 16 11:28:38 2001 Jan Reichmann * EOCacheDataSource.m: fixed timeout bug Mon Jan 15 14:24:45 2001 Helge Hess * NSFileManager+Extensions.h: added locking protocol Mon Jan 15 12:54:54 2001 Helge Hess * NSFileManager+Extensions.h: added methods for versioning Sun Jan 14 19:27:23 2001 Jan Reichmann * EOCacheDataSource.[mh]: improved timeout Fri Jan 12 18:29:33 2001 Jan Reichmann * EOCacheDataSource.[hm]: timeout Wed Jan 10 15:56:40 2001 Helge Hess * EODataSource+NGExtensions.m: added EONoFetchWithEmptyQualifierHint Wed Jan 3 15:36:40 2001 Jan Reichmann * EOCacheDataSource.m: fixed dealloc bug Thu Oct 26 20:00:41 2000 Jan Reichmann * EOQualifier+CtxEval.m: fixed log bug Thu Oct 19 14:31:48 2000 Helge Hess * NSString+misc.m: added changes of Jan Mon Oct 16 19:30:30 2000 Martin Spindler * EODataSource+NGExtensions.m: added Mon Oct 2 18:04:28 2000 Helge Hess * NSString+Formatting.m: added %ll specifier for long-long types Thu Aug 31 17:54:59 2000 Helge Hess * NSEnumerator+misc: added this new category/classes Fri Aug 18 15:09:14 2000 Helge Hess * NGBundleManager.m: cache bundle manager object Thu Aug 17 13:43:06 2000 Helge Hess * NGBundleManager.m: always search in $GSROOT/Library/Bundles Wed Jul 5 20:32:24 2000 Martin Hoerning * NSCalendarDate+misc.m: fixed -numberOfWeeksInYear Wed Jun 28 15:24:46 2000 Helge Hess * NSCalendarDate+misc.m: added -numberOfWeeksInYear Tue Jun 13 18:34:04 2000 Helge Hess * NGObjCRuntime.m, NSString+Formatting.m: doesn't use stack allocated buffers anymore Fri Jun 9 17:37:09 2000 Helge Hess * NGQuotedPrintableCoding.m: changed 'char' type to 'signed char' Wed May 31 16:33:53 2000 Helge Hess * NSCalendarDate+misc.h: added -firstDayOfMonth and -weekOfMonth Wed May 17 11:54:20 2000 Helge Hess * NSCalendarDate+misc.m: added -isForenoon and -isAfternoon Wed May 3 17:45:19 2000 Helge Hess * NSCalendarDate+misc.m: fixed mondays-of-year calculation to respect the DST timezones Wed May 3 17:14:32 2000 Helge Hess * NSCalendarDate+misc.m: added week-calculation methods Tue May 2 17:24:09 2000 Helge Hess * NGBundleManager.m ([NGBundleManager -providedResourcesOfType:inBundle:]): fixed bug, didn't qualify based on type Tue May 2 14:00:45 2000 Jan Reichmann * NSString+misc.m: fixed possible buffer overflow bug Tue May 2 13:24:40 2000 Jan Reichmann * NGHashMap.m: fixed RC-Bug in allObjects and _NGHashMapObjectEnumerator -nextObject Tue May 2 13:12:11 2000 Helge Hess * NGHashMap.m: added NSAssert's to check for a valid 'table' Fri Apr 28 19:00:52 2000 Helge Hess * NSString+misc.m: added placeholder replacement stuff, removed string debugging stuff Wed Apr 12 19:33:26 2000 Helge Hess * NSCalendarDate+misc.m: added -isToday method Tue Feb 29 17:12:15 2000 Helge Hess * MOF3 import Mon Feb 21 13:49:40 2000 Helge Hess * removed -cString calls 2000-02-17 * NSString+Formatting.m, NSBase64Coding.m, NGBundleManager.m, NSString+misc: removed a lot of 'cString' usage Thu Jan 20 18:44:27 2000 Helge Hess * added NGObjCRuntime category. Contains ObjC runtime manipulation stuff Mon Jan 10 12:44:10 2000 Helge Hess * NSCalendarDate+misc.m: added Y2K support method Mon Dec 6 19:15:27 1999 Helge Hess * NGBundleManager.m: added support for EOQualifier queries Thu Sep 16 18:14:39 1999 Helge Hess * removed NGTool.[hm], NGProxy.[hm], NGMainMacros.h Mon Jul 26 12:21:44 1999 Helge Hess * NGBundleManager.m: added -principalObject method Thu Jul 22 14:31:36 1999 Jan Reichmann * NGQuotedPrintableCoding.m: fixed NGEncodeQuotedPrintable Thu Jul 8 10:23:52 1999 Helge Hess * NGBundleManager.m: send notification if bundle did load Wed Jun 30 15:20:05 1999 Helge Hess * added NGBundleManager Fri Jun 25 19:58:14 1999 Helge Hess * NSString+Formatting.m: fixed bug (formatter looks for empty format) Tue Jun 15 10:38:05 1999 Helge Hess * added NGQuotedPrintableCoding categories Fri May 21 16:13:52 1999 Helge Hess * make it compile with gstep-base Fri May 21 13:19:10 1999 Helge Hess * changed OPENSTEP macro to WITH_OPENSTEP Tue Mar 16 12:43:03 1999 Helge Hess * common.h: added support for mingw32 Tue Jan 12 13:19:36 1999 Helge Hess * NGHashMap.m: added -asDictionary method Fri Jan 8 14:42:31 1999 Helge Hess * NSSet+enumerator.m: implemented mapping methods Thu Jan 7 16:14:55 1999 Helge Hess * NGBase64Coding.m: use +stringWithCStringNoCopy:... Wed Jan 6 18:54:50 1999 Helge Hess * NSString+Formatting.m: use Objective-C allocation functions * NGMemoryAllocation.h: use Objective-C allocation functions * NSAutoreleasePool+misc.m: content is ignored if Boehm GC is used Wed Dec 30 09:54:51 1998 Helge Hess * fixed exception creation, cleanups in NSAttributedString Mon Dec 28 09:51:24 1998 Helge Hess * replaced THROW with -raise * replaced TRY with NS_DURING * removed GNU regex library because of license issues Wed Dec 23 12:13:07 1998 Helge Hess * NSArray+enumerator.m: added methods to create sets using selector mapping Wed Dec 16 12:23:24 1998 Helge Hess * NSArray+enumerator.m: added methods to create arrays using selector mapping Fri Dec 11 18:58:35 1998 Helge Hess * NSCalendarDate+misc.m: added -hour:minute:second:, -hour:minute: Tue Dec 8 19:23:23 1998 Helge Hess * NSCalendarDate+misc.m: fixed -tomorrow, -yesterday which was broken * NSCalendarDate+misc.m: added various methods: -isDateOnSameDay, -isDateInSameWeek, -yesterday, -tomorrow * added NSCalendarDate+misc category Fri Nov 27 15:53:48 1998 Helge Hess * NGExtensions.h: added 'index()' function for WIN32 Thu Nov 26 13:48:35 1998 Helge Hess * NSException+misc.h: removed FINALLY from SYNCHRONIZED macros * GNUmakefile: added install capability Tue Nov 24 11:51:08 1998 Helge Hess * NSAutoreleasePool+misc.m: added category linking function * NGStack.m: fixed RC bug (elements were not released on dealloc) Mon Nov 23 10:37:55 1998 Helge Hess * NSString+misc.m: added string debugging methods (init replacements) which were in libFoundation-mof2 before * added NSAutoreleasePool+misc.[hm] Mon Nov 16 18:41:15 1998 Helge Hess * NGCharBuffers.h: fixed bug in initialization Fri Nov 13 10:44:03 1998 Helge Hess * NGExtensions.h: made NoZone a libFoundation specific * Makefile.preamble: added -Wno-protocol switch * NGTool.m: getpid() replaced for WIN32 Tue Nov 10 17:01:20 1998 Helge Hess * NGTool.m: signal handler sets itself again after signal is executed Fri Nov 6 11:07:03 1998 Helge Hess * NGArchiver.m: added proper Copyright information Thu Nov 5 08:28:07 1998 Helge Hess * NGArchiver.m: reformatted for inclusion in libFoundation Wed Oct 28 14:57:40 1998 Helge Hess * NGHashMap.m: added -initWithDictionary:, +hashMapWithDictionary: methods Thu Oct 22 14:07:32 1998 Helge Hess * added NSDictionary+misc category Tue Oct 20 19:34:33 1998 Helge Hess * added xor digests in MD5 generator 1998-10-19 Helge Hess * NSObject+Values.m: modified values method to use only intValue, floatValue and doubleValue. * NSException+misc.h: added synchronized macros * removed property list parser (now in libFoundation) 1998-10-15 Helge Hess * NGStack.m: made category on NSMutableArray to make it conform to stack protocol * added NSString+misc category. Contains a method to return a string escaped using C rules (newline becomes '\n', ..) 1998-10-11 Helge Hess * started Rhapsody support 1998-10-10 Helge Hess * NGBase64Coding.m: removed generation of newline at end of encoding, cleaned up, removed MAXLINE constant 1998-10-09 Helge Hess * reformatted NGArchiver.m * created ChangeLog SOPE/sope-core/NGExtensions/libNGExtensions.def0000644000000000000000000000133612242733417020345 0ustar rootrootEXPORTS __objc_class_name_NGBitSet; __objc_class_name_NGConcreteBitSetEnumerator; __objc_class_name_NGBundleManager; __objc_class_name_NGBundle; __objc_class_name_NGCString; __objc_class_name_NGMutableCString; __objc_class_name_NGExtensions; __objc_class_name_NGHashMap; __objc_class_name_NGMutableHashMap; __objc_class_name__NGHashMapKeyEnumerator; __objc_class_name__NGHashMapObjectEnumerator; __objc_class_name__NGHashMapObjectForKeyEnumerator; __objc_class_name_NGMD5Generator; __objc_class_name_NGStack; __objc_class_name__NGConcreteStackEnumerator; __objc_class_name_NGStackException; NGBundleWasLoadedNotificationName; NGEncodeQuotedPrintable; NGDecodeQuotedPrintable; EODataSourceDidChangeNotification; SOPE/sope-core/NGExtensions/NGLogging.subproj/0000755000000000000000000000000012242733417020105 5ustar rootrootSOPE/sope-core/NGExtensions/NGLogging.subproj/README0000644000000000000000000000132312242733417020764 0ustar rootrootNGLogging OVERVIEW ================== TBD: write overview! NOTES ===== NGLoggerManager: - provide some extra config for configuration of appenders for loggers NGLogger: - what about loggingPrefix? - provide API for setting appenders NSObject+ExtendedLogging: - should check if -loggingPrefix is defined. If YES should provide this to logger NGLogEvent - should remember its logger? -> probably important for filtering APPENDER NOTES ============== - We're probably not interested in providing lots of appenders for lots of different loggers. Most of the time we have something like a default appender, say NGLogConsoleAppender during development and NGLogSyslogAppender for deployment (or file appenders) SOPE/sope-core/NGExtensions/NGLogging.subproj/GNUmakefile0000644000000000000000000000116312242733417022160 0ustar rootroot# GNUstep makefile include ../../../config.make include ../../common.make SUBPROJECT_NAME = NGLogging NGLogging_PCH_FILE = common.h NGLogging_OBJC_FILES += \ NGLogger.m \ NGLoggerManager.m \ NGLogEvent.m \ NGLogEventFormatter.m \ NGLogEventDetailedFormatter.m \ NGLogAppender.m \ NGLogFileHandleAppender.m \ NGLogStdoutAppender.m \ NGLogStderrAppender.m \ # TODO: disable on Windows NGLogging_OBJC_FILES += \ NGLogSyslogAppender.m ADDITIONAL_INCLUDE_DIRS += -I. -I../NGExtensions/ -I.. -I../.. -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/subproject.make -include GNUmakefile.postamble SOPE/sope-core/NGExtensions/NGLogging.subproj/NGLogStderrAppender.m0000644000000000000000000000211112242733417024067 0ustar rootroot/* Copyright (C) 2004-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NGLogFileHandleAppender.h" @interface NGLogStderrAppender : NGLogFileHandleAppender { } @end #include "common.h" @implementation NGLogStderrAppender - (void)openFileHandleWithConfig:(NSDictionary *)_config { self->fh = [[NSFileHandle fileHandleWithStandardError] retain]; } @end /* NGLogStderrAppender */ SOPE/sope-core/NGExtensions/NGLogging.subproj/NGLogSyslogAppender.m0000644000000000000000000000546312242733417024121 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NGLogSyslogAppender.h" #include "NGLogEvent.h" #include #include #include "common.h" @interface NGLogSyslogAppender (PrivateAPI) - (int)syslogLevelForLogLevel:(NGLogLevel)_level; @end @implementation NGLogSyslogAppender static NSString *defaultSyslogIdentifier = nil; + (void)initialize { NSUserDefaults *ud; static BOOL isInitialized = NO; if (isInitialized) return; ud = [NSUserDefaults standardUserDefaults]; defaultSyslogIdentifier = [[ud stringForKey:@"NGLogSyslogIdentifier"] retain]; isInitialized = YES; } + (id)sharedAppender { static id sharedAppender = nil; if (sharedAppender == nil) { sharedAppender = [[self alloc] init]; } return sharedAppender; } - (id)initWithConfig:(NSDictionary *)_config { NSString *identifier; identifier = [_config objectForKey:@"SyslogIdentifier"]; if(!identifier) identifier = defaultSyslogIdentifier; return [self initWithIdentifier:identifier]; } - (id)initWithIdentifier:(NSString *)_ident { if ((self = [super init])) { // TODO: default flags? // TODO: error code processing? openlog([_ident cString], LOG_PID | LOG_NDELAY, LOG_USER); } return self; } - (void)dealloc { closelog(); [super dealloc]; } /* operations */ - (void)appendLogEvent:(NGLogEvent *)_event { NSString *formattedMsg; int level; formattedMsg = [self formattedEvent:_event]; level = [self syslogLevelForLogLevel:[_event level]]; syslog(level, "%s", [formattedMsg cString]); } - (int)syslogLevelForLogLevel:(NGLogLevel)_level { int level; switch (_level) { case NGLogLevelDebug: level = LOG_DEBUG; break; case NGLogLevelInfo: level = LOG_INFO; break; case NGLogLevelWarn: level = LOG_WARNING; break; case NGLogLevelError: level = LOG_ERR; break; case NGLogLevelFatal: level = LOG_ALERT; // LOG_EMERG is broadcast to all users... break; default: level = LOG_NOTICE; break; } return level; } @end /* NGLogSyslogAppender */ SOPE/sope-core/NGExtensions/NGLogging.subproj/NGLogAppender.m0000644000000000000000000000476612242733417022725 0ustar rootroot/* Copyright (C) 2004-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NGLogAppender.h" #include "NGLogLevel.h" #include "NGLogEvent.h" #include "NGLogEventFormatter.h" #include "common.h" @implementation NGLogAppender static NSString *defaultAppenderClassName = nil; + (void)initialize { static BOOL didInit = NO; NSUserDefaults *ud; if (didInit) return; didInit = YES; ud = [NSUserDefaults standardUserDefaults]; defaultAppenderClassName = [[ud stringForKey:@"NGLogDefaultAppenderClass"] retain]; if (defaultAppenderClassName == nil) defaultAppenderClassName = @"NGLogStderrAppender"; } + (id)logAppenderFromConfig:(NSDictionary *)_config { NSString *className; Class clazz; id appender; className = [_config objectForKey:@"Class"]; if (!className) className = defaultAppenderClassName; clazz = NSClassFromString(className); if (clazz == Nil) { NSLog(@"ERROR: can't instantiate appender class named '%@'", className); return nil; } appender = [[[clazz alloc] initWithConfig:_config] autorelease]; return appender; } - (id)initWithConfig:(NSDictionary *)_config { self = [super init]; if (self) { NSDictionary *formatterConfig; formatterConfig = [_config objectForKey:@"Formatter"]; self->formatter = [[NGLogEventFormatter logEventFormatterFromConfig:formatterConfig] retain]; } return self; } - (void)appendLogEvent:(NGLogEvent *)_event { #if LIB_FOUNDATION_LIBRARY [self subclassResponsibility:_cmd]; #else NSLog(@"ERROR(%s): method should be implemented by subclass!", __PRETTY_FUNCTION__); #endif } /* formatting */ - (NSString *)formattedEvent:(NGLogEvent *)_event { return [self->formatter formattedEvent:_event]; } @end /* NGLogAppender */ SOPE/sope-core/NGExtensions/NGLogging.subproj/NGLogEventDetailedFormatter.m0000644000000000000000000000602312242733417025554 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NGLogEventFormatter.h" #include "NGLogLevel.h" @class NSString; @interface NGLogEventDetailedFormatter : NGLogEventFormatter { } @end #include "NGLogEvent.h" #include "common.h" #include "NSProcessInfo+misc.h" @implementation NGLogEventDetailedFormatter static unsigned char *processName = NULL; static NSProcessInfo *processInfo = nil; static char *monthNames[14] = { "Dec", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "Jan" }; + (void)initialize { static BOOL didInit = NO; unsigned len; NSString *pn; if (didInit) return; didInit = YES; processInfo = [[NSProcessInfo processInfo] retain]; /* NOTE: the processName isn't guaranteed to remain constant - NSProcessInfo even offers an API to change it during runtime. Looking at lF this seems to be unimplemented on an OS level though, and Apple's documentation explicitly states that changing the process name at runtime might be unwise to do. Let's treat it as constant. */ pn = [processInfo processName]; len = [pn cStringLength]; processName = malloc(len + 4); [pn getCString:(char *)processName]; } static __inline__ unsigned char *levelPrefixForEvent(NGLogEvent *_event) { switch ([_event level]) { case NGLogLevelWarn: return (unsigned char *)"[WARN] "; case NGLogLevelError: return (unsigned char *)"[ERROR] "; case NGLogLevelFatal: return (unsigned char *)"[FATAL] "; default: return (unsigned char *)""; } } - (NSString *)formattedEvent:(NGLogEvent *)_event { NSMutableString *fe; NSCalendarDate *date; fe = [NSMutableString stringWithCapacity:160]; /* timestamp, process name, process id, level prefix */ date = [_event date]; [fe appendFormat:@"%s %02i %02i:%02i:%02i %s [%d]: %s", monthNames[[date monthOfYear]], [date dayOfMonth], [date hourOfDay], [date minuteOfHour], [date secondOfMinute], processName, /* Note: pid can change after a fork() */ #if NeXT_Foundation_LIBRARY || COCOA_Foundation_LIBRARY [processInfo processIdentifier], #else [[processInfo processId] intValue], #endif levelPrefixForEvent(_event)]; /* message */ [fe appendString:[_event message]]; return fe; } @end /* NGLogEventDetailedFormatter */ SOPE/sope-core/NGExtensions/NGLogging.subproj/ChangeLog0000644000000000000000000000676012242733417021670 0ustar rootroot2013-06-20 Jean Raby * NGLogger.m (_logLevelForString): fix the check and return the defaultLogLevel instead of hardcoding INFO 2004-12-14 Marcus Mueller * NGLogEventDetailedFormatter.m: added comment regarding process name. 2004-11-19 Marcus Mueller * *.h: added detailed documentation * *.m: added -description where appropriate * NGLogger.m: removed +defaultLogger from the API, it's used internally though. * NGLoggerManager.m: reinstated caching of loggers. Added optimization to reuse a "default" logger when no config is available. * NGLogEvent.[hm]: changed -date to return NSCalendarDate instead of NSDate. * NGLogEventFormatter.[hm]: new base class for implementing formatters. Also offers a factory for creating log event formatter instances from configurations. * NGLogEventDetailedFormatter.m: offers rich logging, similar to what NSLog() in libFoundation has to offer. * NGLogConsoleAppender.m: removed, obsoleted by NGLogStdoutAppender. * NGLogFileHandleAppender.[hm]: new base class for implementing file handle based appenders. * NGLogStdoutAppender.m, NGLogStderrAppender.m: appenders for logging to stdout/stderr. 2004-11-19 Helge Hess * NGLoggerManager.m: use default logger if none is registered * NGLogger.m: cleaned up -init, added default logger * NGLogConsoleAppender.m: removed the bug with using a message in place of a format, rewrote logger to be sufficiently fast 2004-11-18 Marcus Mueller * NGLogLevel.h: new header bearing the log levels * NSObject+ExtendedLogging.[hm]: removed. All equivalent functionality is now in NSObject+Logs.[hm]. * NGLogger.[hm]: changed API to that required by NSObject+Logs.m. 2004-11-17 Marcus Mueller * *.h: provided some documentation * NGLoggerManager.[hm]: new method -loggerForFacilityNamed: for sharing/referencing instances based on names. * NSObject+NGExtendedLogging.h: fixed some serious misordering in log levels (thanks to Helge Hess for reporting this! ;-) * NSObject+NGExtendedLogging.m: some optimizations to default logging facilities (check wheter loglevel is enabled before allocating strings which is expensive). * NGLogger.m: changed some code to address changes in NGLogLevel, shortcut logging immediately if minimum log level is not met. 2004-11-12 Helge Hess * deprecated -defaultManager in favor of -defaultLoggerManager * code cleanups for SOPE styleguides 2004-11-12 Marcus Mueller * NSObject+ExtendedLogging.[hm]: -(id)logger queries NGLoggerManager now. Also, a new default "NGDefaultLogLevel" triggers default NSObject based logging now. * README: new file 2004-11-11 Marcus Mueller * NGLoggerManager.[hm]: controller providing loggers based on information from user defaults (currently) 2004-05-27 Marcus Mueller * NGLogAppender.[hm]: introduced -formattedEvent:, currently not configurable. * NGLogSyslogAppender.m: works as expected now. * NGLogger.m: uses new default (see README) to select the default appender. Not optimal, but sufficient. * NGLogConsoleAppender.m: changed to use -formattedEvent: now. 2004-05-27 Marcus Mueller * NGLogSyslogAppender.[hm]: syslog appender, untested. * ChangeLog: created SOPE/sope-core/NGExtensions/NGLogging.subproj/NGLogger.m0000644000000000000000000001544412242733417021737 0ustar rootroot/* Copyright (C) 2004-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NGLogger.h" #include "NGLogEvent.h" #include "NGLogAppender.h" #include "NSNull+misc.h" #include "common.h" @interface NGLogger (PrivateAPI) + (NGLogLevel)_logLevelForString:(NSString *)_level; @end @implementation NGLogger static Class NSStringClass = Nil; static NGLogger *defaultLogger = nil; static NGLogLevel defaultLogLevel = NGLogLevelInfo; + (void)initialize { static BOOL didInit = NO; NSUserDefaults *ud; NSString *level; if (didInit) return; didInit = YES; NSStringClass = [NSString class]; ud = [NSUserDefaults standardUserDefaults]; level = [ud stringForKey:@"NGLogDefaultLogLevel"]; defaultLogLevel = [self _logLevelForString:level]; defaultLogger = [[self alloc] init]; } + (id)loggerWithConfigFromUserDefaults:(NSString *)_defaultName { NSUserDefaults *ud; NSDictionary *config; id logger; ud = [NSUserDefaults standardUserDefaults]; config = [ud dictionaryForKey:_defaultName]; if(!config) return defaultLogger; logger = [[[NGLogger alloc] initWithConfig:config] autorelease]; return logger; } - (id)init { return [self initWithConfig:nil]; } - (id)initWithConfig:(NSDictionary *)_config { self = [super init]; if (self) { NSArray *appenderConfigs; NGLogAppender *appender; NSString *levelString; NGLogLevel level; unsigned count; self->appenders = [[NSMutableArray alloc] initWithCapacity:1]; levelString = [_config objectForKey:@"LogLevel"]; level = [NGLogger _logLevelForString:levelString]; [self setLogLevel:level]; appenderConfigs = [_config objectForKey:@"Appenders"]; count = [appenderConfigs count]; if(!count) { /* create a default appender */ appender = [NGLogAppender logAppenderFromConfig:nil]; [self addAppender:appender]; } else { unsigned i; for(i = 0; i < count; i++) { NSDictionary *appenderConfig; appenderConfig = [appenderConfigs objectAtIndex:i]; appender = [NGLogAppender logAppenderFromConfig:appenderConfig]; if(appender) [self addAppender:appender]; } } } return self; } - (id)initWithLogLevel:(NGLogLevel)_level { self = [self initWithConfig:nil]; if (self) { [self setLogLevel:_level]; } return self; } - (void)dealloc { [self->appenders release]; [super dealloc]; } /* accessors */ - (void)setLogLevel:(NGLogLevel)_level { self->logLevel = _level; } - (NGLogLevel)logLevel { return self->logLevel; } - (void)addAppender:(NGLogAppender *)_appender { [self->appenders addObject:_appender]; } - (void)removeAppender:(NGLogAppender *)_appender { [self->appenders removeObject:_appender]; } /* logging */ - (void)debugWithFormat:(NSString *)_fmt arguments:(va_list)_va { NSString *msg; if (self->logLevel < NGLogLevelDebug) return; msg = [[NSStringClass alloc] initWithFormat:_fmt arguments:_va]; [self logLevel:NGLogLevelDebug message:msg]; [msg release]; } - (void)logWithFormat:(NSString *)_fmt arguments:(va_list)_va { NSString *msg; if (self->logLevel < NGLogLevelInfo) return; msg = [[NSStringClass alloc] initWithFormat:_fmt arguments:_va]; [self logLevel:NGLogLevelInfo message:msg]; [msg release]; } - (void)warnWithFormat:(NSString *)_fmt arguments:(va_list)_va { NSString *msg; if (self->logLevel < NGLogLevelWarn) return; msg = [[NSStringClass alloc] initWithFormat:_fmt arguments:_va]; [self logLevel:NGLogLevelWarn message:msg]; [msg release]; } - (void)errorWithFormat:(NSString *)_fmt arguments:(va_list)_va { NSString *msg; if (self->logLevel < NGLogLevelError) return; msg = [[NSStringClass alloc] initWithFormat:_fmt arguments:_va]; [self logLevel:NGLogLevelError message:msg]; [msg release]; } - (void)fatalWithFormat:(NSString *)_fmt arguments:(va_list)_va { NSString *msg; if (self->logLevel < NGLogLevelFatal) return; msg = [[NSStringClass alloc] initWithFormat:_fmt arguments:_va]; [self logLevel:NGLogLevelFatal message:msg]; [msg release]; } - (void)logLevel:(NGLogLevel)_level message:(NSString *)_msg { NGLogEvent *event; unsigned i, count; event = [[NGLogEvent alloc] initWithLevel:_level message:_msg]; count = [self->appenders count]; for(i = 0; i < count; i++) { NGLogAppender *appender; appender = [self->appenders objectAtIndex:i]; [appender appendLogEvent:event]; } [event release]; } /* log conditions */ - (BOOL)isDebuggingEnabled { return self->logLevel >= NGLogLevelDebug; } - (BOOL)isLogInfoEnabled { return self->logLevel >= NGLogLevelInfo; } - (BOOL)isLogWarnEnabled { return self->logLevel >= NGLogLevelWarn; } - (BOOL)isLogErrorEnabled { return self->logLevel >= NGLogLevelError; } - (BOOL)isLogFatalEnabled { return self->logLevel >= NGLogLevelFatal; } /* Private */ + (NGLogLevel)_logLevelForString:(NSString *)_level { if ([_level length]) { _level = [_level uppercaseString]; if ([_level isEqualToString:@"DEBUG"]) return NGLogLevelDebug; else if ([_level isEqualToString:@"INFO"]) return NGLogLevelInfo; else if ([_level isEqualToString:@"WARN"]) return NGLogLevelWarn; else if ([_level isEqualToString:@"ERROR"]) return NGLogLevelError; else if ([_level isEqualToString:@"FATAL"]) return NGLogLevelFatal; return NGLogLevelAll; /* better than nothing */ } return defaultLogLevel; } /* description */ - (NSString *)description { NSString *lvl; switch (self->logLevel) { case NGLogLevelOff: lvl = @"OFF"; break; case NGLogLevelDebug: lvl = @"DEBUG"; break; case NGLogLevelInfo: lvl = @"INFO"; break; case NGLogLevelWarn: lvl = @"WARN"; break; case NGLogLevelError: lvl = @"ERROR"; break; case NGLogLevelFatal: lvl = @"FATAL"; break; default: lvl = @"ALL"; break; } return [NSString stringWithFormat:@"<%@[0x%p] logLevel=%@ appenders:%@>", NSStringFromClass([self class]), self, lvl, self->appenders]; } @end /* NGLogger */ SOPE/sope-core/NGExtensions/NGLogging.subproj/NGLogFileHandleAppender.m0000644000000000000000000000375712242733417024640 0ustar rootroot/* Copyright (C) 2004-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NGLogFileHandleAppender.h" #include "NGLogEvent.h" #include "common.h" @implementation NGLogFileHandleAppender static NSData *nextLineData = nil; + (void)initialize { static BOOL didInit = NO; if (didInit) return; didInit = YES; nextLineData = [[@"\n" dataUsingEncoding:NSASCIIStringEncoding] retain]; } - (id)initWithConfig:(NSDictionary *)_config { self = [super initWithConfig:_config]; if (self) { self->flushImmediately = NO; self->encoding = [NSString defaultCStringEncoding]; [self openFileHandleWithConfig:_config]; } return self; } - (void)dealloc { if ([self isFileHandleOpen]) [self closeFileHandle]; [self->fh release]; [super dealloc]; } - (BOOL)isFileHandleOpen { return self->fh ? YES : NO; } - (void)openFileHandleWithConfig:(NSDictionary *)_config { } - (void)closeFileHandle { [self->fh closeFile]; } - (void)appendLogEvent:(NGLogEvent *)_event { NSString *formatted; NSData *bin; formatted = [self formattedEvent:_event]; bin = [formatted dataUsingEncoding:self->encoding]; [self->fh writeData:bin]; [self->fh writeData:nextLineData]; if (self->flushImmediately) [self->fh synchronizeFile]; } @end /* NGLogFileHandleAppender */ SOPE/sope-core/NGExtensions/NGLogging.subproj/NGLogEventFormatter.m0000644000000000000000000000401712242733417024121 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NGLogEventFormatter.h" #include "NGLogEvent.h" #include "common.h" @implementation NGLogEventFormatter static NSString *defaultFormatterClassName = nil; + (void)initialize { static BOOL didInit = NO; NSUserDefaults *ud; if (didInit) return; didInit = YES; ud = [NSUserDefaults standardUserDefaults]; defaultFormatterClassName = [[ud stringForKey:@"NGLogDefaultLogEventFormatterClass"] retain]; if (defaultFormatterClassName == nil) defaultFormatterClassName = @"NGLogEventFormatter"; } + (id)logEventFormatterFromConfig:(NSDictionary *)_config { NSString *className; Class clazz; id formatter; className = [_config objectForKey:@"Class"]; if (!className) className = defaultFormatterClassName; clazz = NSClassFromString(className); if (clazz == Nil) { NSLog(@"ERROR: can't instantiate log event formatter class named '%@'", className); return nil; } formatter = [[[clazz alloc] initWithConfig:_config] autorelease]; return formatter; } - (id)initWithConfig:(NSDictionary *)_config { self = [super init]; if (self) { } return self; } /* formatting */ - (NSString *)formattedEvent:(NGLogEvent *)_event { return [_event message]; } @end /* NGLogEventFormatter */ SOPE/sope-core/NGExtensions/NGLogging.subproj/NGLogEvent.m0000644000000000000000000000434112242733417022235 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NGLogEvent.h" #include "common.h" @implementation NGLogEvent static Class DateClass = Nil; + (void)initialize { static BOOL didInit = NO; if (didInit) return; didInit = YES; DateClass = [NSCalendarDate class]; } - (id)initWithLevel:(NGLogLevel)_level message:(NSString *)_msg { self = [super init]; if (self) { // TODO: get time using libc function, cheaper self->date = [DateClass timeIntervalSinceReferenceDate]; self->level = _level; self->msg = [_msg copy]; } return self; } - (void)dealloc { [self->msg release]; [super dealloc]; } /* accessors */ - (NGLogLevel)level { return self->level; } - (NSString *)message { return self->msg; } - (NSCalendarDate *)date { // TODO: set to GMT? return [DateClass dateWithTimeIntervalSinceReferenceDate:self->date]; } /* description */ - (NSString *)description { NSString *lvl; switch (self->level) { case NGLogLevelOff: lvl = @"OFF"; break; case NGLogLevelDebug: lvl = @"DEBUG"; break; case NGLogLevelInfo: lvl = @"INFO"; break; case NGLogLevelWarn: lvl = @"WARN"; break; case NGLogLevelError: lvl = @"ERROR"; break; case NGLogLevelFatal: lvl = @"FATAL"; break; default: lvl = @"ALL"; break; } return [NSString stringWithFormat:@"<%@[0x%p] date=%@ level=%@ msg:%@>", NSStringFromClass([self class]), self, [self date], lvl, self->msg]; } @end /* NGLogEvent */ SOPE/sope-core/NGExtensions/NGLogging.subproj/NGLoggerManager.m0000644000000000000000000000674212242733417023233 0ustar rootroot/* Copyright (C) 2004-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NGLoggerManager.h" #include "NGLogLevel.h" #include "NGLogger.h" #include "NSNull+misc.h" #include "common.h" @interface NGLoggerManager (PrivateAPI) - (NGLogger *)_getConfiguredLoggerNamed:(NSString *)_name; @end @implementation NGLoggerManager static NGLoggerManager *sharedInstance = nil; static NSNull *sharedNull = nil; static BOOL debugAll = NO; + (void)initialize { static BOOL didInit = NO; NSUserDefaults *ud; if (didInit) return; didInit = YES; sharedInstance = [[self alloc] init]; sharedNull = [[NSNull null] retain]; ud = [NSUserDefaults standardUserDefaults]; debugAll = [ud boolForKey:@"NGLogDebugAllEnabled"]; } + (id)defaultLoggerManager { return sharedInstance; } + (id)defaultManager { NSLog(@"WARNING(%s): called deprecated method.", __PRETTY_FUNCTION__); return [self defaultLoggerManager]; } - (id)init { self = [super init]; if (self) { self->loggerMap = [[NSMutableDictionary alloc] initWithCapacity:50]; } return self; } - (void)dealloc { [self->loggerMap release]; [super dealloc]; } /* operations */ - (NGLogger *)loggerForDefaultKey:(NSString *)_defaultKey { id logger; logger = [self->loggerMap objectForKey:_defaultKey]; if (!logger) { NSUserDefaults *ud; ud = [NSUserDefaults standardUserDefaults]; if (!debugAll && ![ud boolForKey:_defaultKey]) { [self->loggerMap setObject:sharedNull forKey:_defaultKey]; logger = sharedNull; } else { logger = [self _getConfiguredLoggerNamed:_defaultKey]; [self->loggerMap setObject:logger forKey:_defaultKey]; } } return (logger != sharedNull) ? logger : nil; } - (NGLogger *)loggerForFacilityNamed:(NSString *)_name { NGLogger *logger; // TODO: expensive, use a faster map (at least NSMapTable) if ((logger = [self->loggerMap objectForKey:_name]) != nil) return logger; logger = [self _getConfiguredLoggerNamed:_name]; [self->loggerMap setObject:logger forKey:_name]; return logger; } - (NGLogger *)loggerForClass:(Class)_clazz { NSString *name; name = _clazz != Nil ? NSStringFromClass(_clazz) : (NSString *)nil; return [self loggerForFacilityNamed:name]; } /* Private */ - (NGLogger *)_getConfiguredLoggerNamed:(NSString *)_name { NSString *configKey; configKey = [NSString stringWithFormat:@"%@LoggerConfig", _name]; return [NGLogger loggerWithConfigFromUserDefaults:configKey]; } /* description */ - (NSString *)description { return [NSString stringWithFormat:@"<%@[0x%p] debugAll=%@ #loggers=%d>", NSStringFromClass([self class]), self, debugAll ? @"YES" : @"NO", [self->loggerMap count]]; } @end /* NGLoggerManager */ SOPE/sope-core/NGExtensions/NGLogging.subproj/common.h0000644000000000000000000000002712242733417021545 0ustar rootroot#include "../common.h" SOPE/sope-core/NGExtensions/NGLogging.subproj/NGLogStdoutAppender.m0000644000000000000000000000212312242733417024111 0ustar rootroot/* Copyright (C) 2004-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NGLogFileHandleAppender.h" @interface NGLogStdoutAppender : NGLogFileHandleAppender { } @end #include "common.h" @implementation NGLogStdoutAppender - (void)openFileHandleWithConfig:(NSDictionary *)_config { self->fh = [[NSFileHandle fileHandleWithStandardOutput] retain]; } @end /* NGLogStdoutAppender */ SOPE/sope-core/NGExtensions/NGFileManager+JS.m0000644000000000000000000002303512242733417017677 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "common.h" #include "NGFileManager.h" #include "NSFileManager+Extensions.h" #include "EOCacheDataSource.h" /* JavaScript Properties cwd - readonly - current working directory, string Methods bool cd(path) Object ls([path|paths]) bool mkdir(path[,path..]) bool rmdir(path[,path..]) bool rm(path[,path..]) bool trash(path[,path..]) bool cp(frompath[,frompath..], topath) bool mv(frompath[,frompath..], topath) bool ln(frompath, topath) bool exists(path[,path..]) bool isdir(path[,path..]) bool islink(path[,path..]) Object getDataSource([String path, [bool cache]]) */ @implementation NGFileManager(JSSupport) static NSNumber *boolYes = nil; static NSNumber *boolNo = nil; static void _ensureBools(void) { if (boolYes == nil) boolYes = [[NSNumber numberWithBool:YES] retain]; if (boolNo == nil) boolNo = [[NSNumber numberWithBool:NO] retain]; } /* properties */ - (id)_jsprop_cwd { return [self currentDirectoryPath]; } /* methods */ - (id)_jsfunc_cd:(NSArray *)_args { _ensureBools(); return [self changeCurrentDirectoryPath:[_args objectAtIndex:0]] ? boolYes : boolNo; } - (id)_jsfunc_ls:(NSArray *)_args { unsigned count; if ((count = [_args count]) == 0) { return [self directoryContentsAtPath:@"."]; } else if (count == 1) { return [self directoryContentsAtPath: [[_args objectAtIndex:0] stringValue]]; } else { NSMutableDictionary *md; unsigned i; md = [NSMutableDictionary dictionaryWithCapacity:count]; for (i = 0; i < count; i++) { NSString *path; NSArray *contents; path = [_args objectAtIndex:i]; contents = [self directoryContentsAtPath:path]; if (contents) [md setObject:contents forKey:path]; } return md; } } - (id)_jsfunc_mkdir:(NSArray *)_args { unsigned count; _ensureBools(); if ((count = [_args count]) == 0) { return boolNo; } else { unsigned i; for (i = 0; i < count; i++) { NSString *path; path = [_args objectAtIndex:i]; if (![self createDirectoryAtPath:path attributes:nil]) return boolNo; } return boolYes; } } - (id)_jsfunc_rmdir:(NSArray *)_args { unsigned count; _ensureBools(); if ((count = [_args count]) == 0) { return boolNo; } else { unsigned i; for (i = 0; i < count; i++) { NSString *path; BOOL isDir; path = [_args objectAtIndex:i]; if (![self fileExistsAtPath:path isDirectory:&isDir]) return boolNo; if (!isDir) /* not a directory ! */ return boolNo; if ([[self directoryContentsAtPath:path] count] > 0) /* directory has contents */ return boolNo; if (![self removeFileAtPath:path handler:nil]) /* remove failed */ return boolNo; } return boolYes; } } - (id)_jsfunc_rm:(NSArray *)_args { unsigned count; _ensureBools(); if ((count = [_args count]) == 0) { return boolNo; } else { unsigned i; for (i = 0; i < count; i++) { NSString *path; BOOL isDir; path = [_args objectAtIndex:i]; if (![self fileExistsAtPath:path isDirectory:&isDir]) return boolNo; if (isDir) { if ([[self directoryContentsAtPath:path] count] > 0) /* directory has contents */ return boolNo; } if (![self removeFileAtPath:path handler:nil]) /* remove failed */ return boolNo; } return boolYes; } } - (id)_jsfunc_trash:(NSArray *)_args { unsigned count; _ensureBools(); if ((count = [_args count]) == 0) { return boolNo; } else { unsigned i; for (i = 0; i < count; i++) { NSString *path; BOOL isDir; path = [_args objectAtIndex:i]; if (![self supportsTrashFolderAtPath:path]) return boolNo; if (![self fileExistsAtPath:path isDirectory:&isDir]) return boolNo; if (![self trashFileAtPath:path handler:nil]) /* remove failed */ return boolNo; } return boolYes; } } - (id)_jsfunc_mv:(NSArray *)_args { unsigned count; _ensureBools(); if ((count = [_args count]) == 0) return boolNo; else if (count == 1) /* missing target path */ return boolNo; else { NSString *destpath; unsigned i; BOOL isDir; destpath = [_args objectAtIndex:(count - 1)]; if (![self fileExistsAtPath:destpath isDirectory:&isDir]) isDir = NO; for (i = 0; i < (count - 1); i++) { NSString *path, *dpath = nil; path = [_args objectAtIndex:i]; dpath = isDir ? [dpath stringByAppendingPathComponent:[path lastPathComponent]] : destpath; if (![self movePath:path toPath:dpath handler:nil]) /* move failed */ return boolNo; } return boolYes; } } - (id)_jsfunc_cp:(NSArray *)_args { unsigned count; _ensureBools(); if ((count = [_args count]) == 0) return boolNo; else if (count == 1) /* missing target path */ return boolNo; else { NSString *destpath; unsigned i; BOOL isDir; destpath = [_args objectAtIndex:(count - 1)]; if (![self fileExistsAtPath:destpath isDirectory:&isDir]) isDir = NO; for (i = 0; i < (count - 1); i++) { NSString *path, *dpath = nil; path = [_args objectAtIndex:i]; dpath = isDir ? [dpath stringByAppendingPathComponent:[path lastPathComponent]] : destpath; if (![self copyPath:path toPath:dpath handler:nil]) /* copy failed */ return boolNo; } return boolYes; } } - (id)_jsfunc_ln:(NSArray *)_args { unsigned count; _ensureBools(); if ((count = [_args count]) == 0) return boolNo; else if (count == 1) /* missing target path */ return boolNo; else { NSString *srcpath; NSString *destpath; srcpath = [_args objectAtIndex:0]; destpath = [_args objectAtIndex:1]; if (![self createSymbolicLinkAtPath:destpath pathContent:srcpath]) return boolNo; return boolYes; } } - (id)_jsfunc_exists:(NSArray *)_args { unsigned count; _ensureBools(); if ((count = [_args count]) == 0) return boolYes; else { unsigned i; for (i = 0; i < count; i++) { NSString *path; path = [_args objectAtIndex:i]; if (![self fileExistsAtPath:path]) return boolNo; } return boolYes; } } - (id)_jsfunc_isdir:(NSArray *)_args { unsigned count; _ensureBools(); if ((count = [_args count]) == 0) { return boolYes; } else { unsigned i; for (i = 0; i < count; i++) { NSString *path; BOOL isDir; path = [_args objectAtIndex:i]; #if 0 NSLog(@"CHECK PATH: %@", path); #endif if (![self fileExistsAtPath:path isDirectory:&isDir]) { #if 0 NSLog(@" does not exist .."); #endif return boolNo; } if (!isDir) { #if 0 NSLog(@" not a directory .."); #endif return boolNo; } } #if 0 NSLog(@"%s: returning yes, %@ are directories", __PRETTY_FUNCTION__, _args); #endif return boolYes; } } - (id)_jsfunc_islink:(NSArray *)_args { unsigned count; _ensureBools(); if ((count = [_args count]) == 0) return boolYes; else { unsigned i; for (i = 0; i < count; i++) { NSString *path; BOOL isDir; NSDictionary *attrs; path = [_args objectAtIndex:i]; if (![self fileExistsAtPath:path isDirectory:&isDir]) return boolNo; if (isDir) return boolNo; if ((attrs = [self fileAttributesAtPath:path traverseLink:NO])==nil) return boolNo; if (![[attrs objectForKey:NSFileType] isEqualToString:NSFileTypeSymbolicLink]) return boolNo; } return boolYes; } } /* datasource */ - (id)_jsfunc_getDataSource:(NSArray *)_args { unsigned count; NSString *path = nil; BOOL lcache; id ds; _ensureBools(); lcache = NO; if ((count = [_args count]) == 0) { path = @"."; } else if (count == 1) { path = [[_args objectAtIndex:0] stringValue]; } else if (count == 2) { path = [[_args objectAtIndex:0] stringValue]; lcache = [[_args objectAtIndex:1] boolValue]; } if (![self supportsFolderDataSourceAtPath:path]) return nil; if ((ds = [(id)self dataSourceAtPath:path])==nil) return nil; if (lcache) ds = [[[EOCacheDataSource alloc] initWithDataSource:ds] autorelease]; return ds; } @end /* NGFileManager(JSSupport) */ SOPE/sope-core/NGExtensions/GNUmakefile.preamble0000644000000000000000000000323712242733417020454 0ustar rootroot# compilation settings ADDITIONAL_INCLUDE_DIRS += \ -I./NGExtensions/ \ -I./FdExt.subproj/ -I./EOExt.subproj/ ADDITIONAL_CPP_FLAGS += -Wall -Wno-import -Wno-protocol -O2 libNGExtensions_INCLUDE_DIRS += -I.. # Parameters for resource lookup ifneq ($(FHS_INSTALL_ROOT),) ADDITIONAL_CPPFLAGS += -DFHS_INSTALL_ROOT=\@\"$(FHS_INSTALL_ROOT)\" endif ifeq ($(CONFIGURE_64BIT),yes) ADDITIONAL_CPPFLAGS += -DCONFIGURE_64BIT=1 endif # dependencies libNGExtensions_LIBRARIES_DEPEND_UPON += \ -lEOControl -lDOM -lSaxObjC \ -lz $(BASE_LIBS) NGExtensions_LIBRARIES_DEPEND_UPON += \ -framework EOControl \ -framework DOM -framework SaxObjC \ -lz # library/framework search pathes DEP_DIRS = \ ../EOControl \ ../../sope-xml/DOM ../../sope-xml/SaxObjC ifneq ($(frameworks),yes) ADDITIONAL_LIB_DIRS += \ $(foreach dir,$(DEP_DIRS),\ -L$(GNUSTEP_BUILD_DIR)/$(dir)/$(GNUSTEP_OBJ_DIR_NAME)) else ADDITIONAL_LIB_DIRS += \ $(foreach dir,$(DEP_DIRS),-F$(GNUSTEP_BUILD_DIR)/$(dir)) endif ifeq ($(findstring _64, $(GNUSTEP_TARGET_CPU)), _64) SYSTEM_LIB_DIR += -L/usr/local/lib64 -L/usr/lib64 else SYSTEM_LIB_DIR += -L/usr/local/lib -L/usr/lib endif # Apple ifeq ($(FOUNDATION_LIB),apple) libNGExtensions_PREBIND_ADDR="0xC1200000" libNGExtensions_LDFLAGS += -seg1addr $(libNGExtensions_PREBIND_ADDR) endif # platform specific settings ifeq ($(GNUSTEP_HOST_OS),rhapsody5.5) #libNGExtensions_LIBRARIES_DEPEND_UPON += -lFoundationExt endif ifeq ($(GNUSTEP_TARGET_OS),freebsd) libNGExtensions_LIB_DIRS += -L/usr/local/lib libNGExtensions_LIBRARIES_DEPEND_UPON += -liconv endif # Foundation specific settings ifeq ($(FOUNDATION_LIB),nx) ADDITIONAL_LDFLAGS += -framework Foundation endif SOPE/sope-core/NGExtensions/NGExtensions/0000755000000000000000000000000012242733417017173 5ustar rootrootSOPE/sope-core/NGExtensions/NGExtensions/NGRuleContext.h0000644000000000000000000000413612242733417022051 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGRuleEngine_NGRuleContext_H__ #define __NGRuleEngine_NGRuleContext_H__ #import /* NGRuleContext This is a specialized rule evaluation object for key based (assignment) rules. It exports evaluated rule values using key-value coding, thereby giving a very simple access somewhat similiar to CSS. */ @class NSString, NSArray, NSMutableDictionary; @class NGRuleModel; @interface NGRuleContext : NSObject { NSMutableDictionary *storedValues; NGRuleModel *model; BOOL debugOn; } + (id)ruleContextWithModelInUserDefault:(NSString *)_defName; + (id)ruleContextWithModel:(NGRuleModel *)_model; - (id)initWithModel:(NGRuleModel *)_model; /* accessors */ - (void)setModel:(NGRuleModel *)_model; - (NGRuleModel *)model; - (void)setDebugEnabled:(BOOL)_flag; - (BOOL)isDebuggingEnabled; /* values */ - (void)takeStoredValue:(id)_value forKey:(NSString *)_key; - (id)storedValueForKey:(NSString *)_key; - (void)reset; - (void)takeValue:(id)_value forKey:(NSString *)_key; /* processing */ - (id)valueForKey:(NSString *)_key; - (id)inferredValueForKey:(NSString *)_key; - (NSArray *)allPossibleValuesForKey:(NSString *)_key; - (NSArray *)valuesForKeyPath:(NSString *)_kp takingSuccessiveValues:(NSArray *)_values forKeyPath:(NSString *)_valkp; @end #endif /* __NGRuleEngine_NGRuleContext_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/NGObjectMacros.h0000644000000000000000000000324512242733417022150 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_NGObjectMacros_H__ #define __NGExtensions_NGObjectMacros_H__ #ifndef ASSIGN # define ASSIGN(object, value) \ ({id __object = (id)object; \ id __value = (id)value; \ if (__value != __object) { \ object = (__value) ? [__value retain] : nil; \ if (__object) [__object release]; \ }}) #endif #ifndef ASSIGNCOPY # define ASSIGNCOPY(object, value) \ ({id __object = (id)object; \ id __value = (id)value; \ if (__value != __object) { \ object = __value ? [__value copy] : nil; \ if (__object) [__object release]; \ }}) #endif #ifndef RETAIN # define RETAIN(__XXX__) [__XXX__ retain] #endif #ifndef RELEASE # define RELEASE(__XXX__) [__XXX__ release] #endif #ifndef AUTORELEASE # define AUTORELEASE(__XXX__) [__XXX__ autorelease] #endif #endif /* __NGExtensions_NGObjectMacros_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/EODataSource+NGExtensions.h0000644000000000000000000000317512242733417024210 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_EODataSource_NGExtensions_H__ #define __NGExtensions_EODataSource_NGExtensions_H__ #import #include @class EOFetchSpecification; NGExtensions_EXPORT NSString *EODataSourceDidChangeNotification; /* If a fetchspecification without a qualifier is passed, the datasource should fetch all objects by default. If the EONoFetchWithEmptyQualifierHint value in the fspec hints-dictionary is YES, an emtpy array should be returned. */ NGExtensions_EXPORT NSString *EONoFetchWithEmptyQualifierHint; @interface EODataSource(NGExtensions) - (void)setFetchSpecification:(EOFetchSpecification *)_fetchSpec; - (EOFetchSpecification *)fetchSpecification; - (void)postDataSourceChangedNotification; - (void)updateObject:(id)_obj; @end #endif /* __NGExtensions_EODataSource_NGExtensions_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/NSString+Encoding.h0000644000000000000000000000246012242733417022577 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_NSString_Encoding_H__ #define __NGExtensions_NSString_Encoding_H__ #import /* NSString(Encoding) TODO: handler is currently fixed to iconv, should allow a registry of handlers */ @interface NSString(Encoding) + (NSString *)stringWithData:(NSData *)_da usingEncodingNamed:(NSString *)_enc; - (NSData *)dataUsingEncodingNamed:(NSString *)_encoding; + (NSStringEncoding)stringEncodingForEncodingNamed:(NSString *)encoding; @end #endif /* __NGExtensions_NSString_Encoding_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/NSAutoreleasePool+misc.h0000644000000000000000000000240612242733417023641 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_NSAutoreleasePool_misc_H__ #define __NGExtensions_NSAutoreleasePool_misc_H__ #import #if defined(LIB_FOUNDATION_LIBRARY) @interface NSAutoreleasePool(misc) + (void)enableRetainRemove:(BOOL)enable; + (NSAutoreleasePool *)findReleasingPoolForObject:(id)_obj; + (BOOL)retainAutoreleasedObject:(id)_obj; - (BOOL)retainAutoreleasedObject:(id)_obj; @end #endif /* !LIB_FOUNDATION_LIBRARY */ #endif /* __NGExtensions_NSAutoreleasePool_misc_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/EOGrouping.h0000644000000000000000000000445612242733417021373 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _EOGrouping_h__ #define _EOGrouping_h__ #import @class NSString, NSArray, NSMutableArray; @class EOQualifier; @interface EOGrouping : NSObject { NSString *defaultName; NSArray *sortOrderings; } - (id)initWithDefaultName:(NSString *)_defaultName; - (NSString *)defaultName; - (void)setDefaultName:(NSString *)_defaultName; - (NSArray *)sortOrderings; - (void)setSortOrderings:(NSArray *)_sortOrderings; - (NSString *)groupNameForObject:(id)object; - (NSArray *)orderedGroupNames; @end @interface EOGroupingSet : EOGrouping { NSArray *groupings; } - (NSArray *)groupings; - (void)setGroupings:(NSArray *)_groupings; @end @interface EOKeyGrouping : EOGrouping { NSString *key; NSMutableArray *groupNames; /* ??? to be fixed */ } - (id)initWithKey:(NSString *)_key; - (NSString *)key; - (void)setKey:(NSString *)_key; @end @interface EOQualifierGrouping : EOGrouping { EOQualifier *qualifier; NSString *name; } - (id)initWithQualifier:(EOQualifier *)_qualifier name:(NSString *)_name; - (void)setName:(NSString *)_name; - (NSString *)name; - (void)setQualifier:(EOQualifier *)_qualifier; - (EOQualifier *)qualifier; @end #import @class NSDictionary; @interface NSArray(EOGrouping) - (NSDictionary *)arrayGroupedBy:(EOGrouping *)_grouping; @end #import extern NSString *EOGroupingHint; @interface EOFetchSpecification(Groupings) - (void)setGroupings:(NSArray *)_groupings; - (NSArray *)groupings; @end #endif /* _EOGrouping_h__ */ SOPE/sope-core/NGExtensions/NGExtensions/NSData+misc.h0000644000000000000000000000205712242733417021411 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_NSData_misc_H__ #define __NGExtensions_NSData_misc_H__ #import @interface NSData(misc) - (BOOL)hasPrefix:(NSData *)_data; - (BOOL)hasPrefixBytes:(const void *)_bytes length:(unsigned)_len; @end #endif /* __NGExtensions_NSData_misc_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/EOTrueQualifier.h0000644000000000000000000000244712242733417022360 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __EOExt_EOTrueQualifier_H__ #define __EOExt_EOTrueQualifier_H__ #import /* EOTrueQualifier This is an extremly simple qualifier which always evaluates to true ... (eg used in the rule-system) Note: the EOTrueQualifier may not map properly to a storage based qualifier, so you probably need to find a workaround to represent a generic 'true' in your database. */ @interface EOTrueQualifier : EOQualifier < EOQualifierEvaluation > { } @end #endif /* __EOExt_EOTrueQualifier_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/NSURL+misc.h0000644000000000000000000000430112242733417021174 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_NSURL_misc_H__ #define __NGExtensions_NSURL_misc_H__ #import // required by gstep-base #import #import @interface NSURL(misc) /* This method tries to construct the "shortest" path between the two URLs. If the URLs are not in the same namespace, -absoluteString is returned ... */ - (NSString *)stringValueRelativeToURL:(NSURL *)_base; /* This checks whether protocol, host, login match. That is, checks whether it's possible to build a relative URL to _url (whether self is in the same path namespace). */ - (BOOL)isInSameNamespaceWithURL:(NSURL *)_url; /* adding fragments and queries to a string ... */ - (NSString *)stringByAddingFragmentAndQueryToPath:(NSString *)_path; @end @interface NSString(URLPathProcessing) /* relative path processing (should never return an absolute path) */ /* eg: "/a/b/c.html" should resolve to: "c.html" Directories are a bit more difficult, eg: "/a/b/c/" is resolved to "../c/" */ - (NSString *)urlPathRelativeToSelf; /* this is the same like the absolute path, only without a leading "/" .. */ - (NSString *)urlPathRelativeToRoot; /* This can be used for URLs in the same namespace. It should never return an absolute path (it only does in error conditions). */ - (NSString *)urlPathRelativeToPath:(NSString *)_base; @end #endif /* __NGExtensions_NSURL_misc_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/NSException+misc.h0000644000000000000000000000765112242733417022503 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_NSException_misc_H__ #define __NGExtensions_NSException_misc_H__ #import #import /* Miscellaneous method additions to NSException the additions make it easier using exceptions in the Java way. In OpenStep exceptions are identified by their name, subclasses are mainly used when additional information needs to be stored. This works well as long as you do not use exceptions very much (as in the Foundation Kit) - if you do you soon wish to have a 'hierachy' of exceptions. This can be modelled - like in Java - using a subclass for each different kind of exception and then using the type of the exception for it's identification. This is supported by libFoundation using the TRY and CATCH macros. The methods below always use the class name as the exception name if the name isn't specified explicitly. */ @interface NSException(NGMiscellaneous) - (id)initWithReason:(NSString *)_reason; - (id)initWithReason:(NSString *)_reason userInfo:(id)_userInfo; - (id)initWithFormat:(NSString *)_format,...; @end @interface NSObject(NSExceptionNGMiscellaneous) - (BOOL)isException; - (BOOL)isExceptionOrNull; @end #if COCOA_Foundation_LIBRARY || GNUSTEP_BASE_LIBRARY @interface NSException (NGLibFoundationCompatibility) - (void)setReason:(NSString *)_reason; @end #endif /* The following macros are for use of locks together with exception handling. A synchronized block is properly 'unlocked' even if an exception occures. It is used this way: SYNCHRONIZED(MyObject) { THROW(MyException..); } END_SYNCHRONIZED; Where MyObject must be an object that conforms to the NSObject and NSLocking protocol. This is much different to [MyObject lock]; { THROW(MyException..); } [MyObject unlock]; which leaves the lock locked when an exception happens. */ #if defined(DEBUG_SYNCHRONIZED) #define SYNCHRONIZED(__lock__) \ { \ id __syncLock__ = [__lock__ retain]; \ [__syncLock__ lock]; \ fprintf(stderr, "0x%08X locked in %s.\n", \ (unsigned)__syncLock__, __PRETTY_FUNCTION__); \ NS_DURING { #define END_SYNCHRONIZED \ } \ NS_HANDLER { \ fprintf(stderr, "0x%08X exceptional unlock in %s exception %s.\n", \ (unsigned)__syncLock__, __PRETTY_FUNCTION__,\ [[localException description] cString]); \ [__syncLock__ unlock]; \ [__syncLock__ release]; __syncLock__ = nil; \ [localException raise]; \ } \ NS_ENDHANDLER; \ fprintf(stderr, "0x%08X unlock in %s.\n", \ (unsigned)__syncLock__, __PRETTY_FUNCTION__); \ [__syncLock__ unlock]; \ [__syncLock__ release]; __syncLock__ = nil; \ } #else #define SYNCHRONIZED(__lock__) \ { \ id __syncLock__ = [__lock__ retain]; \ [__syncLock__ lock]; \ NS_DURING { #define END_SYNCHRONIZED \ } \ NS_HANDLER { \ [__syncLock__ unlock]; \ [__syncLock__ release]; \ [localException raise]; \ } \ NS_ENDHANDLER; \ [__syncLock__ unlock]; \ [__syncLock__ release]; \ } #endif #endif /* __NGExtensions_NSException_misc_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/NGRuleAssignment.h0000644000000000000000000000346312242733417022537 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGRuleEngine_NGRuleAssignment_H__ #define __NGRuleEngine_NGRuleAssignment_H__ #import #import /* NGRuleAssignment Assignments are the right-hand side of a rule in the rule system, if a rule is selected by qualifier and priority the assignment is the "thing" which is executed. NGRuleKeyAssignment Special case of NGRuleAssignment which evaluates the "value" as a keypath relative to the context. */ @class NSString; @interface NGRuleAssignment : NSObject < EOKeyValueArchiving > { NSString *keyPath; id value; } + (id)assignmentWithKeyPath:(NSString *)_kp value:(id)_value; - (id)initWithKeyPath:(NSString *)_kp value:(id)_value; /* accessors */ - (void)setKeyPath:(NSString *)_kp; - (NSString *)keyPath; - (void)setValue:(id)_value; - (id)value; /* operations */ - (BOOL)isCandidateForKey:(NSString *)_key; - (id)fireInContext:(id)_ctx; @end @interface NGRuleKeyAssignment : NGRuleAssignment { } @end #endif /* __NGRuleEngine_NGRuleAssignment_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/NGExtensions.h0000644000000000000000000000534712242733417021741 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_H__ #define __NGExtensions_H__ #include #if defined(LIB_FOUNDATION_LIBRARY) # define NoZone nil #else # define NoZone NULL #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // kit class @interface NGExtensions : NSObject @end // linking .. #define LINK_NGExtensions \ void __link_NGExtensions(void) { \ [NGExtensions self]; \ __link_NGExtensions(); \ } #endif /* __NGExtensions_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/NGBundleManager.h0000644000000000000000000001455612242733417022310 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_NGBundleManager_H__ #define __NGExtensions_NGBundleManager_H__ #import #import #import #include @class NSString, NSArray, NSMutableArray, NSDictionary, NSMutableSet; @class EOQualifier; /* NGBundleManager NGBundleManager is a class similiar to a Java class loader. It searches for dynamically loadable bundles in a specified path set. The default bundle search path is: 1. bundles contained in the main-bundle 2. pathes specified by the 'NGBundlePath' user default 3. pathes specified by the 'NGBundlePath' environment variable Bundles managed by NGBundleManager can specify load-requirements, this is done via the 'bundle-info.plist' file contained at the root of the bundle directory. The file is a property list file and can specify required and provided classes. Example bundle-info.plist: { bundleHandler = "MyBundleManager"; provides = { classes = ( { name = MyClass; } ); }; requires = { bundleManagerVersion = 1; bundles = ( { name = Foundation; type = framework; } ); classes = ( { name = NSObject; exact-version = 1; } ); }; } */ NGExtensions_EXPORT NSString *NGBundleWasLoadedNotificationName; @class NGBundleManager; typedef BOOL (*NGBundleResourceSelector)(NSString *_resourceName, NSString *_resourceType, NSString *_path, NSDictionary *_resourceConfig, NGBundleManager *_bundleManager, void *_context); @interface NGBundleManager : NSObject { @private NSMutableArray *bundleSearchPaths; NSMapTable *pathToBundle; NSMapTable *pathToBundleInfo; NSMapTable *nameToBundle; /* bundles loaded by the manager (NSBundle->BundleManager) */ NSMapTable *loadedBundles; /* the following are maintained using NSBundleDidLoadNotification .. */ NSMapTable *classToBundle; NSMapTable *classNameToBundle; NSMapTable *categoryNameToBundle; // transient NSMutableSet *loadingBundles; } + (id)defaultBundleManager; /* accessors */ - (void)setBundleSearchPaths:(NSArray *)_paths; - (NSArray *)bundleSearchPaths; /* bundle access */ - (NSBundle *)bundleWithName:(NSString *)name type:(NSString *)_type; - (NSBundle *)bundleWithName:(NSString *)name; // type=='bundle' - (NSBundle *)bundleForClassNamed:(NSString *)aClassName; - (NSBundle *)bundleForClass:(Class)aClass; - (NSBundle *)bundleWithPath:(NSString *)path; /* dependencies */ /* returns the names of the bundles required by the bundle */ - (NSArray *)bundlesRequiredByBundle:(NSBundle *)_bundle; /* returns the names of the classes provided by the bundle */ - (NSArray *)classesProvidedByBundle:(NSBundle *)_bundle; /* returns the names of the classes required by the bundle */ - (NSArray *)classesRequiredByBundle:(NSBundle *)_bundle; /* loading */ - (id)loadBundle:(NSBundle *)_bundle; /* bundle manager object */ - (id)principalObjectOfBundle:(NSBundle *)_bundle; /* resources */ - (NSDictionary *)configForResource:(id)_resource ofType:(NSString *)_type providedByBundle:(NSBundle *)_bundle; - (NSBundle *)bundleProvidingResource:(id)_resourceName ofType:(NSString *)_resourceType; - (NSArray *)bundlesProvidingResource:(id)_resourceName ofType:(NSString *)_resourceType; - (NSBundle *)bundleProvidingResourceOfType:(NSString *)_resourceType matchingQualifier:(EOQualifier *)_qual; - (NSBundle *)bundlesProvidingResourcesOfType:(NSString *)_resourceType matchingQualifier:(EOQualifier *)_qual; /* This returns an array of NSDictionaries describing the provided resources. */ - (NSArray *)providedResourcesOfType:(NSString *)_resourceType; - (NSString *)pathForBundleProvidingResource:(id)_resourceName ofType:(NSString *)_type resourceSelector:(NGBundleResourceSelector)_selector context:(void *)_context; @end /* NGBundleManager */ @interface NSBundle(NGLanguageResourceExtensions) - (NSString *)pathForResource:(NSString *)_name ofType:(NSString *)_ext inDirectory:(NSString *)_directory languages:(NSArray *)_languages; - (NSString *)pathForResource:(NSString *)_name ofType:(NSString *)_ext languages:(NSArray *)_languages; @end /* NSBundle(NGLanguageResourceExtensions) */ @interface NSBundle(NGBundleManagerExtensions) /* Returns the object managing the bundle (might be the principal class) */ - (id)principalObject; - (NSArray *)providedResourcesOfType:(NSString *)_resourceType; /* Returns the name of the bundle */ - (NSString *)bundleName; /* Returns the type of the bundle */ - (NSString *)bundleType; /* Returns the names of the classes provided by the bundle */ - (NSArray *)providedClasses; /* Returns the names of the classes required by the bundle */ - (NSArray *)requiredClasses; /* Returns the names of other bundles required for loading this bundle */ - (NSArray *)requiredBundles; /* Return a NSDictionary with bundle-info configuration of the specified rsrc */ - (NSDictionary *)configForResource:(id)_resource ofType:(NSString *)_type; @end /* NSBundle(NGBundleManagerExtensions) */ @interface NSObject(BundleManager) - (id)initForBundle:(NSBundle *)_bundle bundleManager:(NGBundleManager *)_mng; /* This method is invoked if the bundle was successfully loaded. */ - (void)bundleManager:(NGBundleManager *)_manager didLoadBundle:(NSBundle *)_bundle; @end /* NSObject(BundleManager) */ @interface NGBundle : NSBundle @end #endif SOPE/sope-core/NGExtensions/NGExtensions/NGLogger.h0000644000000000000000000000662212242733417021016 0ustar rootroot/* Copyright (C) 2004-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_NGLogger_H_ #define __NGExtensions_NGLogger_H_ /* NGLogger NGLogger has a minimum log level and passes messages to its appenders only if this minimum log level is satisfied - otherwise it silently drops these messages. NGLogger also offers a factory to instantiate loggers from configs stored in NSUserDefaults. NOTE: Except in rare circumstances, do not allocate loggers yourself! Always try to use the appropriate API of NGLoggerManager if possible. NGLogger honours the following user default keys: User Default key Function ---------------------------------------------------------------------------- NGLogDefaultLogLevel The log level to use as a fallback, if no log level is provided during initialization. The default is "INFO". The following keys in the configuration dictionary will be recognized: Key Function ---------------------------------------------------------------------------- "LogLevel" The log level to use for this logger. If no log level is provided, sets log level according to fallback described above. "Appenders" Array of dictionaries suitable as configuration provided to NGLogAppender's factory method. Please see NGLogAppender.h for further explanation. LoggerConfig example: WOHttpTransactionLoggerConfig = { "LogLevel" = "INFO"; "Appenders" = ( { "Class" = "NGLogStdoutAppender"; "Formatter" = { "Class" = "NGLogEventFormatter"; }; }, ); }; */ #import #include @class NSMutableArray, NSString, NSDictionary, NGLogAppender; @interface NGLogger : NSObject { NSMutableArray *appenders; @public NGLogLevel logLevel; } + (id)loggerWithConfigFromUserDefaults:(NSString *)_defaultName; - (id)initWithConfig:(NSDictionary *)_config; - (id)initWithLogLevel:(NGLogLevel)_level; /* accessors */ - (void)setLogLevel:(NGLogLevel)_level; - (NGLogLevel)logLevel; - (void)addAppender:(NGLogAppender *)_appender; - (void)removeAppender:(NGLogAppender *)_appender; /* logging */ - (void)logLevel:(NGLogLevel)_level message:(NSString *)_msg; /* conditions */ - (BOOL)isDebuggingEnabled; - (BOOL)isLogInfoEnabled; - (BOOL)isLogWarnEnabled; - (BOOL)isLogErrorEnabled; - (BOOL)isLogFatalEnabled; @end #endif /* __NGExtensions_NGLogger_H_ */ SOPE/sope-core/NGExtensions/NGExtensions/EOSortOrdering+plist.h0000644000000000000000000000214412242733417023341 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __EOSortOrdering_plist_h__ #define __EOSortOrdering_plist_h__ #import @class NSDictionary, NSString; @interface EOSortOrdering(plist) - (id)initWithDictionary:(NSDictionary *)_dictionary; - (id)initWithString:(NSString *)_string; - (id)initWithPropertyList:(id)_plist owner:(id)_owner; @end #endif SOPE/sope-core/NGExtensions/NGExtensions/NGLogLevel.h0000644000000000000000000000215112242733417021301 0ustar rootroot/* Copyright (C) 2004-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_NGLogLevel_H_ #define __NGExtensions_NGLogLevel_H_ /* Currently defined log levels. */ typedef enum { NGLogLevelOff = 0, NGLogLevelFatal = 1, NGLogLevelError = 2, NGLogLevelWarn = 3, NGLogLevelInfo = 4, NGLogLevelDebug = 5, NGLogLevelAll = 6 } NGLogLevel; #endif /* __NGExtensions_NGLogLevel_H_ */ SOPE/sope-core/NGExtensions/NGExtensions/NGLogAppender.h0000644000000000000000000000477012242733417022001 0ustar rootroot/* Copyright (C) 2004-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_NGLogAppender_H_ #define __NGExtensions_NGLogAppender_H_ /* NGLogAppender Abstract superclass for all log appenders. NGLogAppender honours the following user default keys: User Default key Function ---------------------------------------------------------------------------- NGLogDefaultAppenderClass The appender class to use if no class information was provided by the configuration. The fallback is "NGLogStderrAppender". The following keys in the configuration dictionary will be recognized: Key Function ---------------------------------------------------------------------------- "Class" The class to use for instance creation. If no class name is provided, the fallback path described above will be taken. "Formatter" Dictionary suitable as configuration provided to NGLogEventFormatters's factory method. Please see NGLogEventFormatteer.h for further explanation. */ #import #include @class NSDictionary, NGLogEvent, NGLogEventFormatter; @interface NGLogAppender : NSObject { NGLogEventFormatter *formatter; } /* factory method */ + (id)logAppenderFromConfig:(NSDictionary *)_config; /* designated initializer */ - (id)initWithConfig:(NSDictionary *)_config; /* subclass responsibility */ - (void)appendLogEvent:(NGLogEvent *)_event; - (NSString *)formattedEvent:(NGLogEvent *)_event; @end #endif /* __NGExtensions_NGLogAppender_H_ */ SOPE/sope-core/NGExtensions/NGExtensions/NGCustomFileManager.h0000644000000000000000000000601012242733417023133 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGCustomFileManager_H__ #define __NGCustomFileManager_H__ #include /* An abstract baseclass for developing custom filemanagers which are ideally based on other filemanager classes. */ @class NGCustomFileManagerInfo; @interface NGCustomFileManager : NGFileManager { } /* customization */ - (NSString *)makeAbsolutePath:(NSString *)_path; - (NGCustomFileManagerInfo *)fileManagerInfoForPath:(NSString *)_path; @end @interface NGCustomFileManager(NGFileManagerVersioning) /* versioning */ - (BOOL)checkoutFileAtPath:(NSString *)_path handler:(id)_handler; - (BOOL)releaseFileAtPath:(NSString *)_path handler:(id)_handler; - (BOOL)rejectFileAtPath:(NSString *)_path handler:(id)_handler; - (BOOL)checkoutFileAtPath:(NSString *)_path version:(NSString *)_version handler:(id)_handler; /* versioning data */ - (NSString *)lastVersionAtPath:(NSString *)_path; - (NSArray *)versionsAtPath:(NSString *)_path; - (NSData *)contentsAtPath:(NSString *)_path version:(NSString *)_version; - (NSDictionary *)fileAttributesAtPath:(NSString *)_path traverseLink:(BOOL)_followLink version:(NSString *)_version; @end @interface NGCustomFileManager(NGFileManagerDataSources) /* datasources (work on folders) */ - (EODataSource *)dataSourceAtPath:(NSString *)_path; - (EODataSource *)dataSource; // works on current-directory-path @end @interface NGCustomFileManager(NGFileManagerLocking) - (BOOL)lockFileAtPath:(NSString *)_path handler:(id)_handler; - (BOOL)unlockFileAtPath:(NSString *)_path handler:(id)_handler; - (BOOL)isFileLockedAtPath:(NSString *)_path; /* access rights */ - (BOOL)isLockableFileAtPath:(NSString *)_path; - (BOOL)isUnlockableFileAtPath:(NSString *)_path; @end @interface NGCustomFileManagerInfo : NSObject { @private NGCustomFileManager *master; /* non retained */ id fileManager; } - (id)initWithCustomFileManager:(NGCustomFileManager *)_master fileManager:(id)_fm; - (void)resetMaster; /* accessors */ - (NGCustomFileManager *)master; - (id)fileManager; /* operations */ - (NSString *)rewriteAbsolutePath:(NSString *)_path; /* capabilities */ - (BOOL)supportsGlobalIDs; @end #endif /* __NGCustomFileManager_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/EOFetchSpecification+plist.h0000644000000000000000000000217412242733417024455 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __EOFetchSpecification_plist_h__ #define __EOFetchSpecification_plist_h__ #import @class NSDictionary, NSString; @interface EOFetchSpecification(plist) - (id)initWithDictionary:(NSDictionary *)_dictionary; - (id)initWithString:(NSString *)_string; - (id)initWithPropertyList:(id)_plist owner:(id)_owner; @end #endif SOPE/sope-core/NGExtensions/NGExtensions/NSString+misc.h0000644000000000000000000000700512242733417022004 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_NSString_misc_H__ #define __NGExtensions_NSString_misc_H__ #import @class NSSet, NSDictionary, NSString; @interface NSObject(StringBindings) - (NSString *)valueForStringBinding:(NSString *)_key; @end @interface NSString(misc) /* Replaces keys, which enclosed in '$', with values from _bindings. The values are retrieved using the '-valueForStringBinding:' method which per default use -valueForKey: and -objectForKey: for NSDictionary objects. For using of $ escape it with $$. Example: source: @"du da blah $var$ doof" dest = [source stringByReplacingVariablesWithBindings: @{ var = @"dummy"; }]; => dest: @"du da blah dummy doof" */ - (NSString *)stringByReplacingVariablesWithBindings:(id)_bindings; /* If there are variables with no binding, _unkown is used instead. If _unkown is nil and there are unknown bindings, an exception will be thrown. */ - (NSString *)stringByReplacingVariablesWithBindings:(id)_bindings stringForUnknownBindings:(NSString *)_unknown; /* Returns all binding variables. ('aaa $doof$ $bla$' --> (doof, bla) ) */ - (NSSet *)bindingVariables; @end @interface NSString(FilePathVersioningMethods) /* "/PATH/file.txt;1" */ - (NSString *)pathVersion; - (NSString *)stringByDeletingPathVersion; - (NSString *)stringByAppendingPathVersion:(NSString *)_version; @end /* NSString(FilePathMethodsVersioning) */ @interface NSString(URLEscaping) /* These functions encode/decode HTTP style URL paths, which can escape spaces and special chars. Chars are escaped using the '%' hex-notation: Encode: 'Hello World' => 'Hello%20World' '& ?' => '%26%20%3F' */ - (BOOL)containsURLEscapeCharacters; - (NSString *)stringByUnescapingURL; - (NSString *)stringByEscapingURL; @end @interface NSString(HTMLEscaping) - (NSString *)stringByEscapingHTMLString; - (NSString *)stringByEscapingHTMLAttributeValue; @end @interface NSString(XMLEscaping) - (NSString *)stringByEscapingXMLString; - (NSString *)stringByEscapingXMLAttributeValue; /* The following methods work in "fully-qualified XML names", in this format: '{namespace}name' */ - (BOOL)xmlIsFQN; - (NSString *)xmlNamespaceURI; - (NSString *)xmlLocalName; @end @interface NSString(NGScanning) /* this methods search for a string, while skipping quotes, eg: [@"abc '++' hello" rangeOfString:@"++" skipQuotes:@"\"'"]; would not return a result ! */ - (NSRange)rangeOfString:(NSString *)_s skipQuotes:(NSString *)_quotes escapedByChar:(unichar)_escape; - (NSRange)rangeOfString:(NSString *)_s skipQuotes:(NSString *)_quotes; @end @interface NSString(MailQuoting) - (NSString *)stringByApplyingMailQuoting; @end #endif /* __NGExtensions_NSString_misc_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/EOQualifierGrouping.h0000644000000000000000000000163612242733417023232 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _EOQualifierGrouping_h__ #define _EOQualifierGrouping_h__ #include #endif /* _EOQualifierGrouping_h__ */ SOPE/sope-core/NGExtensions/NGExtensions/NSSet+enumerator.h0000644000000000000000000000261212242733417022516 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_NSSet_enumerator_H__ #define __NGExtensions_NSSet_enumerator_H__ #import @interface NSSet(enumerator) - (id)initWithObjectsFromEnumerator:(NSEnumerator *)_enumerator; - (NSArray *)mappedArrayUsingSelector:(SEL)_selector; - (NSArray *)mappedArrayUsingSelector:(SEL)_selector withObject:(id)_object; - (NSSet *)mappedSetUsingSelector:(SEL)_selector; - (NSSet *)mappedSetUsingSelector:(SEL)_selector withObject:(id)_object; @end @interface NSMutableSet(enumerator); - (id)initWithObjectsFromEnumerator:(NSEnumerator *)_enumerator; @end #endif /* __NGExtensions_NSSet_enumerator_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/EOCacheDataSource.h0000644000000000000000000000262612242733417022554 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_EOCacheDataSource_H__ #define __NGExtensions_EOCacheDataSource_H__ #import #import @class NSTimer; @interface EOCacheDataSource : EODataSource { EODataSource *source; id cache; NSTimeInterval timeout; NSTimeInterval time; NSTimer *timer; BOOL _isFetching; } - (id)initWithDataSource:(EODataSource *)_ds; /* accessors */ - (void)setSource:(EODataSource *)_source; - (EODataSource *)source; - (void)setTimeout:(NSTimeInterval)_timeout; - (NSTimeInterval)timeout; - (void)clear; @end #endif /* __NGExtensions_EOCacheDataSource_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/EOKeyMapDataSource.h0000644000000000000000000000712212242733417022733 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_EOKeyMapDataSource_H__ #define __NGExtensions_EOKeyMapDataSource_H__ #import /* EOKeyMapDataSource This class allows you to remap the keys of a source datasource on the fly. It fully supports fetch enumerators. The class description of the datasource describes what keys the resulting objects should have (note that the fetchspec isn't checked for validaty on that). */ @class NSException, NSEnumerator, NSArray, NSClassDescription; @class NSMutableDictionary, NSDictionary; @class EOFetchSpecification, EOGlobalID; @interface EOKeyMapDataSource : EODataSource { EOFetchSpecification *fspec; EODataSource *source; NSClassDescription *classDescription; NSArray *entityKeys; NSArray *mappedKeys; id map; } - (id)initWithDataSource:(EODataSource *)_ds map:(id)_map; /* accessors */ - (void)setSource:(EODataSource *)_source; - (EODataSource *)source; - (void)setFetchSpecification:(EOFetchSpecification *)_fetchSpec; - (EOFetchSpecification *)fetchSpecification; - (NSException *)lastException; /* mappings (default implementations use the map) */ - (EOFetchSpecification *)mapFetchSpecification:(EOFetchSpecification *)_fs; - (void)setClassDescriptionForObjects:(NSClassDescription *)_cd; - (NSClassDescription *)classDescriptionForObjects; - (id)mapCreatedObject:(id)_object; - (id)mapObjectForUpdate:(id)_object; - (id)mapObjectForInsert:(id)_object; - (id)mapObjectForDelete:(id)_object; - (id)mapFetchedObject:(id)_object; - (id)mapFromSourceObject:(id)_object; - (id)mapToSourceObject:(id)_object; /* fetching */ - (Class)fetchEnumeratorClass; - (NSEnumerator *)fetchEnumerator; - (NSArray *)fetchObjects; - (void)clear; /* operations */ - (void)updateObject:(id)_obj; - (void)insertObject:(id)_obj; - (void)deleteObject:(id)_obj; - (id)createObject; @end #import @interface EOKeyMapDataSourceEnumerator : NSEnumerator { EOKeyMapDataSource *ds; NSEnumerator *source; } - (id)initWithKeyMapDataSource:(EOKeyMapDataSource *)_ds fetchEnumerator:(NSEnumerator *)_enum; @end @interface EOMappedObject : NSObject { id original; EOGlobalID *globalID; NSMutableDictionary *values; struct { BOOL didChange:1; int reserved:31; } flags; } - (id)initWithObject:(id)_object values:(NSDictionary *)_values; /* accessors */ - (id)mappedObject; - (EOGlobalID *)globalID; - (BOOL)isModified; - (void)willChange; - (void)applyChangesOnObject; /* mimic dictionary */ - (void)setObject:(id)_obj forKey:(id)_key; - (id)objectForKey:(id)_key; - (void)removeObjectForKey:(id)_key; - (NSEnumerator *)keyEnumerator; - (NSEnumerator *)objectEnumerator; /* KVC */ - (void)takeValue:(id)_value forKey:(NSString *)_key; - (id)valueForKey:(NSString *)_key; @end #endif /* __NGExtensions_EOKeyMapDataSource_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/NGFileFolderInfoDataSource.h0000644000000000000000000000337412242733417024402 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGFileInfoDataSource_H__ #define __NGFileInfoDataSource_H__ #import #import #include @class NSString; @class EOFetchSpecification; /* supported keys: NSFileName NSFilePath NSParentPath + all NSFileManager attributes returned by -fileAttributesAtPath:... supported fetch hints: NSTraverseLinks - bool */ NGExtensions_EXPORT NSString *NSFileName; NGExtensions_EXPORT NSString *NSFilePath; NGExtensions_EXPORT NSString *NSParentPath; NGExtensions_EXPORT NSString *NSTraverseLinks; @interface NGFileFolderInfoDataSource : EODataSource { NSString *folderPath; EOFetchSpecification *fspec; } - (id)initWithFolderPath:(NSString *)_path; /* accessors */ - (void)setFetchSpecification:(EOFetchSpecification *)_fspec; - (EOFetchSpecification *)fetchSpecification; /* operations */ - (NSArray *)fetchObjects; @end #endif /* __NGFileInfoDataSource_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/EOFilterDataSource.h0000644000000000000000000000277012242733417022776 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_EOFilterDataSource_H__ #define __NGExtensions_EOFilterDataSource_H__ #import @class NSArray; @class EOQualifier; @interface EOFilterDataSource : EODataSource { EODataSource *source; EOQualifier *auxiliaryQualifier; NSArray *sortOrderings; NSArray *groupings; } - (id)initWithDataSource:(EODataSource *)_ds; /* accessors */ - (void)setSource:(EODataSource *)_source; - (EODataSource *)source; - (void)setAuxiliaryQualifier:(EOQualifier *)_q; - (EOQualifier *)auxiliaryQualifier; - (void)setSortOrderings:(NSArray *)_o; - (NSArray *)sortOrderings; - (void)setGroupings:(NSArray *)_groupings; - (NSArray *)groupings; @end #endif /* __NGExtensions_EOFilterDataSource_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/NGQuotedPrintableCoding.h0000644000000000000000000000527512242733417024030 0ustar rootroot/* Copyright (C) 2000-2006 SKYRIX Software AG Copyright (C) 2006 Helge Hess This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_NGQuotedPrintableCoding_H__ #define __NGExtensions_NGQuotedPrintableCoding_H__ #import #import #include /* Quoted Printable encoder/decoder As specified in RFC 822 / 2045 / 2047. Note that 2045 and 2047 specify different variants (Q vs content-transfer-encoding) TODO: explain what it does. It doesn't seem to decode a full line like "=?iso-8859-1?q?Yannick=20DAmboise?=" but only turns "=20D" style encodings to their charcode. Note: apparently sope-mime contains a category on NSData which provides a method to decode the full value: -decodeQuotedPrintableValueOfMIMEHeaderField: (NGMimeMessageParser) */ @interface NSData(QuotedPrintableCoding) /* Decode a quoted printable encoded data. Returns nil if decoding failed. The first method does the RFC 2047 variant, the second RFC 2045 (w/o _ replacing) */ - (NSData *)dataByDecodingQuotedPrintable; - (NSData *)dataByDecodingQuotedPrintableTransferEncoding; /* Decode data in quoted printable encoding. Returns nil if encoding failed. */ - (NSData *)dataByEncodingQuotedPrintable; @end /* Note: you should avoid NSString methods for QP, its defined on byte level */ @interface NSString(QuotedPrintableCoding) - (NSString *)stringByDecodingQuotedPrintable; - (NSString *)stringByEncodingQuotedPrintable; @end NGExtensions_EXPORT int NGEncodeQuotedPrintable(const char *_src, unsigned _srcLen, char *_dest, unsigned _destLen); NGExtensions_EXPORT int NGDecodeQuotedPrintable(const char *_src, unsigned _srcLen, char *_dest, unsigned _destLen); NGExtensions_EXPORT int NGDecodeQuotedPrintableX(const char *_src, unsigned _srcLen, char *_dest, unsigned _destLen, BOOL _replaceUnderline); #endif /* __NGExtensions_NGQuotedPrintableCoding_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/NGStringScanEnumerator.h0000644000000000000000000000360712242733417023714 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_NGStringScanEnumerator_H__ #define __NGExtensions_NGStringScanEnumerator_H__ #import #import /* NGStringScanEnumerator This class is used to scan (binary) NSData objects for printable strings, pretty much like the "strings" Unix program. Example: NSData *data = [NSData dataWithContentsOfMappedFile:@"/bin/ls"]; NSEnumerator *e; NSString *s; e = [data stringScanEnumerator]; while ((s = [e nextObject])) { if ([s hasPrefix:@"4"] && [s length] > 5) { NSLog(@"ls version: %@", s); break; } } */ @interface NGStringScanEnumerator : NSEnumerator { unsigned int curPos; NSData *data; unsigned int maxLength; } + (id)enumeratorWithData:(NSData *)_data maxLength:(unsigned int)_maxLength; @end /* StringEnumerator */ @interface NSData(NGStringScanEnumerator) /* scan strings with up to 256 chars length */ - (NSEnumerator *)stringScanEnumerator; - (NSEnumerator *)stringScanEnumeratorWithMaxStringLength:(unsigned int)_max; @end #endif /* __NGExtensions_NGStringScanEnumerator_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/NGResourceLocator.h0000644000000000000000000000737612242733417022721 0ustar rootroot/* Copyright (C) 2004-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_NGResourceLocator_H__ #define __NGExtensions_NGResourceLocator_H__ #import /* NGResourceLocator This class can be used by libraries to lookup resources in either the GNUstep hierarchy or in FHS locations (/usr/local etc). The pathes given in are relative to the respective root, eg: "Library/Models" and "share/mytool/models". */ @class NSString, NSArray, NSFileManager, NSMutableDictionary; @interface NGResourceLocator : NSObject { NSString *gsSubPath; NSString *fhsSubPath; NSFileManager *fileManager; NSArray *searchPathes; NSMutableDictionary *nameToPathCache; struct { int cacheSearchPathes:1; int cachePathHits:1; int cachePathMisses:1; int reserved:29; } flags; } /* The 'GNUstepPath' is a string describing the required path. This * is the relative location of the path in a standard GNUstep * hierarchy when a standard GNUstep hierarchy is being used; but if * gnustep-base (which supports arbitrary filesystem layouts) is being * used, the path is heuristically mapped to the standard paths * accepted by NSSearchPathForDirectoriesInDomains using the following * logic: * * "Library/WebApplications" --> GSWebApplicationsDirectory * "Library/Libraries" --> GSLibrariesDirectory * "Tools" --> GSToolsDirectory * "Tools/Admin" --> GSAdminToolsDirectory * "Applications" --> GSApplicationsDirectory * "Applications/Admin" --> GSAdminApplicationsDirectory * "Library/xxx" --> NSLibraryDirectory/xxx * "yyy" --> NSLibraryDirectory/yyy * * In the last two cases 'xxx' and 'yyy' are arbitrary strings/paths * that don't match anything else. Eg, if you create an * NGResourceLocators to look up files in "Library/Resources" you will * get one that looks them up in NSLibraryDirectory/Resources (which * means a list of directories containing * GNUSTEP_USER_LIBRARY/Resources, GNUSTEP_LOCAL_LIBRARY/Resources, * GNUSTEP_NETWORK_LIBRARY/Resources, * GNUSTEP_SYSTEM_LIBRARY/Resources). */ + (id)resourceLocatorForGNUstepPath:(NSString *)_path fhsPath:(NSString *)_fhs; - (id)initWithGNUstepPath:(NSString *)_path fhsPath:(NSString *)_fhs; /* resource pathes */ /* It's not a good idea to access these directly if you want portable * code. More logical to use directly the 'operations' lookup methods * below which encapsulate all the internal filesystem details. */ - (NSArray *)gsRootPathes; /* GNUSTEP_PATHPREFIX_LIST or MacOSX */ - (NSArray *)fhsRootPathes; - (NSArray *)searchPathes; /* operations */ /* These are public and work across all types of filesystems, it's how you find resources. */ - (NSString *)lookupFileWithName:(NSString *)_name; - (NSString *)lookupFileWithName:(NSString *)_name extension:(NSString *)_ext; - (NSArray *)lookupAllFilesWithExtension:(NSString *)_ext doReturnFullPath:(BOOL)_withPath; /* End public */ @end #endif /* __NGExtensions_NGResourceLocator_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/DOMNode+EOQualifier.h0000644000000000000000000000216712242733417022740 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DOM_DOMNode_EOQualifier_H__ #define __DOM_DOMNode_EOQualifier_H__ #include @class NSArray; @class EOQualifier; @interface NGDOMNode(EOQualifier) - (NSArray *)childrenMatchingQualifier:(EOQualifier *)_qualifier; - (NSArray *)descendantsMatchingQualifier:(EOQualifier *)_qualifier; @end #endif /* __DOM_DOMNode_EOQualifier_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/EOQualifier+plist.h0000644000000000000000000000213012242733417022634 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __EOQualifier_plist_h__ #define __EOQualifier_plist_h__ #import @class NSDictionary, NSString; @interface EOQualifier(plist) - (id)initWithDictionary:(NSDictionary *)_dictionary; - (id)initWithString:(NSString *)_string; - (id)initWithPropertyList:(id)_plist owner:(id)_owner; @end #endif SOPE/sope-core/NGExtensions/NGExtensions/NSCalendarDate+misc.h0000644000000000000000000000655212242733417023053 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_NSCalendarDate_misc_H__ #define __NGExtensions_NSCalendarDate_misc_H__ #import #import #if NeXT_Foundation_LIBRARY || GNUSTEP_BASE_LIBRARY # import #endif @class NSArray, NSTimeZone; @interface NSCalendarDate(misc) - (int)weekOfMonth; - (int)weekOfYear; - (short)numberOfWeeksInYear; + (NSArray *)mondaysOfYear:(int)_year timeZone:(NSTimeZone *)_tz; - (NSArray *)mondaysOfYear; - (NSCalendarDate *)firstMondayAndLastWeekInYear:(short *)_lastWeek; + (NSCalendarDate *)mondayOfWeek:(int)_weekNumber inYear:(int)_year timeZone:(NSTimeZone *)_tz; - (NSCalendarDate *)mondayOfWeek:(int)_weekNumber; + (NSCalendarDate *)dateForJulianNumber:(long)_jn; - (long)julianNumber; - (NSCalendarDate *)firstDayOfMonth; - (NSCalendarDate *)lastDayOfMonth; - (NSCalendarDate *)mondayOfWeek; - (NSCalendarDate *)beginOfDay; - (NSCalendarDate *)endOfDay; - (int)numberOfDaysInMonth; - (BOOL)isDateOnSameDay:(NSCalendarDate *)_date; - (BOOL)isDateInSameWeek:(NSCalendarDate *)_date; - (BOOL)isInLeapYear; - (BOOL)isToday; - (NSCalendarDate *)yesterday; - (NSCalendarDate *)tomorrow; - (BOOL)isForenoon; - (BOOL)isAfternoon; - (NSCalendarDate *)nextYear; - (NSCalendarDate *)lastYear; /* returns a date on the same day with the specified time */ - (NSCalendarDate *)hour:(int)_hour minute:(int)_minute second:(int)_second; - (NSCalendarDate *)hour:(int)_hour minute:(int)_minute; /* applies the following modifications: if year >= 70 && year < 135 year = 1900 + year elif year >= 0 && year < 70 year = 2000 + year */ - (NSCalendarDate *)y2kDate; /* adding years, months and days while *keeping* the clock time, eg: d1 = [NSCalendarDate dateWithYear:2000 month:2 day:15 hour:12 minute:0 second:0 timeZone:@"MET"]; d2 = [d1 dateByAddingYear:0 month:3 day:0]; [d2 hourOfDay] will be '15' though the timezone changed from MET to MET-DST. -dateByAddingYears:months:days:hours:minutes:seconds: which can be found in NSCalendarDate will not keep the clock time (the time will be adjusted in the new DST timezone */ - (NSCalendarDate *)dateByAddingYears:(int)_years months:(int)_months days:(int)_days; /* calculate easter ... */ - (NSCalendarDate *)easterOfYear; @end @interface NSCalendarDate(CalMatrix) - (NSArray *)calendarMatrixWithStartDayOfWeek:(short)_caldow onlyCurrentMonth:(BOOL)_onlyThisMonth; @end @interface NSString(FuzzyDayOfWeek) - (int)dayOfWeekInEnglishOrGerman; @end #endif /* __NGExtensions_NSCalendarDate_misc_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/NGBase64Coding.h0000644000000000000000000000403312242733417021741 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_NGBase64Encoding_H__ #define __NGExtensions_NGBase64Encoding_H__ #import #import /* Base64 encoder/decoder Attention: these methods/function do _not_ generate a '\n' at the end of the end of encoding (after the '=' signs). The NSString and NSData have their own maximum line length, for strings it is currently 1024 bytes and for data's 72 chars. */ @interface NSString(Base64Coding) - (NSString *)stringByEncodingBase64; - (NSString *)stringByDecodingBase64; - (NSData *)dataByDecodingBase64; @end @interface NSData(Base64Coding) - (NSData *)dataByEncodingBase64; /* Note: inserts '\n' every 72 chars */ - (NSData *)dataByDecodingBase64; - (NSString *)stringByEncodingBase64; - (NSString *)stringByDecodingBase64; - (NSData *)dataByEncodingBase64WithLineLength:(unsigned)_lineLength; @end /* These function return the length of the resulting buffer or -1 on error */ int NGEncodeBase64(const void *_source, unsigned _len, void *_buffer, unsigned _bufferCapacity, int _maxLineWidth); int NGDecodeBase64(const void *_source, unsigned _len, void *_buffer, unsigned _bufferCapacity); #endif /* __NGExtensions_NGBase64Encoding_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/NGLogSyslogAppender.h0000644000000000000000000000353212242733417023175 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_NGLogSyslogAppender_H_ #define __NGExtensions_NGLogSyslogAppender_H_ /* NGLogSyslogAppender An appender which writes to the system's syslog facility. Use the user default key "NGLogSyslogIdentifier" to set the syslog identifier. The syslog identifier is a string that will be prepended to every message. See your operating system's manpage on syslog for details. Note: syslog doesn't support user provided timestamps, thus this information provided by NGLogEvent is silently discarded. The following scheme is used to map NGLogLevels to syslog's levels: NGLogLevel syslog -------------------------- NGLogLevelDebug LOG_DEBUG NGLogLevelInfo LOG_INFO NGLogLevelWarn LOG_WARNING NGLogLevelError LOG_ERR NGLogLevelFatal LOG_ALERT */ #include @class NSString; @interface NGLogSyslogAppender : NGLogAppender { } + (id)sharedAppender; /* provide syslog identifier */ - (id)initWithIdentifier:(NSString *)_ident; @end #endif /* __NGExtensions_NGLogSyslogAppender_H_ */ SOPE/sope-core/NGExtensions/NGExtensions/NGHashMap.h0000644000000000000000000000563212242733417021120 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_NGHashMap_H__ #define __NGExtensions_NGHashMap_H__ #import #import @class NSArray, NSDictionary; @interface NGHashMap : NSObject < NSCopying, NSMutableCopying, NSCoding > { @protected NSMapTable *table; } + (id)hashMap; + (id)hashMapWithHashMap:(NGHashMap *)_hashMap; + (id)hashMapWithObjects:(NSArray *)_objects forKey:(id)_key; + (id)hashMapWithDictionary:(NSDictionary *)_dict; - (id)init; - (id)initWithCapacity:(NSUInteger)_size; - (id)initWithObjects:(NSArray *)_objects forKey:(id)_key; - (id)initWithHashMap:(NGHashMap *)_hashMap; - (id)initWithDictionary:(NSDictionary *)_dictionary; - (BOOL)isEqual:(id)anObject; - (BOOL)isEqualToHashMap:(NGHashMap *)_other; - (id)objectForKey:(id)_key; - (NSArray *)objectsForKey:(id)_key; - (id)objectAtIndex:(NSUInteger)_index forKey:(id)_key; - (NSArray *)allKeys; - (NSArray *)allObjects; - (NSEnumerator *)keyEnumerator; - (NSEnumerator *)objectEnumerator; - (NSEnumerator *)objectEnumeratorForKey:(id)_key; - (id)propertyList; - (NSString *)description; - (NSDictionary *)asDictionary; - (NSDictionary *)asDictionaryWithArraysForValues; - (NSUInteger)hash; - (NSUInteger)count; // returns the number of keys - (NSUInteger)countObjectsForKey:(id)_key; @end @interface NGMutableHashMap : NGHashMap { } + (id)hashMapWithCapacity:(NSUInteger)_numItems; - (id)init; - (void)insertObject:(id)_object atIndex:(NSUInteger)_index forKey:(id)_key; - (void)insertObjects:(NSArray *)_object atIndex:(NSUInteger)_index forKey:(id)_key; - (void)insertObjects:(id*)_objects count:(NSUInteger)_count atIndex:(NSUInteger)_index forKey:(id)_key; - (void)addObject:(id)_object forKey:(id)_key; - (void)addObjects:(NSArray *)_objects forKey:(id)_key; - (void)addObjects:(id*)_objects count:(NSUInteger)_count forKey:(id)_key; - (void)setObject:(id)_object forKey:(id)_key; - (void)setObjects:(NSArray *)_objects forKey:(id)_key; - (void)removeAllObjects; - (void)removeAllObjects:(id)_object forKey:(id)_key; - (void)removeAllObjectsForKey:(id)_key; - (void)removeAllObjectsForKeys:(NSArray *)_keyArray; @end #endif /* __NGExtensions_NGHashMap_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/NGCalendarDateRange.h0000644000000000000000000000425512242733417023063 0ustar rootroot/* Copyright (C) 2004 Marcus Mueller This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_NGCalendarDateRange_H_ #define __NGExtensions_NGCalendarDateRange_H_ #import #import #import @class NSString, NSCalendarDate; @interface NGCalendarDateRange : NSObject { NSCalendarDate *startDate; NSCalendarDate *endDate; } + (id)calendarDateRangeWithStartDate:(NSCalendarDate *)_start endDate:(NSCalendarDate *)_end; - (id)initWithStartDate:(NSCalendarDate *)_start endDate:(NSCalendarDate *)_end; /* accessors */ - (NSCalendarDate *)startDate; - (NSCalendarDate *)endDate; /* comparison */ - (NSComparisonResult)compare:(NGCalendarDateRange *)other; /* operations */ - (NGCalendarDateRange *)intersectionDateRange:(NGCalendarDateRange *)other; - (NGCalendarDateRange *)unionDateRange:(NGCalendarDateRange *)other; - (BOOL)doesIntersectWithDateRange:(NGCalendarDateRange *)_other; - (BOOL)containsDate:(NSCalendarDate *)date; - (BOOL)containsDateRange:(NGCalendarDateRange *)_range; - (NSTimeInterval)duration; @end @interface NSArray(NGCalendarDateRanges) - (NSArray *)arrayByCreatingDateRangesFromObjectsWithStartDateKey:(NSString *)s andEndDateKey:(NSString *)e; - (NSUInteger)indexOfFirstIntersectingDateRange:(NGCalendarDateRange *)_range; - (BOOL)dateRangeArrayContainsDate:(NSCalendarDate *)_date; - (NSArray *)arrayByCompactingContainedDateRanges; @end #endif /* __NGExtensions_NGCalendarDateRange_H_ */ SOPE/sope-core/NGExtensions/NGExtensions/NSString+German.h0000644000000000000000000000230312242733417022256 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_NSString_German_H__ #define __NGExtensions_NSString_German_H__ #import @class NSArray; @interface NSString(German) - (BOOL)doesContainGermanUmlauts; - (NSString *)stringByReplacingGermanUmlautsWithTwoCharsAndSzWith:(unichar)_c; - (NSString *)stringByReplacingGermanUmlautsWithTwoChars; - (NSArray *)germanUmlautVariantsOfString; @end #endif /* __NGExtensions_NSString_German_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/NGBaseTypes.h0000644000000000000000000000264612242733417021500 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_NGBaseTypes_H__ #define __NGExtensions_NGBaseTypes_H__ #import #import #import static inline NSNumber *shortObj(short _s) { return [NSNumber numberWithShort:_s]; } static inline NSNumber *intObj(int _i) { return [NSNumber numberWithInt:_i]; } static inline NSNumber *floatObj(float _f) { return [NSNumber numberWithFloat:_f]; } static inline NSNumber *doubleObj(double _d) { return [NSNumber numberWithDouble:_d]; } static inline NSString *cstrObj(const char *_c) { return [NSString stringWithCString:_c]; } #endif /* __NGExtensions_NGBaseTypes_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/NGRule.h0000644000000000000000000000441712242733417020506 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGRuleEngine_NGRule_H__ #define __NGRuleEngine_NGRule_H__ #import #import /* NGRule This class represents a rule inside the rule-model. A rule conceptually has: - a qualifier - aka lhs (the condition which must be true for the rule) - an action - aka rhs (the "thing" which is performed when the rule is triggered) - a priority - to select a rule if multiple ones match String Representation: qualifer => action [; priority] *true* => action Example: "(request.isXmlRpcRequest = YES) => dispatcher = XmlRpc ;0" */ @class EOQualifier; @interface NGRule : NSObject < EOKeyValueArchiving > { EOQualifier *qualifier; id action; int priority; } + (id)ruleWithQualifier:(EOQualifier *)_q action:(id)_action priority:(int)_p; + (id)ruleWithQualifier:(EOQualifier *)_q action:(id)_action; - (id)initWithQualifier:(EOQualifier *)_q action:(id)_action priority:(int)_p; - (id)initWithPropertyList:(id)_plist; - (id)initWithString:(NSString *)_s; /* accessors */ - (void)setQualifier:(EOQualifier *)_q; - (EOQualifier *)qualifier; - (void)setAction:(id)_action; - (id)action; - (void)setPriority:(int)_pri; - (int)priority; /* operations */ - (BOOL)isCandidateForKey:(NSString *)_key; - (id)fireInContext:(id)_ctx; /* representations */ - (NSString *)stringValue; @end @interface NSObject(RuleAction) - (id)fireInContext:(id)_ctx; @end #endif /* __NGRuleEngine_NGRule_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/NGStack.h0000644000000000000000000000417012242733417020640 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_NGStack_H__ #define __NGExtensions_NGStack_H__ #import #import #import @class NSArray; @protocol NGStack < NSObject > // state - (NSUInteger)stackPointer; - (NSUInteger)count; - (BOOL)isEmpty; // operations - (void)push:(id)_obj; - (id)pop; - (void)clear; // elements - (id)elementAtTop; - (NSEnumerator *)topDownEnumerator; - (NSEnumerator *)bottomUpEnumerator; @end @interface NGStack : NSObject < NGStack, NSCoding, NSCopying > { @protected unsigned int stackPointer; unsigned int capacity; id *stack; } + (id)stackWithCapacity:(NSUInteger)_capacity; + (id)stack; + (id)stackWithArray:(NSArray *)_array; - (id)init; - (id)initWithCapacity:(NSUInteger)_capacity; // designated initializer - (id)initWithArray:(NSArray *)_array; // state - (NSUInteger)capacity; - (NSUInteger)stackPointer; - (NSUInteger)count; - (BOOL)isEmpty; // elements - (id)elementAtTop; - (id)elementAtBottom; - (NSEnumerator *)topDownEnumerator; - (NSEnumerator *)bottomUpEnumerator; // operations - (void)push:(id)_obj; - (id)pop; - (void)clear; // description - (NSArray *)toArray; // array representation, bottom element first @end @interface NGStackException : NSException @end @interface NSMutableArray(Stack) < NGStack > @end #endif /* __NGExtensions_NGStack_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/NGLogFileHandleAppender.h0000644000000000000000000000264512242733417023714 0ustar rootroot/* Copyright (C) 2004-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_NGLogFileHandleAppender_H_ #define __NGExtensions_NGLogFileHandleAppender_H_ /* NGLogFileHandleAppender Suits as an abstract base class for all NSFileHandle based appenders. */ #include #import /* for NSStringEncoding */ @class NSFileHandle, NSDictionary; @interface NGLogFileHandleAppender : NGLogAppender { NSFileHandle *fh; NSStringEncoding encoding; BOOL flushImmediately; } - (BOOL)isFileHandleOpen; - (void)openFileHandleWithConfig:(NSDictionary *)_config; - (void)closeFileHandle; @end #endif /* __NGExtensions_NGLogFileHandleAppender_H_ */ SOPE/sope-core/NGExtensions/NGExtensions/NSString+Ext.h0000644000000000000000000000401512242733417021607 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_NSString_Ext_H__ #define __NGExtensions_NSString_Ext_H__ #import /* was specific to gstep-base and later removed, supported in libFoundation */ #if !LIB_FOUNDATION_LIBRARY @interface NSString(GSAdditions) #if !GNUSTEP - (NSString *)stringWithoutPrefix:(NSString *)_prefix; - (NSString *)stringWithoutSuffix:(NSString *)_suffix; - (NSString *)stringByReplacingString:(NSString *)_orignal withString:(NSString *)_replacement; - (NSString *)stringByTrimmingLeadSpaces; - (NSString *)stringByTrimmingTailSpaces; - (NSString *)stringByTrimmingSpaces; #endif /* !GNUSTEP */ /* the following are not available in gstep-base 1.6 ? */ - (NSString *)stringByTrimmingLeadWhiteSpaces; - (NSString *)stringByTrimmingTailWhiteSpaces; - (NSString *)stringByTrimmingWhiteSpaces; @end /* NSString(GSAdditions) */ #if !GNUSTEP @interface NSMutableString(GNUstepCompatibility) - (void)trimLeadSpaces; - (void)trimTailSpaces; - (void)trimSpaces; @end /* NSMutableString(GNUstepCompatibility) */ #endif /* !GNUSTEP */ #endif /* specific to libFoundation */ #if !LIB_FOUNDATION_LIBRARY @interface NSString(lfNSURLUtilities) - (BOOL)isAbsoluteURL; - (NSString *)urlScheme; @end #endif #endif /* __NGExtensions_NSString_Ext_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/NGRuleEngine.h0000644000000000000000000000165112242733417021631 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include SOPE/sope-core/NGExtensions/NGExtensions/NSDictionary+misc.h0000644000000000000000000000217512242733417022646 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_NSDictionary_misc_H__ #define __NGExtensions_NSDictionary_misc_H__ #import @interface NSDictionary(misc) - (NSDictionary *)dictionaryByExchangingKeysAndValues; @end @interface NSMutableDictionary(misc) - (void)removeObjectsForKeysV:(id)_firstKey, ...; @end #endif /* __NGExtensions_NSDictionary_misc_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/EOKeyGrouping.h0000644000000000000000000000161412242733417022035 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _EOKeyGrouping_h__ #define _EOKeyGrouping_h__ #include #endif /* _EOKeyGrouping_h__ */ SOPE/sope-core/NGExtensions/NGExtensions/NGBitSet.h0000644000000000000000000000461012242733417020764 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_NGBitSet_H__ #define __NGExtensions_NGBitSet_H__ #import #import @class NSArray, NSEnumerator; typedef unsigned int NGBitSetStorage; @protocol NGBitSet < NSObject > // state - (NSUInteger)count; // membership - (BOOL)isMember:(NSUInteger)_element; - (void)addMember:(NSUInteger)_element; - (void)addMembersInRange:(NSRange)_range; - (void)removeMember:(NSUInteger)_element; - (void)removeMembersInRange:(NSRange)_range; - (void)removeAllMembers; @end @interface NGBitSet : NSObject < NGBitSet, NSCopying, NSCoding > { @protected unsigned int universe; unsigned int count; NGBitSetStorage *storage; } + (id)bitSet; + (id)bitSetWithCapacity:(NSUInteger)_capacity; + (id)bitSetWithBitSet:(NGBitSet *)_set; - (id)init; - (id)initWithCapacity:(NSUInteger)_capacity; // designated initializer - (id)initWithBitSet:(NGBitSet *)_set; - (id)initWithNullTerminatedArray:(unsigned int *)_array; // state - (NSUInteger)capacity; // membership - (NSUInteger)firstMember; - (NSUInteger)lastMember; - (void)addMembersFromBitSet:(NGBitSet *)_set; // equality - (BOOL)isEqual:(id)_object; - (BOOL)isEqualToSet:(NGBitSet *)_set; // enumerator - (NSEnumerator *)objectEnumerator; // NSCopying - (id)copy; - (id)copyWithZone:(NSZone *)_zone; // NSCoding - (void)encodeWithCoder:(NSCoder *)_coder; - (id)initWithCoder:(NSCoder *)_coder; // description - (NSString *)description; - (NSArray *)toArray; @end NSString *stringValueForBitset(unsigned int _set, char _setC, char _unsetC, short _wide); #endif /* __NGExtensions_NGBitSet_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/NSRunLoop+FileObjects.h0000644000000000000000000000315412242733417023373 0ustar rootroot/* Copyright (C) 2002-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // Created by Helge Hess on Mon Mar 11 2002. #ifndef __FoundationExt_NSRunLoop_FileObjects__ #define __FoundationExt_NSRunLoop_FileObjects__ #if !LIB_FOUNDATION_LIBRARY #import typedef enum { NSPosixNoActivity = 0, NSPosixReadableActivity = 1, NSPosixWritableActivity = 2, NSPosixExceptionalActivity = 4 } NSPosixFileActivities; extern NSString *NSFileObjectBecameActiveNotificationName; @interface NSRunLoop(FileObjects) /* Monitoring file objects */ - (void)addFileObject:(id)_fileObject activities:(NSUInteger)_activities forMode:(NSString *)_mode; - (void)removeFileObject:(id)_fileObject forMode:(NSString *)_mode; @end @interface NSObject(RunloopFileObject) - (BOOL)isOpen; - (int)fileDescriptor; @end #endif /* !LIB_FOUNDATION_LIBRARY */ #endif /* __FoundationExt_NSRunLoop_FileObjects__ */ SOPE/sope-core/NGExtensions/NGExtensions/NGPropertyListParser.h0000644000000000000000000000544512242733417023436 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_NGPropertyListParser_H__ #define __NGExtensions_NGPropertyListParser_H__ #import @class NSString, NSArray, NSDictionary, NSData; /* The property list format is: Strings: char's without specials: 'hello', but not 'hel lo' or quoted string: '"hello world !" Arrays: '(' ')' or '(' element ( ',' element )* ')' Dicts: '{' ( dictEntry )* '}' dictEntry = property '=' property ';' ; Data: '<' data '>', eg: '< AABB 88CC 77a7 11 >' */ NSString *NGParseStringFromBuffer(const unsigned char *_buffer, unsigned _len); NSArray *NGParseArrayFromBuffer(const unsigned char *_buffer, unsigned _len); NSDictionary *NGParseDictionaryFromBuffer(const unsigned char *_buffer, unsigned _len); NSString *NGParseStringFromData(NSData *_data); NSArray *NGParseArrayFromData(NSData *_data); NSDictionary *NGParseDictionaryFromData(NSData *_data); NSString *NGParseStringFromString(NSString *_str); NSArray *NGParseArrayFromString(NSString *_str); NSDictionary *NGParseDictionaryFromString(NSString *_str); id NGParsePropertyListFromBuffer(const unsigned char *_buffer, unsigned _len); id NGParsePropertyListFromData(NSData *_data); id NGParsePropertyListFromString(NSString *_string); id NGParsePropertyListFromFile(NSString *_path); NSDictionary *NGParseStringsFromBuffer(const unsigned char *_buffer, unsigned _len); NSDictionary *NGParseStringsFromData(NSData *_data); NSDictionary *NGParseStringsFromString(NSString *_string); NSDictionary *NGParseStringsFromFile(NSString *_path); #import #import @interface NSArray(NGPropertyListParser) + (id)skyArrayWithContentsOfFile:(NSString *)_path; - (id)skyInitWithContentsOfFile:(NSString *)_path; @end @interface NSDictionary(NGPropertyListParser) + (id)skyDictionaryWithContentsOfFile:(NSString *)_path; - (id)skyInitWithContentsOfFile:(NSString *)_path; @end #endif /* __NGExtensions_NGPropertyListParser_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/NSFileManager+Extensions.h0000644000000000000000000000217112242733417024113 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NSFileManager_Extensions_H__ #define __NSFileManager_Extensions_H__ #import #include @interface NSFileManager(ExtendedFileManager) < NGFileManagerDataSources > - (BOOL)createDirectoriesAtPath:(NSString *)_p attributes:(NSDictionary *)_a; @end #endif /* __NSFileManager_Extensions_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/NSProcessInfo+misc.h0000644000000000000000000000310212242733417022762 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NSProcessInfo_misc_H__ #define __NSProcessInfo_misc_H__ #import @interface NSProcessInfo(misc) /* arguments */ - (NSArray *)argumentsWithoutDefaults; /* create temp file name */ - (NSString *)temporaryFileName:(NSString *)_prefix; - (NSString *)temporaryFileName; /* return process-id (pid on Unix) */ - (id)processId; /* return path to proc directory for this process */ - (NSString *)procDirectoryPathForProcess; /* returns contents of /proc/pid/status */ - (NSDictionary *)procStatusDictionary; /* returns contents of /proc/pid/stat mapped as in 'man 5 proc' */ - (NSDictionary *)procStatDictionary; /* wrappers */ - (unsigned int)virtualMemorySize; - (unsigned int)residentSetSize; - (unsigned int)residentSetSizeLimit; @end #endif /* __NSProcessInfo_misc_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/NSEnumerator+misc.h0000644000000000000000000000232612242733417022660 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_NSEnumerator_misc_H__ #define __NGExtensions_NSEnumerator_misc_H__ #import @class NSEnumerator, EOQualifier; @interface NSEnumerator(misc) - (NSEnumerator *)filterWithQualifier:(EOQualifier *)_qualifier; - (NSEnumerator *)filterWithQualifierString:(NSString *)_q; - (NSEnumerator *)filterWithSelector:(SEL)_selector withObject:(id)_argument; @end #endif /* __NGExtensions_NSEnumerator_misc_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/NSString+Escaping.h0000644000000000000000000000235212242733417022602 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_NSString_Escaping_H__ #define __NGExtensions_NSString_Escaping_H__ #import @protocol NGStringEscaping < NSObject > - (NSString *)stringByEscapingString:(NSString *)_s; @end @interface NSString (Escaping) - (NSString *)stringByApplyingCEscaping; - (NSString *)stringByEscapingCharactersFromSet:(NSCharacterSet *)_set usingStringEscaping:(id)_esc; @end #endif /* __NGExtensions_NSString_Escaping_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/NSString+Formatting.h0000644000000000000000000000467712242733417023177 0ustar rootroot/* Copyright (C) 2000-2007 SKYRIX Software AG Copyright (C) 2007 Helge Hess This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_NSString_Formatting_H__ #define __NGExtensions_NSString_Formatting_H__ #import // category @interface NSString(XSFormatting) + (id)stringWithCFormat:(const char *)_format arguments:(va_list)_ap; + (id)stringWithCFormat:(const char *)_format, ...; @end @interface NSMutableString(XSFormatting) - (void)appendFormat:(NSString *)_format arguments:(va_list)_ap; - (void)appendFormat:(NSString *)_format, ...; @end // C support functions static inline int xs_vsnprintf(char *_str, size_t max, const char *fmt, va_list _ap) { NSString *obj = [NSString stringWithCFormat:_str arguments:_ap]; #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040 [obj getCString:_str maxLength:(max - 1) encoding:[NSString defaultCStringEncoding]]; return strlen(_str); #else [obj getCString:_str maxLength:(max - 1)]; return [obj cStringLength]; // return the len the string would have consumed #endif } static inline int xs_vsprintf (char *_str, const char *_fmt, va_list _ap) { NSString *obj = [NSString stringWithCFormat:_str arguments:_ap]; #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040 [obj getCString:_str maxLength:65535 /* no limit ... */ encoding:[NSString defaultCStringEncoding]]; return strlen(_str); #else [obj getCString:_str]; return [obj cStringLength]; // return the length of the string #endif } /* Could use formats .. // __attribute__ ((format (printf, 2, 3))); // __attribute__ ((format (printf, 3, 4))); */ int xs_sprintf (char *str, const char *format, ...); int xs_snprintf(char *str, size_t size, const char *format, ...); #endif /* __NGExtensions_NSString_Formatting_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/NGLogEventFormatter.h0000644000000000000000000000447412242733417023211 0ustar rootroot/* Copyright (C) 2004-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_NGLogEventFormatter_H_ #define __NGExtensions_NGLogEventFormatter_H_ /* NGLogEventFormatter Suits as factory and base class for all custom log event formatters. Its purpose is to offer a lightweight interface to transform NGLogEvent objects into string representations. NGLogEventFormatter honours the following user default keys: User Default key Function ---------------------------------------------------------------------------- NGLogDefaultLogEventFormatterClass The formatter class to use if no class information was provided by the configuration. The fallback is "NGLogEventFormatter". The following keys in the configuration dictionary will be recognized: Key Function ---------------------------------------------------------------------------- "Class" The class to use for instance creation. If no class name is provided, the fallback path described above will be taken. */ #import #include @class NSDictionary, NGLogEvent; @interface NGLogEventFormatter : NSObject { } + (id)logEventFormatterFromConfig:(NSDictionary *)_config; - (id)initWithConfig:(NSDictionary *)_config; /* formatting */ - (NSString *)formattedEvent:(NGLogEvent *)_event; @end #endif /* __NGExtensions_NGLogEventFormatter_H_ */ SOPE/sope-core/NGExtensions/NGExtensions/NGExtensionsDecls.h0000644000000000000000000000241412242733417022704 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_NGExtensionsDecls_H__ #define __NGExtensions_NGExtensionsDecls_H__ #if BUILD_libNGExtensions_DLL # define NGExtensions_EXPORT __declspec(dllexport) # define NGExtensions_DECLARE __declspec(dllexport) #elif libNGExtensions_ISDLL # define NGExtensions_EXPORT extern __declspec(dllimport) # define NGExtensions_DECLARE extern __declspec(dllimport) #else # define NGExtensions_EXPORT extern # define NGExtensions_DECLARE #endif #endif /* __NGExtensions_NGExtensionsDecls_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/NGFileManager.h0000644000000000000000000001314512242733417021747 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGFileManager_H__ #define __NGFileManager_H__ #import @class NSString, NSData; @class EODataSource, EOGlobalID; @protocol NGFileManager /* path operations */ - (NSString *)standardizePath:(NSString *)_path; - (NSString *)resolveSymlinksInPath:(NSString *)_path; - (NSString *)expandTildeInPath:(NSString *)_path; /* directory operations */ - (BOOL)changeCurrentDirectoryPath:(NSString *)_path; - (BOOL)createDirectoryAtPath:(NSString *)_path attributes:(NSDictionary *)_ats; - (NSString *)currentDirectoryPath; /* file operations */ - (BOOL)copyPath:(NSString *)_s toPath:(NSString *)_d handler:(id)_handler; - (BOOL)movePath:(NSString *)_s toPath:(NSString *)_d handler:(id)_handler; - (BOOL)linkPath:(NSString *)_s toPath:(NSString *)_d handler:(id)_handler; - (BOOL)removeFileAtPath:(NSString *)_path handler:(id)_handler; - (BOOL)createFileAtPath:(NSString *)_path contents:(NSData *)_contents attributes:(NSDictionary *)_attributes; /* getting and comparing file contents */ - (NSData *)contentsAtPath:(NSString *)_path; - (BOOL)contentsEqualAtPath:(NSString *)_path1 andPath:(NSString *)_path2; /* determining access to files */ - (BOOL)fileExistsAtPath:(NSString *)_path; - (BOOL)fileExistsAtPath:(NSString *)_path isDirectory:(BOOL*)_isDirectory; - (BOOL)isReadableFileAtPath:(NSString *)_path; - (BOOL)isWritableFileAtPath:(NSString *)_path; - (BOOL)isExecutableFileAtPath:(NSString *)_path; - (BOOL)isDeletableFileAtPath:(NSString *)_path; /* Getting and setting attributes */ - (NSDictionary *)fileAttributesAtPath:(NSString *)_p traverseLink:(BOOL)_flag; - (NSDictionary *)fileSystemAttributesAtPath:(NSString *)_p; - (BOOL)changeFileAttributes:(NSDictionary *)_attributes atPath:(NSString *)_p; /* discovering directory contents */ - (NSArray *)directoryContentsAtPath:(NSString *)_path; - (NSDirectoryEnumerator *)enumeratorAtPath:(NSString *)_path; - (NSArray *)subpathsAtPath:(NSString *)_path; /* symbolic-link operations */ - (BOOL)createSymbolicLinkAtPath:(NSString *)_p pathContent:(NSString *)_dpath; - (NSString *)pathContentOfSymbolicLinkAtPath:(NSString *)_path; /* feature check */ - (BOOL)supportsVersioningAtPath:(NSString *)_path; - (BOOL)supportsLockingAtPath:(NSString *)_path; - (BOOL)supportsFolderDataSourceAtPath:(NSString *)_path; - (BOOL)supportsFeature:(NSString *)_featureURI atPath:(NSString *)_path; /* writing */ - (BOOL)writeContents:(NSData *)_content atPath:(NSString *)_path; /* global-IDs */ - (EOGlobalID *)globalIDForPath:(NSString *)_path; - (NSString *)pathForGlobalID:(EOGlobalID *)_gid; /* trash */ - (BOOL)supportsTrashFolderAtPath:(NSString *)_path; - (NSString *)trashFolderForPath:(NSString *)_path; - (BOOL)trashFileAtPath:(NSString *)_path handler:(id)_handler; @end @protocol NGFileManagerVersioning < NGFileManager > /* versioning */ - (BOOL)checkoutFileAtPath:(NSString *)_path handler:(id)_handler; - (BOOL)releaseFileAtPath:(NSString *)_path handler:(id)_handler; - (BOOL)rejectFileAtPath:(NSString *)_path handler:(id)_handler; - (BOOL)checkoutFileAtPath:(NSString *)_path version:(NSString *)_version handler:(id)_handler; /* versioning data */ - (NSString *)lastVersionAtPath:(NSString *)_path; - (NSArray *)versionsAtPath:(NSString *)_path; - (NSData *)contentsAtPath:(NSString *)_path version:(NSString *)_version; - (NSDictionary *)fileAttributesAtPath:(NSString *)_path traverseLink:(BOOL)_followLink version:(NSString *)_version; @end @protocol NGFileManagerLocking < NGFileManager > - (BOOL)lockFileAtPath:(NSString *)_path handler:(id)_handler; - (BOOL)unlockFileAtPath:(NSString *)_path handler:(id)_handler; - (BOOL)isFileLockedAtPath:(NSString *)_path; /* access rights */ - (BOOL)isLockableFileAtPath:(NSString *)_path; - (BOOL)isUnlockableFileAtPath:(NSString *)_path; @end @protocol NGFileManagerDataSources < NGFileManager > /* datasources (work on folders) */ - (EODataSource *)dataSourceAtPath:(NSString *)_path; - (EODataSource *)dataSource; // works on current-directory-path @end /* features */ #define NGFileManagerFeature_DataSources \ @"http://www.skyrix.com/filemanager/datasources" #define NGFileManagerFeature_Locking \ @"http://www.skyrix.com/filemanager/locking" #define NGFileManagerFeature_Versioning \ @"http://www.skyrix.com/filemanager/versioning" /* abstract superclass for filemanagers ... */ @class NSString, NSURL; @interface NGFileManager : NSObject < NGFileManager > { @protected NSString *cwd; } /* paths */ /* This method removes all 'special' things: '.' '//' '..' */ - (NSString *)standardizePath:(NSString *)_path; /* this does return _path in NGFileManager ... */ - (NSString *)resolveSymlinksInPath:(NSString *)_path; /* this does return _path in NGFileManager ... */ - (NSString *)expandTildeInPath:(NSString *)_path; /* URLs */ - (NSURL *)urlForPath:(NSString *)_path; @end #endif /* __NGFileManager_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/NGFileManagerURL.h0000644000000000000000000000277412242733417022340 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGFileManagerURL_H__ #define __NGFileManagerURL_H__ #if GNUSTEP_BASE_LIBRARY # import /* add GS_EXPORT .. */ # import /* add NSObject .. */ #endif #import #include /* A URL which works on NGFileManager's. The NSURLHandle should work, but the URL can't be serialized. */ @interface NGFileManagerURL : NSURL { /* do *NOT* cache in filemanager - retain cycle !!! */ id fileManager; NSString *path; } - (id)initWithPath:(NSString *)_path fileManager:(id)_fm; /* accessors */ - (id)fileManager; @end #endif /* __NGFileManagerURL_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/NSArray+enumerator.h0000644000000000000000000000336412242733417023046 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_NSArray_enumerator_H__ #define __NGExtensions_NSArray_enumerator_H__ #import @class NSSet; @interface NSArray(enumerator) - (id)initWithObjectsFromEnumerator:(NSEnumerator *)_enumerator; /* Returns an array contructed using this algorithm: for (i = 0; i < [self count]; i++) newArray[i] = [array[i] performSelector:_selector]; If the selector returns nil, NSNull is placed in the resulting array. */ - (NSArray *)mappedArrayUsingSelector:(SEL)_selector; - (NSArray *)mappedArrayUsingSelector:(SEL)_selector withObject:(id)_object; - (NSSet *)mappedSetUsingSelector:(SEL)_selector; - (NSSet *)mappedSetUsingSelector:(SEL)_selector withObject:(id)_object; #if !LIB_FOUNDATION_LIBRARY - (NSArray *)map:(SEL)_sel; - (NSArray *)map:(SEL)_sel with:(id)_arg; #endif @end @interface NSMutableArray(enumerator); - (id)initWithObjectsFromEnumerator:(NSEnumerator *)_enumerator; @end #endif /* __NGExtensions_NSArray_enumerator_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/NSBundle+misc.h0000644000000000000000000000215412242733417021747 0ustar rootroot/* Copyright (C) 2004-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_NSBundle_misc_H__ #define __NGExtensions_NSBundle_misc_H__ #import @interface NSBundle (misc) - (NSString*)pathForResource:(NSString*)name ofType:(NSString*)ext inDirectory:(NSString*)directory forLocalizations:(NSArray*)localizationNames; @end #endif /* __NGExtensions_NSBundle_misc_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/NGCharBuffers.h0000644000000000000000000001057312242733417021771 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_NGCharBuffers_H__ #define __NGExtensions_NGCharBuffers_H__ #include #include #import #import #import typedef struct { unsigned capacity; unsigned length; unsigned char increaseRatio; unsigned char *buffer; // zero terminated buffer } NGCharBuffer8Struct; typedef NGCharBuffer8Struct *NGCharBuffer8; static inline NGCharBuffer8 NGCharBuffer8_init(NGCharBuffer8 _str, unsigned _capacity) { _str->capacity = _capacity; _str->length = 0; _str->increaseRatio = 2; _str->buffer = NGMallocAtomic(_capacity); _str->buffer[0] = '\0'; return _str; } static inline void NGCharBuffer8_reset(NGCharBuffer8 _str) { if (_str) { _str->capacity = 0; _str->length = 0; _str->increaseRatio = 0; NGFree(_str->buffer); _str->buffer = NULL; } } static inline NGCharBuffer8 NGCharBuffer8_new(unsigned _capacity) { NGCharBuffer8 str = NULL; str = NGMalloc(sizeof(NGCharBuffer8Struct)); return NGCharBuffer8_init(str, _capacity); } static inline NGCharBuffer8 NGCharBuffer8_newWithCString(const char *_cstr) { NGCharBuffer8 str = NULL; str = NGMalloc(sizeof(NGCharBuffer8Struct)); str = NGCharBuffer8_init(str, strlen(_cstr) + 2); strcpy((char *)str->buffer, _cstr); return str; } static inline void NGCharBuffer8_dealloc(NGCharBuffer8 _str) { if (_str) { NGCharBuffer8_reset(_str); NGFree(_str); _str = NULL; } } static inline void NGCharBuffer8_checkCapacity(NGCharBuffer8 _str, unsigned _needed) { if (_str->capacity < (_str->length + _needed + 1)) { // increase size unsigned char *oldBuffer = _str->buffer; _str->capacity *= _str->increaseRatio; if (_str->capacity < (_str->length + _needed + 1)) _str->capacity += _needed + 1; _str->buffer = NGMallocAtomic(_str->capacity + 2); memcpy(_str->buffer, oldBuffer, (_str->length + 1)); NGFree(oldBuffer); oldBuffer = NULL; } } static inline void NGCharBuffer8_addChar(NGCharBuffer8 _str, unsigned char _c) { NGCharBuffer8_checkCapacity(_str, 1); _str->buffer[_str->length] = _c; (_str->length)++; _str->buffer[_str->length] = '\0'; } static inline void NGCharBuffer8_addCString(NGCharBuffer8 _str, char *_cstr) { unsigned len; if (_cstr == NULL) return; len = strlen(_cstr); NGCharBuffer8_checkCapacity(_str, len); strcat((char *)_str->buffer, _cstr); _str->length += len; } static inline void NGCharBuffer8_removeContents(NGCharBuffer8 _str) { _str->length = 0; _str->buffer[0] = '\0'; } static inline NSString *NGCharBuffer8_makeStringAndDealloc(NGCharBuffer8 _str){ NSString *str; if (_str == NULL) return nil; str = [NSString stringWithCString:(char *)_str->buffer length:_str->length]; NSCAssert3(strlen((char *)_str->buffer) == _str->length, @"length of cstring(%s) and the buffer do not match (%i vs %i)", _str->buffer, strlen((char *)_str->buffer), _str->length); NGCharBuffer8_dealloc(_str); _str = NULL; return str; } static inline void NGCharBuffer8_stripTrailingSpaces(NGCharBuffer8 _str) { if (_str == NULL) return; else if (_str->length == 0) return; else { while (_str->length > 0) { unsigned char c = _str->buffer[_str->length - 1]; if (isspace((int)c) || (c == '\n') || (c == '\r')) { (_str->length)--; } else { break; } } _str->buffer[_str->length] = '\0'; } } #endif /* __NGExtensions_NGCharBuffers_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/EOCompoundDataSource.h0000644000000000000000000000262712242733417023336 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_EOCompoundDataSource_H__ #define __NGExtensions_EOCompoundDataSource_H__ #import @class NSArray; @class EOQualifier; @interface EOCompoundDataSource : EODataSource { NSArray *sources; EOQualifier *auxiliaryQualifier; NSArray *sortOrderings; } - (id)initWithDataSources:(NSArray *)_ds; /* accessors */ - (void)setSources:(NSArray *)_sources; - (NSArray *)sources; - (void)setAuxiliaryQualifier:(EOQualifier *)_q; - (EOQualifier *)auxiliaryQualifier; - (void)setSortOrderings:(NSArray *)_o; - (NSArray *)sortOrderings; @end #endif /* __NGExtensions_EOCompoundDataSource_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/EOGroupingSet.h0000644000000000000000000000161412242733417022040 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _EOGroupingSet_h__ #define _EOGroupingSet_h__ #include #endif /* _EOGroupingSet_h__ */ SOPE/sope-core/NGExtensions/NGExtensions/NGDirectoryEnumerator.h0000644000000000000000000000370112242733417023600 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGDirectoryEnumerator_H__ #define __NGDirectoryEnumerator_H__ #import #include /* A class which is compatible to NSDirectoryEnumerator, but works with any object conforming to the filemanager interface. */ @class NSString, NSMutableArray, NSFileManager, NSDictionary; @interface NGDirectoryEnumerator : NSEnumerator { id fileManager; NSMutableArray *enumStack; NSMutableArray *pathStack; NSString *currentFileName; NSString *currentFilePath; NSString *topPath; struct { BOOL isRecursive:1; BOOL isFollowing:1; } flags; } - (id)initWithFileManager:(id)_fm directoryPath:(NSString *)path recurseIntoSubdirectories:(BOOL)recurse followSymlinks:(BOOL)follow prefixFiles:(BOOL)prefix; - (id)initWithFileManager:(id)_fm; - (id)initWithFileManager:(id)_fm directoryPath:(NSString *)_path; - (id)fileManager; - (NSDictionary *)directoryAttributes; - (NSDictionary *)fileAttributes; - (void)skipDescendents; @end #endif /* __NGDirectoryEnumerator_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/NSNull+misc.h0000644000000000000000000000206712242733417021453 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NSNull_misc_H__ #define __NSNull_misc_H__ #import @interface NSNull(misc) - (BOOL)isNotNull; - (double)doubleValue; - (NSString *)stringValue; @end @interface NSObject(NSNullMisc) - (BOOL)isNotNull; - (BOOL)isNotEmpty; @end #endif /* __NSNull_misc_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/FileObjectHolder.h0000644000000000000000000000310412242733417022506 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // Created by Helge Hess on Wed Apr 17 2002. #ifndef __testrunloop_FileObject__ #define __testrunloop_FileObject__ #import @class NSFileHandle, NSNotificationCenter; /* This class is used to implement Unix filedescriptor notification on the MacOSX Foundation library. */ @interface FileObjectHolder : NSObject { NSFileHandle *fileHandle; NSString *mode; id fileObject; int fd; int activities; BOOL waitActive; } - (id)initWithFileObject:(id)_obj activities:(int)_act mode:(NSString *)_mode; /* accessors */ - (NSFileHandle *)fileHandle; - (id)fileObject; - (int)fileDescriptor; - (int)activities; - (NSString *)mode; - (NSNotificationCenter *)notificationCenter; /* operations */ - (void)wait; - (void)stopWaiting; @end #endif /* __testrunloop_FileObject__ */ SOPE/sope-core/NGExtensions/NGExtensions/NGLogging.h0000644000000000000000000000257712242733417021172 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_NGLogging_H_ #define __NGExtensions_NGLogging_H_ /* NGLogging is a new logging framework, modeled in a similar fashion as Log4J - without some of its bloat. Documentation is currently provided in the headers only. */ #include #include #include #include #include #include #include #include #endif /* __NGExtensions_NGLogging_H_ */ SOPE/sope-core/NGExtensions/NGExtensions/NGMemoryAllocation.h0000644000000000000000000000247512242733417023057 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_NGMemoryAllocation_H__ #define __NGExtensions_NGMemoryAllocation_H__ #if !(__GNU_LIBOBJC__ >= 20100911) #include #endif #include #if LIB_FOUNDATION_BOEHM_GC # define NGMalloc objc_malloc # define NGMallocAtomic objc_atomic_malloc # define NGFree objc_free # define NGRealloc objc_realloc #else # define NGMalloc malloc # define NGMallocAtomic malloc # define NGFree free # define NGRealloc realloc #endif #endif /* __NGExtensions_NGMemoryAllocation_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/NSData+gzip.h0000644000000000000000000000220512242733417021422 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGZlib_NSData_gzip_H__ #define __NGZlib_NSData_gzip_H__ #import #define NGGZipMinimalCompression 0 #define NGGZipMaximalCompression 9 @interface NSData(gzip) - (NSData *)gzipWithLevel:(int)_compressionLevel; - (NSData *)gzip; - (NSData *)compress; - (NSData *)compressWithLevel: (int) level; @end #endif /* __NGZlib_NSData_gzip_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/NSObject+Logs.h0000644000000000000000000000356712242733417021726 0ustar rootroot/* Copyright (C) 2004-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_NSObject_Logs_H__ #define __NGExtensions_NSObject_Logs_H__ #import #import @interface NSObject(NGLogs) /* default loggers for object */ - (id)logger; - (id)debugLogger; /* "end user" methods, variable argument logging methods .. */ - (void)debugWithFormat:(NSString *)_fmt, ...; - (void)logWithFormat:(NSString *)_fmt, ...; - (void)warnWithFormat:(NSString *)_fmt, ...; - (void)errorWithFormat:(NSString *)_fmt, ...; - (void)fatalWithFormat:(NSString *)_fmt, ...; /* prefix, override that, to make a special logging prefix */ - (NSString *)loggingPrefix; /* says whether debugging is enabled for object ... */ - (BOOL)isDebuggingEnabled; /*"designated" logging methods */ - (void)debugWithFormat:(NSString *)_fmt arguments:(va_list)_va; - (void)logWithFormat:(NSString *)_fmt arguments:(va_list)_va; - (void)warnWithFormat:(NSString *)_fmt arguments:(va_list)_va; - (void)errorWithFormat:(NSString *)_fmt arguments:(va_list)_va; - (void)fatalWithFormat:(NSString *)_fmt arguments:(va_list)_va; @end #endif /* __NGExtensions_NSObject_Logs_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/NGMerging.h0000644000000000000000000000311612242733417021162 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_NGMerging_H__ #define __NGExtensions_NGMerging_H__ #import #import #import #import @interface NSObject(NGMerging) - (BOOL)canMergeWithObject:(id)_object; - (id)mergeWithObject:(id)_object zone:(NSZone *)_zone; - (id)mergeWithObject:(id)_object; @end /* dictionaries merge only with other dictionaries */ @interface NSDictionary(NGMerging) - (id)mergeWithDictionary:(NSDictionary *)_object zone:(NSZone *)_zone; @end /* arrays merge with any objects responding to -objectEnumerator */ @interface NSArray(NGMerging) - (id)mergeWithArray:(NSArray *)_object zone:(NSZone *)_zone; - (id)mergeWithEnumeration:(NSEnumerator *)_object zone:(NSZone *)_zone; @end #endif /* __NGExtensions_NGMerging_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/AutoDefines.h0000644000000000000000000000354712242733417021563 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_AutoDefines_H__ #define __NGExtensions_AutoDefines_H__ // TODO: can we remove that? #if defined(__MINGW32__) # define WITH_OPENSTEP 0 # define GNUSTEP 1 #elif defined(__CYGWIN32__) # define WITH_OPENSTEP 0 # ifndef GNUSTEP # define GNUSTEP 1 # endif #elif defined(NeXT) || defined(WIN32) # define WITH_OPENSTEP 1 # define GNUSTEP 0 # ifndef NeXT_RUNTIME # define NeXT_RUNTIME 1 # endif #elif defined(__APPLE__) # ifndef WITH_OPENSTEP # define WITH_OPENSTEP 1 # endif # if !GNU_RUNTIME # ifndef NeXT_RUNTIME # define NeXT_RUNTIME 1 # endif # ifndef APPLE_RUNTIME # define APPLE_RUNTIME 1 # endif # endif # if !GNUSTEP_BASE_LIBRARY && !LIB_FOUNDATION_LIBRARY # ifndef COCOA_Foundation_LIBRARY # define COCOA_Foundation_LIBRARY 1 # endif # ifndef NeXT_Foundation_LIBRARY # define NeXT_Foundation_LIBRARY 1 # endif # ifndef APPLE_Foundation_LIBRARY # define APPLE_Foundation_LIBRARY 1 # endif # endif #else # define WITH_OPENSTEP 0 # define GNUSTEP 1 #endif #endif /* __NGExtensions_AutoDefines_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/EOQualifier+CtxEval.h0000644000000000000000000000352612242733417023061 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_EOQualifier_ContextEvaluation_H__ #define __NGExtensions_EOQualifier_ContextEvaluation_H__ #import #import @interface EOQualifier(ContextEvaluation) - (BOOL)evaluateWithObject:(id)_object context:(id)_context; @end @interface NSArray(ContextEvaluation) - (NSArray *)filteredArrayUsingQualifier:(EOQualifier *)_qualifier context:(id)_context; @end @interface NSObject(ContextQualifierComparisons) - (BOOL)isEqualTo:(id)_object inContext:(id)_context; - (BOOL)isNotEqualTo:(id)_object inContext:(id)_context; - (BOOL)isLessThan:(id)_object inContext:(id)_context; - (BOOL)isGreaterThan:(id)_object inContext:(id)_context; - (BOOL)isLessThanOrEqualTo:(id)_object inContext:(id)_context; - (BOOL)isGreaterThanOrEqualTo:(id)_object inContext:(id)_context; - (BOOL)doesContain:(id)_object inContext:(id)_context; - (BOOL)isLike:(NSString *)_object inContext:(id)_context; - (BOOL)isCaseInsensitiveLike:(NSString *)_object inContext:(id)_context; @end #endif /* __NGExtensions_EOQualifier_ContextEvaluation_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/IndexFunc.h0000644000000000000000000000223012242733417021224 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_IndexFunc_H__ #define __NGExtensions_IndexFunc_H__ #if defined(WIN32) && !defined(__CYGWIN32__) static inline const char *index(register const char *_str, register unsigned char _c) { if (_str == NULL) return NULL; while ((*_str != '\0') && (*_str != _c)) _str++; if (*_str == _c) return _str; return NULL; } #endif #endif /* __NGExtensions_IndexFunc_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/NSDictionary+KVC.h0000644000000000000000000000230012242733417022324 0ustar rootroot/* Copyright (C) 2000-2008 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_NSDictionary_KVC_H__ #define __NGExtensions_NSDictionary_KVC_H__ #import @interface NSDictionary(KVC) - (id)valueForUndefinedKey:(NSString *)key; - (id)handleQueryWithUnboundKey:(NSString *)key; - (void)setValue:(id)value forUndefinedKey:(NSString *)key; - (void)handleTakeValue:(id)value forUnboundKey:(NSString *)key; @end #endif /* __NGExtensions_NSDictionary_KVC_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/NGRuleModel.h0000644000000000000000000000365112242733417021466 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGRuleEngine_NGRuleModel_H__ #define __NGRuleEngine_NGRuleModel_H__ #import #import /* NGRuleModel A rule model is a specialized sequence of rules. */ // TODO: need some method to join two models (two allow one model being // configured as a default but still have fallback rules in another) @class NSArray, NSMutableArray, NSURL; @class NGRule; @interface NGRuleModel : NSObject < EOKeyValueArchiving > { NSMutableArray *rules; } + (id)ruleModelWithPropertyList:(id)_plist; + (id)ruleModelWithContentsOfUserDefault:(NSString *)_defName; - (id)init; - (id)initWithRules:(NSArray *)_rules; - (id)initWithPropertyList:(id)_plist; - (id)initWithContentsOfFile:(NSString *)_path; - (id)initWithContentsOfUserDefault:(NSString *)_defaultName; - (id)initWithKeyValueArchiveAtURL:(NSURL *)_url; /* accessors */ - (void)setRules:(NSArray *)_rules; - (NSArray *)rules; - (void)addRule:(NGRule *)_rule; - (void)removeRule:(NGRule *)_rule; - (void)addRules:(NSArray *)_rules; /* operations */ - (NSArray *)candidateRulesForKey:(NSString *)_key; @end #endif /* __NGRuleEngine_NGRuleModel_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/NSObject+Values.h0000644000000000000000000000342412242733417022251 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_NSObject_Values_H__ #define __NGExtensions_NSObject_Values_H__ #import #import @protocol NGBaseTypeValues - (BOOL)boolValue; - (signed char)charValue; - (unsigned char)unsignedCharValue; - (signed short)shortValue; - (unsigned short)unsignedShortValue; - (signed int)intValue; - (unsigned int)unsignedIntValue; - (signed long)longValue; - (unsigned long)unsignedLongValue; - (signed long long)longLongValue; - (unsigned long long)unsignedLongLongValue; - (float)floatValue; @end /* The default basetype methods perform their operation on the string-representation of the object. -boolValue returns YES per default. (id != nil) */ @interface NSObject(NGValues) < NGBaseTypeValues > - (double)doubleValue; - (NSString *)stringValue; @end @interface NSString(NGValues) + (NSString *) stringWithUnsignedLongLong: (unsigned long long)value; - (BOOL)boolValue; - (NSString *)stringValue; @end #endif /* __NGExtensions_NSObject_Values_H__ */ SOPE/sope-core/NGExtensions/NGExtensions/NGLogEvent.h0000644000000000000000000000274112242733417021320 0ustar rootroot/* Copyright (C) 2004-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_NGLogEvent_H_ #define __NGExtensions_NGLogEvent_H_ /* NGLogEvent Instances of this class encapsulate log events, retaining all vital information associated with it. Log events are generally passed on to log appenders for further treatment. */ #import #import #include @class NSString, NSCalendarDate; @interface NGLogEvent : NSObject { NSString *msg; NGLogLevel level; NSTimeInterval date; } - (id)initWithLevel:(NGLogLevel)_level message:(NSString *)_msg; /* accessors */ - (NGLogLevel)level; - (NSString *)message; - (NSCalendarDate *)date; @end #endif /* __NGExtensions_NGLogEvent_H_ */ SOPE/sope-core/NGExtensions/NGExtensions/NGLoggerManager.h0000644000000000000000000000533012242733417022304 0ustar rootroot/* Copyright (C) 2004-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_NGLoggerManager_H_ #define __NGExtensions_NGLoggerManager_H_ /* NGLoggerManager Manages a set of loggers by associating logger instances with names. Thus clients will be given the same instances if accessing the manager with the same name/key. Also, NGLoggerManager offers conditional creation of loggers based on user default keys (and special values associated with these keys). NGLoggerManager honours the following user default keys: User Default key Function ---------------------------------------------------------------------------- LoggerConfig contains the configuration of the logger named . Depending on what method you used to retrieve the logger, is either the user default key, class name or another arbitrary name. The config found for that key is used to initialize the logger instance. NGLogDebugAllEnabled if set to "YES" will always return a logger when -loggerForDefaultKey: is called. */ #import @class NSString, NSMutableDictionary; @class NGLogger; @interface NGLoggerManager : NSObject { NSMutableDictionary *loggerMap; } + (id)defaultLoggerManager; /* Retrieves a logger conditional to the existence of the given default key. In order to stay backwards compatible to existing applications, a boolean value auf YES associated with this key sets the default log level of this logger to NGLogLevelDebug. If the requested default key is not set, *nil* is returned. */ - (NGLogger *)loggerForDefaultKey:(NSString *)_defaultKey; /* Retrieves a "named" logger with NGLogLevelAll. */ - (NGLogger *)loggerForFacilityNamed:(NSString *)_name; - (NGLogger *)loggerForClass:(Class)_clazz; @end #endif /* __NGExtensions_NGLoggerManager_H_ */ SOPE/sope-core/NGExtensions/NGBase64Coding.m0000644000000000000000000003364212242733417017372 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NGBase64Coding.h" #include "common.h" #import #import #import static inline BOOL isbase64(char a) { if (('A' <= a) && (a <= 'Z')) return YES; if (('a' <= a) && (a <= 'z')) return YES; if (('0' <= a) && (a <= '9')) return YES; if ((a == '+') || (a == '/')) return YES; return NO; } static inline int encode_base64(const char *_src, size_t _srcLen, char *_dest, size_t _destSize, size_t *_destLen, int _maxLineWidth); static inline int decode_base64(const char *_src, size_t _srcLen, char *_dest, size_t _destSize, size_t *_destLen); @implementation NSString(Base64Coding) static Class StringClass = Nil; static int NSStringMaxLineWidth = 1024; - (NSString *)stringByEncodingBase64 { unsigned len; size_t destSize; size_t destLength = -1; const char *src; char *dest; NSString *result; src = [self UTF8String]; len = strlen (src); if (len > 0) { destSize = ((len + 2) * 4) / 3; // 3:4 conversion ratio destSize += destSize / NSStringMaxLineWidth + 2; // space for '\n' and '\0' destSize += 64; dest = malloc (destSize + 4); NSAssert(dest, @"invalid buffer .."); if (encode_base64 (src, len, dest, destSize, &destLength, NSStringMaxLineWidth) == 0) { // base64 must *always* be transported as ascii result = [[NSString alloc] initWithBytesNoCopy:dest length:destLength encoding:NSASCIIStringEncoding freeWhenDone:YES]; [result autorelease]; } else { free(dest); result = nil; } } else result = @""; return result; } - (NSString *)stringByDecodingBase64 { unsigned len; size_t destSize; size_t destLength = -1; const char *src; char *dest; NSString *result; if (StringClass == Nil) StringClass = [NSString class]; src = [self UTF8String]; len = strlen (src); if (len > 0) { destSize = ((len * 3 ) / 4) + 4; dest = malloc (destSize + 1); NSAssert(dest, @"invalid buffer .."); if (decode_base64(src, len, dest, destSize, &destLength) == 0) { NSAssert (destLength < destSize, @"buffer overflow"); if (*dest == '\0' && destLength > 0) { [self errorWithFormat: @"(%s): could not decode '%@' as string (contains \\0 bytes)!", __PRETTY_FUNCTION__, self]; abort(); // not executed past this point result = nil; } else { result = [[StringClass alloc] initWithBytes:dest length:destLength encoding:NSUTF8StringEncoding]; // we fallback on latin 1 if (!result) result = [[StringClass alloc] initWithBytes:dest length:destLength encoding:NSISOLatin1StringEncoding]; free(dest); [result autorelease]; } } else { free(dest); result = nil; } } else result = @""; return result; } - (NSData *)dataByDecodingBase64 { unsigned len; size_t destSize; size_t destLength = -1; const char *src; char *dest; NSData *result; if (StringClass == Nil) StringClass = [NSString class]; src = [self UTF8String]; len = strlen(src); if (len > 0) { destSize = ((len * 3) / 4) + 4; dest = malloc(destSize + 1); NSAssert(dest, @"invalid buffer .."); if (decode_base64(src, len, dest, destSize, &destLength) == 0) { NSAssert (destLength < destSize, @"buffer overflow"); result = [NSData dataWithBytesNoCopy:dest length:destLength]; } else { free(dest); result = nil; } } else result = [NSData data]; return result; } @end /* NSString(Base64Coding) */ @implementation NSData(Base64Coding) // TODO: explain that size (which RFC specifies that?) static int NSDataMaxLineWidth = 72; - (NSData *)dataByEncodingBase64WithLineLength:(unsigned)_lineLength { unsigned len; size_t destSize; size_t destLength = -1; char *dest; if ((len = [self length]) == 0) return [NSData data]; destSize = ((len + 2) * 4) / 3; // 3:4 conversion ratio destSize += destSize / _lineLength + 2; // space for newlines and '\0' destSize += 64; dest = malloc(destSize + 4); NSAssert(dest, @"invalid buffer .."); if (encode_base64([self bytes], len, dest, destSize, &destLength, _lineLength) == 0) { NSAssert (destLength < destSize, @"buffer overflow"); return [NSData dataWithBytesNoCopy:dest length:destLength]; } if (dest != NULL) free((void *)dest); return nil; } - (NSData *)dataByEncodingBase64 { return [self dataByEncodingBase64WithLineLength:NSDataMaxLineWidth]; } - (NSData *)dataByDecodingBase64 { unsigned len; size_t destSize; size_t destLength = -1; char *dest; if ((len = [self length]) == 0) return [NSData data]; destSize = (len / 4 + 1) * 3 + 1; dest = malloc(destSize + 4); NSAssert(dest, @"invalid buffer .."); if (decode_base64([self bytes], len, dest, destSize, &destLength) == 0) { NSAssert (destLength < destSize, @"buffer overflow"); return [NSData dataWithBytesNoCopy:dest length:destLength]; } if (dest) free(dest); return nil; } - (NSString *)stringByEncodingBase64 { NSData *data; NSString *result; data = [self dataByEncodingBase64]; if (data) { // base64 must *always* be transported as ascii result = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding]; [result autorelease]; } else result = nil; return result; } - (NSString *)stringByDecodingBase64 { NSData *data; NSString *result; data = [self dataByDecodingBase64]; if (data) { result = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; if (!result) result = [[NSString alloc] initWithData:data encoding:NSISOLatin1StringEncoding]; [result autorelease]; } else result = nil; return result; } @end /* NSData(Base64Coding) */ // functions int NGEncodeBase64(const void *_source, unsigned _len, void *_buffer, unsigned _bufferCapacity, int _maxLineWidth) { size_t len; if ((_source == NULL) || (_buffer == NULL) || (_bufferCapacity == 0)) return -1; { // check whether buffer is big enough size_t outSize; outSize = ((_len + 2) * 4) / 3; // 3:4 conversion ratio outSize += (outSize / _maxLineWidth) + 2; // Space for newlines and NUL if (_bufferCapacity < outSize) return -1; } if (encode_base64(_source, _len, _buffer, _bufferCapacity, &len, _maxLineWidth) == 0) { return len; } else return -1; } int NGDecodeBase64(const void *_source, unsigned _len, void *_buffer, unsigned _bufferCapacity) { size_t len; if ((_source == NULL) || (_buffer == NULL) || (_bufferCapacity == 0)) return -1; if (((_len / 4 + 1) * 3 + 1) > _bufferCapacity) return -1; if (decode_base64(_source, _len, _buffer, _bufferCapacity, &len) == 0) return len; else return -1; } // private implementation static char base64tab[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz0123456789+/"; static char base64idx[128] = { '\377','\377','\377','\377','\377','\377','\377','\377', '\377','\377','\377','\377','\377','\377','\377','\377', '\377','\377','\377','\377','\377','\377','\377','\377', '\377','\377','\377','\377','\377','\377','\377','\377', '\377','\377','\377','\377','\377','\377','\377','\377', '\377','\377','\377', 62,'\377','\377','\377', 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,'\377','\377','\377','\377','\377','\377', '\377', 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,'\377','\377','\377','\377','\377', '\377', 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,'\377','\377','\377','\377','\377' }; static inline int encode_base64(const char *_src, size_t _srcLen, char *_dest, size_t _destSize, size_t *_destLen, int _maxLineWidth) { size_t inLen = _srcLen; char *out = _dest; size_t inPos = 0; size_t outPos = 0; int c1, c2, c3; unsigned i; // Get three characters at a time and encode them. for (i = 0; i < inLen / 3; ++i) { c1 = _src[inPos++] & 0xFF; c2 = _src[inPos++] & 0xFF; c3 = _src[inPos++] & 0xFF; out[outPos++] = base64tab[(c1 & 0xFC) >> 2]; out[outPos++] = base64tab[((c1 & 0x03) << 4) | ((c2 & 0xF0) >> 4)]; out[outPos++] = base64tab[((c2 & 0x0F) << 2) | ((c3 & 0xC0) >> 6)]; out[outPos++] = base64tab[c3 & 0x3F]; if ((outPos + 1) % (_maxLineWidth + 1) == 0) out[outPos++] = '\n'; } // Encode the remaining one or two characters. switch (inLen % 3) { case 0: //out[outPos++] = '\n'; break; case 1: c1 = _src[inPos] & 0xFF; out[outPos++] = base64tab[(c1 & 0xFC) >> 2]; out[outPos++] = base64tab[((c1 & 0x03) << 4)]; out[outPos++] = '='; out[outPos++] = '='; //out[outPos++] = '\n'; break; case 2: c1 = _src[inPos++] & 0xFF; c2 = _src[inPos] & 0xFF; out[outPos++] = base64tab[(c1 & 0xFC) >> 2]; out[outPos++] = base64tab[((c1 & 0x03) << 4) | ((c2 & 0xF0) >> 4)]; out[outPos++] = base64tab[((c2 & 0x0F) << 2)]; out[outPos++] = '='; //out[outPos++] = '\n'; break; } out[outPos] = 0; *_destLen = outPos; return 0; } static inline int decode_base64(const char *_src, size_t inLen, char *out, size_t _destSize, size_t *_destLen) { BOOL isErr = NO; BOOL isEndSeen = NO; register int b1, b2, b3; register int a1, a2, a3, a4; register size_t inPos = 0; register size_t outPos = 0; /* Get four input chars at a time and decode them. Ignore white space * chars (CR, LF, SP, HT). If '=' is encountered, terminate input. If * a char other than white space, base64 char, or '=' is encountered, * flag an input error, but otherwise ignore the char. */ while (inPos < inLen) { a1 = a2 = a3 = a4 = 0; // get byte 1 while (inPos < inLen) { a1 = _src[inPos++] & 0xFF; if (isbase64(a1)) break; else if (a1 == '=') { isEndSeen = YES; break; } else if (a1 != '\r' && a1 != '\n' && a1 != ' ' && a1 != '\t') { isErr = YES; } } // get byte 2 while (inPos < inLen) { a2 = _src[inPos++] & 0xFF; if (isbase64(a2)) break; else if (a2 == '=') { isEndSeen = YES; break; } else if (a2 != '\r' && a2 != '\n' && a2 != ' ' && a2 != '\t') { isErr = YES; } } // get byte 3 while (inPos < inLen) { a3 = _src[inPos++] & 0xFF; if (isbase64(a3)) break; else if (a3 == '=') { isEndSeen = YES; break; } else if (a3 != '\r' && a3 != '\n' && a3 != ' ' && a3 != '\t') { isErr = YES; } } // get byte 4 while (inPos < inLen) { a4 = _src[inPos++] & 0xFF; if (isbase64(a4)) break; else if (a4 == '=') { isEndSeen = YES; break; } else if (a4 != '\r' && a4 != '\n' && a4 != ' ' && a4 != '\t') { isErr = YES; } } // complete chunk if (isbase64(a1) && isbase64(a2) && isbase64(a3) && isbase64(a4)) { a1 = base64idx[a1] & 0xFF; a2 = base64idx[a2] & 0xFF; a3 = base64idx[a3] & 0xFF; a4 = base64idx[a4] & 0xFF; b1 = ((a1 << 2) & 0xFC) | ((a2 >> 4) & 0x03); b2 = ((a2 << 4) & 0xF0) | ((a3 >> 2) & 0x0F); b3 = ((a3 << 6) & 0xC0) | ( a4 & 0x3F); out[outPos++] = (char)b1; out[outPos++] = (char)b2; out[outPos++] = (char)b3; } // 3-chunk else if (isbase64(a1) && isbase64(a2) && isbase64(a3) && a4 == '=') { a1 = base64idx[a1] & 0xFF; a2 = base64idx[a2] & 0xFF; a3 = base64idx[a3] & 0xFF; b1 = ((a1 << 2) & 0xFC) | ((a2 >> 4) & 0x03); b2 = ((a2 << 4) & 0xF0) | ((a3 >> 2) & 0x0F); out[outPos++] = (char)b1; out[outPos++] = (char)b2; break; } // 2-chunk else if (isbase64(a1) && isbase64(a2) && a3 == '=' && a4 == '=') { a1 = base64idx[a1] & 0xFF; a2 = base64idx[a2] & 0xFF; b1 = ((a1 << 2) & 0xFC) | ((a2 >> 4) & 0x03); out[outPos++] = (char)b1; break; } // invalid state else { break; } if (isEndSeen) break; } *_destLen = outPos; return (isErr) ? -1 : 0; } // for static linking void __link_NGBase64Coding(void) { __link_NGBase64Coding(); } SOPE/sope-core/NGExtensions/NGBundleManager.m0000644000000000000000000016142212242733417017724 0ustar rootroot/* Copyright (C) 2000-2006 SKYRIX Software AG Copyright (C) 2006 Helge Hess This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NGBundleManager.h" #include "common.h" #include #include #import #import #include #if NeXT_Foundation_LIBRARY || COCOA_Foundation_LIBRARY # include #endif #if LIB_FOUNDATION_LIBRARY @interface NSBundle(UsedPrivates) + (BOOL)isFlattenedDirLayout; @end #endif #if NeXT_RUNTIME || APPLE_RUNTIME #include //OBJC_EXPORT void objc_setClassHandler(int (*)(const char *)); static BOOL debugClassHook = NO; static BOOL hookDoLookup = YES; static int _getClassHook(const char *className) { // Cocoa variant if (className == NULL) return 0; if (debugClassHook) printf("lookup class '%s'.\n", className); if (objc_lookUpClass(className)) return 1; if (hookDoLookup) { static NGBundleManager *manager = nil; NSBundle *bundle; NSString *cns; if (debugClassHook) printf("%s: look for class %s\n", __PRETTY_FUNCTION__, className); if (manager == nil) manager = [NGBundleManager defaultBundleManager]; cns = [[NSString alloc] initWithCString:className]; bundle = [manager bundleForClassNamed:cns]; [cns release]; cns = nil; if (bundle != nil) { if (debugClassHook) { NSLog(@"%s: found bundle %@", __PRETTY_FUNCTION__, [bundle bundlePath]); } if (![manager loadBundle:bundle]) { fprintf(stderr, "bundleManager couldn't load bundle for class '%s'.\n", className); } #if 0 else { Class c = objc_lookUpClass(className); NSLog(@"%s: loaded bundle %@ for className %s class %@", __PRETTY_FUNCTION__, bundle, className, c); } #endif } } return 1; } #endif NSString *NGBundleWasLoadedNotificationName = @"NGBundleWasLoadedNotification"; @interface NSBundle(NGBundleManagerPrivate) - (BOOL)_loadForBundleManager:(NGBundleManager *)_manager; @end @interface NGBundleManager(PrivateMethods) - (void)registerBundle:(NSBundle *)_bundle classes:(NSArray *)_classes categories:(NSArray *)_categories; - (NSString *)pathForBundleProvidingResource:(NSString *)_resourceName ofType:(NSString *)_type resourceSelector:(NGBundleResourceSelector)_selector context:(void *)_ctx; - (NSString *)makeBundleInfoPath:(NSString *)_path; @end static BOOL _selectClassByVersion(NSString *_resourceName, NSString *_resourceType, NSString *_path, NSDictionary *_resourceConfig, NGBundleManager *_bundleManager, void *_version) { id tmp; int classVersion; if (![_resourceType isEqualToString:@"classes"]) return NO; if (_version == NULL) return YES; if ([(id)_version intValue] == -1) return YES; if ((tmp = [_resourceConfig objectForKey:@"version"])) { classVersion = [tmp intValue]; if (classVersion < [(id)_version intValue]) { NSLog(@"WARNING: class version mismatch for class %@: " @"requested at least version %i, got version %i", _resourceName, [(id)_version intValue], classVersion); } } if ((tmp = [_resourceConfig objectForKey:@"exact-version"])) { classVersion = [tmp intValue]; if (classVersion != [(id)_version intValue]) { NSLog(@"WARNING: class version mismatch for class %@: " @"requested exact version %i, got version %i", _resourceName, [(id)_version intValue], classVersion); } } return YES; } @implementation NGBundleManager // THREAD static NGBundleManager *defaultManager = nil; static BOOL debugOn = NO; #if defined(__MINGW32__) static NSString *NGEnvVarPathSeparator = @";"; #else static NSString *NGEnvVarPathSeparator = @":"; #endif + (void)initialize { NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; debugOn = [ud boolForKey:@"NGBundleManagerDebugEnabled"]; } + (id)defaultBundleManager { if (defaultManager == nil) { defaultManager = [[NGBundleManager alloc] init]; } return defaultManager; } /* setup bundle search path */ - (void)_addMainBundlePathToPathArray:(NSMutableArray *)_paths { NSProcessInfo *pi; NSString *path; pi = [NSProcessInfo processInfo]; path = [[pi arguments] objectAtIndex:0]; path = [path stringByDeletingLastPathComponent]; if ([path length] > 0) { // TODO: to be correct this would need to read the bundle-info // NSExecutable?! /* The path is the complete path to the executable, including the processor, the OS and the library combo. Strip these directories from the main bundle's path. */ path = [[[path stringByDeletingLastPathComponent] stringByDeletingLastPathComponent] stringByDeletingLastPathComponent]; [_paths addObject:path]; } } - (void)_addBundlePathDefaultToPathArray:(NSMutableArray *)_paths { NSUserDefaults *ud; id paths; if ((ud = [NSUserDefaults standardUserDefaults]) == nil) { // got this with gstep-base during the port, apparently it happens // if the bundle manager is created inside the setup process of // gstep-base (for whatever reason) NSLog(@"ERROR(NGBundleManager): got no system userdefaults object!"); #if DEBUG abort(); #endif } if ((paths = [ud arrayForKey:@"NGBundlePath"]) == nil) { if ((paths = [ud stringForKey:@"NGBundlePath"]) != nil) paths = [paths componentsSeparatedByString:NGEnvVarPathSeparator]; } if (paths != nil) [_paths addObjectsFromArray:paths]; else if (debugOn) NSLog(@"Note: NGBundlePath default is not configured."); } - (void)_addEnvironmentPathToPathArray:(NSMutableArray *)_paths { NSProcessInfo *pi; id paths; pi = [NSProcessInfo processInfo]; paths = [[pi environment] objectForKey:@"NGBundlePath"]; if (paths) paths = [paths componentsSeparatedByString:NGEnvVarPathSeparator]; if (paths) [_paths addObjectsFromArray:paths]; } - (void)_addGNUstepPathsToPathArray:(NSMutableArray *)_paths { /* Old code for old gstep-make and gstep-base. */ NSDictionary *env; NSString *p; unsigned i, count; id tmp; env = [[NSProcessInfo processInfo] environment]; if ((tmp = [env objectForKey:@"GNUSTEP_PATHPREFIX_LIST"]) == nil) tmp = [env objectForKey:@"GNUSTEP_PATHLIST"]; tmp = [tmp componentsSeparatedByString:@":"]; for (i = 0, count = [tmp count]; i < count; i++) { p = [tmp objectAtIndex:i]; p = [p stringByAppendingPathComponent:@"Library"]; p = [p stringByAppendingPathComponent:@"Bundles"]; if ([self->bundleSearchPaths containsObject:p]) continue; if (p) [self->bundleSearchPaths addObject:p]; } /* New code for new gstep-make and gstep-base. */ tmp = NSStandardLibraryPaths(); { NSEnumerator *e = [tmp objectEnumerator]; while ((tmp = [e nextObject]) != nil) { tmp = [tmp stringByAppendingPathComponent:@"Bundles"]; if ([self->bundleSearchPaths containsObject:tmp]) continue; [self->bundleSearchPaths addObject:tmp]; } } } - (void)_setupBundleSearchPathes { /* setup bundle search path */ self->bundleSearchPaths = [[NSMutableArray alloc] initWithCapacity:16]; [self _addMainBundlePathToPathArray:self->bundleSearchPaths]; [self _addBundlePathDefaultToPathArray:self->bundleSearchPaths]; [self _addEnvironmentPathToPathArray:self->bundleSearchPaths]; [self _addGNUstepPathsToPathArray:self->bundleSearchPaths]; #if DEBUG && NeXT_Foundation_LIBRARY && 0 NSLog(@"%s: bundle search pathes:\n%@", __PRETTY_FUNCTION__, self->bundleSearchPaths); #endif } - (void)_registerLoadedBundles { NSEnumerator *currentBundles; NSBundle *loadedBundle; currentBundles = [[NSBundle allBundles] objectEnumerator]; while ((loadedBundle = [currentBundles nextObject]) != nil) [self registerBundle:loadedBundle classes:nil categories:nil]; } - (void)_registerForBundleLoadNotification { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_bundleDidLoadNotifcation:) name:@"NSBundleDidLoadNotification" object:nil]; } - (id)init { #if GNUSTEP_BASE_LIBRARY if ([NSUserDefaults standardUserDefaults] == nil) { /* called inside setup process, deny creation (HACK) */ [self release]; return nil; } #endif if ((self = [super init])) { self->classToBundle = NSCreateMapTable(NSNonOwnedPointerMapKeyCallBacks, NSNonRetainedObjectMapValueCallBacks, 32); self->classNameToBundle = NSCreateMapTable(NSObjectMapKeyCallBacks, NSNonRetainedObjectMapValueCallBacks, 32); self->categoryNameToBundle = NSCreateMapTable(NSObjectMapKeyCallBacks, NSNonRetainedObjectMapValueCallBacks, 32); self->pathToBundle = NSCreateMapTable(NSObjectMapKeyCallBacks, NSNonRetainedObjectMapValueCallBacks, 32); self->pathToBundleInfo = NSCreateMapTable(NSObjectMapKeyCallBacks, NSObjectMapValueCallBacks, 32); self->nameToBundle = NSCreateMapTable(NSObjectMapKeyCallBacks, NSNonRetainedObjectMapValueCallBacks, 32); self->loadedBundles = NSCreateMapTable(NSNonRetainedObjectMapKeyCallBacks, NSObjectMapValueCallBacks, 32); [self _setupBundleSearchPathes]; [self _registerLoadedBundles]; [self _registerForBundleLoadNotification]; } return self; } - (void)dealloc { [self->loadingBundles release]; if (self->loadedBundles) NSFreeMapTable(self->loadedBundles); if (self->classToBundle) NSFreeMapTable(self->classToBundle); if (self->classNameToBundle) NSFreeMapTable(self->classNameToBundle); if (self->categoryNameToBundle) NSFreeMapTable(self->categoryNameToBundle); if (self->pathToBundle) NSFreeMapTable(self->pathToBundle); if (self->pathToBundleInfo) NSFreeMapTable(self->pathToBundleInfo); if (self->nameToBundle) NSFreeMapTable(self->nameToBundle); [self->bundleSearchPaths release]; [super dealloc]; } /* accessors */ - (void)setBundleSearchPaths:(NSArray *)_paths { ASSIGNCOPY(self->bundleSearchPaths, _paths); } - (NSArray *)bundleSearchPaths { return self->bundleSearchPaths; } /* registering bundles */ - (void)registerBundle:(NSBundle *)_bundle classes:(NSArray *)_classes categories:(NSArray *)_categories { NSEnumerator *e; id v; #if NeXT_RUNTIME || APPLE_RUNTIME v = [_bundle bundlePath]; if ([v hasSuffix:@"Libraries"] || [v hasSuffix:@"Tools"]) { if (debugOn) fprintf(stderr, "INVALID BUNDLE: %s\n", [[_bundle bundlePath] cString]); return; } #endif #if 0 NSLog(@"NGBundleManager: register loaded bundle %@", [_bundle bundlePath]); #endif e = [_classes objectEnumerator]; while ((v = [e nextObject]) != nil) { #if NeXT_RUNTIME || APPLE_RUNTIME hookDoLookup = NO; #endif NSMapInsert(self->classToBundle, NSClassFromString(v), _bundle); NSMapInsert(self->classNameToBundle, v, _bundle); #if NeXT_RUNTIME || APPLE_RUNTIME hookDoLookup = YES; #endif } e = [_categories objectEnumerator]; while ((v = [e nextObject]) != nil) NSMapInsert(self->categoryNameToBundle, v, _bundle); } /* bundle locator */ - (NSString *)pathForBundleWithName:(NSString *)_name type:(NSString *)_type { NSFileManager *fm = [NSFileManager defaultManager]; NSEnumerator *e; NSString *path; NSString *bundlePath; NSBundle *bundle; /* first check in table */ bundlePath = [_name stringByAppendingPathExtension:_type]; if ((bundle = NSMapGet(self->nameToBundle, bundlePath))) return [bundle bundlePath]; e = [self->bundleSearchPaths objectEnumerator]; while ((path = [e nextObject])) { BOOL isDir = NO; if ([fm fileExistsAtPath:path isDirectory:&isDir]) { if (!isDir) continue; if ([[path lastPathComponent] isEqualToString:bundlePath]) { // direct match (a bundle was specified in the path) return path; } else { NSString *tmp; tmp = [path stringByAppendingPathComponent:bundlePath]; if ([fm fileExistsAtPath:tmp isDirectory:&isDir]) { if (isDir) // found bundle return tmp; } } } } return nil; } /* getting bundles */ - (NSBundle *)bundleForClass:(Class)aClass { /* this method never loads a dynamic bundle (since the class is set up) */ NSBundle *bundle; if (aClass == Nil) return nil; bundle = NSMapGet(self->classToBundle, aClass); #if NeXT_Foundation_LIBRARY || COCOA_Foundation_LIBRARY if (bundle == nil) { NSString *p; bundle = [NSBundle bundleForClass:aClass]; if (bundle == [NSBundle mainBundle]) bundle = nil; else { p = [bundle bundlePath]; if ([p hasSuffix:@"Libraries"]) { if (debugOn) { fprintf(stderr, "%s: Dylib bundle: 0x%p: %s\n", __PRETTY_FUNCTION__, bundle, [[bundle bundlePath] cString]); } bundle = nil; } else if ([p hasSuffix:@"Tools"]) { if (debugOn) { fprintf(stderr, "%s: Tool bundle: 0x%p: %s\n", __PRETTY_FUNCTION__, bundle, [[bundle bundlePath] cString]); } bundle = nil; } } } #endif if (bundle == nil) { /* if the class wasn't loaded from a bundle, it's *either* the main bundle or a bundle loaded before NGExtension was loaded !!! */ #if !LIB_FOUNDATION_LIBRARY && !GNUSTEP_BASE_LIBRARY // Note: incorrect behaviour if NGExtensions is dynamically loaded ! // TODO: can we do anything about this? Can we detect the situation and // print a log instead of the compile warning? // Note: the above refers to the situation when a framework is implicitly // loaded by loading a bundle (the framework is not linked against // the main tool) #endif bundle = [NSBundle mainBundle]; NSMapInsert(self->classToBundle, aClass, bundle); NSMapInsert(self->classNameToBundle, NSStringFromClass(aClass), bundle); } return bundle; } - (NSBundle *)bundleWithPath:(NSString *)path { NSBundle *bundle = nil; NSString *bn; path = [path stringByResolvingSymlinksInPath]; if (path == nil) return nil; if (debugOn) NSLog(@"find bundle for path: '%@'", path); bundle = NSMapGet(self->pathToBundle, path); if (bundle) { if (debugOn) NSLog(@" found: %@", bundle); return bundle; } if ((bundle = [(NGBundle *)[NGBundle alloc] initWithPath:path]) == nil) { NSLog(@"ERROR(%s): could not create bundle for path: '%@'", __PRETTY_FUNCTION__, path); return nil; } bn = [[bundle bundleName] stringByAppendingPathExtension:[bundle bundleType]], NSMapInsert(self->pathToBundle, path, bundle); NSMapInsert(self->nameToBundle, bn, bundle); return bundle; } - (NSBundle *)bundleWithName:(NSString *)_name type:(NSString *)_type { NSBundle *bundle; NSString *bn; bn = [_name stringByAppendingPathExtension:_type]; bundle = NSMapGet(self->nameToBundle, bn); if (![bundle isNotNull]) { bundle = [self bundleWithPath: [self pathForBundleWithName:_name type:_type]]; } if (![bundle isNotNull]) /* NSNull is used to signal missing bundles */ return nil; if (![[bundle bundleType] isEqualToString:_type]) return nil; /* bundle matches */ return bundle; } - (NSBundle *)bundleWithName:(NSString *)_name { return [self bundleWithName:_name type:@"bundle"]; } - (NSBundle *)bundleForClassNamed:(NSString *)_className { NSString *path = nil; NSBundle *bundle = nil; if (_className == nil) return nil; /* first check in table */ if ((bundle = NSMapGet(self->classNameToBundle, _className)) != nil) return bundle; path = [self pathForBundleProvidingResource:_className ofType:@"classes" resourceSelector:_selectClassByVersion context:NULL /* version */]; if (path != nil) { path = [path stringByResolvingSymlinksInPath]; NSAssert(path, @"couldn't resolve symlinks in path .."); } if (path == nil) return nil; if ((bundle = [self bundleWithPath:path]) != nil) NSMapInsert(self->classNameToBundle, _className, bundle); return bundle; } // dependencies + (NSInteger)version { return 2; } - (NSArray *)bundlesRequiredByBundle:(NSBundle *)_bundle { [self doesNotRecognizeSelector:_cmd]; return nil; } - (NSArray *)classesProvidedByBundle:(NSBundle *)_bundle { return [[_bundle providedResourcesOfType:@"classes"] valueForKey:@"name"]; } - (NSArray *)classesRequiredByBundle:(NSBundle *)_bundle { [self doesNotRecognizeSelector:_cmd]; return nil; } /* initialization */ - (NSString *)makeBundleInfoPath:(NSString *)_path { #if (NeXT_Foundation_LIBRARY || APPLE_Foundation_LIBRARY) && !defined(GSWARN) return [[[_path stringByAppendingPathComponent:@"Contents"] stringByAppendingPathComponent:@"Resources"] stringByAppendingPathComponent:@"bundle-info.plist"]; #else return [_path stringByAppendingPathComponent:@"bundle-info.plist"]; #endif } - (id)_initializeLoadedBundle:(NSBundle *)_bundle info:(NSDictionary *)_bundleInfo { id handler; /* check whether a handler was specified */ if ((handler = [_bundleInfo objectForKey:@"bundleHandler"]) != nil) { [self debugWithFormat:@"lookup bundle handler %@ of bundle: %@", handler, _bundle]; if ((handler = NSClassFromString(handler)) == nil) { NSLog(@"ERROR: did not find handler class %@ of bundle %@.", [_bundleInfo objectForKey:@"bundleHandler"], [_bundle bundlePath]); handler = [_bundle principalClass]; } handler = [handler alloc]; if ([handler respondsToSelector:@selector(initForBundle:bundleManager:)]) handler = [handler initForBundle:_bundle bundleManager:self]; else handler = [handler init]; handler = [handler autorelease]; if (handler == nil) { NSLog(@"ERROR: could not instantiate handler class %@ of bundle %@.", [_bundleInfo objectForKey:@"bundleHandler"], [_bundle bundlePath]); handler = [_bundle principalClass]; } } else { [self debugWithFormat: @"no bundle handler, lookup principal class of bundle: %@", _bundle]; if ((handler = [_bundle principalClass]) == nil) { /* use NGBundle class as default bundle handler */ #if !(NeXT_Foundation_LIBRARY || COCOA_Foundation_LIBRARY) [self warnWithFormat:@"bundle has no principal class: %@", _bundle]; #endif handler = [NGBundle class]; } else [self debugWithFormat:@" => %@", handler]; } return handler; } /* loading */ - (NSDictionary *)_loadBundleInfoAtExistingPath:(NSString *)_path { NSDictionary *bundleInfo; id info; #if NeXT_Foundation_LIBRARY || COCOA_Foundation_LIBRARY bundleInfo = NGParsePropertyListFromFile(_path); #else bundleInfo = [NSDictionary dictionaryWithContentsOfFile:_path]; #endif if (bundleInfo == nil) { NSLog(@"could not load bundle-info at path '%@' !", _path); return nil; } /* check required bundle manager version */ info = [bundleInfo objectForKey:@"requires"]; if ((info = [(NSDictionary *)info objectForKey:@"bundleManagerVersion"])) { if ([info intValue] > [[self class] version]) { /* bundle manager version does not match ... */ return nil; } } NSMapInsert(self->pathToBundleInfo, _path, bundleInfo); return bundleInfo; } - (NSBundle *)_locateBundleForClassInfo:(NSDictionary *)_classInfo { NSString *className; NSBundle *bundle; if (_classInfo == nil) return nil; if ((className = [_classInfo objectForKey:@"name"]) == nil) { NSLog(@"ERROR: missing classname in bundle-info.plist class section !"); return nil; } // TODO: do we need to check the runtime for already loaded classes? // Yes, I think so. But avoid recursions #if 0 #if APPLE_Foundation_LIBRARY || COCOA_Foundation_LIBRARY // TODO: HACK, see above. w/o this, we get issues. if ([className hasPrefix:@"NS"]) return nil; #endif #endif if ((bundle = [self bundleForClassNamed:className]) == nil) { #if 0 // class might be already loaded NSLog(@"ERROR: did not find class %@ required by bundle %@.", className, [_bundle bundlePath]); #endif } if (debugOn) NSLog(@"CLASS %@ => BUNDLE %@", className, bundle); return bundle; } - (NSArray *)_locateBundlesForClassInfos:(NSEnumerator *)_classInfos { NSMutableArray *requiredBundles; NSDictionary *i; requiredBundles = [NSMutableArray arrayWithCapacity:16]; while ((i = [_classInfos nextObject]) != nil) { NSBundle *bundle; if ((bundle = [self _locateBundleForClassInfo:i]) == nil) continue; [requiredBundles addObject:bundle]; } return requiredBundles; } - (BOOL)_preLoadBundle:(NSBundle *)_bundle info:(NSDictionary *)_bundleInfo { /* TODO: split up this huge method */ NSDictionary *requires; NSMutableArray *requiredBundles = nil; NSBundle *requiredBundle = nil; if (debugOn) NSLog(@"NGBundleManager: preload bundle: %@", _bundle); requires = [_bundleInfo objectForKey:@"requires"]; if (requires == nil) /* invalid bundle info specified */ return YES; /* load required bundles */ { NSEnumerator *e; NSDictionary *i; /* locate required bundles */ e = [[requires objectForKey:@"bundles"] objectEnumerator]; while ((i = [e nextObject]) != nil) { NSString *bundleName; if (![i respondsToSelector:@selector(objectForKey:)]) { NSLog(@"ERROR(%s): invalid bundle-info of bundle %@ !!!\n" @" requires-entry is not a dictionary: %@", __PRETTY_FUNCTION__, _bundle, i); continue; } if ((bundleName = [i objectForKey:@"name"])) { NSString *type; type = [i objectForKey:@"type"]; if (type == nil) type = @"bundle"; if ((requiredBundle = [self bundleWithName:bundleName type:type])) { if (requiredBundles == nil) requiredBundles = [NSMutableArray arrayWithCapacity:16]; [requiredBundles addObject:requiredBundle]; } else { NSLog(@"ERROR(NGBundleManager): did not find bundle '%@' (type=%@) " @"required by bundle %@.", bundleName, type, [_bundle bundlePath]); continue; } } else NSLog(@"ERROR: error in bundle-info.plist of bundle %@", _bundle); } } /* load located bundles */ { NSEnumerator *e; if (debugOn) { NSLog(@"NGBundleManager: preload required bundles: %@", requiredBundles); } e = [requiredBundles objectEnumerator]; while ((requiredBundle = [e nextObject]) != nil) { Class bundleMaster; if ((bundleMaster = [self loadBundle:requiredBundle]) == Nil) { NSLog(@"ERROR: could not load bundle %@ (%@) required by bundle %@.", [requiredBundle bundlePath], requiredBundle, [_bundle bundlePath]); continue; } } } /* load required classes */ { NSArray *bundles; NSArray *reqClasses; reqClasses = [requires objectForKey:@"classes"]; bundles = [self _locateBundlesForClassInfos:[reqClasses objectEnumerator]]; if (requiredBundles == nil) requiredBundles = [NSMutableArray arrayWithCapacity:16]; [requiredBundles addObjectsFromArray:bundles]; } /* load located bundles */ { NSEnumerator *e; e = [requiredBundles objectEnumerator]; while ((requiredBundle = [e nextObject]) != nil) { Class bundleMaster; if ((bundleMaster = [self loadBundle:requiredBundle]) == Nil) { NSLog(@"ERROR: could not load bundle %@ (%@) required by bundle %@.", [requiredBundle bundlePath], requiredBundle, [_bundle bundlePath]); continue; } } } /* check whether versions of classes match */ { NSEnumerator *e; NSDictionary *i; e = [[requires objectForKey:@"classes"] objectEnumerator]; while ((i = [e nextObject]) != nil) { NSString *className; Class clazz; if ((className = [i objectForKey:@"name"]) == nil) continue; if ((clazz = NSClassFromString(className)) == Nil) continue; if ([i objectForKey:@"exact-version"]) { int v; v = [[i objectForKey:@"exact-version"] intValue]; if (v != [clazz version]) { NSLog(@"ERROR: required exact class match failed:\n" @" class: %@\n" @" required version: %i\n" @" loaded version: %i\n" @" bundle: %@", className, v, [clazz version], [_bundle bundlePath]); } } else if ([i objectForKey:@"version"]) { int v; v = [[i objectForKey:@"version"] intValue]; if (v > [clazz version]) { NSLog(@"ERROR: provided class does not match required version:\n" @" class: %@\n" @" least required version: %i\n" @" loaded version: %i\n" @" bundle: %@", className, v, [clazz version], [_bundle bundlePath]); } } } } return YES; } - (BOOL)_postLoadBundle:(NSBundle *)_bundle info:(NSDictionary *)_bundleInfo { return YES; } - (id)loadBundle:(NSBundle *)_bundle { NSString *path = nil; NSDictionary *bundleInfo = nil; id bundleManager = nil; #if DEBUG NSAssert(self->loadedBundles, @"missing loadedBundles hashmap .."); #endif if ((bundleManager = NSMapGet(self->loadedBundles, _bundle))) return bundleManager; if (_bundle == [NSBundle mainBundle]) return [NSBundle mainBundle]; if ([self->loadingBundles containsObject:_bundle]) // recursive call return nil; if (self->loadingBundles == nil) self->loadingBundles = [[NSMutableSet allocWithZone:[self zone]] init]; [self->loadingBundles addObject:_bundle]; path = [_bundle bundlePath]; path = [self makeBundleInfoPath:path]; if ((bundleInfo = NSMapGet(self->pathToBundleInfo, path)) == nil) { if ([[NSFileManager defaultManager] fileExistsAtPath:path]) bundleInfo = [self _loadBundleInfoAtExistingPath:path]; } if (![self _preLoadBundle:_bundle info:bundleInfo]) goto done; if (debugOn) NSLog(@"NGBundleManager: will load bundle: %@", _bundle); if (![_bundle _loadForBundleManager:self]) goto done; if (debugOn) NSLog(@"NGBundleManager: did load bundle: %@", _bundle); if (![self _postLoadBundle:_bundle info:bundleInfo]) goto done; if ((bundleManager = [self _initializeLoadedBundle:_bundle info:bundleInfo])) { NSMapInsert(self->loadedBundles, _bundle, bundleManager); if ([bundleManager respondsToSelector: @selector(bundleManager:didLoadBundle:)]) [bundleManager bundleManager:self didLoadBundle:_bundle]; } #if 0 else { NSLog(@"ERROR(%s): couldn't initialize loaded bundle '%@'", __PRETTY_FUNCTION__, [_bundle bundlePath]); } #endif done: [self->loadingBundles removeObject:_bundle]; if (bundleManager) { if (bundleInfo == nil) bundleInfo = [NSDictionary dictionary]; [[NSNotificationCenter defaultCenter] postNotificationName: NGBundleWasLoadedNotificationName object:_bundle userInfo:[NSDictionary dictionaryWithObjectsAndKeys: self, @"NGBundleManager", bundleManager, @"NGBundleHandler", bundleInfo, @"NGBundleInfo", nil]]; } return bundleManager; } // manager - (id)principalObjectOfBundle:(NSBundle *)_bundle { return (id)NSMapGet(self->loadedBundles, _bundle); } // resources static BOOL _doesInfoMatch(NSArray *keys, NSDictionary *dict, NSDictionary *info) { int i, count; for (i = 0, count = [keys count]; i < count; i++) { NSString *key; id kv, vv; key = [keys objectAtIndex:i]; vv = [info objectForKey:key]; if (vv == nil) { /* info has no matching key */ return NO; } kv = [dict objectForKey:key]; if (![kv isEqual:vv]) return NO; } return YES; } - (NSDictionary *)configForResource:(id)_resource ofType:(NSString *)_type providedByBundle:(NSBundle *)_bundle { NSDictionary *bundleInfo = nil; NSString *infoPath; NSEnumerator *providedResources; NSArray *rnKeys = nil; id info; if ([_resource respondsToSelector:@selector(objectForKey:)]) { rnKeys = [_resource allKeys]; } infoPath = [self makeBundleInfoPath:[_bundle bundlePath]]; /* check whether info is in cache */ if ((bundleInfo = NSMapGet(self->pathToBundleInfo, infoPath)) == nil) { if (![[NSFileManager defaultManager] fileExistsAtPath:infoPath]) /* no bundle-info.plist available .. */ return nil; /* load info */ bundleInfo = [self _loadBundleInfoAtExistingPath:infoPath]; } /* get provided resources config */ providedResources = [[(NSDictionary *)[bundleInfo objectForKey:@"provides"] objectForKey:_type] objectEnumerator]; if (providedResources == nil) return nil; /* scan provided resources */ while ((info = [providedResources nextObject])) { if (rnKeys) { if (!_doesInfoMatch(rnKeys, _resource, info)) continue; } else { NSString *name; name = [[(NSDictionary *)info objectForKey:@"name"] stringValue]; if (name == nil) continue; if (![name isEqualToString:_resource]) continue; } return info; } return nil; } - (void)_processInfoForProvidedResources:(NSDictionary *)info ofType:(NSString *)_type path:(NSString *)path resourceName:(NSString *)_resourceName resourceSelector:(NGBundleResourceSelector)_selector context:(void *)_context andAddToResultArray:(NSMutableArray *)result { NSEnumerator *providedResources = nil; if (info == nil) return; /* direct match (a bundle was specified in the path) */ providedResources = [[(NSDictionary *)[info objectForKey:@"provides"] objectForKey:_type] objectEnumerator]; info = nil; if (providedResources == nil) return; /* scan provide array */ while ((info = [providedResources nextObject])) { NSString *name; if ((name = [[info objectForKey:@"name"] stringValue]) == nil) continue; if (_resourceName) { if (![name isEqualToString:_resourceName]) continue; } if (_selector) { if (!_selector(_resourceName, _type, path, info, self, _context)) continue; } [result addObject:path]; } } - (NSArray *)pathsForBundlesProvidingResource:(NSString *)_resourceName ofType:(NSString *)_type resourceSelector:(NGBundleResourceSelector)_selector context:(void *)_context { /* TODO: split up method */ NSMutableArray *result = nil; NSFileManager *fm; NSEnumerator *e; NSString *path; if (debugOn) { NSLog(@"BM LOOKUP pathes (%d bundles loaded): %@ / %@", NSCountMapTable(self->loadedBundles), _resourceName, _type); } fm = [NSFileManager defaultManager]; result = [NSMutableArray arrayWithCapacity:64]; // TODO: look in loaded bundles /* check physical pathes */ e = [self->bundleSearchPaths objectEnumerator]; while ((path = [e nextObject]) != nil) { NSEnumerator *dir; BOOL isDir = NO; NSString *tmp, *bundleDirPath; id info = nil; if (![fm fileExistsAtPath:path isDirectory:&isDir]) continue; if (!isDir) continue; /* check whether an appropriate bundle is contained in 'path' */ dir = [[fm directoryContentsAtPath:path] objectEnumerator]; while ((bundleDirPath = [dir nextObject]) != nil) { NSDictionary *bundleInfo = nil; NSEnumerator *providedResources = nil; NSString *infoPath; id info; bundleDirPath = [path stringByAppendingPathComponent:bundleDirPath]; infoPath = [self makeBundleInfoPath:bundleDirPath]; // TODO: can we use _doesBundleInfo:path:providedResource:... ? if ((bundleInfo = NSMapGet(self->pathToBundleInfo, infoPath))==nil) { if (![fm fileExistsAtPath:infoPath]) continue; bundleInfo = [self _loadBundleInfoAtExistingPath:infoPath]; } providedResources = [[(NSDictionary *)[bundleInfo objectForKey:@"provides"] objectForKey:_type] objectEnumerator]; if (providedResources == nil) continue; /* scan 'provides' array */ while ((info = [providedResources nextObject])) { NSString *name; name = [[(NSDictionary *)info objectForKey:@"name"] stringValue]; if (name == nil) continue; if (_resourceName != nil) { if (![name isEqualToString:_resourceName]) continue; } if (_selector != NULL) { if (!_selector(name, _type, bundleDirPath, info, self, _context)) continue; } [result addObject:bundleDirPath]; break; } } /* check for direct match (NGBundlePath element is a bundle) */ tmp = [self makeBundleInfoPath:path]; if ((info = NSMapGet(self->pathToBundleInfo, tmp)) == nil) { if ([fm fileExistsAtPath:tmp]) info = [self _loadBundleInfoAtExistingPath:tmp]; } [self _processInfoForProvidedResources:info ofType:_type path:path resourceName:_resourceName resourceSelector:_selector context:_context andAddToResultArray:result]; } if ([result count] == 0) { [self logWithFormat: @"Note(%s): method does not search in loaded bundles for " @"resources of type '%@'", __PRETTY_FUNCTION__, _type]; } return [[result copy] autorelease]; } - (BOOL)_doesBundleInfo:(NSDictionary *)_bundleInfo path:(NSString *)_path provideResource:(id)_resourceName ofType:(NSString *)_type rnKeys:(NSArray *)_rnKeys resourceSelector:(NGBundleResourceSelector)_selector context:(void *)_context { NSEnumerator *providedResources; NSDictionary *info; providedResources = [[(NSDictionary *)[_bundleInfo objectForKey:@"provides"] objectForKey:_type] objectEnumerator]; if (providedResources == nil) return NO; /* scan provide array */ while ((info = [providedResources nextObject])) { if (_rnKeys != nil) { if (!_doesInfoMatch(_rnKeys, _resourceName, info)) continue; } else { NSString *name; name = [[(NSDictionary *)info objectForKey:@"name"] stringValue]; if (name == nil) continue; if (![name isEqualToString:_resourceName]) continue; } if (_selector != NULL) { if (!_selector(_resourceName, _type, _path, info, self, _context)) continue; } /* all conditions applied (found) */ return YES; } return NO; } - (NSString *)pathOfLoadedBundleProvidingResource:(id)_resourceName ofType:(NSString *)_type resourceSelector:(NGBundleResourceSelector)_selector context:(void *)_context { NSMapEnumerator menum; NSString *path; NSDictionary *bundleInfo; NSArray *rnKeys; rnKeys = ([_resourceName respondsToSelector:@selector(objectForKey:)]) ? [_resourceName allKeys] : (NSArray *)nil; menum = NSEnumerateMapTable(self->pathToBundleInfo); while (NSNextMapEnumeratorPair(&menum, (void *)&path, (void *)&bundleInfo)) { if (debugOn) { NSLog(@"check loaded bundle for resource %@: %@", _resourceName, path); } if ([self _doesBundleInfo:bundleInfo path:path provideResource:_resourceName ofType:_type rnKeys:rnKeys resourceSelector:_selector context:_context]) /* strip bundle-info.plist name */ return [path stringByDeletingLastPathComponent]; } return nil; } - (NSString *)pathForBundleProvidingResource:(id)_resourceName ofType:(NSString *)_type resourceSelector:(NGBundleResourceSelector)_selector context:(void *)_context { /* main path lookup method */ // TODO: this method seriously needs some refactoring NSFileManager *fm; NSEnumerator *e; NSString *path; NSArray *rnKeys = nil; if (debugOn) { NSLog(@"BM LOOKUP path (%d bundles loaded): %@ / %@", NSCountMapTable(self->loadedBundles), _resourceName, _type); } /* look in loaded bundles */ path = [self pathOfLoadedBundleProvidingResource:_resourceName ofType:_type resourceSelector:_selector context:_context]; if (path != nil) return path; /* look in filesystem */ if ([_resourceName respondsToSelector:@selector(objectForKey:)]) { rnKeys = [_resourceName allKeys]; } fm = [NSFileManager defaultManager]; e = [self->bundleSearchPaths objectEnumerator]; while ((path = [e nextObject]) != nil) { NSEnumerator *dir; BOOL isDir = NO; NSString *tmp; id info = nil; if (![fm fileExistsAtPath:path isDirectory:&isDir]) continue; if (!isDir) continue; /* check whether an appropriate bundle is contained in 'path' */ dir = [[fm directoryContentsAtPath:path] objectEnumerator]; while ((tmp = [dir nextObject]) != nil) { NSDictionary *bundleInfo = nil; NSString *infoPath; tmp = [path stringByAppendingPathComponent:tmp]; infoPath = [self makeBundleInfoPath:tmp]; if (debugOn) NSLog(@"check path path=%@ info=%@", tmp, infoPath); if ((bundleInfo = NSMapGet(self->pathToBundleInfo, infoPath)) == nil) { if (![fm fileExistsAtPath:infoPath]) continue; bundleInfo = [self _loadBundleInfoAtExistingPath:infoPath]; } if (debugOn) NSLog(@"found info for path=%@ info=%@: %@", tmp,infoPath,bundleInfo); if ([self _doesBundleInfo:bundleInfo path:tmp provideResource:_resourceName ofType:_type rnKeys:rnKeys resourceSelector:_selector context:_context]) return tmp; } /* check for direct match */ tmp = [self makeBundleInfoPath:path]; if ((info = NSMapGet(self->pathToBundleInfo, tmp)) == nil) { if ([fm fileExistsAtPath:tmp]) info = [self _loadBundleInfoAtExistingPath:tmp]; else if (debugOn) { NSLog(@"WARNING(%s): did not find direct path '%@'", __PRETTY_FUNCTION__, tmp); } } if (info != nil) { // direct match (a bundle was specified in the path) NSEnumerator *providedResources; NSDictionary *provides; provides = [(NSDictionary *)info objectForKey:@"provides"]; providedResources = [[provides objectForKey:_type] objectEnumerator]; info = nil; if (providedResources == nil) continue; // scan provide array while ((info = [providedResources nextObject])) { if (rnKeys) { if (!_doesInfoMatch(rnKeys, _resourceName, info)) continue; } else { NSString *name; name = [[(NSDictionary *)info objectForKey:@"name"] stringValue]; if (name == nil) continue; if (![name isEqualToString:_resourceName]) continue; } if (_selector) { if (!_selector(_resourceName, _type, tmp, info, self, _context)) continue; } /* all conditions applied */ return tmp; } } } return nil; } - (NSBundle *)bundleProvidingResource:(id)_name ofType:(NSString *)_type { NSString *bp; if (debugOn) NSLog(@"BM LOOKUP: %@ / %@", _name, _type); bp = [self pathForBundleProvidingResource:_name ofType:_type resourceSelector:NULL context:nil]; if ([bp length] == 0) { #if (NeXT_Foundation_LIBRARY || APPLE_Foundation_LIBRARY) && HEAVY_DEBUG NSLog(@"%s: found no resource '%@' of type '%@' ...", __PRETTY_FUNCTION__, _resourceName, _resourceType); #endif if (debugOn) NSLog(@" did not find: %@ / %@", _name, _type); return nil; } if (debugOn) NSLog(@" FOUND: %@", bp); return [self bundleWithPath:bp]; } - (NSArray *)bundlesProvidingResource:(id)_resourceName ofType:(NSString *)_type { NSArray *paths; NSMutableArray *bundles; int i, count; paths = [self pathsForBundlesProvidingResource:_resourceName ofType:_type resourceSelector:NULL context:nil]; count = [paths count]; if (paths == nil) return nil; if (count == 0) return paths; bundles = [NSMutableArray arrayWithCapacity:count]; for (i = 0; i < count; i++) { NSBundle *bundle; if ((bundle = [self bundleWithPath:[paths objectAtIndex:i]])) [bundles addObject:bundle]; } return [[bundles copy] autorelease]; } - (NSArray *)providedResourcesOfType:(NSString *)_resourceType inBundle:(NSBundle *)_bundle { NSString *path; NSDictionary *bundleInfo; path = [self makeBundleInfoPath:[_bundle bundlePath]]; if (path == nil) return nil; /* retrieve bundle info dictionary */ if ((bundleInfo = NSMapGet(self->pathToBundleInfo, path)) == nil) bundleInfo = [self _loadBundleInfoAtExistingPath:path]; return [(NSDictionary *)[bundleInfo objectForKey:@"provides"] objectForKey:_resourceType]; } - (void)_addRegisteredProvidedResourcesOfType:(NSString *)_type toSet:(NSMutableSet *)_result { NSMapEnumerator menum; NSString *path; NSDictionary *bundleInfo; menum = NSEnumerateMapTable(self->pathToBundleInfo); while (NSNextMapEnumeratorPair(&menum, (void *)&path, (void *)&bundleInfo)) { NSArray *providedResources; if (debugOn) NSLog(@"check loaded bundle for resource types %@: %@", _type, path); providedResources = [(NSDictionary *)[bundleInfo objectForKey:@"provides"] objectForKey:_type]; if (providedResources == nil) continue; [_result addObjectsFromArray:providedResources]; } } - (NSArray *)providedResourcesOfType:(NSString *)_resourceType { NSMutableSet *result = nil; NSFileManager *fm = [NSFileManager defaultManager]; NSEnumerator *e; NSString *path; result = [NSMutableSet setWithCapacity:128]; /* scan loaded bundles */ [self _addRegisteredProvidedResourcesOfType:_resourceType toSet:result]; /* scan all bundle search paths */ e = [self->bundleSearchPaths objectEnumerator]; while ((path = [e nextObject]) != nil) { NSEnumerator *dir; BOOL isDir = NO; NSString *tmp; id info = nil; if (![fm fileExistsAtPath:path isDirectory:&isDir]) continue; if (!isDir) continue; /* check whether an appropriate bundle is contained in 'path' */ // TODO: move to own method dir = [[fm directoryContentsAtPath:path] objectEnumerator]; while ((tmp = [dir nextObject]) != nil) { NSDictionary *bundleInfo = nil; NSArray *providedResources = nil; NSString *infoPath; tmp = [path stringByAppendingPathComponent:tmp]; infoPath = [self makeBundleInfoPath:tmp]; #if 0 NSLog(@" info path: %@", tmp); #endif if ((bundleInfo = NSMapGet(self->pathToBundleInfo, infoPath)) == nil) { if (![fm fileExistsAtPath:infoPath]) continue; bundleInfo = [self _loadBundleInfoAtExistingPath:infoPath]; } providedResources = [(NSDictionary *)[bundleInfo objectForKey:@"provides"] objectForKey:_resourceType]; if (providedResources == nil) continue; [result addObjectsFromArray:providedResources]; } /* check for direct match */ tmp = [self makeBundleInfoPath:path]; if ((info = NSMapGet(self->pathToBundleInfo, tmp)) == nil) { if ([fm fileExistsAtPath:tmp]) info = [self _loadBundleInfoAtExistingPath:tmp]; } if (info != nil) { // direct match (a bundle was specified in the path) NSArray *providedResources; NSDictionary *provides; provides = [(NSDictionary *)info objectForKey:@"provides"]; providedResources = [provides objectForKey:_resourceType]; info = nil; if (providedResources == nil) continue; [result addObjectsFromArray:providedResources]; } } return [result allObjects]; } - (NSBundle *)bundleProvidingResourceOfType:(NSString *)_resourceType matchingQualifier:(EOQualifier *)_qual { NSFileManager *fm = [NSFileManager defaultManager]; NSEnumerator *e; NSString *path; /* foreach search path entry */ e = [self->bundleSearchPaths objectEnumerator]; while ((path = [e nextObject])) { BOOL isDir = NO; if ([fm fileExistsAtPath:path isDirectory:&isDir]) { NSString *tmp; id info = nil; if (!isDir) continue; /* check whether an appropriate bundle is contained in 'path' */ { NSEnumerator *dir; dir = [[fm directoryContentsAtPath:path] objectEnumerator]; while ((tmp = [dir nextObject])) { NSDictionary *bundleInfo; NSArray *providedResources; NSString *infoPath; tmp = [path stringByAppendingPathComponent:tmp]; infoPath = [self makeBundleInfoPath:tmp]; if ((bundleInfo=NSMapGet(self->pathToBundleInfo, infoPath)) == nil) { if (![fm fileExistsAtPath:infoPath]) continue; bundleInfo = [self _loadBundleInfoAtExistingPath:infoPath]; } bundleInfo = [bundleInfo objectForKey:@"provides"]; providedResources = [bundleInfo objectForKey:_resourceType]; bundleInfo = nil; if (providedResources == nil) continue; providedResources = [providedResources filteredArrayUsingQualifier:_qual]; if ([providedResources count] > 0) return [self bundleWithPath:tmp]; } } /* check for direct match */ tmp = [self makeBundleInfoPath:path]; if ((info = NSMapGet(self->pathToBundleInfo, tmp)) == nil) { if ([fm fileExistsAtPath:tmp]) info = [self _loadBundleInfoAtExistingPath:tmp]; } if (info) { // direct match (a bundle was specified in the path) NSArray *providedResources; NSDictionary *provides; provides = [(NSDictionary *)info objectForKey:@"provides"]; providedResources = [provides objectForKey:_resourceType]; info = nil; if (providedResources == nil) continue; providedResources = [providedResources filteredArrayUsingQualifier:_qual]; if ([providedResources count] > 0) return [self bundleWithPath:path]; } } } return nil; } - (NSBundle *)bundlesProvidingResourcesOfType:(NSString *)_resourceType matchingQualifier:(EOQualifier *)_qual { NSMutableArray *bundles = nil; NSFileManager *fm = [NSFileManager defaultManager]; NSEnumerator *e; NSString *path; bundles = [NSMutableArray arrayWithCapacity:128]; /* foreach search path entry */ e = [self->bundleSearchPaths objectEnumerator]; while ((path = [e nextObject])) { BOOL isDir = NO; if ([fm fileExistsAtPath:path isDirectory:&isDir]) { NSString *tmp; id info = nil; if (!isDir) continue; /* check whether an appropriate bundle is contained in 'path' */ { NSEnumerator *dir; dir = [[fm directoryContentsAtPath:path] objectEnumerator]; while ((tmp = [dir nextObject])) { NSDictionary *bundleInfo = nil; NSArray *providedResources = nil; NSString *infoPath; tmp = [path stringByAppendingPathComponent:tmp]; infoPath = [self makeBundleInfoPath:tmp]; if ((bundleInfo=NSMapGet(self->pathToBundleInfo, infoPath)) == nil) { if (![fm fileExistsAtPath:infoPath]) continue; bundleInfo = [self _loadBundleInfoAtExistingPath:infoPath]; } bundleInfo = [bundleInfo objectForKey:@"provides"]; providedResources = [bundleInfo objectForKey:_resourceType]; bundleInfo = nil; if (providedResources == nil) continue; providedResources = [providedResources filteredArrayUsingQualifier:_qual]; if ([providedResources count] > 0) [bundles addObject:[self bundleWithPath:tmp]]; } } /* check for direct match */ tmp = [self makeBundleInfoPath:path]; if ((info = NSMapGet(self->pathToBundleInfo, tmp)) == nil) { if ([fm fileExistsAtPath:tmp]) info = [self _loadBundleInfoAtExistingPath:tmp]; } if (info) { // direct match (a bundle was specified in the path) NSArray *providedResources; NSDictionary *provides; provides = [(NSDictionary *)info objectForKey:@"provides"]; providedResources = [provides objectForKey:_resourceType]; info = nil; if (providedResources == nil) continue; providedResources = [providedResources filteredArrayUsingQualifier:_qual]; if ([providedResources count] > 0) [bundles addObject:[self bundleWithPath:path]]; } } } return [[bundles copy] autorelease]; } /* notifications */ - (void)_bundleDidLoadNotifcation:(NSNotification *)_notification { NSDictionary *ui = [_notification userInfo]; #if 0 NSLog(@"bundle %@ did load with classes %@", [[_notification object] bundlePath], [ui objectForKey:@"NSLoadedClasses"]); #endif [self registerBundle:[_notification object] classes:[ui objectForKey:@"NSLoadedClasses"] categories:[ui objectForKey:@"NSLoadedCategories"]]; } /* debugging */ - (BOOL)isDebuggingEnabled { return debugOn; } @end /* NGBundleManager */ @implementation NSBundle(BundleManagerSupport) + (id)alloc { return [NGBundle alloc]; } + (id)allocWithZone:(NSZone *)zone { return [NGBundle allocWithZone:zone]; } #if !(NeXT_Foundation_LIBRARY || APPLE_Foundation_LIBRARY) //#warning remember, bundleForClass is not overridden ! #if 0 + (NSBundle *)bundleForClass:(Class)aClass { return [[NGBundleManager defaultBundleManager] bundleForClass:aClass]; } #endif + (NSBundle *)bundleWithPath:(NSString*)path { return [[NGBundleManager defaultBundleManager] bundleWithPath:path]; } #endif @end /* NSBundle(BundleManagerSupport) */ @implementation NSBundle(NGBundleManagerExtensions) - (id)principalObject { return [[NGBundleManager defaultBundleManager] principalObjectOfBundle:self]; } - (NSArray *)providedResourcesOfType:(NSString *)_resourceType { return [[NGBundleManager defaultBundleManager] providedResourcesOfType:_resourceType inBundle:self]; } - (NSString *)bundleName { return [[[self bundlePath] lastPathComponent] stringByDeletingPathExtension]; } - (NSString *)bundleType { return [[self bundlePath] pathExtension]; } - (NSArray *)providedClasses { return [[NGBundleManager defaultBundleManager] classesProvidedByBundle:self]; } - (NSArray *)requiredClasses { return [[NGBundleManager defaultBundleManager] classesRequiredByBundle:self]; } - (NSArray *)requiredBundles { return [[NGBundleManager defaultBundleManager] bundlesRequiredByBundle:self]; } - (NSDictionary *)configForResource:(id)_resource ofType:(NSString *)_type { return [[NGBundleManager defaultBundleManager] configForResource:_resource ofType:_type providedByBundle:self]; } /* loading */ - (BOOL)_loadForBundleManager:(NGBundleManager *)_manager { return [self load]; } @end /* NSBundle(NGBundleManagerExtensions) */ @implementation NSBundle(NGLanguageResourceExtensions) static BOOL debugLanguageLookup = NO; // locating resources - (NSString *)pathForResource:(NSString *)_name ofType:(NSString *)_ext inDirectory:(NSString *)_directory languages:(NSArray *)_languages { NSFileManager *fm; NSString *path = nil; int i, langCount; id (*objAtIdx)(id,SEL,int); if (debugLanguageLookup) { NSLog(@"LOOKUP(%s): %@ | %@ | %@ | %@", __PRETTY_FUNCTION__, _name, _ext, _directory, [_languages componentsJoinedByString:@","]); } path = [self bundlePath]; if ([_directory isNotNull]) { // TODO: should we change that? path = [path stringByAppendingPathComponent:_directory]; } else { #if (NeXT_Foundation_LIBRARY || APPLE_Foundation_LIBRARY) path = [path stringByAppendingPathComponent:@"Contents"]; #endif path = [path stringByAppendingPathComponent:@"Resources"]; } if (debugLanguageLookup) NSLog(@" BASE: %@", path); fm = [NSFileManager defaultManager]; if (![fm fileExistsAtPath:path]) return nil; if (_ext != nil) _name = [_name stringByAppendingPathExtension:_ext]; langCount = [_languages count]; objAtIdx = (langCount > 0) ? (void*)[_languages methodForSelector:@selector(objectAtIndex:)] : NULL; for (i = 0; i < langCount; i++) { NSString *language; NSString *lpath; language = objAtIdx ? objAtIdx(_languages, @selector(objectAtIndex:), i) : [_languages objectAtIndex:i]; language = [language stringByAppendingPathExtension:@"lproj"]; lpath = [path stringByAppendingPathComponent:language]; lpath = [lpath stringByAppendingPathComponent:_name]; if ([fm fileExistsAtPath:lpath]) return lpath; } if (debugLanguageLookup) NSLog(@" no language matched, check base: %@", path); /* now look into x.bundle/Resources/name.type */ if ([fm fileExistsAtPath:[path stringByAppendingPathComponent:_name]]) return [path stringByAppendingPathComponent:_name]; return nil; } - (NSString *)pathForResource:(NSString *)_name ofType:(NSString *)_ext languages:(NSArray *)_languages { NSString *path; path = [self pathForResource:_name ofType:_ext inDirectory:@"Resources" languages:_languages]; if (path) return path; path = [self pathForResource:_name ofType:_ext inDirectory:nil languages:_languages]; return path; } @end /* NSBundle(NGLanguageResourceExtensions) */ @implementation NGBundle + (id)alloc { return [self allocWithZone:NULL]; } + (id)allocWithZone:(NSZone*)zone { return NSAllocateObject(self, 0, zone); } - (id)initWithPath:(NSString *)__path { return [super initWithPath:__path]; } /* loading */ - (BOOL)_loadForBundleManager:(NGBundleManager *)_manager { return [super load]; } - (BOOL)load { NGBundleManager *bm; bm = [NGBundleManager defaultBundleManager]; return [bm loadBundle:self] ? YES : NO; } + (NSBundle *)bundleForClass:(Class)aClass { return [[NGBundleManager defaultBundleManager] bundleForClass:aClass]; } + (NSBundle *)bundleWithPath:(NSString*)path { return [[NGBundleManager defaultBundleManager] bundleWithPath:path]; } #if GNUSTEP_BASE_LIBRARY - (Class)principalClass { Class c; NSString *cname; if ((c = [super principalClass]) != Nil) return c; if ((cname = [[self infoDictionary] objectForKey:@"NSPrincipalClass"]) ==nil) return Nil; if ((c = NSClassFromString(cname)) != Nil) return c; NSLog(@"%s: did not find principal class named '%@' of bundle %@, dict: %@", __PRETTY_FUNCTION__, cname, self, [self infoDictionary]); return Nil; } /* description */ - (NSString *)description { char buffer[1024]; sprintf (buffer, "<%s %p fullPath: %s infoDictionary: %p loaded=%s>", #if (defined(__GNU_LIBOBJC__) && (__GNU_LIBOBJC__ >= 20100911)) || defined(APPLE_RUNTIME) || defined(__GNUSTEP_RUNTIME__) (char*)class_getName([self class]), #else (char*)object_get_class_name(self), #endif self, [[self bundlePath] cString], [self infoDictionary], self->_codeLoaded ? "yes" : "no"); return [NSString stringWithCString:buffer]; } #endif @end /* NGBundle */ SOPE/sope-core/NGExtensions/NGFileFolderInfoDataSource.m0000644000000000000000000001004512242733417022014 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #import #import #import #include "common.h" NGExtensions_DECLARE NSString *NSFileName = @"NSFileName"; NGExtensions_DECLARE NSString *NSFilePath = @"NSFilePath"; NGExtensions_DECLARE NSString *NSParentPath = @"NSParentPath"; NGExtensions_DECLARE NSString *NSTraverseLinks = @"NSTraverseLinks"; @implementation NGFileFolderInfoDataSource - (id)initWithFolderPath:(NSString *)_path { if ((self = [self init])) { self->folderPath = [_path copy]; } return self; } - (void)dealloc { [self->fspec release]; [self->folderPath release]; [super dealloc]; } /* accessors */ - (void)setFetchSpecification:(EOFetchSpecification *)_fspec { ASSIGN(self->fspec, _fspec); } - (EOFetchSpecification *)fetchSpecification { return self->fspec; } /* operations */ - (NSArray *)_attributesForPaths:(NSEnumerator *)_paths filterUsingQualifier:(EOQualifier *)_q fileManager:(NSFileManager *)_fm { NSMutableArray *ma; NSMutableDictionary *workArea; NSArray *result; NSString *path; BOOL tlinks; ma = [NSMutableArray arrayWithCapacity:256]; workArea = [NSMutableDictionary dictionaryWithCapacity:32]; tlinks = [[[self->fspec hints] objectForKey:@"NSTraverseLinks"] boolValue]; while ((path = [_paths nextObject])) { NSDictionary *record; NSString *fullPath; fullPath = [self->folderPath stringByAppendingPathComponent:path]; [workArea setDictionary: [_fm fileAttributesAtPath:fullPath traverseLink:tlinks]]; [workArea setObject:path forKey:@"NSFileName"]; [workArea setObject:fullPath forKey:@"NSFilePath"]; [workArea setObject:self->folderPath forKey:@"NSParentPath"]; record = [[workArea copy] autorelease]; if (_q) { if (![(id)_q evaluateWithObject:record]) /* filter out */ continue; } /* add to result set */ [ma addObject:record]; } result = [[ma copy] autorelease]; return result; } - (NSArray *)_fetchObjectsFromFileManager:(NSFileManager *)_fm { NSAutoreleasePool *pool; BOOL isDir; NSArray *array; NSArray *sortOrderings; if (![_fm fileExistsAtPath:self->folderPath isDirectory:&isDir]) /* path does not exist */ return nil; if (!isDir) /* path is not a directory */ return nil; pool = [[NSAutoreleasePool alloc] init]; array = [_fm directoryContentsAtPath:self->folderPath]; if ([array count] == 0) { /* no directory contents */ array = [array retain]; [pool release]; return [array autorelease]; } array = [self _attributesForPaths:[array objectEnumerator] filterUsingQualifier:[self->fspec qualifier] fileManager:_fm]; if ((sortOrderings = [self->fspec sortOrderings])) /* sort set */ array = [array sortedArrayUsingKeyOrderArray:sortOrderings]; array = [array retain]; [pool release]; return [array autorelease]; } - (NSArray *)fetchObjects { NSFileManager *fm; fm = [NSFileManager defaultManager]; return [self _fetchObjectsFromFileManager:fm]; } @end /* NGFileInfoDataSource */ SOPE/sope-core/NGExtensions/EOExt.subproj/0000755000000000000000000000000012242733417017256 5ustar rootrootSOPE/sope-core/NGExtensions/EOExt.subproj/EOQualifierGrouping.m0000644000000000000000000000366212242733417023323 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "EOGrouping.h" #import #include "common.h" @implementation EOQualifierGrouping - (id)initWithQualifier:(EOQualifier *)_qualifier name:(NSString *)_name { if ((self = [super initWithDefaultName:nil])) { self->name = [_name copy]; self->qualifier = [_qualifier retain]; } return self; } - (void)dealloc { [self->qualifier release]; [self->name release]; [super dealloc]; } /* accessors */ - (void)setName:(NSString *)_name { NSAssert1(_name != nil, @"%s: name is nil", __PRETTY_FUNCTION__); ASSIGNCOPY(self->name, _name); } - (NSString *)name { return self->name; } - (void)setQualifier:(EOQualifier *)_qualifier { ASSIGN(self->qualifier, _qualifier); } - (EOQualifier *)qualifier { return self->qualifier; } /* operations */ - (NSString *)groupNameForObject:(id)_object { if (self->qualifier == nil) return self->name; if ([(id)self->qualifier evaluateWithObject:_object]) return self->name; return self->defaultName; } - (NSArray *)orderedGroupNames { return [NSArray arrayWithObjects:[self name], [self defaultName], nil]; } @end /* EOQualifierGrouping */ SOPE/sope-core/NGExtensions/EOExt.subproj/EOGlobalID+Ext.m0000644000000000000000000000215012242733417022027 0ustar rootroot/* Copyright (C) 2008 Helge Hess This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import #import #import @implementation EOGlobalID(SOPEExt) #if !LIB_FOUNDATION_LIBRARY - (id)valueForUndefinedKey:(NSString *)_key { NSLog(@"WARNING: tried to access undefined KVC key '%@' on GID object: %@", _key, self); return nil; } #endif @end /* EOGlobalID(SOPEExt) */ SOPE/sope-core/NGExtensions/EOExt.subproj/EOSortOrdering+plist.m0000644000000000000000000000677412242733417023446 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include "common.h" @implementation EOSortOrdering(plist) /*" Initialize a sort-ordering with information contained in the dictionary. The following keys are recognized: "key" is required and specifies the key to be sorted on, "selector" is optional and specifies the sort selector as a string. The default for "selector" is EOCompareAscending and the following "special" values are recognized: "compareAscending", "compareDescending", "compareCaseInsensitiveAscending", "compareCaseInsensitiveDescending". "*/ - (id)initWithDictionary:(NSDictionary *)_dict { NSString *k = nil; SEL sel = EOCompareAscending; NSString *tmp; if (_dict == nil) { [self release]; return nil; } k = [_dict objectForKey:@"key"]; if ([k length] == 0) { NSLog(@"%s: invalid key %@ (dict=%@)", __PRETTY_FUNCTION__, k, _dict); [self release]; return nil; } if ((tmp = [[_dict objectForKey:@"selector"] stringValue])) { if ([tmp isEqualToString:@"compareAscending"]) sel = EOCompareAscending; else if ([tmp isEqualToString:@"compareDescending"]) sel = EOCompareDescending; else if ([tmp isEqualToString:@"compareCaseInsensitiveAscending"]) sel = EOCompareCaseInsensitiveAscending; else if ([tmp isEqualToString:@"compareCaseInsensitiveDescending"]) sel = EOCompareCaseInsensitiveDescending; else sel = NSSelectorFromString(tmp); } return [self initWithKey:k selector:sel]; } /*" Initialize/parse a sort-ordering from a string. Usually the string is taken as the key of the ordering and the sorting EOCompareAscending. This can be modified by adding ".reverse" to the key, eg "name.reverse" sorts on the "name" key using EOCompareDescending. "*/ - (id)initWithString:(NSString *)_string { SEL sel; NSString *k; NSRange r; if ([_string length] == 0) { [self release]; return nil; } r = [_string rangeOfString:@".reverse"]; if (r.length == 0) { k = _string; sel = EOCompareAscending; } else { k = [_string substringToIndex:r.location]; sel = EOCompareDescending; } return [self initWithKey:k selector:sel]; } - (id)initWithPropertyList:(id)_plist owner:(id)_owner { if (_plist == nil) { [self release]; return nil; } if ([_plist isKindOfClass:[NSDictionary class]]) return [self initWithDictionary:_plist]; if ([_plist isKindOfClass:[NSString class]]) return [self initWithString:_plist]; if ([_plist isKindOfClass:[self class]]) { [self release]; return [_plist copy]; } [self release]; return nil; } - (id)initWithPropertyList:(id)_plist { return [self initWithPropertyList:_plist owner:nil]; } @end /* EOSortOrdering(plist) */ SOPE/sope-core/NGExtensions/EOExt.subproj/GNUmakefile0000644000000000000000000000134512242733417021333 0ustar rootroot# GNUstep makefile include ../../../config.make include ../../common.make SUBPROJECT_NAME = EOExt EOExt_PCH_FILE = common.h EOExt_OBJC_FILES = \ EOCacheDataSource.m \ EOCompoundDataSource.m \ EODataSource+NGExtensions.m \ EOFetchSpecification+plist.m \ EOFilterDataSource.m \ EOGrouping.m \ EOGroupingSet.m \ EOKeyGrouping.m \ EOKeyMapDataSource.m \ EOQualifier+CtxEval.m \ EOQualifier+plist.m \ EOQualifierGrouping.m \ EOSortOrdering+plist.m \ EOTrueQualifier.m \ NSArray+EOGrouping.m \ EOGlobalID+Ext.m \ ADDITIONAL_INCLUDE_DIRS += -I. -I.. -I../NGExtensions/ \ -I../FdExt.subproj/ \ -I../.. -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/subproject.make -include GNUmakefile.postamble SOPE/sope-core/NGExtensions/EOExt.subproj/EOFilterDataSource.m0000644000000000000000000001400712242733417023062 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "EOFilterDataSource.h" #include "EODataSource+NGExtensions.h" #include "EOGrouping.h" #import #include "common.h" @interface NSDictionary(EOFilterDataSource) - (NSArray *)flattenedArrayWithHint:(unsigned int)_hint andKeys:(NSArray *)_keys; @end @implementation EOFilterDataSource - (id)initWithDataSource:(EODataSource *)_ds { if ((self = [super init])) { [self setSource:_ds]; } return self; } - (id)init { return [self initWithDataSource:nil]; } - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; [self->sortOrderings release]; [self->groupings release]; [self->auxiliaryQualifier release]; [self->source release]; [super dealloc]; } /* accessors */ - (void)setSource:(EODataSource *)_source { NSNotificationCenter *nc; if (self->source == _source) return; nc = [NSNotificationCenter defaultCenter]; if (self->source) { [nc removeObserver:self name:EODataSourceDidChangeNotification object:self->source]; } ASSIGN(self->source, _source); if (self->source) { [nc addObserver:self selector:@selector(_sourceDidChange:) name:EODataSourceDidChangeNotification object:self->source]; } [self postDataSourceChangedNotification]; } - (EODataSource *)source { return self->source; } - (void)setAuxiliaryQualifier:(EOQualifier *)_q { if ([_q isEqual:self->auxiliaryQualifier]) return; ASSIGN(self->auxiliaryQualifier, _q); [self postDataSourceChangedNotification]; } - (EOQualifier *)auxiliaryQualifier { return self->auxiliaryQualifier; } - (void)setSortOrderings:(NSArray *)_so { if (self->sortOrderings == _so) return; _so = [_so shallowCopy]; [self->sortOrderings release]; self->sortOrderings = _so; [self postDataSourceChangedNotification]; } - (NSArray *)sortOrderings { return self->sortOrderings; } - (void)setGroupings:(NSArray *)_groupings { if (self->groupings == _groupings) return; _groupings = [_groupings shallowCopy]; [self->groupings release]; self->groupings = _groupings; [self postDataSourceChangedNotification]; } - (NSArray *)groupings { return self->groupings; } - (void)setFetchSpecification:(EOFetchSpecification *)_fspec { [[self source] setFetchSpecification:_fspec]; } - (EOFetchSpecification *)fetchSpecification { return [[self source] fetchSpecification]; } /* notifications */ - (void)_sourceDidChange:(NSNotification *)_notification { [self postDataSourceChangedNotification]; } /* operations */ - (NSArray *)fetchObjects { NSAutoreleasePool *pool; NSArray *objs; NSArray *groups; pool = [[NSAutoreleasePool alloc] init]; objs = [[self source] fetchObjects]; if ([self auxiliaryQualifier] != nil) objs = [objs filteredArrayUsingQualifier:[self auxiliaryQualifier]]; if ((groups = [self groupings]) != nil) { unsigned int cnt; EOGrouping *grouping; NSArray *allKeys; NSArray *sos; NSDictionary *groupDict; cnt = [objs count]; grouping = [groups lastObject]; if ((sos = [self sortOrderings]) != nil) [grouping setSortOrderings:sos]; groupDict = [objs arrayGroupedBy:grouping]; allKeys = [groupDict allKeys]; allKeys = [allKeys sortedArrayUsingSelector:@selector(compare:)]; objs = [groupDict flattenedArrayWithHint:cnt andKeys:allKeys]; } else if ([self sortOrderings] != nil) objs = [objs sortedArrayUsingKeyOrderArray:[self sortOrderings]]; objs = [objs copy]; [pool release]; return [objs autorelease]; } - (void)insertObject:(id)_obj { [[self source] insertObject:_obj]; } - (void)deleteObject:(id)_obj { [[self source] deleteObject:_obj]; } - (void)updateObject:(id)_obj { [self->source updateObject:_obj]; } - (id)createObject { return [[self source] createObject]; } - (EOClassDescription *)classDescriptionForObjects { return [[self source] classDescriptionForObjects]; } /* description */ - (NSString *)description { NSMutableString *ms; ms = [NSMutableString stringWithCapacity:64]; [ms appendFormat:@"<0x%p[%@]:", self, NSStringFromClass([self class])]; if (self->source != nil) [ms appendFormat:@" source=%@", self->source]; if (self->auxiliaryQualifier != nil) [ms appendFormat:@" qualifier=%@", self->auxiliaryQualifier]; if (self->sortOrderings != nil) [ms appendFormat:@" orderings=%@", self->sortOrderings]; if (self->groupings != nil) [ms appendFormat:@" groupings=%@", self->groupings]; [ms appendString:@">"]; return ms; } @end /* EOFilterDataSource */ @implementation NSDictionary(EOFilterDataSource) - (NSArray *)flattenedArrayWithHint:(unsigned int)_hint andKeys:(NSArray *)_keys { /* This works on a dictionary of arrays. It walks over the keys in the given order and flattenes the value arrays into one array. */ NSMutableArray *result = nil; unsigned int i, cnt; result = [[NSMutableArray alloc] initWithCapacity:_hint]; // should be improved for (i = 0, cnt = [_keys count]; i < cnt; i++) { NSString *key; NSArray *tmp; key = [_keys objectAtIndex:i]; tmp = [self objectForKey:key]; [result addObjectsFromArray:tmp]; } return [result autorelease]; } @end /* NSDictionary(EOFilterDataSource) */ SOPE/sope-core/NGExtensions/EOExt.subproj/EOTrueQualifier.m0000644000000000000000000000242412242733417022443 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "EOTrueQualifier.h" #include "common.h" @implementation EOTrueQualifier static EOTrueQualifier *tq = nil; - (id)init { if (tq == nil) { tq = [[super init] retain]; return tq; } else { [self release]; return [tq retain]; } } - (BOOL)evaluateWithObject:(id)_object { /* we always evaluate to "true" ... */ return YES; } /* description */ - (NSString *)stringValue { return @"*true*"; } - (NSString *)description { return [self stringValue]; } @end /* EOTrueQualifier */ SOPE/sope-core/NGExtensions/EOExt.subproj/EOKeyMapDataSource.m0000644000000000000000000002522112242733417023023 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "EOKeyMapDataSource.h" #include "NSArray+enumerator.h" #include "EODataSource+NGExtensions.h" #include "NSNull+misc.h" #import #include "common.h" #include @interface EOKeyMapDataSource(Private) - (void)_registerForSource:(id)_source; - (void)_removeObserverForSource:(id)_source; - (void)_sourceChanged; @end @implementation EOKeyMapDataSource - (id)initWithDataSource:(EODataSource *)_ds map:(id)_map { if ((self = [super init])) { self->source = [_ds retain]; self->map = [_map retain]; [self _registerForSource:self->source]; } return self; } - (id)initWithDataSource:(EODataSource *)_ds { return [self initWithDataSource:_ds map:nil]; } - (id)init { return [self initWithDataSource:nil map:nil]; } - (void)dealloc { [self _removeObserverForSource:self->source]; [self->classDescription release]; [self->entityKeys release]; [self->mappedKeys release]; [self->map release]; [self->fspec release]; [self->source release]; [super dealloc]; } /* mapping */ - (EOFetchSpecification *)mapFetchSpecification:(EOFetchSpecification *)_fs { return [_fs fetchSpecificationByApplyingKeyMap:self->map]; } - (id)mapFromSourceObject:(id)_object { id values; if (_object == nil) return nil; if (self->mappedKeys == nil) { /* no need to rewrite keys, only taking a subset */ values = [_object valuesForKeys:self->entityKeys]; } else { unsigned i, count; count = [self->entityKeys count]; values = [NSMutableDictionary dictionaryWithCapacity:count]; for (i = 0; i < count; i++) { NSString *key, *newKey; id value; key = [self->mappedKeys objectAtIndex:i]; newKey = [self->entityKeys objectAtIndex:i]; value = [_object valueForKey:key]; if (value) [(NSMutableDictionary *)values setObject:value forKey:newKey]; } } return [[[EOMappedObject alloc] initWithObject:_object values:values] autorelease]; } - (id)mapToSourceObject:(id)_object { // TODO if (_object == nil) return nil; if ([_object isKindOfClass:[EOMappedObject class]]) { id obj; if ((obj = [_object mappedObject]) == nil) { NSLog(@"don't know how to back-map objects: %@", _object); return nil; } if ([obj isModified]) { if (self->map) { NSLog(@"%s: don't know how to back-map modified object: %@", _object); #if NeXT_Foundation_LIBRARY [self doesNotRecognizeSelector:_cmd]; return nil; // keep compiler happy #else return [self notImplemented:_cmd]; #endif } [obj applyChangesOnObject]; } return obj; } else { NSLog(@"don't know how to back-map objects of class %@", [_object class]); #if NeXT_Foundation_LIBRARY [self doesNotRecognizeSelector:_cmd]; #else return [self notImplemented:_cmd]; #endif } return nil; // keep compiler happy } - (id)mapCreatedObject:(id)_object { return [self mapFromSourceObject:_object]; } - (id)mapObjectForUpdate:(id)_object { return [self mapToSourceObject:_object]; } - (id)mapObjectForInsert:(id)_object { return [self mapToSourceObject:_object]; } - (id)mapObjectForDelete:(id)_object { return [self mapToSourceObject:_object]; } - (id)mapFetchedObject:(id)_object { return [self mapFromSourceObject:_object]; } - (void)setClassDescriptionForObjects:(NSClassDescription *)_cd { ASSIGN(self->classDescription, _cd); /* setup array of keys to map */ [self->entityKeys release]; self->entityKeys = nil; [self->mappedKeys release]; self->mappedKeys = nil; if (_cd != nil) { NSMutableArray *ma; NSArray *tmp; unsigned i, count; ma = [[NSMutableArray alloc] initWithCapacity:16]; /* first, collect keys we need */ if ((tmp = [_cd attributeKeys]) != nil) [ma addObjectsFromArray:tmp]; if ((tmp = [_cd toOneRelationshipKeys]) != nil) [ma addObjectsFromArray:tmp]; if ((tmp = [_cd toManyRelationshipKeys]) != nil) [ma addObjectsFromArray:tmp]; self->entityKeys = [ma copy]; /* next, map those keys to the source-schema */ if (self->map != nil) { [ma removeAllObjects]; for (i = 0, count = [entityKeys count]; i < count; i++) { NSString *mappedKey, *key; key = [entityKeys objectAtIndex:i]; mappedKey = [self->map valueForKey:key]; [ma addObject:mappedKey ? mappedKey : key]; } self->mappedKeys = [ma copy]; } [ma release]; } } - (NSClassDescription *)classDescriptionForObjects { return self->classDescription; } /* accessors */ - (void)setSource:(EODataSource *)_source { NSAssert(self->fspec == nil, @"only allowed as long as no spec is set !"); [self _removeObserverForSource:self->source]; ASSIGN(self->source, _source); [self _registerForSource:self->source]; [self postDataSourceChangedNotification]; } - (EODataSource *)source { return self->source; } - (void)setFetchSpecification:(EOFetchSpecification *)_fetchSpec { EOFetchSpecification *mappedSpec; if ([_fetchSpec isEqual:self->fspec]) return; /* This saves the spec in the datasource and saves a mapped spec in the source datasource. */ ASSIGN(self->fspec, _fetchSpec); mappedSpec = [self mapFetchSpecification:self->fspec]; [self->source setFetchSpecification:mappedSpec]; [self postDataSourceChangedNotification]; } - (EOFetchSpecification *)fetchSpecification { return self->fspec; } - (NSException *)lastException { if ([self->source respondsToSelector:@selector(lastException)]) return [(id)self->source lastException]; return nil; } /* fetch operations */ - (Class)fetchEnumeratorClass { return [EOKeyMapDataSourceEnumerator class]; } - (NSEnumerator *)fetchEnumerator { NSEnumerator *e; if ((e = [self->source fetchEnumerator]) == nil) return nil; e = [[[self fetchEnumeratorClass] alloc] initWithKeyMapDataSource:self fetchEnumerator:e]; return [e autorelease]; } - (NSArray *)fetchObjects { NSAutoreleasePool *pool; NSArray *a; pool = [[NSArray alloc] init]; a = [[NSArray alloc] initWithObjectsFromEnumerator:[self fetchEnumerator]]; [pool release]; return [a autorelease]; } /* modifications */ - (void)insertObject:(id)_obj { [self->source insertObject:[self mapObjectForInsert:_obj]]; } - (void)deleteObject:(id)_obj { [self->source deleteObject:[self mapObjectForDelete:_obj]]; } - (id)createObject { return [self mapCreatedObject:[self->source createObject]]; } - (void)updateObject:(id)_obj { [self->source updateObject:[self mapObjectForUpdate:_obj]]; } - (void)clear { if ([self->source respondsToSelector:@selector(clear)]) [(id)self->source clear]; } /* description */ - (NSString *)description { NSString *fmt; fmt = [NSString stringWithFormat:@"<%@[0x%p]: source=%@ map=%@>", NSStringFromClass([self class]), self, self->source, self->map]; return fmt; } /* private */ - (void)_registerForSource:(id)_source { static NSNotificationCenter *nc = nil; if (_source != nil) { if (nc == nil) nc = [[NSNotificationCenter defaultCenter] retain]; [nc addObserver:self selector:@selector(_sourceChanged) name:EODataSourceDidChangeNotification object:_source]; } } - (void)_removeObserverForSource:(id)_source { static NSNotificationCenter *nc = nil; if (_source != nil) { if (nc == nil) nc = [NSNotificationCenter defaultCenter]; [nc removeObserver:self name:EODataSourceDidChangeNotification object:_source]; } } - (void)_sourceChanged { [self postDataSourceChangedNotification]; } @end /* EOKeyMapDataSource */ @implementation EOKeyMapDataSourceEnumerator - (id)initWithKeyMapDataSource:(EOKeyMapDataSource *)_ds fetchEnumerator:(NSEnumerator *)_enum { if ((self = [super init])) { self->ds = [_ds retain]; self->source = [_enum retain]; } return self; } - (void)dealloc { [self->ds release]; [self->source release]; [super dealloc]; } /* fetching */ - (void)fetchDone { } - (id)nextObject { id object; if ((object = [self->source nextObject]) == nil) { [self fetchDone]; return nil; } return [self->ds mapFetchedObject:object]; } @end /* EOKeyMapDataSourceEnumerator */ @implementation EOMappedObject - (id)initWithObject:(id)_object values:(NSDictionary *)_values { if ((self = [super init])) { self->original = [_object retain]; self->values = [_values mutableCopy]; } return self; } - (void)dealloc { [self->original release]; [self->globalID release]; [self->values release]; [super dealloc]; } /* accessors */ - (id)mappedObject { return self->original; } - (EOGlobalID *)globalID { if (self->globalID == nil) { if ([self->original respondsToSelector:@selector(globalID)]) self->globalID = [[self->original globalID] retain]; } return self->globalID; } - (BOOL)isModified { return self->flags.didChange ? YES : NO; } - (void)willChange { self->flags.didChange = 1; } - (void)applyChangesOnObject { if (!self->flags.didChange) [self->original takeValuesFromDictionary:self->values]; } /* mimic dictionary */ - (void)setObject:(id)_obj forKey:(id)_key { [self willChange]; [self->values setObject:_obj forKey:_key]; } - (id)objectForKey:(id)_key { return [self->values objectForKey:_key]; } - (void)removeObjectForKey:(id)_key { [self willChange]; [self->values removeObjectForKey:_key]; } - (NSEnumerator *)keyEnumerator { return [self->values keyEnumerator]; } - (NSEnumerator *)objectEnumerator { return [self->values objectEnumerator]; } - (NSDictionary *)asDictionary { return self->values; } /* KVC */ - (void)takeValue:(id)_value forKey:(NSString *)_key { [self willChange]; if ([_value isNotNull]) [self->values setObject:_value forKey:_key]; else [self->values removeObjectForKey:_key]; } - (id)valueForKey:(NSString *)_key { return [self->values objectForKey:_key]; } @end /* EOMappedObject */ SOPE/sope-core/NGExtensions/EOExt.subproj/EOKeyGrouping.m0000644000000000000000000000370312242733417022126 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "EOGrouping.h" #include "common.h" @implementation EOKeyGrouping - (id)initWithKey:(NSString *)_key { if ((self = [super initWithDefaultName:nil]) != nil) { self->key = [_key copy]; // TODO: create on-demand? self->groupNames = [[NSMutableArray alloc] initWithCapacity:32]; } return self; } - (void)dealloc { [self->key release]; [self->groupNames release]; [super dealloc]; } /* accessors */ - (void)setKey:(NSString *)_key { NSAssert1(_key != nil, @"%s: nil _key parameter", __PRETTY_FUNCTION__); ASSIGNCOPY(self->key, _key); } - (NSString *)key { return self->key; } /* operations */ - (NSString *)groupNameForObject:(id)_object { NSString *result = nil; if ([self->key length] == 0) return @""; result = [[_object valueForKey:self->key] stringValue]; result = (result != nil) ? result : self->defaultName; if (result == nil) return nil; if (![self->groupNames containsObject:result]) [self->groupNames addObject:result]; return result; } - (NSArray *)orderedGroupNames { if ([self->key length] == 0) return [NSArray arrayWithObject:@""]; return self->groupNames; } @end /* EOKeyGrouping */ SOPE/sope-core/NGExtensions/EOExt.subproj/EOGroupingSet.m0000644000000000000000000000432112242733417022126 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "EOGrouping.h" #include "common.h" @interface EOGroupingSet(PrivateMethodes) - (void)_updateDefaultNames; @end @implementation EOGroupingSet - (void)dealloc { [self->groupings release]; [super dealloc]; } - (void)setGroupings:(NSArray *)_groupings { ASSIGN(self->groupings, _groupings); [self _updateDefaultNames]; } - (NSArray *)groupings { return self->groupings; } - (void)setDefaultName:(NSString *)_defaultName { [super setDefaultName:_defaultName]; [self _updateDefaultNames]; } - (NSString *)groupNameForObject:(id)_object { NSString *result; int i, cnt; for (i = 0, cnt = [self->groupings count]; i < cnt; i++) { EOGrouping *group; group = [self->groupings objectAtIndex:i]; if ((result = [group groupNameForObject:_object])) return result; } return self->defaultName; } - (NSArray *)orderedGroupNames { NSMutableArray *result; unsigned int i, cnt; result = [NSMutableArray arrayWithCapacity:8]; for (i = 0, cnt = [self->groupings count]; i < cnt; i++) { EOGrouping *group; group = [self->groupings objectAtIndex:i]; [result addObjectsFromArray:[group orderedGroupNames]]; } return result; } /* PrivateMethodes */ - (void)_updateDefaultNames { unsigned int i, cnt; for (i = 0, cnt = [self->groupings count]; i < cnt; i++) { EOGrouping *group; group = [self->groupings objectAtIndex:i]; [group setDefaultName:nil]; } } @end /* EOGroupingSet */ SOPE/sope-core/NGExtensions/EOExt.subproj/EOQualifier+CtxEval.m0000644000000000000000000001504212242733417023145 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "EOQualifier+CtxEval.h" #import #import #include "common.h" #if LIB_FOUNDATION_LIBRARY # import # import # import #elif GNUSTEP_BASE_LIBRARY #if __GNU_LIBOBJC__ >= 20100911 # define sel_get_name sel_getName # import #else # import #endif #else # import # define sel_get_name sel_getName #endif static inline int countSelArgs(SEL _sel) { register const char *selName; if ((selName = sel_get_name(_sel))) { register int count; for (count = 0; *selName; selName++) { if (*selName == ':') count++; } return count + 2; } else return -1; } @implementation EOQualifier(ContextEvaluation) - (BOOL)evaluateWithObject:(id)_object context:(id)_context { [self doesNotRecognizeSelector:_cmd]; /* subclass */ return NO; } @end /* EOQualifier(ContextEvaluation) */ @implementation NSArray(ContextEvaluation) - (NSArray *)filteredArrayUsingQualifier:(EOQualifier *)_qualifier context:(id)_context { NSMutableArray *a = nil; unsigned i, count; for (i = 0, count = [self count]; i < count; i++) { id o; o = [self objectAtIndex:i]; if ([_qualifier evaluateWithObject:o context:_context]) { if (a == nil) a = [NSMutableArray arrayWithCapacity:count]; [a addObject:o]; } } return a ? [[a copy] autorelease] : [NSArray array]; } @end /* NSArray(ContextEvaluation) */ @implementation EOAndQualifier(ContextEvaluation) - (BOOL)evaluateWithObject:(id)_object context:(id)_context { unsigned i; IMP objAtIdx; NSArray *qs; qs = [self qualifiers]; objAtIdx = [qs methodForSelector:@selector(objectAtIndex:)]; for (i = 0; i < [qs count]; i++) { EOQualifier *q; q = objAtIdx(qs, @selector(objectAtIndex:), i); if (![q evaluateWithObject:_object context:_context]) return NO; } return YES; } @end /* EOAndQualifier(ContextEvaluation) */ @implementation EOOrQualifier(ContextEvaluation) - (BOOL)evaluateWithObject:(id)_object context:(id)_context { unsigned i; IMP objAtIdx; NSArray *qs; qs = [self qualifiers]; objAtIdx = [qs methodForSelector:@selector(objectAtIndex:)]; for (i = 0; i < [qs count]; i++) { EOQualifier *q; q = objAtIdx(qs, @selector(objectAtIndex:), i); if ([q evaluateWithObject:_object context:_context]) return YES; } return NO; } @end /* EOOrQualifier(ContextEvaluation) */ @implementation EONotQualifier(ContextEvaluation) - (BOOL)evaluateWithObject:(id)_object context:(id)_context { return [[self qualifier] evaluateWithObject:_object context:_context] ? NO : YES; } @end /* EONotQualifier(ContextEvaluation) */ @implementation EOKeyValueQualifier(ContextEvaluation) - (BOOL)evaluateWithObject:(id)_object context:(id)_context { static EONull *null = nil; id lv, rv; union { IMP m; BOOL (*unary)(id, SEL); BOOL (*binary)(id, SEL, id); BOOL (*ctx)(id, SEL, id, id); } m; SEL op; op = [self selector]; lv = [_object valueForKeyPath:[self key]]; rv = [self value]; if (null == nil) null = [EONull null]; if (lv == nil) lv = null; if (rv == nil) rv = null; if ((m.m = [lv methodForSelector:op]) == NULL) { /* no such operator method ! */ [lv doesNotRecognizeSelector:op]; return NO; } switch (countSelArgs(op)) { case 0: case 1: NSLog(@"%s: called with invalid selector %@", __PRETTY_FUNCTION__, NSStringFromSelector(op)); return NO; case 2: return m.unary(lv, op); case 3: return m.binary(lv, op, rv); default: return m.ctx(lv, op, rv, _context); } } @end /* EOKeyValueQualifier(ContextEvaluation) */ @implementation EOKeyComparisonQualifier(ContextEvaluation) - (BOOL)evaluateWithObject:(id)_object context:(id)_context { static EONull *null = nil; id lv, rv; union { IMP m; BOOL (*unary)(id, SEL); BOOL (*binary)(id, SEL, id); BOOL (*ctx)(id, SEL, id, id); } m; SEL op; lv = [_object valueForKeyPath:[self leftKey]]; rv = [_object valueForKeyPath:[self rightKey]]; if (null == nil) null = [EONull null]; if (lv == nil) lv = null; if (rv == nil) rv = null; op = [self selector]; if ((m.m = (void *)[lv methodForSelector:op]) == NULL) { /* no such operator method ! */ [lv doesNotRecognizeSelector:op]; return NO; } switch (countSelArgs(op)) { case 0: case 1: NSLog(@"%s: called with invalid selector %@", __PRETTY_FUNCTION__, NSStringFromSelector(op)); return NO; case 2: return m.unary(lv, op); case 3: return m.binary(lv, op, rv); default: return m.ctx(lv, op, rv, _context); } } @end /* EOKeyComparisonQualifier(ContextEvaluation) */ @implementation NSObject(ImplementedQualifierComparisons2) - (BOOL)isEqualTo:(id)_object inContext:(id)_context { return [self isEqualTo:_object]; } - (BOOL)isNotEqualTo:(id)_object inContext:(id)_context { return [self isNotEqualTo:_object]; } - (BOOL)isLessThan:(id)_object inContext:(id)_context { return [self isLessThan:_object]; } - (BOOL)isGreaterThan:(id)_object inContext:(id)_context { return [self isGreaterThan:_object]; } - (BOOL)isLessThanOrEqualTo:(id)_object inContext:(id)_context { return [self isLessThanOrEqualTo:_object]; } - (BOOL)isGreaterThanOrEqualTo:(id)_object inContext:(id)_context { return [self isGreaterThanOrEqualTo:_object]; } - (BOOL)doesContain:(id)_object inContext:(id)_context { return [self doesContain:_object]; } - (BOOL)isLike:(NSString *)_object inContext:(id)_context { return [self isLike:_object]; } - (BOOL)isCaseInsensitiveLike:(NSString *)_object inContext:(id)_context { return [self isCaseInsensitiveLike:_object]; } @end SOPE/sope-core/NGExtensions/EOExt.subproj/EOFetchSpecification+plist.m0000644000000000000000000000761312242733417024550 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #import #include "common.h" @implementation EOFetchSpecification(plist) - (id)initWithDictionary:(NSDictionary *)_dictionary { if ((self = [self init]) != nil) { id tmp; // TODO: add groupings if ((tmp = [_dictionary objectForKey:@"qualifier"]) != nil) { if ([tmp isKindOfClass:[NSDictionary class]]) tmp = [EOQualifier qualifierToMatchAllValues:tmp]; else tmp = [EOQualifier qualifierWithQualifierFormat:tmp]; [self setQualifier:tmp]; } if ((tmp = [_dictionary objectForKey:@"sortOrderings"]) != nil) { NSArray *sos = nil; EOSortOrdering *so; if ([tmp isKindOfClass:[NSArray class]]) { NSMutableArray *result = nil; NSEnumerator *objEnum; id obj; objEnum = [tmp objectEnumerator]; result = [NSMutableArray arrayWithCapacity:8]; while ((obj = [objEnum nextObject])) { so = [[EOSortOrdering alloc] initWithPropertyList:obj owner:nil]; [so autorelease]; if (so) [result addObject:so]; } sos = [[NSArray alloc] initWithArray:result]; } else { so = [[[EOSortOrdering alloc] initWithPropertyList:tmp owner:nil] autorelease]; if (so != nil) sos = [[NSArray alloc] initWithObjects:&so count:1]; } if (sos != nil) [self setSortOrderings:sos]; [sos release]; } if ((tmp = [_dictionary objectForKey:@"fetchLimit"]) != nil) { if ([tmp respondsToSelector:@selector(intValue)]) [self setFetchLimit:[tmp intValue]]; else NSLog(@"%s: invalid fetchLimit key !", __PRETTY_FUNCTION__); } if ((tmp = [_dictionary objectForKey:@"hints"])) { if ([tmp isKindOfClass:[NSDictionary class]]) [self setHints:tmp]; else NSLog(@"%s: invalid hints key !", __PRETTY_FUNCTION__); } if ([[self hints] objectForKey:@"addDocumentsAsObserver"] == nil) { NSMutableDictionary *hnts; hnts = [[NSMutableDictionary alloc] initWithDictionary:[self hints]]; [hnts setObject:[NSNumber numberWithBool:NO] forKey:@"addDocumentsAsObserver"]; [self setHints:hnts]; [hnts release]; } } return self; } - (id)initWithString:(NSString *)_string { EOQualifier *q; q = [EOQualifier qualifierWithQualifierFormat:_string]; return [self initWithEntityName:nil qualifier:q sortOrderings:nil usesDistinct:NO isDeep:NO hints:nil]; } - (id)initWithPropertyList:(id)_plist owner:(id)_owner { if ([_plist isKindOfClass:[NSDictionary class]]) return [self initWithDictionary:_plist]; if ([_plist isKindOfClass:[NSString class]]) return [self initWithString:_plist]; if ([_plist isKindOfClass:[self class]]) { [self release]; return [_plist copy]; } [self release]; return nil; } - (id)initWithPropertyList:(id)_plist { return [self initWithPropertyList:_plist owner:nil]; } @end /* EOFetchSpecification(plist) */ SOPE/sope-core/NGExtensions/EOExt.subproj/EOGrouping.m0000644000000000000000000000462712242733417021463 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "EOGrouping.h" #include "common.h" @implementation EOGrouping - (id)initWithDefaultName:(NSString *)_defaultName { if ((self = [super init])) { self->defaultName = [_defaultName copy]; } return self; } - (id)init { return [self initWithDefaultName:nil]; } - (void)dealloc { [self->defaultName release]; [self->sortOrderings release]; [super dealloc]; } /* accessors */ - (void)setDefaultName:(NSString *)_defaultName { ASSIGN(self->defaultName, _defaultName); } - (NSString *)defaultName { return self->defaultName; } - (void)setSortOrderings:(NSArray *)_sortOrderings { ASSIGN(self->sortOrderings, _sortOrderings); } - (NSArray *)sortOrderings { return self->sortOrderings; } /* operations */ - (NSString *)groupNameForObject:(id)_object { [self doesNotRecognizeSelector:_cmd]; // subclass return nil; } - (NSArray *)orderedGroupNames { [self doesNotRecognizeSelector:_cmd]; // subclass return nil; } - (NSString *)description { return @"EOGrouping"; } @end /* EOGrouping */ NSString *EOGroupingHint = @"EOGroupingHint"; @implementation EOFetchSpecification(Groupings) - (void)setGroupings:(NSArray *)_groupings { NSDictionary *lhints; NSMutableDictionary *md; lhints = [self hints]; md = lhints ? [lhints mutableCopy] : [[NSMutableDictionary alloc] init]; if (_groupings) [md setObject:_groupings forKey:EOGroupingHint]; else [md removeObjectForKey:EOGroupingHint]; lhints = [md copy]; [md release]; [self setHints:lhints]; [lhints release]; } - (NSArray *)groupings { return [[self hints] objectForKey:EOGroupingHint]; } @end /* EOFetchSpecification(Groupings) */ SOPE/sope-core/NGExtensions/EOExt.subproj/EOCompoundDataSource.m0000644000000000000000000001520012242733417023415 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "EOCompoundDataSource.h" #import #import "EODataSource+NGExtensions.h" #import "common.h" @implementation EOCompoundDataSource - (id)initWithDataSources:(NSArray *)_ds { if ((self = [super init])) { self->sources = [_ds shallowCopy]; } return self; } - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; [self->sortOrderings release]; [self->auxiliaryQualifier release]; [self->sources release]; [super dealloc]; } /* accessors */ - (void)setSources:(NSArray *)_sources { NSNotificationCenter *nc; NSEnumerator *enumerator; id obj; if (self->sources == _sources) return; // BUG: this needs to unregister the old datssources! _sources = [_sources shallowCopy]; [self->sources release]; self->sources = _sources; nc = [NSNotificationCenter defaultCenter]; enumerator = [self->sources objectEnumerator]; while ((obj = [enumerator nextObject]) != nil) { [nc addObserver:self selector:@selector(postDataSourceChangedNotification) name:EODataSourceDidChangeNotification object:obj]; } [self postDataSourceChangedNotification]; } - (NSArray *)sources { return self->sources; } - (void)setAuxiliaryQualifier:(EOQualifier *)_q { ASSIGN(self->auxiliaryQualifier, _q); [self postDataSourceChangedNotification]; } - (EOQualifier *)auxiliaryQualifier { return self->auxiliaryQualifier; } - (void)setSortOrderings:(NSArray *)_so { if (self->sortOrderings == _so) return; _so = [_so shallowCopy]; [self->sortOrderings release]; self->sortOrderings = _so; [self postDataSourceChangedNotification]; } - (NSArray *)sortOrderings { return self->sortOrderings; } /* operations */ - (NSArray *)fetchObjects { NSArray *objs; unsigned count; if ((count = [[self sources] count]) == 0) { objs = nil; } else if (count == 1) objs = [[[self sources] objectAtIndex:0] fetchObjects]; else { NSMutableArray *a; NSEnumerator *e; EODataSource *ds; a = nil; e = [[self sources] objectEnumerator]; while ((ds = [e nextObject])) { NSArray *o; o = [ds fetchObjects]; if ([o count] > 0) { if (a == nil) a = [NSMutableArray arrayWithCapacity:[o count]]; [a addObjectsFromArray:o]; } } objs = [[a shallowCopy] autorelease]; } if (objs == nil) return [NSArray array]; if ([self auxiliaryQualifier] != nil) objs = [objs filteredArrayUsingQualifier:[self auxiliaryQualifier]]; if ([self sortOrderings] != nil) objs = [objs sortedArrayUsingKeyOrderArray:[self sortOrderings]]; return objs; } - (void)insertObject:(id)_obj { unsigned count; if ((count = [[self sources] count]) == 0) [super insertObject:_obj]; else if (count == 1) [[[self sources] objectAtIndex:0] insertObject:_obj]; else { NSEnumerator *e; EODataSource *ds; e = [[self sources] objectEnumerator]; while ((ds = [e nextObject])) { BOOL didFail = NO; NS_DURING [ds insertObject:_obj]; NS_HANDLER didFail = YES; NS_ENDHANDLER; if (!didFail) return; } /* all datasources failed to insert .. */ [super insertObject:_obj]; } [self postDataSourceChangedNotification]; } - (void)deleteObject:(id)_obj { unsigned count; if ((count = [[self sources] count]) == 0) [super deleteObject:_obj]; else if (count == 1) [[[self sources] objectAtIndex:0] deleteObject:_obj]; else { NSEnumerator *e; EODataSource *ds; e = [[self sources] objectEnumerator]; while ((ds = [e nextObject])) { BOOL didFail = NO; NS_DURING [ds deleteObject:_obj]; NS_HANDLER didFail = YES; NS_ENDHANDLER; if (!didFail) return; } /* all datasources failed to delete .. */ [super deleteObject:_obj]; } [self postDataSourceChangedNotification]; } - (id)createObject { unsigned count; id newObj = nil; if ((count = [[self sources] count]) == 0) newObj = [[super createObject] retain]; else if (count == 1) newObj = [[[[self sources] objectAtIndex:0] createObject] retain]; else { NSEnumerator *e; EODataSource *ds; e = [[self sources] objectEnumerator]; while ((ds = [e nextObject]) != nil) { id obj; if ((obj = [ds createObject])) { newObj = [obj retain]; break; } } /* all datasources failed to create .. */ if (newObj == nil) newObj = [[super createObject] retain]; } [self postDataSourceChangedNotification]; return [newObj autorelease]; } - (void)updateObject:(id)_obj { unsigned count; if ((count = [[self sources] count]) == 0) [super updateObject:_obj]; else if (count == 1) [[[self sources] objectAtIndex:0] updateObject:_obj]; else { NSEnumerator *e; EODataSource *ds; e = [[self sources] objectEnumerator]; while ((ds = [e nextObject])) { BOOL didFail = NO; NS_DURING [ds updateObject:_obj]; NS_HANDLER didFail = YES; NS_ENDHANDLER; if (!didFail) return; } /* all datasources failed to update .. */ [super updateObject:_obj]; } [self postDataSourceChangedNotification]; } - (EOClassDescription *)classDescriptionForObjects { unsigned count; NSEnumerator *e; EODataSource *ds; if ((count = [[self sources] count]) == 0) return [super classDescriptionForObjects]; if (count == 1) return [[[self sources] objectAtIndex:0] classDescriptionForObjects]; e = [[self sources] objectEnumerator]; while ((ds = [e nextObject]) != nil) { EOClassDescription *cd; if ((cd = [ds classDescriptionForObjects]) != nil) return cd; } /* all datasources failed to create .. */ return [super classDescriptionForObjects]; } @end /* EOCompoundDataSource */ SOPE/sope-core/NGExtensions/EOExt.subproj/EOCacheDataSource.m0000644000000000000000000001273212242733417022643 0ustar rootroot/* Copyright (C) 2000-2006 SKYRIX Software AG Copyright (C) 2006 Helge Hess This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ //#define PROFILE 1 #include "EOCacheDataSource.h" #import #import "EODataSource+NGExtensions.h" #import "common.h" #include @interface EOCacheDataSource(Private) - (void)_registerForSource:(id)_source; - (void)_removeObserverForSource:(id)_source; - (void)_clearCache; @end @interface EOCacheDataSourceTimer : NSObject { @public EOCacheDataSource *ds; /* non-retained! */ } @end @implementation EOCacheDataSource - (id)initWithDataSource:(EODataSource *)_ds { if ((self = [super init])) { self->source = [_ds retain]; self->timeout = 0; self->timer = nil; self->time = 0; [self _registerForSource:self->source]; } return self; } - (void)dealloc { [self _removeObserverForSource:self->source]; [self->timer invalidate]; [self->timer release]; [self->source release]; [self->cache release]; [super dealloc]; } /* accessors */ - (void)setSource:(EODataSource *)_source { if (self->source == _source) return; [self _removeObserverForSource:self->source]; ASSIGN(self->source, _source); [self _registerForSource:self->source]; [self _clearCache]; } - (EODataSource *)source { return self->source; } - (void)setTimeout:(NSTimeInterval)_timeout { self->timeout = _timeout; } - (NSTimeInterval)timeout { return self->timeout; } /* operations */ - (NSArray *)fetchObjects { BEGIN_PROFILE; self->_isFetching = YES; if (self->time > 0) { if (self->time < [[NSDate date] timeIntervalSinceReferenceDate]) { [self->cache release]; self->cache = nil; } } if (self->cache == nil) { self->time = 0; if (self->timer != nil) { [self->timer invalidate]; [self->timer release]; self->timer = nil; } self->cache = [[self->source fetchObjects] retain]; if (self->timeout > 0) { EOCacheDataSourceTimer *holder; /* this object is here to avoid a retain cycle */ holder = [[EOCacheDataSourceTimer alloc] init]; holder->ds = self; self->time = [[NSDate date] timeIntervalSinceReferenceDate] + self->timeout; /* the timer retains the holder, but no the DS */ self->timer = [[NSTimer scheduledTimerWithTimeInterval:self->timeout target:holder selector:@selector(clear) userInfo:nil repeats:NO] retain]; [holder release]; holder = nil; } PROFILE_CHECKPOINT("cache miss"); } else { PROFILE_CHECKPOINT("cache hit"); } self->_isFetching = NO; END_PROFILE; return self->cache; } - (void)setFetchSpecification:(EOFetchSpecification *)_fetchSpec { [self->source setFetchSpecification:_fetchSpec]; } - (EOFetchSpecification *)fetchSpecification { return [self->source fetchSpecification]; } /* operations */ - (void)insertObject:(id)_obj { [self _clearCache]; [self->source insertObject:_obj]; } - (void)deleteObject:(id)_obj { [self _clearCache]; [self->source deleteObject:_obj]; } - (id)createObject { return [self->source createObject]; } - (void)updateObject:(id)_obj { [self->source updateObject:_obj]; [self _clearCache]; } - (EOClassDescription *)classDescriptionForObjects { return [[self source] classDescriptionForObjects]; } - (void)clear { [self _clearCache]; } /* description */ - (NSString *)description { NSString *fmt; fmt = [NSString stringWithFormat:@"<%@[0x%p]: source=%@>", NSStringFromClass([self class]), self, self->source]; return fmt; } /* private methods */ - (void)_registerForSource:(id)_source { static NSNotificationCenter *nc = nil; if (_source != nil) { if (nc == nil) nc = [[NSNotificationCenter defaultCenter] retain]; [nc addObserver:self selector:@selector(_clearCache) name:EODataSourceDidChangeNotification object:_source]; } } - (void)_removeObserverForSource:(id)_source { static NSNotificationCenter *nc = nil; if (_source != nil) { if (nc == nil) nc = [NSNotificationCenter defaultCenter]; [nc removeObserver:self name:EODataSourceDidChangeNotification object:_source]; } } - (void)_clearCache { #if DEBUG && 0 NSLog(@"clearing cache (%s)...", self->_isFetching?"fetching":""); if (fgetc(stdin) == 'a') abort(); #endif self->time = 0; if (self->timer) { [self->timer invalidate]; [self->timer release]; self->timer = nil; } if (self->cache) { [self->cache release]; self->cache = nil; [self postDataSourceChangedNotification]; } } @end /* EOCacheDataSource */ @implementation EOCacheDataSourceTimer - (void)clear { [self->ds clear]; } @end /* EOCacheDataSourceTimer */ SOPE/sope-core/NGExtensions/EOExt.subproj/EODataSource+NGExtensions.m0000644000000000000000000000343312242733417024275 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "EODataSource+NGExtensions.h" #import #include "common.h" NGExtensions_DECLARE NSString *EODataSourceDidChangeNotification = @"EODataSourceDidChangeNotification"; NGExtensions_DECLARE NSString *EONoFetchWithEmptyQualifierHint = @"EONoFetchWithEmptyQualifierHint"; @implementation EODataSource(NGExtensions) - (void)setFetchSpecification:(EOFetchSpecification *)_fetchSpec { [self doesNotRecognizeSelector:_cmd]; } - (EOFetchSpecification *)fetchSpecification { [self doesNotRecognizeSelector:_cmd]; return nil; } - (void)updateObject:(id)_obj { [self doesNotRecognizeSelector:_cmd]; } - (void)postDataSourceChangedNotification { static NSNotificationCenter *nc = nil; if (nc == nil) nc = [[NSNotificationCenter defaultCenter] retain]; [nc postNotificationName:EODataSourceDidChangeNotification object:self]; } @end /* EODataSource(NGExtensions) */ /* static linking */ void __link_EODataSource_NGExtensions(void) { __link_EODataSource_NGExtensions(); } SOPE/sope-core/NGExtensions/EOExt.subproj/NSArray+EOGrouping.m0000644000000000000000000000513012242733417022764 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "EOGrouping.h" #import #include "common.h" @implementation NSArray(EOGrouping) static BOOL ProfileComponents = NO; - (NSDictionary *)arrayGroupedBy:(EOGrouping *)_grouping { NSMutableDictionary *result; NSEnumerator *keyEnum; NSString *key; NSArray *sortings; int i, cnt; IMP objAtIndex; IMP groupForObj; NSTimeInterval st = 0.0; if (ProfileComponents) st = [[NSDate date] timeIntervalSince1970]; cnt = [self count]; result = [NSMutableDictionary dictionaryWithCapacity:cnt]; objAtIndex = [self methodForSelector:@selector(objectAtIndex:)]; groupForObj = [_grouping methodForSelector:@selector(groupNameForObject:)]; for (i = 0; i < cnt; i++) { NSString *gName = nil; // groupName NSMutableArray *tmp = nil; id obj = nil; obj = objAtIndex(self, @selector(objectAtIndex:), i); gName = groupForObj(_grouping, @selector(groupNameForObject:), obj); if (gName == nil) continue; if (!(tmp = [result objectForKey:gName])) { tmp = [[[NSMutableArray alloc] initWithCapacity:4] autorelease]; [result setObject:tmp forKey:gName]; } [tmp addObject:obj]; } sortings = [_grouping sortOrderings]; if ([sortings count] > 0) { // sort each group keyEnum = [result keyEnumerator]; while ((key = [keyEnum nextObject])) { NSArray *tmp; tmp = [result objectForKey:key]; tmp = [tmp sortedArrayUsingKeyOrderArray:sortings]; [result setObject:tmp forKey:key]; } } if (ProfileComponents) { NSTimeInterval diff; diff = [[NSDate date] timeIntervalSince1970] - st; printf("NSArray+Grouping: %0.4fs\n", diff); } return result; } @end /* NSArray(EOGrouping) */ SOPE/sope-core/NGExtensions/EOExt.subproj/common.h0000644000000000000000000000002712242733417020716 0ustar rootroot#include "../common.h" SOPE/sope-core/NGExtensions/EOExt.subproj/README.txt0000644000000000000000000000541012242733417020754 0ustar rootrootExtensions for EOControl ======================== This subproject contains categories and additional classes to enhance functionality provided by EOControl. General additions: a) plist init methods, like -initWithPropertyList:, -initWithPropertyList:owner:, -initWithString:, -initWithDictionary:, etc DataSources =========== General Additions ***************** NGExtensions adds the following to datasources: a) standardized -setFetchSpecification:/-fetchSpecification b) -updateObject: for triggering updates in 'raw' datasources c) -postDataSourceChanged, to notify the system of changed datasource fetch specifications EOCacheDataSource ***************** A "regular" EODataSource in SOPE is not supposed to cache the results it fetches, it should just perform the raw fetch and then tidy up. To provide caching, you can wrap an arbitary datasource in an EOCacheDataSource which will manage the cache, perform on-demand loads etc. To keep the cache consistent, in SOPE a EODataSource is supposed to call -postDataSourceChanged when its fetch-specification changes in a way which would lead to different fetch results. (Notably an EODatabaseDataSource in EOF2 often has implicit caching in the EOObjectStore/EOEditingContext, the above applies more to SOPE and OGo datasources like the NGLdapDataSource, NGImap4FolderDataSource, EOAdaptorDataSource etc). EOCompoundDataSource ******************** As the name suggests this datasource joins the results of other datasources into one. In the context of create/insert/delete/update operations, the datasource tries each of the child datasources in sequence until one of them succeeds in the delete and otherwise calls the super method. Finally this datasource has own sort-orderings and an own auxiliaryQualifier. EOFilterDataSource ****************** This datasource is somewhat similiar to EOCompoundDataSource but intended for subclassing and has just one source datasources. It provides own sort-orderings, groupings and an own auxiliaryQualifier. It can be used as-is to add grouping capabilities to datasources. EOKeyMapDataSource ****************** TODO: document - EOMappedObject - EOKeyMapDataSourceEnumerator Grouping ======== TODO document. - Groupings on an EODataSource still return an array, but one sorted by the 'grouping keys'. Remember that the grouping does *not* need to be a plain KVC key but can be arbitary. - You can add grouping facilities to arbitary datasources using EOFilterDataSource. Convenience methods ******************* NSArray - (NSArray *)arrayGroupedBy:(EOGrouping *)_grouping; EOFetchSpecification: - setGroupings:(NSArray *)_groupings; // sets 'EOGroupingHint' - (NSArray *)groupings; Classes ******* EOGrouping EOGroupingSet EOKeyGrouping EOQualifierGrouping SOPE/sope-core/NGExtensions/EOExt.subproj/EOQualifier+plist.m0000644000000000000000000000432012242733417022727 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include "common.h" @implementation EOQualifier(plist) - (id)initWithDictionary:(NSDictionary *)_dict { [self release]; return [[EOQualifier qualifierToMatchAllValues:_dict] retain]; } - (id)initWithArray:(NSArray *)_array { unsigned count; NSString *fmt; NSArray *args; [self release]; if ((count = [_array count]) == 0) { NSLog(@"%s: invalid array for qualifier: %@", __PRETTY_FUNCTION__, _array); return nil; } fmt = [_array objectAtIndex:0]; if (count == 1) args = nil; else args = [_array subarrayWithRange:NSMakeRange(1, (count - 1))]; return [[EOQualifier qualifierWithQualifierFormat:fmt arguments:args] retain]; } - (id)initWithString:(NSString *)_string { [self release]; return [[EOQualifier qualifierWithQualifierFormat:_string] retain]; } - (id)initWithPropertyList:(id)_plist owner:(id)_owner { if ([_plist isKindOfClass:[NSDictionary class]]) return [self initWithDictionary:_plist]; if ([_plist isKindOfClass:[NSString class]]) return [self initWithString:_plist]; if ([_plist isKindOfClass:[NSArray class]]) return [self initWithArray:_plist]; if ([_plist isKindOfClass:[self class]]) { [self release]; return [_plist copy]; } [self release]; return nil; } - (id)initWithPropertyList:(id)_plist { return [self initWithPropertyList:_plist owner:nil]; } @end /* EOQualifier(plist) */ SOPE/sope-core/NGExtensions/TODO0000644000000000000000000000342012242733417015276 0ustar rootrootTODO ==== - remove dependency on FoundationExt on GNUstep Base and Cocoa - added source of FileObjectHolder, NSRunLoop+FileObjects NSString+Encoding.m: - encoding support for MacOSX and other non-iconv platforms - add a "charset" encoding registry - improve error handling - improve buffer size handling NGLogger: - fix format bugs - fix performance - running two format parsers and varargs processors is unnecessary and far too expensive - running seven methods calls just in logWithFormat:arguments: is expensive - analysis: (for a simple logWithFormat:) - NSObject logWithFormat:arguments: - one format parser - one varargs run - 7 method calls - NSObject logger - caches in static variable, no method call after warm up - NGLogger isLogInfoEnabled - simple comparison (use macro or access public ivars?) - NSObject loggingPrefix - one autorelease string - one format parser - 2 method calls - NGLogger logWithFormat:arguments: - since we already know that logging is enabled, we do not need to check again => forceLogWithPrefix:string: or -logLevel:message: - one format parser - one varargs run - 4 method calls - NGLogger logLevel:message: - creates/releases a log event object - calls appender - 4 method calls - NGLogConsoleAppender - (incorrectly) calls NSLog => one varargs parser - 1 method call - NGLogAppender formattedEvent: - 8 method calls - creates an autorelease string - NGLogAppender localizedNameOfLogLevel: - simple switch - summary: limit NGLogger to the few applications which require it - having -logWithFormat:arguments: on NSObject seems unnecessary, there is no reason to override this method SOPE/sope-core/NGExtensions/NGBitSet.m0000644000000000000000000002207712242733417016414 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import "common.h" #import "NGMemoryAllocation.h" #import "NGBitSet.h" #define NGStorageSize sizeof(NGBitSetStorage) #define NGBitsPerEntry (NGStorageSize * 8) #define NGByteSize (universe / 8) #define NGTestBit(_x) (((storage[ _x / NGBitsPerEntry ] & \ (1 << (_x % NGBitsPerEntry))) == 0) ? NO : YES) @interface NGConcreteBitSetEnumerator : NSEnumerator { @public unsigned int universe; unsigned int count; NGBitSetStorage *storage; unsigned int position; unsigned int found; } - (id)nextObject; @end @implementation NGBitSet + (id)bitSet { return [[[self alloc] init] autorelease]; } + (id)bitSetWithCapacity:(NSUInteger)_capacity { return [[[self alloc] initWithCapacity:_capacity] autorelease]; } + (id)bitSetWithBitSet:(NGBitSet *)_set { return [[[self alloc] initWithBitSet:_set] autorelease]; } - (id)initWithCapacity:(NSUInteger)_capacity { if ((self = [super init])) { self->universe = (_capacity / NGBitsPerEntry + 1) * NGBitsPerEntry; storage = NGMallocAtomic(NGByteSize); memset(storage, 0, NGByteSize); count = 0; } return self; } - (id)initWithBitSet:(NGBitSet *)_set { if ((self = [self initWithCapacity:NGBitsPerEntry])) { NSEnumerator *enumerator = [_set objectEnumerator]; id obj = nil; while ((obj = [enumerator nextObject])) [self addMember:[obj unsignedIntValue]]; enumerator = nil; } return self; } - (id)init { return [self initWithCapacity:NGBitsPerEntry]; } - (id)initWithNullTerminatedArray:(unsigned int *)_array { if ((self = [self initWithCapacity:NGBitsPerEntry])) { while (*_array) { [self addMember:*_array]; _array++; } } return self; } - (void)dealloc { if (self->storage) { NGFree(self->storage); self->storage = NULL; } [super dealloc]; } /* storage */ - (void)_expandToInclude:(NSUInteger)_element { unsigned int nu = (_element / NGBitsPerEntry + 1) * NGBitsPerEntry; if (nu > self->universe) { void *old = storage; storage = (NGBitSetStorage *)NGMallocAtomic(nu / 8); memset(storage, 0, nu / 8); if (old) { memcpy(storage, old, NGByteSize); NGFree(old); old = NULL; } self->universe = nu; } } /* accessors */ - (NSUInteger)capacity { return self->universe; } - (NSUInteger)count { return count; } /* membership */ - (BOOL)isMember:(NSUInteger)_element { return (_element >= self->universe) ? NO : NGTestBit(_element); } - (void)addMember:(NSUInteger)_element { register unsigned int subIdxPattern = 1 << (_element % NGBitsPerEntry); if (_element >= self->universe) [self _expandToInclude:_element]; if ((storage[ _element / NGBitsPerEntry ] & subIdxPattern) == 0) { storage[ _element / NGBitsPerEntry ] |= subIdxPattern; count++; } } - (void)addMembersInRange:(NSRange)_range { register unsigned int from = _range.location; register unsigned int to = from + _range.length - 1; if (to >= self->universe) [self _expandToInclude:to]; for (; from <= to; from++) { register unsigned int subIdxPattern = 1 << (from % NGBitsPerEntry); if ((storage[ from / NGBitsPerEntry ] & subIdxPattern) == 0) { storage[ from / NGBitsPerEntry ] |= subIdxPattern; count++; } } } - (void)addMembersFromBitSet:(NGBitSet *)_set { unsigned i; if ([_set capacity] > self->universe) [self _expandToInclude:[_set capacity]]; for (i = 0; i < [_set capacity]; i++) { if ([_set isMember:i]) { register unsigned int subIdxPattern = 1 << (i % NGBitsPerEntry); if ((storage[ i / NGBitsPerEntry ] & subIdxPattern) == 0) { storage[ i / NGBitsPerEntry ] |= subIdxPattern; count++; } } } } - (void)removeMember:(NSUInteger)_element { register unsigned int subIdxPattern = 1 << (_element % NGBitsPerEntry); if (_element >= self->universe) return; if ((storage[ _element / NGBitsPerEntry ] & subIdxPattern) != 0) { storage[ _element / NGBitsPerEntry ] -= subIdxPattern; count--; } } - (void)removeMembersInRange:(NSRange)_range { register unsigned int from = _range.location; register unsigned int to = from + _range.length - 1; if (from >= self->universe) return; if (to >= self->universe) to = self->universe - 1; for (; from <= to; from++) { register unsigned int subIdxPattern = 1 << (from % NGBitsPerEntry); if ((storage[ from / NGBitsPerEntry ] & subIdxPattern) != 0) { storage[ from / NGBitsPerEntry ] -= subIdxPattern; count--; } } } - (void)removeAllMembers { memset(storage, 0, NGByteSize); count = 0; } - (NSUInteger)firstMember { register unsigned int element; for (element = 0; element < self->universe; element++) { if (NGTestBit(element)) return element; } return NSNotFound; } - (NSUInteger)lastMember { register unsigned int element; for (element = (self->universe - 1); element >= 0; element--) { if (NGTestBit(element)) return element; } return NSNotFound; } /* equality */ - (BOOL)isEqual:(id)_object { if (self == _object) return YES; if ([self class] != [_object class]) return NO; return [self isEqualToSet:_object]; } - (BOOL)isEqualToSet:(NGBitSet *)_set { if (self == _set) return YES; if (count != [_set count]) return NO; { register unsigned int element; for (element = 0; element < self->universe; element++) { if (NGTestBit(element)) { if (![_set isMember:element]) return NO; } } return YES; } } /* enumerator */ - (NSEnumerator *)objectEnumerator { if (self->count == 0) return nil; else { NGConcreteBitSetEnumerator *en = [[NGConcreteBitSetEnumerator alloc] init]; en->universe = self->universe; en->count = self->count; en->storage = self->storage; return [en autorelease]; } } /* NSCopying */ - (id)copy { return [self copyWithZone:[self zone]]; } - (id)copyWithZone:(NSZone *)_zone { return [[NGBitSet alloc] initWithBitSet:self]; } /* NSCoding */ - (void)encodeWithCoder:(NSCoder *)_coder { unsigned int element; register unsigned int found; [_coder encodeValueOfObjCType:@encode(NSUInteger) at:&count]; for (element = 0, found = 0; (element < self->universe) && (found < count); element++) { if (NGTestBit(element)) { [_coder encodeValueOfObjCType:@encode(NSUInteger) at:&element]; found++; } } } - (id)initWithCoder:(NSCoder *)_coder { if ((self = [super init])) { unsigned int nc; register unsigned int cnt; self->universe = NGBitsPerEntry; storage = NGMallocAtomic(NGByteSize); memset(storage, 0, NGByteSize); [_coder decodeValueOfObjCType:@encode(NSUInteger) at:&nc]; for (cnt = 0; cnt < nc; cnt++) { unsigned int member; [_coder decodeValueOfObjCType:@encode(NSUInteger) at:&member]; [self addMember:member]; } } return self; } /* description */ - (NSString *)description { return [NSString stringWithFormat: @"", self, self->universe, self->count, [[self toArray] description]]; } - (NSArray *)toArray { NSMutableArray *result = [[NSMutableArray alloc] initWithCapacity:count + 1]; register unsigned int element, found; for (element = 0, found = 0; (element < self->universe) && (found < self->count); element++) { if (NGTestBit(element)) { [result addObject:[NSNumber numberWithUnsignedInt:element]]; found++; } } return [[[result autorelease] copy] autorelease]; } @end /* NGBitSet */ @implementation NGConcreteBitSetEnumerator - (id)nextObject { if (self->found == self->count) return nil; if (self->position >= self->universe) return nil; while (!NGTestBit(self->position)) self->position++; self->found++; self->position++; return [NSNumber numberWithUnsignedInt:(self->position - 1)]; } @end /* NGConcreteBitSetEnumerator */ NSString *stringValueForBitset(unsigned int _set, char _setC, char _unsetC, short _wide) { char buf[_wide + 1]; register short pos; for (pos = 0; pos < _wide; pos++) { register unsigned int v = (1 << pos); buf[(int)pos] = ((v & _set) == v) ? _setC : _unsetC; } buf[_wide] = '\0'; return [NSString stringWithCString:buf]; } void __link_NGExtensions_NGBitSet() { __link_NGExtensions_NGBitSet(); } SOPE/sope-core/NGExtensions/NGMerging.m0000644000000000000000000001267412242733417016614 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NGMerging.h" #include "common.h" #import #import static NSString *NGCannotMergeWithObjectException = @"NGCannotMergeWithObjectException"; @implementation NSObject(NGMerging) - (BOOL)canMergeWithObject:(id)_object { return ((_object == nil) || (_object == self)) ? YES : NO; } - (id)_makeMergeCopyWithZone:(NSZone *)_zone { return [(id)self copyWithZone:_zone]; } - (id)mergeWithObject:(id)_object zone:(NSZone *)_zone { if ((_object == nil) || (_object == self)) return [self _makeMergeCopyWithZone:_zone]; [NSException raise:NGCannotMergeWithObjectException format:@"cannot merge objects of class %@ and %@", NSStringFromClass([self class]), NSStringFromClass([_object class])]; return nil; } - (id)mergeWithObject:(id)_object { return [self mergeWithObject:_object zone:NULL]; } @end @implementation NSDictionary(NGMerging) - (BOOL)canMergeWithObject:(id)_object { if ((self == _object) || (_object == nil)) return YES; if ([_object isKindOfClass:[NSDictionary class]]) return YES; return NO; } - (id)_makeMergeCopyWithZone:(NSZone *)_zone { return [self retain]; } - (id)mergeWithDictionary:(NSDictionary *)_object zone:(NSZone *)_zone { NSMutableDictionary *result; NSArray *aKeys, *bKeys; int i, count; if ((self == _object) || (_object == nil)) return [self _makeMergeCopyWithZone:_zone]; aKeys = [self allKeys]; bKeys = [_object allKeys]; result = [NSMutableDictionary dictionary]; /* merge all keys of a */ for (i = 0, count = [aKeys count]; i < count; i++) { id key; id av, bv; key = [aKeys objectAtIndex:i]; av = [self objectForKey:key]; bv = [_object objectForKey:key]; if (bv == nil) { /* key is only in a */ [result setObject:av forKey:key]; } else { /* key is in both - need to merge */ if ([av canMergeWithObject:bv]) { av = [av mergeWithObject:bv zone:_zone]; [result setObject:av forKey:key]; } else // if objects cannot be merged, av wins [result setObject:av forKey:key]; } } /* add remaining keys in b */ for (i = 0, count = [bKeys count]; i < count; i++) { id key; key = [bKeys objectAtIndex:i]; if ([result objectForKey:key]) // already merged key .. continue; [result setObject:[_object objectForKey:key] forKey:key]; } return result; } - (id)mergeWithObject:(id)_object zone:(NSZone *)_zone { if ((self == _object) || (_object == nil)) return [self _makeMergeCopyWithZone:_zone]; if ([_object isKindOfClass:[NSDictionary class]]) return [self mergeWithDictionary:_object zone:_zone]; [NSException raise:NGCannotMergeWithObjectException format:@"cannot merge %@ with %@", NSStringFromClass([self class]), NSStringFromClass([_object class])]; return nil; } @end @implementation NSMutableDictionary(NGMerging) - (id)_makeMergeCopyWithZone:(NSZone *)_zone { return [self copyWithZone:_zone]; } @end @implementation NSArray(NGMerging) - (BOOL)canMergeWithObject:(id)_object { if ((self == _object) || (_object == nil)) return YES; if ([_object respondsToSelector:@selector(objectEnumerator)]) return YES; return NO; } - (id)_makeMergeCopyWithZone:(NSZone *)_zone { return [self retain]; } - (id)mergeWithEnumeration:(NSEnumerator *)_object zone:(NSZone *)_zone { NSMutableArray *result; id value; if (_object == nil) return [self _makeMergeCopyWithZone:_zone]; /* make copy of self */ result = [[self mutableCopyWithZone:_zone] autorelease]; /* add other elements */ while ((value = [_object nextObject])) [result addObject:value]; return result; } - (id)mergeWithArray:(NSArray *)_object zone:(NSZone *)_zone { if (_object == nil) return [self _makeMergeCopyWithZone:_zone]; return [self arrayByAddingObjectsFromArray:_object]; } - (id)mergeWithObject:(id)_object zone:(NSZone *)_zone { if (_object == nil) return [self _makeMergeCopyWithZone:_zone]; if ([_object respondsToSelector:@selector(objectEnumerator)]) return [self mergeWithEnumeration:[_object objectEnumerator] zone:_zone]; [NSException raise:NGCannotMergeWithObjectException format:@"cannot merge %@ with %@", NSStringFromClass([self class]), NSStringFromClass([_object class])]; return nil; } @end @implementation NSMutableArray(NGMerging) - (id)_makeMergeCopyWithZone:(NSZone *)_zone { return [self copyWithZone:_zone]; } @end // for static linking void __link_NGExtensions_NGMerging(void) { __link_NGExtensions_NGMerging(); } SOPE/sope-core/NGExtensions/NGQuotedPrintableCoding.m0000644000000000000000000002467012242733417021451 0ustar rootroot/* Copyright (C) 2000-2008 SKYRIX Software AG Copyright (C) 2006-2008 Helge Hess This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NGQuotedPrintableCoding.h" #include "common.h" #include "NGMemoryAllocation.h" @implementation NSString(QuotedPrintableCoding) - (NSString *)stringByDecodingQuotedPrintable { NSData *data; data = ([self length] > 0) ? [self dataUsingEncoding:NSASCIIStringEncoding] : [NSData data]; data = [data dataByDecodingQuotedPrintable]; // TODO: should we default to some specific charset instead? (either // Latin1 or UTF-8 // or the charset of the receiver? return [NSString stringWithCString:[data bytes] length:[data length]]; } - (NSString *)stringByEncodingQuotedPrintable { NSData *data; // TBD: which encoding to use? data = ([self length] > 0) ? [self dataUsingEncoding:[NSString defaultCStringEncoding]] : [NSData data]; data = [data dataByEncodingQuotedPrintable]; return [[[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding] autorelease]; } @end /* NSString(QuotedPrintableCoding) */ @implementation NSData(QuotedPrintableCoding) - (NSData *)dataByDecodingQuotedPrintable { char *dest; size_t destSize; size_t resSize; destSize = [self length]; dest = malloc(destSize * sizeof(char) + 2); resSize = NGDecodeQuotedPrintableX([self bytes], [self length], dest, destSize, YES); return ((int)resSize != -1) ? [NSData dataWithBytesNoCopy:dest length:resSize] : nil; } - (NSData *)dataByDecodingQuotedPrintableTransferEncoding { char *dest; size_t destSize; size_t resSize; destSize = [self length]; dest = malloc(destSize * sizeof(char) + 2); resSize = NGDecodeQuotedPrintableX([self bytes], [self length], dest, destSize, NO); return ((int)resSize != -1) ? [NSData dataWithBytesNoCopy:dest length:resSize] : nil; } - (NSData *)dataByEncodingQuotedPrintable { const char *bytes = [self bytes]; unsigned int length = [self length]; char *des = NULL; unsigned int desLen = 0; // length/64*3 should be plenty for soft newlines desLen = (length + length/64) *3; des = NGMallocAtomic(sizeof(char) * desLen); desLen = NGEncodeQuotedPrintable(bytes, length, des, desLen); return (int)desLen != -1 ? [NSData dataWithBytesNoCopy:des length:desLen] : nil; } @end /* NSData(QuotedPrintableCoding) */ // implementation static inline signed char __hexToChar(char c) { if ((c > 47) && (c < 58)) // '0' .. '9' return c - 48; if ((c > 64) && (c < 71)) // 'A' .. 'F' return c - 55; if ((c > 96) && (c < 103)) // 'a' .. 'f' return c - 87; return -1; } int NGDecodeQuotedPrintableX(const char *_src, unsigned _srcLen, char *_dest, unsigned _destLen, BOOL _replaceUnderline) { /* Eg: "Hello=20World" => "Hello World" =XY where XY is a hex encoded byte. In addition '_' is decoded as 0x20 (not as space!, this depends on the charset, see RFC 2047 4.2). */ unsigned cnt = 0; unsigned destCnt = 0; if (_srcLen < _destLen) return -1; for (cnt = 0; ((cnt < _srcLen) && (destCnt < _destLen)); cnt++) { if (_src[cnt] != '=') { _dest[destCnt] = (_replaceUnderline && _src[cnt] == '_') ? 0x20 : _src[cnt]; destCnt++; } else { if ((_srcLen - cnt) > 1) { signed char c1, c2; cnt++; // skip '=' c1 = _src[cnt]; // first hex digit if (c1 == '\r' || c1 == '\n') { if (_src[cnt + 1] == '\r' || _src[cnt + 1] == '\n' ) cnt++; continue; } c1 = __hexToChar(c1); cnt++; // skip first hex digit c2 = __hexToChar(_src[cnt]); if ((c1 == -1) || (c2 == -1)) { if ((_destLen - destCnt) > 1) { _dest[destCnt] = _src[cnt - 1]; destCnt++; _dest[destCnt] = _src[cnt]; destCnt++; } else break; } else { register unsigned char c = ((c1 << 4) | c2); _dest[destCnt] = c; destCnt++; } } else break; } } if (cnt < _srcLen && ((_srcLen - cnt) > 1 || _src[_srcLen-1] != '=')) return -1; return destCnt; } int NGDecodeQuotedPrintable(const char *_src, unsigned _srcLen, char *_dest, unsigned _destLen) { // should we deprecated that? return NGDecodeQuotedPrintableX(_src, _srcLen, _dest, _destLen, YES); } /* From RFC 2045 Multipurpose Internet Mail Extensions 6.7. Quoted-Printable Content-Transfer-Encoding ... In this encoding, octets are to be represented as determined by the following rules: (1) (General 8bit representation) Any octet, except a CR or LF that is part of a CRLF line break of the canonical (standard) form of the data being encoded, may be represented by an "=" followed by a two digit hexadecimal representation of the octet's value. The digits of the hexadecimal alphabet, for this purpose, are "0123456789ABCDEF". Uppercase letters must be used; lowercase letters are not allowed. Thus, for example, the decimal value 12 (US-ASCII form feed) can be represented by "=0C", and the decimal value 61 (US- ASCII EQUAL SIGN) can be represented by "=3D". This rule must be followed except when the following rules allow an alternative encoding. (2) (Literal representation) Octets with decimal values of 33 through 60 inclusive, and 62 through 126, inclusive, MAY be represented as the US-ASCII characters which correspond to those octets (EXCLAMATION POINT through LESS THAN, and GREATER THAN through TILDE, respectively). (3) (White Space) Octets with values of 9 and 32 MAY be represented as US-ASCII TAB (HT) and SPACE characters, respectively, but MUST NOT be so represented at the end of an encoded line. Any TAB (HT) or SPACE characters on an encoded line MUST thus be followed on that line by a printable character. In particular, an "=" at the end of an encoded line, indicating a soft line break (see rule #5) may follow one or more TAB (HT) or SPACE characters. It follows that an octet with decimal value 9 or 32 appearing at the end of an encoded line must be represented according to Rule #1. This rule is necessary because some MTAs (Message Transport Agents, programs which transport messages from one user to another, or perform a portion of such transfers) are known to pad lines of text with SPACEs, and others are known to remove "white space" characters from the end of a line. Therefore, when decoding a Quoted-Printable body, any trailing white space on a line must be deleted, as it will necessarily have been added by intermediate transport agents. (4) (Line Breaks) A line break in a text body, represented as a CRLF sequence in the text canonical form, must be represented by a (RFC 822) line break, which is also a CRLF sequence, in the Quoted-Printable encoding. Since the canonical representation of media types other than text do not generally include the representation of line breaks as CRLF sequences, no hard line breaks (i.e. line breaks that are intended to be meaningful and to be displayed to the user) can occur in the quoted-printable encoding of such types. Sequences like "=0D", "=0A", "=0A=0D" and "=0D=0A" will routinely appear in non-text data represented in quoted- printable, of course. (5) (Soft Line Breaks) The Quoted-Printable encoding REQUIRES that encoded lines be no more than 76 characters long. If longer lines are to be encoded with the Quoted-Printable encoding, "soft" line breaks must be used. An equal sign as the last character on a encoded line indicates such a non-significant ("soft") line break in the encoded text. */ int NGEncodeQuotedPrintable(const char *_src, unsigned _srcLen, char *_dest, unsigned _destLen) { unsigned cnt = 0; unsigned destCnt = 0; unsigned lineStart= destCnt; char hexT[16] = {'0','1','2','3','4','5','6','7','8', '9','A','B','C','D','E','F'}; if (_srcLen > _destLen) return -1; for (cnt = 0; (cnt < _srcLen) && (destCnt < _destLen); cnt++) { if (destCnt - lineStart > 70) { // Possibly going to exceed 76 chars this line if (_destLen - destCnt > 2) { _dest[destCnt++] = '='; _dest[destCnt++] = '\r'; _dest[destCnt++] = '\n'; lineStart = destCnt; } else break; } char c = _src[cnt]; if (c == 95) { // we encode the _, otherwise we'll always decode it as a space! if (_destLen - destCnt > 2) { _dest[destCnt++] = '='; _dest[destCnt++] = '5'; _dest[destCnt++] = 'F'; } else break; } else if ((c == 9) || (c == 13) || ((c > 31) && (c < 61)) || ((c > 61) && (c < 127))) { // no quoting _dest[destCnt++] = c; } else if (c == 10) { // Reset line length counter _dest[destCnt++] = c; lineStart = destCnt; } else { // need to be quoted if (_destLen - destCnt > 2) { _dest[destCnt++] = '='; _dest[destCnt++] = hexT[(c >> 4) & 15]; _dest[destCnt++] = hexT[c & 15]; } else break; } } if (cnt < _srcLen) return -1; return destCnt; } // static linking void __link_NGQuotedPrintableCoding(void) { __link_NGQuotedPrintableCoding(); } SOPE/sope-core/NGExtensions/common.h0000644000000000000000000000621112242733417016250 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGExtensions_common_h__ #define __NGExtensions_common_h__ #import #import #include #if defined(WIN32) # include #elif defined(NeXT) || NeXT_Foundation_LIBRARY # include #else # include # include #endif #if !defined(WIN32) #include #endif #if GNU_RUNTIME #if __GNU_LIBOBJC__ >= 20100911 # include #else # import # import # import #endif #endif #if LIB_FOUNDATION_LIBRARY # include # import #endif #ifndef ASSIGN # define ASSIGN(object, value) \ ({id __object = (id)object; \ id __value = (id)value; \ if (__value != __object) { if (__value) [__value retain]; \ if (__object) [__object release]; \ object = __value;}}) #endif #ifndef ASSIGNCOPY # define ASSIGNCOPY(object, value) \ ({id __object = (id)object; \ id __value = (id)value; \ if (__value != __object) { if (__value) __value = [__value copy]; \ if (__object) [__object release]; \ object = __value;}}) #endif #if LIB_FOUNDATION_LIBRARY # define NoZone nil #else # define NoZone NULL #endif #include #include #include #include #include #ifndef __MINGW32__ #include #endif #if defined(WIN32) static inline const char *index(const char *str, char c) __attribute__((unused)); static const char *index(const char *str, char c) { while ((*str != '\0') && (*str != c)) str++; if (*str == '\0') return NULL; else return str; } #endif #if PROFILE # define BEGIN_PROFILE \ { NSTimeInterval __ti = [[NSDate date] timeIntervalSince1970]; # define END_PROFILE \ __ti = [[NSDate date] timeIntervalSince1970] - __ti;\ if (__ti > 0.05) \ printf("***PROF[%s]: %0.3fs\n", __PRETTY_FUNCTION__, __ti);\ else if (__ti > 0.005) \ printf("PROF[%s]: %0.3fs\n", __PRETTY_FUNCTION__, __ti);\ } # define PROFILE_CHECKPOINT(__key__) \ printf("---PROF[%s] CP %s: %0.3fs\n", __PRETTY_FUNCTION__, __key__,\ [[NSDate date] timeIntervalSince1970] - __ti) #else # define BEGIN_PROFILE { # define END_PROFILE } # define PROFILE_CHECKPOINT(__key__) #endif #endif SOPE/sope-core/NGExtensions/NGResourceLocator.m0000644000000000000000000001624512242733417020335 0ustar rootroot/* Copyright (C) 2000-2006 SKYRIX Software AG Copyright (C) 2006 Helge Hess This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NGResourceLocator.h" #include "NSNull+misc.h" #include "common.h" @implementation NGResourceLocator + (id)resourceLocatorForGNUstepPath:(NSString *)_path fhsPath:(NSString *)_fhs{ return [[[self alloc] initWithGNUstepPath:_path fhsPath:_fhs] autorelease]; } - (id)initWithGNUstepPath:(NSString *)_path fhsPath:(NSString *)_fhs { if ((self = [super init])) { self->gsSubPath = [_path copy]; self->fhsSubPath = [_fhs copy]; self->fileManager = [[NSFileManager defaultManager] retain]; self->flags.cacheSearchPathes = 1; self->flags.cachePathMisses = 1; self->flags.cachePathHits = 1; } return self; } - (id)init { #if GNUSTEP_BASE_LIBRARY return [self initWithGNUstepPath:@"Resources" fhsPath:@"share"]; #else return [self initWithGNUstepPath:@"Library/Resources" fhsPath:@"share"]; #endif } - (void)dealloc { [self->nameToPathCache release]; [self->searchPathes release]; [self->fhsSubPath release]; [self->gsSubPath release]; [self->fileManager release]; [super dealloc]; } /* search pathes */ - (NSArray *)gsRootPathes { static NSArray *pathes = nil; NSDictionary *env; NSString *apath; if (pathes != nil) return [pathes isNotNull] ? pathes : (NSArray *)nil; env = [[NSProcessInfo processInfo] environment]; if ((apath = [env objectForKey:@"GNUSTEP_PATHPREFIX_LIST"]) == nil) apath = [env objectForKey:@"GNUSTEP_PATHLIST"]; if (![apath isNotNull]) return nil; pathes = [[apath componentsSeparatedByString:@":"] copy]; return pathes; } - (NSArray *)fhsRootPathes { // TODO: we probably want to make this configurable?! At least with an envvar static NSArray *pathes = nil; if (pathes == nil) { pathes = [[NSArray alloc] initWithObjects: #ifdef FHS_INSTALL_ROOT FHS_INSTALL_ROOT, #endif @"/usr/local/", @"/usr/", nil]; } return pathes; } - (NSArray *)collectSearchPathes { NSMutableArray *ma; NSEnumerator *e; NSString *p; ma = [NSMutableArray arrayWithCapacity:6]; if ([self->gsSubPath length] > 0) { #if GNUSTEP_BASE_LIBRARY NSString *directory; e = [NSStandardLibraryPaths() objectEnumerator]; while ((directory = [e nextObject])) [ma addObject: [directory stringByAppendingPathComponent:self->gsSubPath]]; #else /* Old hack using GNUSTEP_PATHLIST. Should be removed at some point. */ e = [[self gsRootPathes] objectEnumerator]; while ((p = [e nextObject]) != nil) { p = [p stringByAppendingPathComponent:self->gsSubPath]; if ([ma containsObject:p]) continue; if (![self->fileManager fileExistsAtPath:p]) continue; [ma addObject:p]; } #endif } e = ([self->fhsSubPath length] > 0) ? [[self fhsRootPathes] objectEnumerator] : (NSEnumerator *)nil; while ((p = [e nextObject]) != nil) { p = [p stringByAppendingPathComponent:self->fhsSubPath]; if ([ma containsObject:p]) continue; if (![self->fileManager fileExistsAtPath:p]) continue; [ma addObject:p]; } return ma; } - (NSArray *)searchPathes { NSArray *a; if (self->searchPathes != nil) return self->searchPathes; a = [self collectSearchPathes]; if (self->flags.cacheSearchPathes) { ASSIGNCOPY(self->searchPathes, a); return self->searchPathes; /* return copy */ } return a; } /* cache */ - (void)cachePath:(NSString *)_path forName:(NSString *)_name { if (self->nameToPathCache == nil) self->nameToPathCache = [[NSMutableDictionary alloc] initWithCapacity:64]; [self->nameToPathCache setObject:(_path ? _path : (NSString *)[NSNull null]) forKey:_name]; } /* operation */ - (NSString *)lookupFileWithName:(NSString *)_name { NSEnumerator *e; NSString *p; if (![_name isNotNull] || [_name length] == 0) return nil; if ((p = [self->nameToPathCache objectForKey:_name]) != nil) return [p isNotNull] ? p : (NSString *)nil; e = [[self searchPathes] objectEnumerator]; while ((p = [e nextObject]) != nil) { p = [p stringByAppendingPathComponent:_name]; if (![self->fileManager fileExistsAtPath:p]) continue; [self cachePath:p forName:_name]; return p; } if (self->flags.cachePathMisses) [self cachePath:nil forName:_name]; return nil; } - (NSString *)lookupFileWithName:(NSString *)_name extension:(NSString *)_ext { if ([_ext isNotNull] && [_ext length] > 0) _name = [_name stringByAppendingPathExtension:_ext]; return [self lookupFileWithName:_name]; } - (NSArray *)lookupAllFilesWithExtension:(NSString *)_ext doReturnFullPath:(BOOL)_withPath { /* only deliver each filename once */ NSMutableArray *pathes; NSMutableSet *uniquer; NSArray *lSearchPathes; unsigned i, count; _ext = ([_ext length] > 0) ? [@"." stringByAppendingString:_ext] : (NSString *)nil; uniquer = [NSMutableSet setWithCapacity:128]; pathes = _withPath ? [NSMutableArray arrayWithCapacity:64] : nil; lSearchPathes = [self searchPathes]; for (i = 0, count = [lSearchPathes count]; i < count; i++) { NSArray *filenames; unsigned j, jcount; filenames = [self->fileManager directoryContentsAtPath: [lSearchPathes objectAtIndex:i]]; for (j = 0, jcount = [filenames count]; j < jcount; j++) { NSString *fn, *pn; fn = [filenames objectAtIndex:j]; if (_ext != nil) { if (![fn hasSuffix:_ext]) continue; } if ([uniquer containsObject:fn]) continue; [uniquer addObject:fn]; /* build and cache path */ pn = [[lSearchPathes objectAtIndex:i] stringByAppendingPathComponent:fn]; [self cachePath:pn forName:fn]; if (_withPath) [pathes addObject:pn]; } } return _withPath ? (NSArray *)pathes : [uniquer allObjects]; } /* description */ - (NSString *)description { NSMutableString *ms; ms = [NSMutableString stringWithCapacity:128]; [ms appendFormat:@"<0x%p[%@]:", self, NSStringFromClass([self class])]; [ms appendFormat:@" gs=%@ fhs=%@", self->gsSubPath, self->fhsSubPath]; [ms appendString:@" cache"]; if (self->flags.cacheSearchPathes) [ms appendString:@":pathes"]; if (self->flags.cachePathHits) [ms appendString:@":hits"]; if (self->flags.cachePathMisses) [ms appendString:@":misses"]; [ms appendFormat:@":#%d", [self->nameToPathCache count]]; [ms appendString:@">"]; return ms; } @end /* NGResourceLocator */ SOPE/sope-core/NGExtensions/Version0000644000000000000000000000016612242733417016162 0ustar rootroot# version SUBMINOR_VERSION:=203 # v4.3.115 requires libFoundation v1.0.59 # v4.2.72 requires libEOControl v4.2.39 SOPE/sope-core/README-OSX.txt0000644000000000000000000000053312242733417014371 0ustar rootrootPlease refer to ../README-OSX.txt for compilation directives. Building Notes ============== Prerequisites: - sope-xml Prebinding Notes (DEPRECATED, for reference only) ================================================= sope-core: 0xC1000000 - 0xC2FFFFFF 0xC1000000 EOControl 0xC1200000 NGExtensions 0xC1400000 NGStreams 0xC2E00000 EOCoreData SOPE/sope-core/EOCoreData/0000755000000000000000000000000012242733417014131 5ustar rootrootSOPE/sope-core/EOCoreData/fhs.make0000644000000000000000000000160512242733417015552 0ustar rootroot# postprocessing # FHS support (this is a hack and is going to be done by gstep-make!) ifneq ($(FHS_INSTALL_ROOT),) FHS_INCLUDE_DIR=$(FHS_INSTALL_ROOT)/include/ FHS_LIB_DIR=$(FHS_INSTALL_ROOT)/lib/ FHS_BIN_DIR=$(FHS_INSTALL_ROOT)/bin/ fhs-header-dirs :: $(MKDIRS) $(FHS_INCLUDE_DIR)$(libEOCoreData_HEADER_FILES_INSTALL_DIR) move-headers-to-fhs :: fhs-header-dirs @echo "moving headers to $(FHS_INCLUDE_DIR) .." mv -f $(GNUSTEP_HEADERS)$(libEOCoreData_HEADER_FILES_INSTALL_DIR)/*.h \ $(FHS_INCLUDE_DIR)$(libEOCoreData_HEADER_FILES_INSTALL_DIR)/ NONFHS_LIBDIR="$(GNUSTEP_LIBRARIES)/$(GNUSTEP_TARGET_LDIR)/" NONFHS_LIBNAME="$(LIBRARY_NAME)$(LIBRARY_NAME_SUFFIX)$(SHARED_LIBEXT)" move-libs-to-fhs :: @echo "moving libs to $(FHS_LIB_DIR) .." mv -f $(NONFHS_LIBDIR)/$(NONFHS_LIBNAME)* $(FHS_LIB_DIR)/ move-to-fhs :: move-headers-to-fhs move-libs-to-fhs after-install :: move-to-fhs endif SOPE/sope-core/EOCoreData/EOSortOrdering+CoreData.m0000644000000000000000000000521312242733417020633 0ustar rootroot/* Copyright (C) 2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "EOSortOrdering+CoreData.h" #include "common.h" @implementation EOSortOrdering(CoreData) - (id)initWithSortDescriptor:(NSSortDescriptor *)_descriptor { SEL sel; if (_descriptor == nil) { [self release]; return nil; } sel = [_descriptor selector]; if (SEL_EQ(sel, @selector(compare:))) { sel = [_descriptor ascending] ? EOCompareAscending : EOCompareDescending; } else if (SEL_EQ(sel, @selector(caseInsensitiveCompare:))) { sel = [_descriptor ascending] ? EOCompareCaseInsensitiveAscending : EOCompareCaseInsensitiveDescending; } else { if (![_descriptor ascending]) { NSLog(@"WARNING(%s): cannot representing descending selector in " @"NSSortDescriptor: %@", __PRETTY_FUNCTION__, _descriptor); } } return [self initWithKey:[_descriptor key] selector:sel]; } - (BOOL)isAscendingEOSortSelector:(SEL)_sel { if (SEL_EQ(_sel, EOCompareDescending)) return NO; if (SEL_EQ(_sel, EOCompareCaseInsensitiveAscending)) return NO; return YES; } - (SEL)cdSortSelectorFromEOSortSelector:(SEL)_sel { if (SEL_EQ(_sel, EOCompareAscending)) return @selector(compare:); if (SEL_EQ(_sel, EOCompareDescending)) return @selector(compare:); if (SEL_EQ(_sel, EOCompareCaseInsensitiveAscending)) return @selector(caseInsensitiveCompare:); if (SEL_EQ(_sel, EOCompareCaseInsensitiveDescending)) return @selector(caseInsensitiveCompare:); return _sel; } - (NSSortDescriptor *)asSortDescriptor { SEL sel; sel = [self selector]; return [[[NSSortDescriptor alloc] initWithKey:[self key] ascending:[self isAscendingEOSortSelector:sel] selector:[self cdSortSelectorFromEOSortSelector:sel]] autorelease]; } @end /* EOSortOrdering(CoreData) */ @implementation NSSortDescriptor(EOCoreData) - (NSSortDescriptor *)asSortDescriptor { return self; } @end /* NSSortDescriptor(EOCoreData) */ SOPE/sope-core/EOCoreData/EOKeyComparisonQualifier+CoreData.m0000644000000000000000000000464612242733417022650 0ustar rootroot/* Copyright (C) 2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "EOQualifier+CoreData.h" #include "NSPredicate+EO.h" #include "NSExpression+EO.h" #include "common.h" @implementation EOKeyComparisonQualifier(CoreData) + (EOQualifier *)qualifierForComparisonPredicate:(NSComparisonPredicate *)_p { SEL sel; if ((sel = [self eoSelectorForForComparisonPredicate:_p]) == nil) return (EOQualifier *)_p; return [[[self alloc] initWithLeftKey:[[_p leftExpression] keyPath] operatorSelector:sel rightKey:[[_p rightExpression] keyPath]] autorelease]; } - (NSPredicate *)asPredicate { NSExpression *lhs, *rhs; id tmp; tmp = [self leftKey]; lhs = [tmp isKindOfClass:[EOQualifierVariable class]] ? [NSExpression expressionForVariable:[(EOQualifierVariable *)tmp key]] : [NSExpression expressionForKeyPath:tmp]; tmp = [self rightKey]; rhs = [tmp isKindOfClass:[EOQualifierVariable class]] ? [NSExpression expressionForVariable:[(EOQualifierVariable *)tmp key]] : [NSExpression expressionForKeyPath:tmp]; return [self predicateWithLeftExpression:lhs rightExpression:rhs eoSelector:[self selector]]; } /* CoreData compatibility */ - (NSComparisonPredicateModifier)comparisonPredicateModifier { return NSDirectPredicateModifier; } - (NSPredicateOperatorType)predicateOperatorType { return [[self class] predicateOperatorTypeForEOSelector:[self selector]]; } - (unsigned)options { return (SEL_EQ([self selector], EOQualifierOperatorCaseInsensitiveLike)) ? NSCaseInsensitivePredicateOption : 0; } - (SEL)customSelector { return [self predicateOperatorType] == NSCustomSelectorPredicateOperatorType ? [self selector] : nil; } @end /* EOKeyComparisonQualifier(CoreData) */ SOPE/sope-core/EOCoreData/NSPredicate+EO.h0000644000000000000000000000244012242733417016742 0ustar rootroot/* Copyright (C) 2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NSPredicate_EO_H__ #define __NSPredicate_EO_H__ #import #import #include /* NSPredicate(EO) Convert an NSPredicate to an EOQualifier. */ @class NSExpression; @class EOQualifier; @interface NSPredicate(EO) - (NSPredicate *)asPredicate; - (NSExpression *)asExpression; - (EOQualifier *)asQualifier; @end @interface NSComparisonPredicate(EOCoreData) < EOKeyValueArchiving > @end #endif /* __NSPredicate_EO_H__ */ SOPE/sope-core/EOCoreData/GNUmakefile0000644000000000000000000000344012242733417016204 0ustar rootroot# GNUstep makefile include ../../config.make include ../common.make ifneq ($(frameworks),yes) LIBRARY_NAME = libEOCoreData else FRAMEWORK_NAME = EOCoreData endif libEOCoreData_PCH_FILE = common.h libEOCoreData_INTERFACE_VERSION=$(MAJOR_VERSION).$(MINOR_VERSION) libEOCoreData_INSTALL_DIR=$(SOPE_SYSLIBDIR) libEOCoreData_VERSION=$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBMINOR_VERSION) libEOCoreData_HEADER_FILES_DIR = . libEOCoreData_HEADER_FILES_INSTALL_DIR = /EOCoreData # headers libEOCoreData_HEADER_FILES += \ EOCoreData.h \ EOCoreDataSource.h \ \ EOFetchSpecification+CoreData.h \ EOQualifier+CoreData.h \ EOSortOrdering+CoreData.h \ libEOCoreData_HEADER_FILES += \ NSExpression+EO.h \ NSPredicate+EO.h \ NSEntityDescription+EO.h \ NSAttributeDescription+EO.h \ NSRelationshipDescription+EO.h \ # implementations libEOCoreData_OBJC_FILES += \ EOCoreDataSource.m \ \ EOFetchSpecification+CoreData.m \ EOQualifier+CoreData.m \ EOSortOrdering+CoreData.m \ EOKeyValueQualifier+CoreData.m \ EOKeyComparisonQualifier+CoreData.m \ EOCompoundQualifiers.m \ libEOCoreData_OBJC_FILES += \ NSExpression+EO.m \ NSPredicate+EO.m \ NSEntityDescription+EO.m \ NSAttributeDescription+EO.m \ NSRelationshipDescription+EO.m \ NSManagedObject+KVC.m \ libEOCoreData_OBJC_FILES += \ NSString+CoreData.m # framework support EOCoreData_PCH_FILE = $(libEOCoreData_PCH_FILE) EOCoreData_HEADER_FILES = $(libEOCoreData_HEADER_FILES) EOCoreData_OBJC_FILES = $(libEOCoreData_OBJC_FILES) # building -include GNUmakefile.preamble ifneq ($(FHS_INSTALL_ROOT),) GNUSTEP_HEADERS=$(DESTDIR)$(FHS_INSTALL_ROOT)/include endif ifneq ($(frameworks),yes) include $(GNUSTEP_MAKEFILES)/library.make else include $(GNUSTEP_MAKEFILES)/framework.make endif -include GNUmakefile.postamble SOPE/sope-core/EOCoreData/EOCoreData-Info.plist0000644000000000000000000000134612242733417020011 0ustar rootroot CFBundleDevelopmentRegion English CFBundleExecutable EOCoreData CFBundleGetInfoString CFBundleIdentifier org.OpenGroupware.SOPE.core.EOCoreData CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType FMWK CFBundleShortVersionString CFBundleSignature ???? CFBundleVersion 4.5 SOPE/sope-core/EOCoreData/NSExpression+EO.h0000644000000000000000000000220712242733417017202 0ustar rootroot/* Copyright (C) 2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NSExpression_EO_H__ #define __NSExpression_EO_H__ #import /* NSExpression(EO) Convert an NSExpression to an EOQualifier. */ @class NSExpression; @class EOQualifier; @interface NSExpression(EOCoreData) < EOKeyValueArchiving > - (NSPredicate *)asPredicate; - (NSExpression *)asExpression; @end #endif /* __NSExpression_EO_H__ */ SOPE/sope-core/EOCoreData/COPYING0000644000000000000000000006130312242733417015167 0ustar rootroot GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 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. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] 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 Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, 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 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 a program 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. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, 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 companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. 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, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library 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 compile 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) 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. c) 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. d) 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 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. 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 to 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 Library 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 Appendix: 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 Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library 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! SOPE/sope-core/EOCoreData/EOQualifier+CoreData.m0000644000000000000000000001544112242733417020137 0ustar rootroot/* Copyright (C) 2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "EOQualifier+CoreData.h" #include "NSPredicate+EO.h" #include "NSExpression+EO.h" #include "common.h" /* CoreData / Foundation EOF Predicates: NSComparisonPredicate EOKeyValueQualifier / EOKeyComparisonQualifier NSCompoundPredicate EOAndQualifier / EOOrQualifier / EONotQualifier NSExpressions: - constant - evaluatedObject - variable EOQualifierVariable - keypath - function EOF operators: EOQualifierOperatorEqual; EOQualifierOperatorNotEqual; EOQualifierOperatorLessThan; EOQualifierOperatorGreaterThan; EOQualifierOperatorLessThanOrEqualTo; EOQualifierOperatorGreaterThanOrEqualTo; EOQualifierOperatorContains; EOQualifierOperatorLike; EOQualifierOperatorCaseInsensitiveLike; */ @implementation EOQualifier(CoreData) + (NSPredicateOperatorType)predicateOperatorTypeForEOSelector:(SEL)_sel { if (SEL_EQ(_sel, EOQualifierOperatorEqual)) return NSEqualToPredicateOperatorType; if (SEL_EQ(_sel, EOQualifierOperatorNotEqual)) return NSNotEqualToPredicateOperatorType; if (SEL_EQ(_sel, EOQualifierOperatorLessThan)) return NSLessThanPredicateOperatorType; if (SEL_EQ(_sel, EOQualifierOperatorGreaterThan)) return NSGreaterThanPredicateOperatorType; if (SEL_EQ(_sel, EOQualifierOperatorLessThanOrEqualTo)) return NSLessThanOrEqualToPredicateOperatorType; if (SEL_EQ(_sel, EOQualifierOperatorGreaterThanOrEqualTo)) return NSGreaterThanOrEqualToPredicateOperatorType; if (SEL_EQ(_sel, EOQualifierOperatorContains)) return NSInPredicateOperatorType; if (SEL_EQ(_sel, EOQualifierOperatorLike) || SEL_EQ(_sel, EOQualifierOperatorCaseInsensitiveLike)) return NSLikePredicateOperatorType; return NSCustomSelectorPredicateOperatorType; } + (SEL)eoSelectorForForComparisonPredicate:(NSComparisonPredicate *)_p { BOOL hasOpt; SEL sel = NULL; if (_p == nil) return NULL; hasOpt = [_p options] != 0 ? YES : NO; // TODO: need to check options switch ([_p predicateOperatorType]) { case NSCustomSelectorPredicateOperatorType: sel = hasOpt ? NULL : [_p customSelector]; break; case NSLessThanPredicateOperatorType: sel = hasOpt ? NULL : EOQualifierOperatorLessThan; break; case NSLessThanOrEqualToPredicateOperatorType: sel = hasOpt ? NULL : EOQualifierOperatorLessThanOrEqualTo; break; case NSGreaterThanPredicateOperatorType: sel = hasOpt ? NULL : EOQualifierOperatorGreaterThan; break; case NSGreaterThanOrEqualToPredicateOperatorType: sel = hasOpt ? NULL : EOQualifierOperatorGreaterThanOrEqualTo; break; case NSEqualToPredicateOperatorType: sel = hasOpt ? NULL : EOQualifierOperatorEqual; break; case NSNotEqualToPredicateOperatorType: sel = hasOpt ? NULL : EOQualifierOperatorNotEqual; break; case NSLikePredicateOperatorType: sel = ([_p options] == NSCaseInsensitivePredicateOption) ? EOQualifierOperatorCaseInsensitiveLike : (hasOpt ? NULL : EOQualifierOperatorLike); break; case NSInPredicateOperatorType: // TODO: for arrays: containsObject:, for strings: containsString: sel = hasOpt ? NULL : EOQualifierOperatorContains; break; case NSBeginsWithPredicateOperatorType: sel = hasOpt ? NULL : @selector(hasPrefix:); break; case NSEndsWithPredicateOperatorType: sel = hasOpt ? NULL : @selector(hasSuffix:); break; /* unsupported predicates */ case NSMatchesPredicateOperatorType: // TODO default: sel = NULL; break; } if (sel == NULL) { NSLog(@"ERROR(%s): cannot map NSComparisonPredicate to " @"EOQualifier selector: %@", __PRETTY_FUNCTION__, _p); } return sel; } - (NSPredicate *)predicateWithLeftExpression:(NSExpression *)_lhs rightExpression:(NSExpression *)_rhs eoSelector:(SEL)_selector { // TODO: create non-custom predicate if possible NSComparisonPredicateModifier pmod; NSPredicateOperatorType ptype; unsigned popts; if (_selector == NULL) { NSLog(@"ERROR(0x%p/%@): missing selector for predicate construction: %@", self, NSStringFromClass([self class]), self); return nil; } ptype = [EOQualifier predicateOperatorTypeForEOSelector:_selector]; if (ptype == NSCustomSelectorPredicateOperatorType) { return [NSComparisonPredicate predicateWithLeftExpression:_lhs rightExpression:_rhs customSelector:_selector]; } pmod = NSDirectPredicateModifier; popts = 0; if (SEL_EQ(_selector, EOQualifierOperatorCaseInsensitiveLike)) popts = NSCaseInsensitivePredicateOption; return [NSComparisonPredicate predicateWithLeftExpression:_lhs rightExpression:_rhs modifier:pmod type:ptype options:popts]; } + (EOQualifier *)qualifierForPredicate:(NSPredicate *)_predicate { if (_predicate == nil) return nil; if ([_predicate respondsToSelector:@selector(asQualifier)]) return [_predicate asQualifier]; NSLog(@"ERROR(%s): cannot convert NSPredicate class %@!", __PRETTY_FUNCTION__, NSStringFromClass([self class])); return nil; } - (EOQualifier *)asQualifier { return self; } - (NSPredicate *)asPredicate { NSLog(@"TODO(%s): implement me for class %@!", __PRETTY_FUNCTION__, NSStringFromClass([self class])); return nil; } - (NSExpression *)asExpression { return nil; } /* CoreData compatibility */ + (NSPredicate *)andPredicateWithSubpredicates:(NSArray *)_sub { return [NSCompoundPredicate andPredicateWithSubpredicates: [_sub valueForKey:@"asPredicate"]]; } + (NSPredicate *)orPredicateWithSubpredicates:(NSArray *)_sub { return [NSCompoundPredicate orPredicateWithSubpredicates: [_sub valueForKey:@"asPredicate"]]; } + (NSPredicate *)notPredicateWithSubpredicate:(id)_predicate { return [NSCompoundPredicate notPredicateWithSubpredicate: [_predicate asPredicate]]; } - (NSPredicate *)predicateWithSubstitutionVariables:(NSDictionary *)_vars { return [[self asPredicate] predicateWithSubstitutionVariables:_vars]; } - (NSString *)predicateFormat { return [[self asPredicate] predicateFormat]; } @end /* EOQualifier(CoreData) */ SOPE/sope-core/EOCoreData/NSAttributeDescription+EO.m0000644000000000000000000000367112242733417021225 0ustar rootroot/* Copyright (C) 2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NSAttributeDescription+EO.h" #import #include "common.h" @implementation NSAttributeDescription(EO) - (unsigned)width { /* This scans for a validation predicate checking for the maximum length. The code looks for: - an NSComparisonPredicate - which has the operator <= - and a keypath LHS with the keypath 'length' Note: only scans one level, does not walk NSCompoundPredicates */ NSArray *preds; unsigned i, count; if ((preds = [self validationPredicates]) == nil) return 0; if ((count = [preds count]) == 0) return 0; for (i = 0; i < count; i++) { NSComparisonPredicate *p; p = [preds objectAtIndex:i]; if (![p isKindOfClass:[NSComparisonPredicate class]]) continue; if ([p predicateOperatorType] != NSLessThanOrEqualToPredicateOperatorType) continue; if (![[[p leftExpression] keyPath] isEqualToString:@"length"]) continue; /* found it! */ return [[[p rightExpression] constantValue] unsignedIntValue]; } return 0; } - (BOOL)allowsNull { return [self isOptional]; } @end /* NSAttributeDescription(EO) */ SOPE/sope-core/EOCoreData/NSAttributeDescription+EO.h0000644000000000000000000000254312242733417021215 0ustar rootroot/* Copyright (C) 2005-2007 SKYRIX Software AG Copyright (C) 2007 Helge Hess This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NSAttributeDescription_EO_H__ #define __NSAttributeDescription_EO_H__ // the next two are here to please the Leopard #import @class NSData; #import /* NSAttributeDescription(EO) Make an NSAttributeDescription behave like an EOAttribute. This is mostly to make the CoreData model objects work with DirectToWeb and EO at the same time. */ @interface NSAttributeDescription(EO) - (unsigned)width; - (BOOL)allowsNull; @end #endif /* __NSAttributeDescription_EO_H__ */ SOPE/sope-core/EOCoreData/EOCoreDataSource.h0000644000000000000000000000472312242733417017377 0ustar rootroot/* Copyright (C) 2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __EOCoreDataSource_H__ #define __EOCoreDataSource_H__ #include /* EOCoreDataSource This wraps a NSManagedObjectContext in an EODataSource. It corresponds to the EODatabaseDataSource available in EOF. Note: if you use -setFetchRequest: all the EO related methods will be reset! */ @class NSArray, NSDictionary; @class NSManagedObjectContext, NSEntityDescription, NSFetchRequest; @class EOQualifier, EOFetchSpecification; @interface EOCoreDataSource : EODataSource { NSManagedObjectContext *managedObjectContext; NSEntityDescription *entity; EOFetchSpecification *fetchSpecification; EOQualifier *auxiliaryQualifier; NSDictionary *qualifierBindings; NSFetchRequest *fetchRequest; struct { int isFetchEnabled:1; int isEntityFromFetchSpec:1; int reserved:30; } ecdFlags; } - (id)initWithManagedObjectContext:(NSManagedObjectContext *)_moc entity:(NSEntityDescription *)_entity; /* fetch-spec */ - (void)setFetchSpecification:(EOFetchSpecification *)_fspec; - (EOFetchSpecification *)fetchSpecification; - (EOFetchSpecification *)fetchSpecificationForFetch; - (void)setAuxiliaryQualifier:(EOQualifier *)_qualifier; - (EOQualifier *)auxiliaryQualifier; - (void)setIsFetchEnabled:(BOOL)_flag; - (BOOL)isFetchEnabled; - (NSArray *)qualifierBindingKeys; - (void)setQualifierBindings:(NSDictionary *)_bindings; - (NSDictionary *)qualifierBindings; /* directly access a CoreData fetch request */ - (void)setFetchRequest:(NSFetchRequest *)_fr; - (NSFetchRequest *)fetchRequest; /* accessors */ - (NSEntityDescription *)entity; - (NSManagedObjectContext *)managedObjectContext; @end #endif /* __EOCoreDataSource_H__ */ SOPE/sope-core/EOCoreData/EOCoreDataSource.m0000644000000000000000000002662212242733417017406 0ustar rootroot/* Copyright (C) 2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "EOCoreDataSource.h" #include "EOFetchSpecification+CoreData.h" #include "EOQualifier+CoreData.h" #include "common.h" static NSString *EODataSourceDidChangeNotification = @"EODataSourceDidChangeNotification"; @implementation EOCoreDataSource static BOOL debugOn = NO; + (void)initialize { NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; if ((debugOn = [ud boolForKey:@"EOCoreDataSourceDebugEnabled"])) NSLog(@"EOCoreDataSource: debugging enabled."); } - (id)initWithManagedObjectContext:(NSManagedObjectContext *)_moc entity:(NSEntityDescription *)_entity { if ((self = [super init]) != nil) { if (_moc == nil) { NSLog(@"ERROR(%s): missing object-context parameter!", __PRETTY_FUNCTION__); [self release]; return nil; } self->ecdFlags.isFetchEnabled = 1; self->managedObjectContext = [_moc retain]; self->entity = [_entity retain]; } return self; } - (id)init { return [self initWithManagedObjectContext:nil entity:nil]; } - (void)dealloc { [self->qualifierBindings release]; [self->entity release]; [self->managedObjectContext release]; [self->fetchSpecification release]; [self->auxiliaryQualifier release]; [super dealloc]; } /* post datasource changes */ - (void)postDataSourceChangedNotification { /* reimplemented here to avoid linking against NGExtensions */ static NSNotificationCenter *nc = nil; if (nc == nil) nc = [[NSNotificationCenter defaultCenter] retain]; [nc postNotificationName:EODataSourceDidChangeNotification object:self]; } /* fetch-spec */ - (void)_resetFetchRequest { [self->fetchRequest release]; self->fetchRequest = nil; } - (void)setFetchSpecification:(EOFetchSpecification *)_fspec { BOOL isSameEntity; if ([self->fetchSpecification isEqual:_fspec]) return; if ([_fspec isKindOfClass:[NSFetchRequest class]]) { /* be tolerant, we ain't no Java ... */ [self setFetchRequest:(NSFetchRequest *)_fspec]; return; } isSameEntity = [[self->fetchSpecification entityName] isEqual:[_fspec entityName]]; [self->fetchSpecification autorelease]; self->fetchSpecification = [_fspec copy]; /* reset derived entities */ if (self->ecdFlags.isEntityFromFetchSpec && !isSameEntity) { self->ecdFlags.isEntityFromFetchSpec = 0; } [self _resetFetchRequest]; [self postDataSourceChangedNotification]; } - (EOFetchSpecification *)fetchSpecification { return self->fetchSpecification; } - (EOFetchSpecification *)fetchSpecificationForFetch { EOFetchSpecification *fs; EOQualifier *aq; NSDictionary *bindings; fs = [[[self fetchSpecification] copy] autorelease]; /* add auxiliary-qualifier */ if ((aq = [self auxiliaryQualifier]) != nil) { EOQualifier *q; if ((q = [fs qualifier]) != nil) { q = [[EOAndQualifier alloc] initWithQualifiers:q, aq, nil]; [fs setQualifier:q]; [q release]; q = nil; } else [fs setQualifier:aq]; } /* apply bindings */ if ((bindings = [self qualifierBindings]) != nil ) { EOQualifier *q; if ((q = [fs qualifier]) != nil) { q = [q qualifierWithBindings:[self qualifierBindings] requiresAllVariables:YES]; [fs setQualifier:q]; } } /* finished */ return fs; } - (void)setAuxiliaryQualifier:(EOQualifier *)_qualifier { if ([_qualifier isKindOfClass:[NSPredicate class]]) /* be tolerant */ _qualifier = [EOQualifier qualifierForPredicate:(NSPredicate *)_qualifier]; if ([self->auxiliaryQualifier isEqual:_qualifier]) return; ASSIGNCOPY(self->auxiliaryQualifier, _qualifier); [self _resetFetchRequest]; [self postDataSourceChangedNotification]; } - (EOQualifier *)auxiliaryQualifier { return self->auxiliaryQualifier; } - (NSArray *)qualifierBindingKeys { NSMutableSet *join; NSArray *b, *ab; b = [[[self fetchSpecification] qualifier] bindingKeys]; ab = [[self auxiliaryQualifier] bindingKeys]; if (ab == nil) return b; if (b == nil) return ab; join = [[NSMutableSet alloc] initWithCapacity:16]; [join addObjectsFromArray:b]; [join addObjectsFromArray:ab]; b = [join allObjects]; [join release]; return b; } - (void)setQualifierBindings:(NSDictionary *)_bindings { ASSIGN(self->qualifierBindings, _bindings); [self _resetFetchRequest]; [self postDataSourceChangedNotification]; } - (NSDictionary *)qualifierBindings { return self->qualifierBindings; } - (void)setIsFetchEnabled:(BOOL)_flag { int f; f = _flag ? 1 : 0; if (self->ecdFlags.isFetchEnabled == f) return; self->ecdFlags.isFetchEnabled = f; [self postDataSourceChangedNotification]; } - (BOOL)isFetchEnabled { return self->ecdFlags.isFetchEnabled ? YES : NO; } /* directly access a CoreData fetch request */ - (void)setFetchRequest:(NSFetchRequest *)_fr { if (_fr == self->fetchRequest) return; /* reset EO objects */ [self->fetchSpecification release]; self->fetchSpecification = nil; [self->auxiliaryQualifier release]; self->auxiliaryQualifier = nil; [self->qualifierBindings release]; self->qualifierBindings = nil; /* use entity of fetch-request */ if ([_fr entity] != nil) { ASSIGN(self->entity, [_fr entity]); self->ecdFlags.isEntityFromFetchSpec = 1; } ASSIGN(self->fetchRequest, _fr); } - (NSFetchRequest *)fetchRequest { return self->fetchRequest; } /* accessors */ - (NSEntityDescription *)entity { if (self->entity == nil && !self->ecdFlags.isEntityFromFetchSpec) { NSManagedObjectContext *moc; NSString *n; self->ecdFlags.isEntityFromFetchSpec = 1; /* also used for caching fails */ moc = [self managedObjectContext]; n = [[self fetchSpecification] entityName]; if (moc != nil && n != nil) { self->entity = [[NSEntityDescription entityForName:n inManagedObjectContext:moc] retain]; } } return self->entity; } - (NSManagedObjectContext *)managedObjectContext { return self->managedObjectContext; } /* fetching */ - (NSArray *)fetchObjects { EOFetchSpecification *fs; NSError *error = nil; NSArray *results; if (debugOn) NSLog(@"fetchObjects"); if (![self isFetchEnabled]) return [NSArray array]; // TODO: print a warning on entity mismatch? if (self->fetchRequest == nil) { fs = [self fetchSpecificationForFetch]; self->fetchRequest = [[fs fetchRequestWithEntity:[self entity]] retain]; } if (debugOn) NSLog(@" request: %@", self->fetchRequest); results = [[self managedObjectContext] executeFetchRequest:self->fetchRequest error:&error]; if (results == nil) { // TODO: improve (-lastException on the datasource or return the error?) NSLog(@"ERROR(%s): datasource failed to fetch: %@", __PRETTY_FUNCTION__, error); return nil; } if (debugOn) NSLog(@"=> got %d records.", [results count]); // TODO: add grouping support? return results; } /* operations */ - (void)deleteObject:(id)_object { [[self managedObjectContext] deleteObject:_object]; [self postDataSourceChangedNotification]; } - (void)insertObject:(id)_object { [[self managedObjectContext] insertObject:_object]; [self postDataSourceChangedNotification]; } - (id)createObject { Class clazz; id newObject; clazz = NSClassFromString([[self entity] managedObjectClassName]); newObject = [[clazz alloc] initWithEntity:[self entity] insertIntoManagedObjectContext: [self managedObjectContext]]; return [newObject autorelease]; } /* class description */ - (EOClassDescription *)classDescriptionForObjects { // TODO: should we create an EOClassDescription or just add // EOClassDescription description stuff to NSEntityDescription? return (id)[self entity]; } /* archiving */ - (id)initWithKeyValueUnarchiver:(EOKeyValueUnarchiver *)_unarchiver { id lEntity, fs, ec, tmp; /* fetch object context */ ec = [_unarchiver decodeObjectReferenceForKey:@"managedObjectContext"]; if (ec == nil) ec = [_unarchiver decodeObjectReferenceForKey:@"editingContext"]; if (ec != nil && ![ec isKindOfClass:[NSManagedObjectContext class]]) { NSLog(@"WARNING(%s): decode object context is of unexpected class: %@", __PRETTY_FUNCTION__, ec); } if (ec == nil) { NSLog(@"WARNING(%s): decoded no object context from archive!", __PRETTY_FUNCTION__); } /* fetch fetch specification */ fs = [_unarchiver decodeObjectForKey:@"fetchRequest"]; if (fs == nil) fs = [_unarchiver decodeObjectForKey:@"fetchSpecification"]; if (fs != nil && [fs isKindOfClass:[NSFetchRequest class]]) fs = [[[EOFetchSpecification alloc] initWithFetchRequest:fs] autorelease]; /* setup entity */ lEntity = [_unarchiver decodeObjectForKey:@"entity"]; if (lEntity == nil && fs != nil) { /* try to determine entity from fetch-spec */ lEntity = [(EOFetchSpecification *)fs entityName]; } if ([lEntity isKindOfClass:[NSString class]] && ec != nil) { lEntity = [NSEntityDescription entityForName:lEntity inManagedObjectContext:ec]; } /* create object */ if ((self = [self initWithManagedObjectContext:ec entity:lEntity]) == nil) return nil; /* add non-initializer settings */ [self setFetchSpecification:fs]; [self setAuxiliaryQualifier: [_unarchiver decodeObjectForKey:@"auxiliaryQualifier"]]; [self setQualifierBindings: [_unarchiver decodeObjectForKey:@"qualifierBindings"]]; if ((tmp = [_unarchiver decodeObjectForKey:@"isFetchEnabled"]) != nil) [self setIsFetchEnabled:[tmp boolValue]]; return self; } - (void)encodeWithKeyValueArchiver:(EOKeyValueArchiver *)_archiver { // TODO: do we need to produce the reference on our own? [_archiver encodeReferenceToObject:[self managedObjectContext] forKey:@"managedObjectContext"]; [_archiver encodeObject:[self fetchSpecification] forKey:@"fetchSpecification"]; [_archiver encodeObject:[self entity] forKey:@"entity"]; [_archiver encodeObject:[self auxiliaryQualifier] forKey:@"auxiliaryQualifier"]; [_archiver encodeObject:[self qualifierBindings] forKey:@"qualifierBindings"]; [_archiver encodeBool:[self isFetchEnabled] forKey:@"isFetchEnabled"]; } /* description */ - (NSString *)description { NSMutableString *ms; ms = [NSMutableString stringWithCapacity:64]; [ms appendFormat:@"<0x%p[%@]:", self, NSStringFromClass([self class])]; if (self->fetchSpecification != nil) [ms appendFormat:@" fs=%@", self->fetchSpecification]; if (self->auxiliaryQualifier != nil) [ms appendFormat:@" aux=%@", self->auxiliaryQualifier]; if (self->entity != nil) [ms appendFormat:@" entity=%@", [self->entity name]]; [ms appendString:@">"]; return ms; } @end /* EOCoreDataSource */ SOPE/sope-core/EOCoreData/COPYRIGHT0000644000000000000000000000010112242733417015414 0ustar rootrootCopyright (C) 2005 SKYRIX Software AG Contact: info@skyrix.com SOPE/sope-core/EOCoreData/EOQualifier+CoreData.h0000644000000000000000000000544012242733417020130 0ustar rootroot/* Copyright (C) 2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __EOQualifier_CoreData_H__ #define __EOQualifier_CoreData_H__ #import #import #include /* EOQualifier(CoreData) Convert an libEOControl EOQualifier to a CoreData compliant NSPredicate object. */ @class NSArray; @class NSPredicate, NSExpression, NSComparisonPredicate, NSCompoundPredicate; @interface EOQualifier(CoreData) + (EOQualifier *)qualifierForPredicate:(NSPredicate *)_predicate; - (NSPredicate *)asPredicate; - (NSExpression *)asExpression; /* support methods */ + (SEL)eoSelectorForForComparisonPredicate:(NSComparisonPredicate *)_p; + (NSPredicateOperatorType)predicateOperatorTypeForEOSelector:(SEL)_sel; - (NSPredicate *)predicateWithLeftExpression:(NSExpression *)_lhs rightExpression:(NSExpression *)_rhs eoSelector:(SEL)_selector; /* CoreData compatibility */ + (NSPredicate *)andPredicateWithSubpredicates:(NSArray *)_sub; + (NSPredicate *)orPredicateWithSubpredicates:(NSArray *)_sub; + (NSPredicate *)notPredicateWithSubpredicate:(id)_predicate; @end #import /* compound qualifiers */ @interface EOAndQualifier(CoreData) - (NSCompoundPredicateType)compoundPredicateType; @end @interface EOOrQualifier(CoreData) - (NSCompoundPredicateType)compoundPredicateType; @end @interface EONotQualifier(CoreData) - (NSCompoundPredicateType)compoundPredicateType; @end /* comparison qualifiers */ @interface EOKeyValueQualifier(CoreData) + (EOQualifier *)qualifierForComparisonPredicate:(NSComparisonPredicate *)_p; - (NSComparisonPredicateModifier)comparisonPredicateModifier; - (NSPredicateOperatorType)predicateOperatorType; - (SEL)customSelector; - (unsigned)options; @end @interface EOKeyComparisonQualifier(CoreData) + (EOQualifier *)qualifierForComparisonPredicate:(NSComparisonPredicate *)_p; - (NSComparisonPredicateModifier)comparisonPredicateModifier; - (NSPredicateOperatorType)predicateOperatorType; - (SEL)customSelector; - (unsigned)options; @end #endif /* __EOQualifier_CoreData_H__ */ SOPE/sope-core/EOCoreData/ChangeLog0000644000000000000000000000457512242733417015716 0ustar rootroot2007-12-03 Helge Hess * fixed Leopard compilation issues (v4.5.12) 2005-10-03 Helge Hess * v4.5.11 * EOFetchSpecification+CoreData.m: only transfer limit to NSFetchRequest if its != 0 * EOCompoundQualifiers.m: added support for qualifier=>predicate conversion * improved qualifier=>predicate conversion support (v4.5.10) 2005-08-23 Helge Hess * v4.5.9 * added NSString+CoreData.m: for string related CD methods * EOCoreDataSource.m: added 'EOCoreDataSourceDebugEnabled' default to enable debugging 2005-08-06 Marcus Mueller * EOCoreData-Info.plist: new Xcode Info.plist file * EOCoreData.xcodeproj: new Xcode 2.1 project * README.txt: fixed a typo 2005-08-06 Helge Hess * v4.5.8 * NSEntityDescription+EO.m: added -isReadOnly, -classPropertyNames, -primaryKeyAttributeNames, -relationships, -attributes * added NSAttributeDescription+EO category containing the -width and -allowsNull methods * added NSRelationshipDescription+EO category containing the -sourceAttributes method 2005-08-04 Helge Hess * EOCoreDataSource.m: print a warning if no object-context was decoded from an archive, improved decoding of 'isFetchEnabled' (set to yes in case no value was set) (v4.5.7) * NSEntityDescription+EO.m: added EO compatible attribute/relship lookup methods (v4.5.6) 2005-08-04 Helge Hess * NSPredicate+EO.m: also check 'selectorName' key during unarchiving (v4.5.5) 2005-08-04 Helge Hess * NSExpression+EO.m: added EOKeyValueArchiving (v4.5.4) * NSPredicate+EO.m: added EOKeyValueArchiving to NSComparisonPredicate (v4.5.3) 2005-08-03 Helge Hess * v4.5.2 * EOFetchSpecification+CoreData.m: implemented -initWithFetchRequest: * EOCoreDataSource.m: added key/value archiving, added ability to retrieve the entity from the fetch specification, added support for qualifier bindings (v4.5.2) * EOSortOrdering+CoreData.m: implemented conversion methods * EOQualifier+CoreData.m: implemented conversion methods * moved NS* categories to own files * v4.5.1 * moved in implementation prototypes from CoreDataBlog * started EOCoreData library SOPE/sope-core/EOCoreData/NSExpression+EO.m0000644000000000000000000000517012242733417017211 0ustar rootroot/* Copyright (C) 2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import #include "common.h" @implementation NSExpression(EOCoreData) - (NSPredicate *)asPredicate { return nil; } - (NSExpression *)asExpression { return self; } /* key/value archiving */ - (id)initWithKeyValueUnarchiver:(EOKeyValueUnarchiver *)_unarchiver { id tmp; [self release]; self = nil; if ((tmp = [_unarchiver decodeObjectForKey:@"constantValue"]) != nil) return [[NSExpression expressionForConstantValue:tmp] retain]; if ((tmp = [_unarchiver decodeObjectForKey:@"keyPath"]) != nil) return [[NSExpression expressionForKeyPath:tmp] retain]; if ((tmp = [_unarchiver decodeObjectForKey:@"variable"]) != nil) return [[NSExpression expressionForVariable:tmp] retain]; if ((tmp = [_unarchiver decodeObjectForKey:@"function"]) != nil) { NSArray *args; args = [_unarchiver decodeObjectForKey:@"arguments"]; return [[NSExpression expressionForFunction:tmp arguments:args] retain]; } return [[NSExpression expressionForEvaluatedObject] retain]; } - (void)encodeWithKeyValueArchiver:(EOKeyValueArchiver *)_archiver { switch ([self expressionType]) { case NSConstantValueExpressionType: [_archiver encodeObject:[self constantValue] forKey:@"constantValue"]; return; case NSEvaluatedObjectExpressionType: /* encode no marker */ return; case NSVariableExpressionType: [_archiver encodeObject:[self variable] forKey:@"variable"]; return; case NSKeyPathExpressionType: [_archiver encodeObject:[self keyPath] forKey:@"keyPath"]; return; case NSFunctionExpressionType: [_archiver encodeObject:[self function] forKey:@"function"]; [_archiver encodeObject:[self arguments] forKey:@"arguments"]; return; default: NSLog(@"WARNING(%s): could not encode NSExpression: %@!", __PRETTY_FUNCTION__, self); } } @end /* NSPredicate(EOCoreData) */ SOPE/sope-core/EOCoreData/EOCompoundQualifiers.m0000644000000000000000000000354012242733417020346 0ustar rootroot/* Copyright (C) 2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "EOQualifier+CoreData.h" #include "NSPredicate+EO.h" #include "NSExpression+EO.h" #include "common.h" @implementation EOAndQualifier(CoreData) - (NSCompoundPredicateType)compoundPredicateType { return NSAndPredicateType; } - (NSPredicate *)asPredicate { NSArray *tmp; tmp = [self subqualifiers]; tmp = [tmp valueForKey:@"asPredicate"]; return [NSCompoundPredicate andPredicateWithSubpredicates:tmp]; } @end /* EOAndQualifier(CoreData) */ @implementation EOOrQualifier(CoreData) - (NSCompoundPredicateType)compoundPredicateType { return NSOrPredicateType; } - (NSPredicate *)asPredicate { NSArray *tmp; tmp = [self subqualifiers]; tmp = [tmp valueForKey:@"asPredicate"]; return [NSCompoundPredicate orPredicateWithSubpredicates:tmp]; } @end /* EOOrQualifier(CoreData) */ @implementation EONotQualifier(CoreData) - (NSCompoundPredicateType)compoundPredicateType { return NSNotPredicateType; } - (NSPredicate *)asPredicate { return [NSCompoundPredicate notPredicateWithSubpredicate: [[self qualifier] asPredicate]]; } @end /* EONotQualifier(CoreData) */ SOPE/sope-core/EOCoreData/GNUmakefile.preamble0000644000000000000000000000215212242733417017771 0ustar rootroot# GNUstep Makefile ADDITIONAL_CPP_FLAGS += -Wall -Wno-import -Wno-protocol -O2 libEOCoreData_INCLUDE_DIRS += -I.. ADDITIONAL_CPPFLAGS += -Wall -funsigned-char libEOCoreData_LIBRARIES_DEPEND_UPON += -lEOControl EOCoreData_LIBRARIES_DEPEND_UPON += -framework EOControl # library/framework search pathes DEP_DIRS = ../EOControl ifneq ($(frameworks),yes) ADDITIONAL_LIB_DIRS += \ $(foreach dir,$(DEP_DIRS),\ -L$(GNUSTEP_BUILD_DIR)/$(dir)/$(GNUSTEP_OBJ_DIR_NAME)) else ADDITIONAL_LIB_DIRS += \ $(foreach dir,$(DEP_DIRS),-F$(GNUSTEP_BUILD_DIR)/$(dir)) endif SYSTEM_LIB_DIR += -L/usr/local/lib -L/usr/lib # libFoundation, gstep-base ifeq ($(FOUNDATION_LIB),fd) libEOCoreData_LIBRARIES_DEPEND_UPON += -lFoundation endif ifeq ($(FOUNDATION_LIB),gnu) libEOCoreData_LIBRARIES_DEPEND_UPON += -lgnustep-base endif # Apple ifeq ($(FOUNDATION_LIB),apple) # TODO: libEOCoreData_PREBIND_ADDR="0xC1000000" ifneq ($(libEOCoreData_PREBIND_ADDR),) libEOCoreData_LDFLAGS += -seg1addr $(libEOCoreData_PREBIND_ADDR) EOCoreData_LDFLAGS += -seg1addr $(libEOCoreData_PREBIND_ADDR) endif ADDITIONAL_LDFLAGS += -framework CoreData endif SOPE/sope-core/EOCoreData/NSRelationshipDescription+EO.h0000644000000000000000000000260412242733417021711 0ustar rootroot/* Copyright (C) 2005-2007 SKYRIX Software AG Copyright (C) 2007 Helge Hess This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NSRelationshipDescription_EO_H__ #define __NSRelationshipDescription_EO_H__ // the next two are here to please the Leopard #import @class NSData; #import /* NSRelationshipDescription(EO) Make an NSRelationshipDescription behave like an EORelationship. This is mostly to make the CoreData model objects work with DirectToWeb and EO at the same time. */ @class NSArray; @interface NSRelationshipDescription(EO) - (NSArray *)sourceAttributes; @end #endif /* __NSRelationshipDescription_EO_H__ */ SOPE/sope-core/EOCoreData/EOKeyValueQualifier+CoreData.m0000644000000000000000000000506512242733417021606 0ustar rootroot/* Copyright (C) 2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "EOQualifier+CoreData.h" #include "NSPredicate+EO.h" #include "NSExpression+EO.h" #include "common.h" @implementation EOKeyValueQualifier(CoreData) + (EOQualifier *)qualifierForComparisonPredicate:(NSComparisonPredicate *)_p { SEL sel; if ((sel = [self eoSelectorForForComparisonPredicate:_p]) == nil) return (EOQualifier *)_p; return [[[self alloc] initWithKey:[[_p leftExpression] keyPath] operatorSelector:sel value:[[_p rightExpression] constantValue]] autorelease]; } - (NSPredicate *)asPredicate { /* EOKeyValueQualifier has a key/value path expression on the left side and a constant value expression on the right side. */ NSExpression *lhs, *rhs; id tmp; tmp = [self key]; lhs = [tmp isKindOfClass:[EOQualifierVariable class]] ? [NSExpression expressionForVariable:[(EOQualifierVariable *)tmp key]] : [NSExpression expressionForKeyPath:tmp]; tmp = [self value]; rhs = [tmp isKindOfClass:[EOQualifierVariable class]] ? [NSExpression expressionForVariable:[(EOQualifierVariable *)tmp key]] : [NSExpression expressionForConstantValue:tmp]; return [self predicateWithLeftExpression:lhs rightExpression:rhs eoSelector:[self selector]]; } /* CoreData compatibility */ - (NSComparisonPredicateModifier)comparisonPredicateModifier { return NSDirectPredicateModifier; } - (NSPredicateOperatorType)predicateOperatorType { return [[self class] predicateOperatorTypeForEOSelector:[self selector]]; } - (unsigned)options { return (SEL_EQ([self selector], EOQualifierOperatorCaseInsensitiveLike)) ? NSCaseInsensitivePredicateOption : 0; } - (SEL)customSelector { return [self predicateOperatorType] == NSCustomSelectorPredicateOperatorType ? [self selector] : nil; } @end /* EOKeyValueQualifier(CoreData) */ SOPE/sope-core/EOCoreData/EOFetchSpecification+CoreData.m0000644000000000000000000000712212242733417021745 0ustar rootroot/* Copyright (C) 2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "EOFetchSpecification+CoreData.h" #include "EOSortOrdering+CoreData.h" #include "EOQualifier+CoreData.h" #include "common.h" @implementation EOFetchSpecification(CoreData) - (id)initWithFetchRequest:(NSFetchRequest *)_fr { NSMutableArray *so; EOQualifier *q; NSArray *sd; unsigned count; if (_fr == nil) { [self release]; return nil; } /* convert sort descriptors */ sd = [_fr sortDescriptors]; so = nil; if ((count = [sd count]) > 0) { unsigned i; so = [[NSMutableArray alloc] initWithCapacity:count]; for (i = 0; i < count; i++) { EOSortOrdering *soo; soo = [[EOSortOrdering alloc] initWithSortDescriptor: [sd objectAtIndex:i]]; if (soo == nil) { soo = [sd objectAtIndex:i]; /* oh well, this is sneaky */ NSLog(@"WARNING(%s): could not convert NSSortDescriptor to " @"EOSortOrdering: %@", __PRETTY_FUNCTION__, soo); } [so addObject:soo]; [soo release]; } } /* convert predicate */ q = [EOQualifier qualifierForPredicate:[_fr predicate]]; /* create object */ // TODO: maybe add 'affectedStores' as a hint? self = [self initWithEntityName:[[_fr entity] name] qualifier:q sortOrderings:so usesDistinct:YES isDeep:NO hints:nil]; [so release]; so = nil; [self setFetchLimit:[_fr fetchLimit]]; return self; } - (NSArray *)sortOrderingsAsSortDescriptors { NSMutableArray *ma; NSArray *a; unsigned i, count; if ((a = [self sortOrderings]) == nil) return nil; if ((count = [a count]) == 0) return nil; if (count == 1) /* common, optimization */ return [NSArray arrayWithObject:[[a objectAtIndex:0] asSortDescriptor]]; ma = [NSMutableArray arrayWithCapacity:count]; for (i = 0; i < count; i++) [ma addObject:[[a objectAtIndex:i] asSortDescriptor]]; return ma; } - (NSFetchRequest *)fetchRequestWithEntity:(NSEntityDescription *)_entity { NSFetchRequest *fr; unsigned int limit; fr = [[[NSFetchRequest alloc] init] autorelease]; [fr setEntity:_entity]; if ((limit = [self fetchLimit]) > 0) [fr setFetchLimit:limit]; [fr setPredicate:[[self qualifier] asPredicate]]; [fr setSortDescriptors:[self sortOrderingsAsSortDescriptors]]; return fr; } - (NSFetchRequest *)fetchRequestWithModel:(NSManagedObjectModel *)_model { NSEntityDescription *entity; NSString *s; entity = ((s = [self entityName]) != nil) ? [[_model entitiesByName] objectForKey:s] : nil; return [self fetchRequestWithEntity:entity]; } @end /* EOFetchSpecification(CoreData) */ @implementation NSFetchRequest(EOCoreData) - (NSFetchRequest *)fetchRequestWithEntity:(NSEntityDescription *)_entity { return self; } - (NSFetchRequest *)fetchRequestWithModel:(NSManagedObjectModel *)_model { return self; } @end /* NSFetchRequest(EOCoreData) */ SOPE/sope-core/EOCoreData/NSString+CoreData.m0000644000000000000000000000170412242733417017476 0ustar rootroot/* Copyright (C) 2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "common.h" @implementation NSString(CoreData) - (NSPredicate *)asPredicate { return [NSPredicate predicateWithFormat:self arguments:nil]; } @end /* NSString(CoreData) */ SOPE/sope-core/EOCoreData/EOSortOrdering+CoreData.h0000644000000000000000000000252512242733417020631 0ustar rootroot/* Copyright (C) 2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __EOSortOrdering_CoreData_H__ #define __EOSortOrdering_CoreData_H__ #include /* EOSortOrdering(CoreData) Convert an libEOControl EOSortOrdering to a CoreData compliant NSSortDescriptor object. */ @class NSSortDescriptor; @interface EOSortOrdering(CoreData) - (id)initWithSortDescriptor:(NSSortDescriptor *)_descriptor; - (NSSortDescriptor *)asSortDescriptor; /* converting selectors */ - (BOOL)isAscendingEOSortSelector:(SEL)_sel; - (SEL)cdSortSelectorFromEOSortSelector:(SEL)_sel; @end #endif /* __EOSortOrdering_CoreData_H__ */ SOPE/sope-core/EOCoreData/NSRelationshipDescription+EO.m0000644000000000000000000000177712242733417021730 0ustar rootroot/* Copyright (C) 2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NSRelationshipDescription+EO.h" #include "common.h" @implementation NSRelationshipDescription(EO) - (NSArray *)sourceAttributes { /* such are transparent with CoreData */ return nil; } @end /* NSRelationshipDescription(EO) */ SOPE/sope-core/EOCoreData/NSEntityDescription+EO.h0000644000000000000000000000304012242733417020517 0ustar rootroot/* Copyright (C) 2005-2007 SKYRIX Software AG Copyright (C) 2007 Helge Hess This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NSEntityDescription_EO_H__ #define __NSEntityDescription_EO_H__ // the next two are here to please the Leopard #import @class NSData; #import /* NSEntityDescription(EO) Make an NSEntityDescription behave like an EOEntity. This is mostly to make the CoreData model objects work with DirectToWeb and EO at the same time. */ @class NSString, NSArray; @interface NSEntityDescription(EO) - (id)relationshipNamed:(NSString *)_name; - (id)attributeNamed:(NSString *)_name; - (NSArray *)relationships; - (NSArray *)attributes; - (BOOL)isReadOnly; - (NSArray *)classPropertyNames; - (NSArray *)primaryKeyAttributeNames; @end #endif /* __NSEntityDescription_EO_H__ */ SOPE/sope-core/EOCoreData/common.h0000644000000000000000000000366412242733417015603 0ustar rootroot/* Copyright (C) 2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __EOCoreData_COMMON_H__ #define __EOCoreData_COMMON_H__ #import #import #include #import #import #import #import #import #ifndef ASSIGN # define ASSIGN(object, value) \ ({id __object = (id)object; \ id __value = (id)value; \ if (__value != __object) { if (__value) [__value retain]; \ if (__object) [__object release]; \ object = __value;}}) #endif #ifndef ASSIGNCOPY # define ASSIGNCOPY(object, value) \ ({id __object = (id)object; \ id __value = (id)value; \ if (__value != __object) { if (__value) __value = [__value copy]; \ if (__object) [__object release]; \ object = __value;}}) #endif #if GNU_RUNTIME # include #endif #ifndef SEL_EQ # if GNU_RUNTIME # define SEL_EQ(sel1,sel2) sel_eq(sel1,sel2) # else # define SEL_EQ(sel1,sel2) (sel1 == sel2) # endif #endif #endif /* __EOCoreData_COMMON_H__ */ SOPE/sope-core/EOCoreData/NSManagedObject+KVC.m0000644000000000000000000000212612242733417017653 0ustar rootroot/* Copyright (C) 2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import // Note: just including NSManagedObject is a nogo #include "common.h" @implementation NSManagedObject(KVC) - (void)takeValue:(id)_value forKey:(NSString *)_key { /* Yes, I know, deprecated. But hey, don't do this to us! */ [self setValue:_value forKey:_key]; } @end /* NSManagedObject(KVC) */ SOPE/sope-core/EOCoreData/Version0000644000000000000000000000004512242733417015500 0ustar rootroot# version file SUBMINOR_VERSION:=12 SOPE/sope-core/EOCoreData/EOCoreData.h0000644000000000000000000000215012242733417016206 0ustar rootroot/* Copyright (C) 2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __EOCoreData_H__ #define __EOCoreData_H__ #include #include #include #include #include #include #endif /* __EOCoreData_H__ */ SOPE/sope-core/EOCoreData/README.txt0000644000000000000000000000030712242733417015627 0ustar rootrootEOCoreData ========== This is a library/framework which wraps the new MacOSX 10.4 CoreData objects in EOControl objects. It provides various methods to convert objects between the two environments. SOPE/sope-core/EOCoreData/NSEntityDescription+EO.m0000644000000000000000000000276112242733417020535 0ustar rootroot/* Copyright (C) 2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NSEntityDescription+EO.h" #include "common.h" @implementation NSEntityDescription(EO) - (id)relationshipNamed:(NSString *)_qname { return [[self relationshipsByName] objectForKey:_qname]; } - (id)attributeNamed:(NSString *)_qname { return [[self attributesByName] objectForKey:_qname]; } - (BOOL)isReadOnly { return NO; /* always read/write, no? */ } - (NSArray *)classPropertyNames { return [[self propertiesByName] allKeys]; } - (NSArray *)primaryKeyAttributeNames { /* such are transparent with CoreData */ return nil; } - (NSArray *)attributes { return [[self attributesByName] allValues]; } - (NSArray *)relationships { return [[self relationshipsByName] allValues]; } @end /* NSEntityDescription(EO) */ SOPE/sope-core/EOCoreData/EOFetchSpecification+CoreData.h0000644000000000000000000000310412242733417021734 0ustar rootroot/* Copyright (C) 2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __EOFetchSpecification_CoreData_H__ #define __EOFetchSpecification_CoreData_H__ #include /* EOFetchSpecification(CoreData) Convert an libEOControl EOFetchSpecification to a CoreData compliant fetch specification. A major difference is that a CoreData NSFetchRequest takes the entity object while in EOF we just pass the name of it. */ @class NSArray; @class NSFetchRequest, NSManagedObjectModel, NSEntityDescription; @interface EOFetchSpecification(CoreData) - (id)initWithFetchRequest:(NSFetchRequest *)_fr; - (NSFetchRequest *)fetchRequestWithEntity:(NSEntityDescription *)_entity; - (NSFetchRequest *)fetchRequestWithModel:(NSManagedObjectModel *)_model; - (NSArray *)sortOrderingsAsSortDescriptors; @end #endif /* __EOFetchSpecification_CoreData_H__ */ SOPE/sope-core/EOCoreData/NSPredicate+EO.m0000644000000000000000000002172712242733417016760 0ustar rootroot/* Copyright (C) 2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NSPredicate+EO.h" #include "EOQualifier+CoreData.h" #include "common.h" @implementation NSPredicate(EOCoreData) - (NSPredicate *)asPredicate { return self; } - (NSExpression *)asExpression { return nil; } @end /* NSPredicate(EOCoreData) */ @implementation NSCompoundPredicate(EOCoreData) - (EOQualifier *)asQualifier { /* Compound predicates join other predicates, they do not deal with expressions. */ NSMutableArray *sq; NSArray *sp; unsigned i, count; Class clazz; BOOL isNot = NO; EOQualifier *q; sp = [self subpredicates]; count = [sp count]; switch ([self compoundPredicateType]) { case NSNotPredicateType: isNot = YES; clazz = [EONotQualifier class]; break; case NSAndPredicateType: clazz = [EOAndQualifier class]; break; case NSOrPredicateType: clazz = [EOOrQualifier class]; break; default: NSLog(@"ERROR(%s): unknown compound predicate type: %@", __PRETTY_FUNCTION__, self); return nil; } if (count == 0) return [[[clazz alloc] init] autorelease]; if (count == 1) { q = [sp objectAtIndex:0]; return (isNot) ? [[[EONotQualifier alloc] initWithQualifier:q] autorelease] : q; } sq = [[NSMutableArray alloc] initWithCapacity:count]; for (i = 0; i < count; i++) { q = [EOQualifier qualifierForPredicate:[sp objectAtIndex:i]]; if (q == nil) { q = [sp objectAtIndex:i]; NSLog(@"ERROR(%s): could not convert predicate to qualifier: %@", __PRETTY_FUNCTION__, q); } if (isNot) q = [[EONotQualifier alloc] initWithQualifier:q]; [sq addObject:q]; if (isNot) [q release]; q = nil; } q = [[(isNot ? [EOAndQualifier class] : clazz) alloc] initWithQualifier:q]; [sq release]; return [q autorelease]; } @end /* NSCompoundPredicate(EOCoreData) */ @implementation NSComparisonPredicate(EOCoreData) - (EOQualifier *)asQualifier { NSExpression *lhs, *rhs; lhs = [self leftExpression]; rhs = [self rightExpression]; // TODO: need to check predicate modifiers // TODO: add support for variables if ([rhs expressionType] == NSKeyPathExpressionType) { if ([lhs expressionType] == NSConstantValueExpressionType) return [EOKeyValueQualifier qualifierForComparisonPredicate:self]; if ([lhs expressionType] == NSKeyPathExpressionType) return [EOKeyComparisonQualifier qualifierForComparisonPredicate:self]; } NSLog(@"ERROR(%s): cannot map NSComparisonPredicate to EOQualifier: %@", __PRETTY_FUNCTION__, self); return (id)self; } /* key/value archiving */ - (id)initWithKeyValueUnarchiver:(EOKeyValueUnarchiver *)_unarchiver { int opt; NSPredicateOperatorType ptype; NSComparisonPredicateModifier mod; NSExpression *left, *right; NSString *selName, *s; /* left / right - TODO: need to check 'official' keys fo rthat */ left = [_unarchiver decodeObjectForKey:@"left"]; if (left != nil && ![left isKindOfClass:[NSExpression class]]) left = [NSExpression expressionForConstantValue:left]; right = [_unarchiver decodeObjectForKey:@"right"]; if (right != nil && ![right isKindOfClass:[NSExpression class]]) right = [NSExpression expressionForConstantValue:right]; /* custom selector */ if ((selName = [_unarchiver decodeObjectForKey:@"selectorName"]) != nil) { if (![selName hasSuffix:@":"]) selName = [selName stringByAppendingString:@":"]; } else selName = [_unarchiver decodeObjectForKey:@"selector"]; if ([selName length] > 0) { return [self initWithLeftExpression:left rightExpression:right customSelector:selName ? NSSelectorFromString(selName):NULL]; } /* modifier */ if ((s = [_unarchiver decodeObjectForKey:@"modifier"]) != nil) { if ([s isEqualToString:@"direct"]) mod = NSDirectPredicateModifier; else if ([s isEqualToString:@"all"]) mod = NSAllPredicateModifier; else if ([s isEqualToString:@"any"]) mod = NSAnyPredicateModifier; else { NSLog(@"WARNING(%s): could not decode modifier (trying int): %@!", __PRETTY_FUNCTION__, s); mod = [s intValue]; } } else mod = NSDirectPredicateModifier; /* type */ if ((s = [_unarchiver decodeObjectForKey:@"type"]) != nil) { if ([s isEqualToString:@"<"]) ptype = NSLessThanPredicateOperatorType; else if ([s isEqualToString:@"=<"]) ptype = NSLessThanOrEqualToPredicateOperatorType; else if ([s isEqualToString:@">"]) ptype = NSGreaterThanPredicateOperatorType; else if ([s isEqualToString:@">="]) ptype = NSGreaterThanOrEqualToPredicateOperatorType; else if ([s isEqualToString:@"=="]) ptype = NSEqualToPredicateOperatorType; else if ([s isEqualToString:@"!="]) ptype = NSNotEqualToPredicateOperatorType; else if ([s isEqualToString:@"like"]) ptype = NSLikePredicateOperatorType; else if ([s isEqualToString:@"contains"]) ptype = NSInPredicateOperatorType; else if ([s isEqualToString:@"beginswith"]) ptype = NSBeginsWithPredicateOperatorType; else if ([s isEqualToString:@"endswith"]) ptype = NSEndsWithPredicateOperatorType; else if ([s isEqualToString:@"matches"]) ptype = NSMatchesPredicateOperatorType; else { NSLog(@"WARNING(%s): could not decode type (trying int): %@!", __PRETTY_FUNCTION__, s); ptype = [s intValue]; } } else ptype = NSEqualToPredicateOperatorType; /* options */ // TODO: use bit-compare and a set? if ((s = [_unarchiver decodeObjectForKey:@"options"]) != nil) { if ([s isEqualToString:@"caseInsensitive"]) opt = NSCaseInsensitivePredicateOption; else if ([s isEqualToString:@"diacritic"]) opt = NSDiacriticInsensitivePredicateOption; else { NSLog(@"WARNING(%s): could not decode options (trying int): %@!", __PRETTY_FUNCTION__, s); opt = [s intValue]; } } else opt = 0; /* create and return */ return [self initWithLeftExpression:left rightExpression:right modifier:mod type:ptype options:opt]; } - (void)encodeWithKeyValueArchiver:(EOKeyValueArchiver *)_archiver { NSString *s; [_archiver encodeObject:[self leftExpression] forKey:@"left"]; [_archiver encodeObject:[self rightExpression] forKey:@"right"]; /* type */ switch ([self predicateOperatorType]) { case NSCustomSelectorPredicateOperatorType: [_archiver encodeObject:NSStringFromSelector([self customSelector]) forKey:@"selector"]; return; /* no more info */ case NSLessThanPredicateOperatorType: s = @"<"; break; case NSLessThanOrEqualToPredicateOperatorType: s = @"=<"; break; case NSGreaterThanPredicateOperatorType: s = @">"; break; case NSGreaterThanOrEqualToPredicateOperatorType: s = @">="; break; case NSEqualToPredicateOperatorType: s = @"=="; break; case NSNotEqualToPredicateOperatorType: s = @"!="; break; case NSLikePredicateOperatorType: s = @"like"; break; case NSInPredicateOperatorType: s = @"contains"; break; case NSBeginsWithPredicateOperatorType: s = @"beginswith"; break; case NSEndsWithPredicateOperatorType: s = @"endswith"; break; case NSMatchesPredicateOperatorType: s = @"matches"; break; default: s = [NSString stringWithFormat:@"%i", [self predicateOperatorType]]; break; } if (s != nil) [_archiver encodeObject:s forKey:@"type"]; /* modifier */ switch ([self comparisonPredicateModifier]) { case NSDirectPredicateModifier: s = nil; break; case NSAllPredicateModifier: s = @"all"; break; case NSAnyPredicateModifier: s = @"any"; break; default: s = [NSString stringWithFormat:@"%i", [self comparisonPredicateModifier]]; break; } if (s != nil) [_archiver encodeObject:s forKey:@"modifier"]; /* options */ // TODO: use bit-compare and a set? if ([self options] == NSCaseInsensitivePredicateOption) [_archiver encodeObject:@"caseInsensitive" forKey:@"options"]; else if ([self options] == NSDiacriticInsensitivePredicateOption) [_archiver encodeObject:@"diacritic" forKey:@"options"]; } @end /* NSComparisonPredicate(EOCoreData) */ SOPE/sope-core/Version0000644000000000000000000000032412242733417013572 0ustar rootroot# # This file is included by library makefiles to set the version information # of the executable. MAJOR_VERSION=4 MINOR_VERSION=9 # subminor versions are set in the Version files contained in the library path SOPE/sope-core/dummy.c0000644000000000000000000000215412242733417013524 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* this is required by the "fake" frameworks NGImap4 and NGMail, otherwise linking will fail with: ---snip--- ld: /Users/helge/build/NGImap4.framework/NGImap4 tocoff in load command 7 extends past the end of the file ld: /Users/helge/build/NGMail.framework/NGMail tocoff in load command 7 extends past the end of the file ---snap--- */ SOPE/sope-xml/0000755000000000000000000000000012242733420012065 5ustar rootrootSOPE/sope-xml/SaxObjC/0000755000000000000000000000000012242733417013364 5ustar rootrootSOPE/sope-xml/SaxObjC/SaxException.m0000644000000000000000000000172312242733417016157 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "SaxException.h" @implementation SaxException @end @implementation SaxParseException @end @implementation SaxNotSupportedException @end @implementation SaxNotRecognizedException @end SOPE/sope-xml/SaxObjC/SaxMethodCallHandler.m0000644000000000000000000002107312242733417017533 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "SaxMethodCallHandler.h" #include "common.h" @interface NSObject(ToBeFixed) - (id)performSelector:(SEL)_sel withObject:(id)_arg1 withObject:(id)_arg2 withObject:(id)_arg3; @end @implementation SaxMethodCallHandler static BOOL debugOn = NO; - (id)init { if ((self = [super init]) != nil) { self->delegate = self; self->fqNameToStartSel = NSCreateMapTable(NSObjectMapKeyCallBacks, NSNonOwnedPointerMapValueCallBacks, 64); self->selName = [[NSMutableString alloc] initWithCapacity:64]; self->tagStack = [[NSMutableArray alloc] initWithCapacity:16]; self->startKey = @"start_"; self->endKey = @"end_"; self->unknownNamespaceKey = @"any_"; self->ignoreLevel = -1; } return self; } - (void)dealloc { NSFreeMapTable(self->fqNameToStartSel); [self->tagStack release]; [self->unknownNamespaceKey release]; [self->startKey release]; [self->endKey release]; [self->selName release]; [self->namespaceToKey release]; [super dealloc]; } - (void)registerNamespace:(NSString *)_namespace withKey:(NSString *)_key { if (self->namespaceToKey == nil) self->namespaceToKey = [[NSMutableDictionary alloc] initWithCapacity:16]; [self->namespaceToKey setObject:_key forKey:_namespace]; } - (void)setDelegate:(id)_delegate { NSResetMapTable(self->fqNameToStartSel); self->delegate = _delegate; } - (id)delegate { return self->delegate; } - (void)setStartKey:(NSString *)_s { id o = self->startKey; self->startKey = [_s copy]; [o release]; } - (NSString *)startKey { return self->startKey; } - (void)setEndKey:(NSString *)_s { id o = self->endKey; self->endKey = [_s copy]; [o release]; } - (NSString *)endKey { return self->endKey; } - (void)setUnknownNamespaceKey:(NSString *)_s { id o = self->unknownNamespaceKey; self->unknownNamespaceKey = [_s copy]; [o release]; } - (NSString *)unknownNamespaceKey { return self->unknownNamespaceKey; } - (NSArray *)tagStack { return self->tagStack; } - (unsigned)depth { return [self->tagStack count]; } - (void)ignoreChildren { if (self->ignoreLevel == -1) self->ignoreLevel = [self depth]; } - (BOOL)doesIgnoreChildren { if (self->ignoreLevel == -1) return NO; return (int)[self depth] >= self->ignoreLevel ? YES : NO; } /* standard Sax callbacks */ - (void)endDocument { [super endDocument]; [selName setString:@""]; } static inline void _selAdd(SaxMethodCallHandler *self, NSString *_s) { [self->selName appendString:_s]; } static inline void _selAddEscaped(SaxMethodCallHandler *self, NSString *_s) { register unsigned i, len; unichar *buf16; BOOL needsEscape = NO; unichar *buf; unsigned j; NSString *s; if ((len = [_s length]) == 0) return; buf16 = calloc(len + 2, sizeof(unichar)); for (i = 0; i < len; i++) { // TODO: does isalnum work OK for Unicode? (at least it takes an int) if (!(isalnum(buf16[i]) || (buf16[i] == '_'))) { needsEscape = YES; break; } } if (!needsEscape) { /* no escaping required, stop processing */ if (buf16 != NULL) free(buf16); [self->selName appendString:_s]; return; } /* strip out all non-ASCII, non-alnum or _ chars */ buf = calloc(len + 2, sizeof(unichar)); for (i = 0, j = 0; i < len; i++) { register unichar c = buf16[i]; // TODO: isalnum() vs Unicode if (isalnum((int)c) || (c == '_')) { if (i > 0) { if (buf16[i - 1] == '-') c = toupper(c); } buf[j] = c; j++; } /* else: do nothing, leave out non-ASCII char */ } buf[j] = '\0'; if (buf16 != NULL) free(buf16); s = [[NSString alloc] initWithCharacters:buf length:j]; if (buf != NULL) free(buf); [self->selName appendString:s]; [s release]; } - (void)startElement:(NSString *)_localName namespace:(NSString *)_ns rawName:(NSString *)_rawName attributes:(id)_attrs { NSString *fqName; NSString *nskey; SEL sel; fqName = [[NSString alloc] initWithFormat:@"{%@}%@", _ns, _localName]; [self->tagStack addObject:fqName]; [fqName release]; // still retained by tagStack if ((int)[self depth] > self->ignoreLevel) return; if ((nskey = [self->namespaceToKey objectForKey:_ns]) == nil) { /* unknown namespace */ if (debugOn) NSLog(@"unknown namespace key %@ (tag=%@)", _ns, _rawName); [self->selName setString:@""]; _selAdd(self, self->startKey); } else if ((sel = NSMapGet(self->fqNameToStartSel, fqName))) { /* cached a selector .. */ [self->delegate performSelector:sel withObject:_attrs]; goto found; } else { [self->selName setString:self->startKey]; _selAdd(self, nskey); _selAddEscaped(self, _localName); _selAdd(self, @":"); sel = NSSelectorFromString(self->selName); if ([self->delegate respondsToSelector:sel]) { /* ok, found correct selector */ [self->delegate performSelector:sel withObject:_attrs]; NSMapInsert(self->fqNameToStartSel, fqName, sel); goto found; } /* check for 'start_nskey_unknownTag:attributes:' */ [self->selName setString:self->startKey]; _selAdd(self, nskey); _selAdd(self, @"unknownTag:attributes:"); sel = NSSelectorFromString(self->selName); if ([self->delegate respondsToSelector:sel]) { /* ok, found selector */ [self->delegate performSelector:sel withObject:_localName withObject:_attrs]; goto found; } /* check for 'start_tag:namespace:attributes:' */ [self->selName setString:self->startKey]; _selAdd(self, @"tag:namespace:attributes:"); sel = NSSelectorFromString(self->selName); if ([self->delegate respondsToSelector:sel]) { /* ok, found selector */ [self->delegate performSelector:sel withObject:_localName withObject:_ns withObject:_attrs]; goto found; } /* ignore tag */ } if (debugOn) { NSLog(@"%s: ignore tag: %@, sel %@", __PRETTY_FUNCTION__, fqName, self->selName); } return; found: ; // required for MacOSX gcc } - (void)endElement:(NSString *)_localName namespace:(NSString *)_ns rawName:(NSString *)_rawName { NSString *nskey; SEL sel; if ((int)[self depth] > self->ignoreLevel) { [self->tagStack removeLastObject]; return; } self->ignoreLevel = -1; if ((nskey = [self->namespaceToKey objectForKey:_ns]) == nil) { /* unknown namespace */ if (debugOn) NSLog(@"unknown namespace key %@ (tag=%@)", _ns, _rawName); [selName setString:self->endKey]; } else { [selName setString:self->endKey]; _selAdd(self, nskey); _selAdd(self, _localName); sel = NSSelectorFromString(self->selName); if ([self->delegate respondsToSelector:sel]) { /* ok, found correct selector */ [self->delegate performSelector:sel]; goto found; } /* check for 'end_nskey_unknownTag:' */ [self->selName setString:self->endKey]; _selAdd(self, nskey); _selAdd(self, @"unknownTag:"); sel = NSSelectorFromString(self->selName); if ([self->delegate respondsToSelector:sel]) { /* ok, found selector */ [self->delegate performSelector:sel withObject:_localName]; goto found; } /* check for 'end_tag:namespace:attributes:' */ [self->selName setString:self->endKey]; _selAdd(self, @"tag:namespace:"); sel = NSSelectorFromString(self->selName); if ([self->delegate respondsToSelector:sel]) { /* ok, found selector */ [self->delegate performSelector:sel withObject:_localName withObject:_ns]; goto found; } /* didn't find end tag .. */ } [self->tagStack removeLastObject]; return; found: [self->tagStack removeLastObject]; } @end /* SaxMethodCallHandler */ SOPE/sope-xml/SaxObjC/fhs.make0000644000000000000000000000173612242733417015012 0ustar rootroot# postprocessing # FHS support (this is a hack and is going to be done by gstep-make!) ifneq ($(FHS_INSTALL_ROOT),) FHS_INCLUDE_DIR=$(FHS_INSTALL_ROOT)/include/ FHS_BIN_DIR=$(FHS_INSTALL_ROOT)/bin/ ifeq ($(findstring _64, $(GNUSTEP_TARGET_CPU)), _64) FHS_LIB_DIR=$(FHS_INSTALL_ROOT)/lib64/ else FHS_LIB_DIR=$(FHS_INSTALL_ROOT)/lib/ endif fhs-header-dirs :: $(MKDIRS) $(FHS_INCLUDE_DIR)$(libSaxObjC_HEADER_FILES_INSTALL_DIR) move-headers-to-fhs :: fhs-header-dirs @echo "moving headers to $(FHS_INCLUDE_DIR) .." mv $(GNUSTEP_HEADERS)$(libSaxObjC_HEADER_FILES_INSTALL_DIR)/*.h \ $(FHS_INCLUDE_DIR)$(libSaxObjC_HEADER_FILES_INSTALL_DIR)/ NONFHS_LIBDIR="$(GNUSTEP_LIBRARIES)/$(GNUSTEP_TARGET_LDIR)/" NONFHS_LIBNAME="$(LIBRARY_NAME)$(LIBRARY_NAME_SUFFIX)$(SHARED_LIBEXT)" move-libs-to-fhs :: @echo "moving libs to $(FHS_LIB_DIR) .." mv $(NONFHS_LIBDIR)/$(NONFHS_LIBNAME)* $(FHS_LIB_DIR)/ move-to-fhs :: move-headers-to-fhs move-libs-to-fhs after-install :: move-to-fhs endif SOPE/sope-xml/SaxObjC/README0000644000000000000000000000102512242733417014242 0ustar rootrootThis directory contains a SAX (Simple API for XML) for Objective-C. SaxObjDecoder ============= Take a look at SaxObjDecoder for simple mapping from XML to ObjC objects. SaxMethodCallHandler ==================== Take a look at SaxMethodCallHandler for mapping SAX events to ObjC method calls. Write a method per tag and SaxMethodCallHandler will call that for you ;-) Defaults ======== SaxCoreOnMissingParser - YES|NO - abort if a SAX driver could not be found SaxDebugReaderFactory - YES|NO - debug SAX reader lookup/loading SOPE/sope-xml/SaxObjC/SaxAttributes.h0000644000000000000000000000462212242733417016343 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __SaxAttributes_H__ #define __SaxAttributes_H__ #import @class NSString, NSArray, NSMutableArray, NSDictionary; /* new in SAX 2.0beta, replaces the SaxAttributeList */ @protocol SaxAttributes /* lookup indices */ - (NSUInteger)indexOfRawName:(NSString *)_rawName; - (NSUInteger)indexOfName:(NSString *)_localPart uri:(NSString *)_uri; /* lookup data by index */ - (NSString *)nameAtIndex:(NSUInteger)_idx; - (NSString *)rawNameAtIndex:(NSUInteger)_idx; - (NSString *)typeAtIndex:(NSUInteger)_idx; - (NSString *)uriAtIndex:(NSUInteger)_idx; - (NSString *)valueAtIndex:(NSUInteger)_idx; /* lookup data by name */ - (NSString *)typeForRawName:(NSString *)_rawName; - (NSString *)typeForName:(NSString *)_localName uri:(NSString *)_uri; - (NSString *)valueForRawName:(NSString *)_rawName; - (NSString *)valueForName:(NSString *)_localName uri:(NSString *)_uri; /* list size */ - (NSUInteger)count; @end /* simple attributes implementation, should be improved */ @interface SaxAttributes : NSObject < SaxAttributes, NSCopying > { @private NSMutableArray *names; NSMutableArray *uris; NSMutableArray *rawNames; NSMutableArray *types; NSMutableArray *values; } - (id)initWithAttributes:(id)_attrs; - (id)initWithDictionary:(NSDictionary *)_dict; - (void)addAttribute:(NSString *)_localName uri:(NSString *)_uri rawName:(NSString *)_rawName type:(NSString *)_type value:(NSString *)_value; - (void)clear; @end #include @interface SaxAttributes(Compatibility) - (id)initWithAttributeList:(id)_attrList; @end #endif /* __SaxAttributes_H__ */ SOPE/sope-xml/SaxObjC/GNUmakefile0000644000000000000000000000255112242733417015441 0ustar rootroot# GNUstep makefile include ../../config.make include ../common.make ifneq ($(frameworks),yes) LIBRARY_NAME = libSaxObjC else FRAMEWORK_NAME = SaxObjC SaxObjC_RESOURCE_FILES += Version endif libSaxObjC_PCH_FILE = common.h SaxObjC_PCH_FILE = common.h libSaxObjC_OBJC_FILES = \ SaxAttributeList.m \ SaxAttributes.m \ SaxDefaultHandler.m \ SaxException.m \ SaxHandlerBase.m \ SaxLocator.m \ SaxMethodCallHandler.m \ SaxNamespaceSupport.m \ SaxObjectDecoder.m \ SaxObjectModel.m \ SaxXMLFilter.m \ SaxXMLReaderFactory.m \ libSaxObjC_HEADER_FILES = \ SaxObjC.h \ SaxAttributeList.h \ SaxAttributes.h \ SaxContentHandler.h \ SaxDTDHandler.h \ SaxDeclHandler.h \ SaxDefaultHandler.h \ SaxDocumentHandler.h \ SaxEntityResolver.h \ SaxErrorHandler.h \ SaxException.h \ SaxHandlerBase.h \ SaxLexicalHandler.h \ SaxLocator.h \ SaxNamespaceSupport.h \ SaxObjectDecoder.h \ SaxObjectModel.h \ SaxXMLFilter.h \ SaxXMLReader.h \ SaxXMLReaderFactory.h \ SaxMethodCallHandler.h \ XMLNamespaces.h \ libSaxObjC_PCH_FILE = common.h # building -include GNUmakefile.preamble ifneq ($(FHS_INSTALL_ROOT),) GNUSTEP_HEADERS=$(DESTDIR)$(FHS_INSTALL_ROOT)/include endif ifneq ($(frameworks),yes) include $(GNUSTEP_MAKEFILES)/library.make else include $(GNUSTEP_MAKEFILES)/framework.make endif -include GNUmakefile.postamble SOPE/sope-xml/SaxObjC/SaxNamespaceSupport.m0000644000000000000000000000300512242733417017505 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "SaxNamespaceSupport.h" #include "common.h" @implementation SaxNamespaceSupport - (void)pushContext { [self doesNotRecognizeSelector:_cmd]; } - (void)popContext { [self doesNotRecognizeSelector:_cmd]; } - (BOOL)declarePrefix:(NSString *)_prefix uri:(NSString *)_uri { [self doesNotRecognizeSelector:_cmd]; return NO; } - (NSEnumerator *)prefixEnumerator { [self doesNotRecognizeSelector:_cmd]; return nil; } - (NSString *)getUriForPrefix:(NSString *)_prefix { [self doesNotRecognizeSelector:_cmd]; return nil; } - (void)reset { } - (NSArray *)processName:(NSString *)_rawName parts:(NSArray *)_parts isAttribute:(BOOL)_isAttribute { [self doesNotRecognizeSelector:_cmd]; return nil; } @end /* SaxNamespaceSupport */ SOPE/sope-xml/SaxObjC/SaxDefaultHandler.h0000644000000000000000000000224512242733417017076 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __SaxDefaultHandler_H__ #define __SaxDefaultHandler_H__ #import #include #include #include #include @interface SaxDefaultHandler : NSObject < SaxEntityResolver, SaxDTDHandler, SaxContentHandler, SaxErrorHandler > @end #endif /* __SaxDefaultHandler_H__ */ SOPE/sope-xml/SaxObjC/SaxAttributeList.m0000644000000000000000000001125012242733417017014 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "SaxAttributeList.h" #include "SaxAttributes.h" #include "common.h" @implementation SaxAttributeList - (id)init { self->names = [[NSMutableArray alloc] init]; self->types = [[NSMutableArray alloc] init]; self->values = [[NSMutableArray alloc] init]; return self; } - (id)initWithAttributeList:(id)_attrList { if ((self = [self init])) { NSUInteger i; for (i = 0; i < [_attrList count]; i++) { [self->names addObject:[_attrList nameAtIndex:i]]; [self->types addObject:[_attrList typeAtIndex:i]]; [self->values addObject:[_attrList valueAtIndex:i]]; } } return self; } - (id)initWithAttributes:(id)_attrList { if ((self = [self init])) { NSUInteger i, c; for (i = 0, c = [_attrList count]; i < c; i++) { [self->names addObject:[_attrList rawNameAtIndex:i]]; [self->types addObject:[_attrList typeAtIndex:i]]; [self->values addObject:[_attrList valueAtIndex:i]]; } } return self; } - (void)dealloc { [self->names release]; [self->types release]; [self->values release]; [super dealloc]; } /* modify operations */ - (void)setAttributeList:(id)_attrList { NSUInteger i; [self clear]; for (i = 0; i < [_attrList count]; i++) { [self->names addObject:[_attrList nameAtIndex:i]]; [self->types addObject:[_attrList typeAtIndex:i]]; [self->values addObject:[_attrList valueAtIndex:i]]; } } - (void)clear { [self->names removeAllObjects]; [self->types removeAllObjects]; [self->values removeAllObjects]; } - (void)addAttribute:(NSString *)_name type:(NSString *)_type value:(NSString *)_value { if (_type == nil) _type = @"CDATA"; if (_value == nil) _value = @""; [self->names addObject:_name]; [self->types addObject:_type]; [self->values addObject:_value]; } - (void)removeAttribute:(NSString *)_name { NSUInteger idx; if ((idx = [self->names indexOfObject:_name]) == NSNotFound) return; [self->names removeObjectAtIndex:idx]; [self->types removeObjectAtIndex:idx]; [self->values removeObjectAtIndex:idx]; } /* protocol implementation */ - (NSString *)nameAtIndex:(NSUInteger)_idx { return [self->names objectAtIndex:_idx]; } - (NSString *)typeAtIndex:(NSUInteger)_idx { return [self->types objectAtIndex:_idx]; } - (NSString *)valueAtIndex:(NSUInteger)_idx { return [self->values objectAtIndex:_idx]; } - (NSString *)typeForName:(NSString *)_name { NSUInteger i; if ((i = [self->names indexOfObject:_name]) == NSNotFound) return nil; return [self typeAtIndex:i]; } - (NSString *)valueForName:(NSString *)_name { NSUInteger i; if ((i = [self->names indexOfObject:_name]) == NSNotFound) return nil; return [self valueAtIndex:i]; } - (NSUInteger)count { return [self->names count]; } /* NSCopying */ - (id)copyWithZone:(NSZone *)_zone { return [[[self class] allocWithZone:_zone] initWithAttributeList:self]; } /* description */ - (id)propertyList { id objs[3], keys[3]; objs[0] = self->names; keys[0] = @"names"; objs[1] = self->types; keys[1] = @"types"; objs[2] = self->values; keys[2] = @"values"; return [NSDictionary dictionaryWithObjects:objs forKeys:keys count:3]; } - (NSString *)description { NSMutableString *s; NSString *is; NSUInteger i, c; s = [[NSMutableString alloc] init]; [s appendFormat:@"<%08X[%@]:", self, NSStringFromClass([self class])]; for (i = 0, c = [self count]; i < c; i++) { NSString *type; [s appendString:@" "]; [s appendString:[self nameAtIndex:i]]; [s appendString:@"='"]; [s appendString:[self valueAtIndex:i]]; [s appendString:@"'"]; type = [self typeAtIndex:i]; if (![type isEqualToString:@"CDATA"]) { [s appendString:@"["]; [s appendString:type]; [s appendString:@"]"]; } } [s appendString:@">"]; is = [s copy]; [s release]; return [is autorelease]; } @end /* SaxAttributeList */ SOPE/sope-xml/SaxObjC/COPYING0000644000000000000000000006130312242733417014422 0ustar rootroot GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 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. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] 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 Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, 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 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 a program 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. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, 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 companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. 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, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library 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 compile 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) 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. c) 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. d) 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 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. 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 to 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 Library 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 Appendix: 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 Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library 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! SOPE/sope-xml/SaxObjC/SaxErrorHandler.h0000644000000000000000000000210012242733417016571 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __SaxErrorHandler_H__ #define __SaxErrorHandler_H__ @class SaxParseException; @protocol SaxErrorHandler - (void)warning:(SaxParseException *)_exception; - (void)error:(SaxParseException *)_exception; - (void)fatalError:(SaxParseException *)_exception; @end #endif /* __SaxErrorHandler_H__ */ SOPE/sope-xml/SaxObjC/SaxDocumentHandler.h0000644000000000000000000000305212242733417017265 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __SaxDocumentHandler_H__ #define __SaxDocumentHandler_H__ #import #include #include /* deprecated in SAX 2.0beta (replaced by SaxXMLContentHandler) */ @protocol SaxDocumentHandler - (void)startDocument; - (void)endDocument; - (void)startElement:(NSString *)_tagName attributes:(id)_attrs; - (void)endElement:(NSString *)_tagName; /* CDATA */ - (void)characters:(unichar *)_chars length:(int)_len; - (void)ignorableWhitespace:(unichar *)_chars length:(int)_len; /* PIs */ - (void)processingInstruction:(NSString *)_pi data:(NSString *)_data; /* positioning info */ - (void)setDocumentLocator:(id)_locator; @end #endif /* __SaxDocumentHandler_H__ */ SOPE/sope-xml/SaxObjC/SaxDTDHandler.h0000644000000000000000000000226012242733417016122 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __SaxDTDHandler_H__ #define __SaxDTDHandler_H__ @class NSString; @protocol SaxDTDHandler - (void)notationDeclaration:(NSString *)_name publicId:(NSString *)_pubId systemId:(NSString *)_sysId; - (void)unparsedEntityDeclaration:(NSString *)_name publicId:(NSString *)_pubId systemId:(NSString *)_sysId notationName:(NSString *)_notName; @end /* SaxDTDHandler */ #endif /* __SaxDTDHandler_H__ */ SOPE/sope-xml/SaxObjC/SaxObjectDecoder.m0000644000000000000000000002770612242733417016726 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "SaxObjectDecoder.h" #include "SaxObjectModel.h" #include "common.h" static BOOL debugOn = NO; @interface _SaxObjTagInfo : NSObject { @public SaxObjectDecoder *decoder; /* non-retained */ _SaxObjTagInfo *parentInfo; /* non-retained */ SaxTagModel *mapping; NSString *tagName; NSString *namespace; NSException *error; id object; struct { int isRoot:1; int isMutableDict:1; int isString:1; int isMutableString:1; int hasContentKey:1; } flags; NSMutableString *collectedCharData; } /* accessors */ - (SaxTagModel *)mapping; - (id)object; /* tag handling */ - (void)start; - (void)stop; - (void)characters:(unichar *)_chars length:(int)_len; @end @implementation SaxObjectDecoder static NSNull *null = nil; + (void)initialize { static BOOL didInit = NO; NSUserDefaults *ud; if (didInit) return; didInit = YES; null = [[NSNull null] retain]; ud = [NSUserDefaults standardUserDefaults]; debugOn = [ud boolForKey:@"SaxObjectDecoderDebugEnabled"]; } - (id)initWithMappingModel:(SaxObjectModel *)_model { if ((self = [super init])) { self->mapping = [_model retain]; } return self; } - (id)initWithMappingAtPath:(NSString *)_path { SaxObjectModel *model; model = [SaxObjectModel modelWithContentsOfFile:_path]; return [self initWithMappingModel:model]; } - (id)initWithMappingNamed:(NSString *)_name { SaxObjectModel *model; model = [SaxObjectModel modelWithName:_name]; return [self initWithMappingModel:model]; } - (id)init { return [self initWithMappingModel:nil]; } - (void)dealloc { [self->locator release]; [self->rootObject release]; [self->mapping release]; [self->infoStack release]; [self->mappingStack release]; [self->objectStack release]; [super dealloc]; } /* parse results */ - (id)rootObject { return self->rootObject; } /* cleanup */ - (void)parseReset { NSAutoreleasePool *pool; pool = [[NSAutoreleasePool alloc] init]; [self->infoStack removeAllObjects]; [self->mappingStack removeAllObjects]; [self->objectStack removeAllObjects]; [pool release]; } - (void)reset { [self parseReset]; [self->rootObject release]; self->rootObject = nil; } /* parsing */ - (void)startDocument { [self reset]; if (self->infoStack == nil) self->infoStack = [[NSMutableArray alloc] initWithCapacity:16]; } - (void)endDocument { [self parseReset]; } /* positioning info */ - (void)setDocumentLocator:(id)_locator { ASSIGN(self->locator, _locator); } /* stacks */ - (void)pushInfo:(_SaxObjTagInfo *)_info { [self->infoStack addObject:_info]; } - (void)popInfo { [self->infoStack removeObjectAtIndex:([self->infoStack count] - 1)]; } - (id)currentInfo { return [self->infoStack lastObject]; } /* elements */ - (NSException *)missingNamespaceMapping:(NSString *)_ns { return [NSException exceptionWithName:@"MissingNamespaceMapping" reason:_ns userInfo:nil]; } - (NSException *)missingElementMapping:(NSString *)_ns:(NSString *)_tag { return [NSException exceptionWithName:@"MissingElementMapping" reason:_tag userInfo:nil]; } - (NSException *)missingMappedClass:(NSString *)_className { return [NSException exceptionWithName:@"MissingMappedClass" reason:_className userInfo:nil]; } - (SaxTagModel *)mappingForTag:(NSString *)_tag namespace:(NSString *)_ns { return [self->mapping modelForTag:_tag namespace:_ns]; } - (void)couldNotApplyAttribute:(NSString *)_attr asKey:(NSString *)_key onObject:(id)_object { NSLog(@"SaxObjectDecoder: could not apply attribute '%@' (key=%@) " @"on object %@", _attr, _key, _object); } - (void)startElement:(NSString *)_localName namespace:(NSString *)_ns rawName:(NSString *)_rawName attributes:(id)_attributes { _SaxObjTagInfo *info; info = [_SaxObjTagInfo alloc]; info->decoder = self; info->flags.isRoot = [self->infoStack count] == 0 ? 1 : 0; info->parentInfo = info->flags.isRoot ? nil : [self->infoStack lastObject]; info->tagName = [_localName copy]; info->namespace = [_ns copy]; [self->infoStack addObject:info]; [info release]; /* determine mapping dictionary */ if ((info->mapping = [self mappingForTag:_localName namespace:_ns]) == nil) { if (debugOn) { NSLog(@"found no mapping for element '%@' (namespace %@)", _localName, _ns); } info->error = [[self missingElementMapping:_ns:_localName] retain]; return; } /* start object */ [info start]; /* add attribute values */ { NSEnumerator *e; NSString *a; e = [[info->mapping attributeKeys] objectEnumerator]; while ((a = [e nextObject])) { NSString *v, *key; if ((v = [_attributes valueForName:a uri:_ns])) { key = [info->mapping propertyKeyForAttribute:a]; NS_DURING [info->object takeValue:v forKey:key]; NS_HANDLER [self couldNotApplyAttribute:a asKey:key onObject:info->object]; NS_ENDHANDLER; } } } } - (void)endElement:(NSString *)_localName namespace:(NSString *)_ns rawName:(NSString *)_rawName { _SaxObjTagInfo *info; unsigned idx; idx = [self->infoStack count] - 1; info = [self->infoStack objectAtIndex:idx]; [info stop]; if (idx == 0) ASSIGN(self->rootObject, [info object]); [self->infoStack removeObjectAtIndex:idx]; } /* CDATA */ - (void)characters:(unichar *)_chars length:(int)_len { _SaxObjTagInfo *info; if (_len == 0) return; info = [self->infoStack objectAtIndex:([self->infoStack count] - 1)]; [info characters:_chars length:_len]; } - (BOOL)processIgnorableWhitespace { return NO; } - (void)ignorableWhitespace:(unichar *)_chars length:(int)_len { if ([self processIgnorableWhitespace]) [self characters:_chars length:_len]; } @end /* SaxObjectDecoder */ @implementation NSObject(SaxObjectCoding) - (id)initWithSaxDecoder:(SaxObjectDecoder *)_decoder { return [self init]; } - (id)awakeAfterUsingSaxDecoder:(SaxObjectDecoder *)_decoder { return self; } @end /* SaxCoding */ @implementation _SaxObjTagInfo static Class MutableDictClass = Nil; static Class MutableStringClass = Nil; static Class StringClass = Nil; + (void)initialize { MutableDictClass = [NSMutableDictionary class]; MutableStringClass = [NSMutableString class]; StringClass = [NSString class]; } - (void)dealloc { [self->tagName release]; [self->namespace release]; [self->error release]; [self->object release]; [self->collectedCharData release]; [super dealloc]; } /* errors */ - (NSException *)missingMappedClass:(NSString *)_className { return [NSException exceptionWithName:@"MissingMappedClass" reason:_className userInfo:nil]; } /* accessors */ - (SaxTagModel *)mapping { return self->mapping; } - (id)object { return (self->object == null) ? nil : self->object; } - (SaxTagModel *)parentMapping { return [self->parentInfo mapping]; } - (id)parentObject { return [self->parentInfo object]; } /* run */ - (Class)defaultElementClass { return [NSMutableDictionary class]; } - (void)unableToSetValue:(id)_object forKey:(NSString *)_key withTag:(NSString *)_tag toParent:(id)_parent exception:(NSException *)_exc { NSLog(@"couldn't apply value %@ for key %@ with parent %@<%@>: %@", _object, _key, _parent, NSStringFromClass([_parent class]), _exc); } - (void)addObject:(id)_object fromTag:(NSString *)_tag withMapping:(SaxTagModel *)_elementMap toParent:(id)_parent withMapping:(SaxTagModel *)_parentMap { NSString *key; if (_object == nil || _object == null) return; if (_parent == nil || _parent == null) return; if (_elementMap == nil || _elementMap == (id)null) return; if (_parentMap == nil || _parentMap == (id)null) return; if ((key = [_parentMap propertyKeyForChildTag:_tag]) == nil) { if ((key = [_elementMap key]) == nil) key = _tag; } NS_DURING { if ([_parentMap isToManyKey:key]) { [_parentMap addValue:_object toPropertyWithKey:key ofObject:_parent]; } else { [_parent takeValue:_object forKey:key]; } } NS_HANDLER { [self unableToSetValue:_object forKey:key withTag:_tag toParent:_parent exception:localException]; } NS_ENDHANDLER; } - (void)start { NSString *s; Class mappedClazz; /* determine class */ if ((s = [self->mapping className])) { mappedClazz = NSClassFromString(s); if (mappedClazz == Nil) { self->error = [[self missingMappedClass:s] retain]; return; } } else mappedClazz = [self defaultElementClass]; /* do we need to check for subclasses? I guess not. */ self->flags.isMutableDict = (mappedClazz == MutableDictClass) ? 1 : 0; self->flags.isMutableString = (mappedClazz == MutableStringClass) ? 1 : 0; self->flags.isString = (mappedClazz == StringClass) ? 1 : 0; self->flags.hasContentKey = [[self->mapping contentKey] length] > 0 ?1:0; /* create an object for the element .. */ if ((self->object = [[mappedClazz alloc] initWithSaxDecoder:self->decoder])) { NSDictionary *defaultValues; id tmp; if ((defaultValues = [self->mapping defaultValues])) [self->object takeValuesFromDictionary:defaultValues]; if ((tmp = [self->mapping tagKey])) [self->object takeValue:self->tagName forKey:tmp]; if ((tmp = [self->mapping namespaceKey])) [self->object takeValue:self->namespace forKey:tmp]; } } - (void)stop { id tmp; /* awake from decoding (the decoded object can replace itself :-) */ if (self->flags.isString) { } else { if (self->flags.hasContentKey) { NSString *s; s = [self->collectedCharData copy]; ASSIGN(self->collectedCharData, (id)nil); [self->object takeValue:s forKey:[self->mapping contentKey]]; [s release]; } tmp = self->object; self->object = [[self->object awakeAfterUsingSaxDecoder:self->decoder] retain]; [tmp release]; } if (!self->flags.isRoot) { NSString *t; id parent; parent = [self parentObject]; /* add to parent */ if ((t = [self->mapping parentKey])) [self->object takeValue:parent forKey:t]; [self addObject:self->object fromTag:self->tagName withMapping:self->mapping toParent:parent withMapping:[self parentMapping]]; } } - (void)characters:(unichar *)_chars length:(int)_len { if (self->flags.isMutableString) { NSString *tmp; tmp = [[NSString alloc] initWithCharacters:_chars length:_len]; [self->object appendString:tmp]; [tmp release]; } else if (self->flags.isString) { NSString *tmp, *old; old = self->object; tmp = [[NSString alloc] initWithCharacters:_chars length:_len]; self->object = [[self->object stringByAppendingString:tmp] retain]; [tmp release]; [old release]; } else if (self->flags.hasContentKey) { if (self->collectedCharData == nil) { self->collectedCharData = [[NSMutableString alloc] initWithCharacters:_chars length:_len]; } else { NSString *tmp; tmp = [[NSString alloc] initWithCharacters:_chars length:_len]; [self->collectedCharData appendString:tmp]; [tmp release]; } } } @end /* _SaxObjTagInfo */ SOPE/sope-xml/SaxObjC/SaxXMLReader.h0000644000000000000000000000543312242733417016001 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __SaxXMLReader_H__ #define __SaxXMLReader_H__ #import #include #include #include #include /* new in SAX 2.0beta, replaces SaxParser Interface for reading an XML document using callbacks. This is a common interface that can be shared by many XML parsers. This interface allows an application to set and query features and properties in the parser, to register event handlers for document processing, and to initiate a document parse. This interface replaces the (now deprecated) SAX 1.0 Parser interface; it currently extends Parser to aid in the transition to SAX2, but it will likely not do so in any future versions of SAX. The Reader interface contains two important enhancements over the old Parser interface: 1. it adds a standard way to query and set features and properties; and 2. it adds Namespace support, which is required for many higher-level XML standards. There are adapters available to convert a SAX1 Parser to a SAX2 XMLReader and vice-versa. */ @protocol SaxXMLReader /* features & properties */ - (void)setFeature:(NSString *)_name to:(BOOL)_value; - (BOOL)feature:(NSString *)_name; - (void)setProperty:(NSString *)_name to:(id)_value; - (id)property:(NSString *)_name; /* handlers */ - (void)setContentHandler:(id)_handler; - (void)setDTDHandler:(id)_handler; - (void)setErrorHandler:(id)_handler; - (void)setEntityResolver:(id)_handler; - (id)contentHandler; - (id)dtdHandler; - (id)errorHandler; - (id)entityResolver; /* parsing */ - (void)parseFromSource:(id)_source; - (void)parseFromSource:(id)_source systemId:(NSString *)_sysId; - (void)parseFromSystemId:(NSString *)_sysId; @end #endif /* __SaxXMLReader_H__ */ SOPE/sope-xml/SaxObjC/SaxDefaultHandler.m0000644000000000000000000000435712242733417017111 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "SaxDefaultHandler.h" #include "SaxException.h" @implementation SaxDefaultHandler /* SaxContentHandler */ - (void)startDocument { } - (void)endDocument { } - (void)startPrefixMapping:(NSString *)_prefix uri:(NSString *)_uri { } - (void)endPrefixMapping:(NSString *)_prefix { } - (void)startElement:(NSString *)_localName namespace:(NSString *)_ns rawName:(NSString *)_rawName attributes:(id)_attributes { } - (void)endElement:(NSString *)_localName namespace:(NSString *)_ns rawName:(NSString *)_rawName { } - (void)characters:(unichar *)_chars length:(int)_len { } - (void)ignorableWhitespace:(unichar *)_chars length:(int)_len { } - (void)processingInstruction:(NSString *)_pi data:(NSString *)_data { } - (void)setDocumentLocator:(id)_locator { } - (void)skippedEntity:(NSString *)_entityName { } /* SaxDTDHandler */ - (void)notationDeclaration:(NSString *)_name publicId:(NSString *)_pubId systemId:(NSString *)_sysId { } - (void)unparsedEntityDeclaration:(NSString *)_name publicId:(NSString *)_pubId systemId:(NSString *)_sysId notationName:(NSString *)_notName { } /* SaxEntityResolver */ - (id)resolveEntityWithPublicId:(NSString *)_pubId systemId:(NSString *)_sysId { return nil; } /* SaxErrorHandler */ - (void)warning:(SaxParseException *)_exception { } - (void)error:(SaxParseException *)_exception { } - (void)fatalError:(SaxParseException *)_exception { [_exception raise]; } @end /* SaxDefaultHandler */ SOPE/sope-xml/SaxObjC/SaxContentHandler.h0000644000000000000000000000353412242733417017126 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __SaxContentHandler_H__ #define __SaxContentHandler_H__ #import #include #include @class NSString; /* new in SAX 2.0beta, replaces SaxDocumentHandler */ @protocol SaxContentHandler - (void)startDocument; - (void)endDocument; - (void)startPrefixMapping:(NSString *)_prefix uri:(NSString *)_uri; - (void)endPrefixMapping:(NSString *)_prefix; - (void)startElement:(NSString *)_localName namespace:(NSString *)_ns rawName:(NSString *)_rawName attributes:(id)_attributes; - (void)endElement:(NSString *)_localName namespace:(NSString *)_ns rawName:(NSString *)_rawName; /* CDATA */ - (void)characters:(unichar *)_chars length:(int)_len; - (void)ignorableWhitespace:(unichar *)_chars length:(int)_len; /* PIs */ - (void)processingInstruction:(NSString *)_pi data:(NSString *)_data; /* positioning info */ - (void)setDocumentLocator:(id)_locator; /* entities */ - (void)skippedEntity:(NSString *)_entityName; @end #endif /* __SaxContentHandler_H__ */ SOPE/sope-xml/SaxObjC/SaxMethodCallHandler.h0000644000000000000000000000561712242733417017534 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __SaxMethodCallHandler_H__ #define __SaxMethodCallHandler_H__ #include #import @class NSString, NSMutableArray, NSMutableDictionary; /* [also take a look at SaxObjectDecoder] This handler calls a method on a delegate for each tag. The selector is constructed this way: [start|end] + nskey + tagname + ':' If no method could be found for the tag, it is first checked whether the delegate responds to [start|end] + nskey + 'unknownTag:attributes:' and it this couldn't be found, it is checked for [start|end] + 'tag:_tagName namespace:_ns attributes:' If no key could be found for a namespace, it is first checked whether the delegate responds to [start|end] + 'any_' + tagname + ':' if this fails it is checked for this selector [start|end] + 'tag:_tagName namespace:_ns attributes:' if neither exists, the tag is ignored. Eg: nskey='xhtml' startKey='start_' endKey='end_' - (void)start_xhtml_br:(id)_attrs; - (void)end_xhtml_br; */ @interface SaxMethodCallHandler : SaxDefaultHandler { id delegate; // non-retained: default=self (for subclasses) NSMutableDictionary *namespaceToKey; NSMutableArray *tagStack; NSString *startKey; // default: 'start_' NSString *endKey; // default: 'end_' NSString *unknownNamespaceKey; // default: 'any_' int ignoreLevel; /* processing */ NSMapTable *fqNameToStartSel; NSMutableString *selName; /* reused for each construction */ } /* namespaces */ - (void)registerNamespace:(NSString *)_namespace withKey:(NSString *)_key; /* keys */ - (void)setStartKey:(NSString *)_s; - (NSString *)startKey; - (void)setEndKey:(NSString *)_s; - (NSString *)endKey; - (void)setUnknownNamespaceKey:(NSString *)_s; - (NSString *)unknownNamespaceKey; /* tag stack */ - (NSArray *)tagStack; - (unsigned)depth; - (void)ignoreChildren; - (BOOL)doesIgnoreChildren; /* delegate */ - (void)setDelegate:(id)_delegate; - (id)delegate; @end #endif /* __SaxMethodCallHandler_H__ */ SOPE/sope-xml/SaxObjC/SaxObjectModel.m0000644000000000000000000002666212242733417016421 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "SaxObjectModel.h" #include "common.h" #if NeXT_Foundation_LIBRARY || COCOA_Foundation_LIBRARY || \ APPLE_FOUNDATION_LIBRARY bool _CFArrayIsMutable(CFArrayRef dict); #endif static NSDictionary *mapDictsToObjects(NSDictionary *_dict, Class clazz) { NSMutableDictionary *md; NSEnumerator *e; NSString *key; md = [NSMutableDictionary dictionaryWithCapacity:16]; e = [_dict keyEnumerator]; while ((key = [e nextObject])) { id obj; obj = [[clazz alloc] initWithDictionary:[_dict objectForKey:key]]; [md setObject:obj forKey:key]; [obj release]; } return md; } @implementation SaxObjectModel static BOOL doDebug = NO; static NSArray *searchPathes = nil; #if NeXT_Foundation_LIBRARY || COCOA_Foundation_LIBRARY || \ APPLE_FOUNDATION_LIBRARY static Class NSCFArrayClass = Nil; + (void)initialize { static BOOL isInitialized = NO; if (isInitialized) return; isInitialized = YES; NSCFArrayClass = NSClassFromString(@"NSCFArray"); } #endif + (NSArray *)saxMappingSearchPathes { if (searchPathes == nil) { NSMutableArray *ma; ma = [NSMutableArray arrayWithCapacity:6]; #if COCOA_Foundation_LIBRARY id tmp; tmp = NSSearchPathForDirectoriesInDomains(NSAllLibrariesDirectory, NSAllDomainsMask, YES); if ([tmp count] > 0) { NSEnumerator *e; e = [tmp objectEnumerator]; while ((tmp = [e nextObject])) { tmp = [tmp stringByAppendingPathComponent:@"SaxMappings"]; if (![ma containsObject:tmp]) [ma addObject:tmp]; } } #elif GNUSTEP_BASE_LIBRARY NSEnumerator *libraryPaths; NSString *directory, *suffix; suffix = [self libraryDriversSubDir]; libraryPaths = [NSStandardLibraryPaths() objectEnumerator]; while ((directory = [libraryPaths nextObject])) [ma addObject: [directory stringByAppendingPathComponent: suffix]]; #else NSDictionary *env; id tmp; env = [[NSProcessInfo processInfo] environment]; if ((tmp = [env objectForKey:@"GNUSTEP_PATHPREFIX_LIST"]) == nil) tmp = [env objectForKey:@"GNUSTEP_PATHLIST"]; tmp = [tmp componentsSeparatedByString:@":"]; if ([tmp count] > 0) { NSEnumerator *e; e = [tmp objectEnumerator]; while ((tmp = [e nextObject])) { tmp = [tmp stringByAppendingPathComponent:@"Library/SaxMappings"]; if (![ma containsObject:tmp]) [ma addObject:tmp]; } } #endif /* FHS fallback */ { NSString *p; p = [NSString stringWithFormat:@"share/sope-%i.%i/saxmappings/", SOPE_MAJOR_VERSION, SOPE_MINOR_VERSION]; #ifdef FHS_INSTALL_ROOT [ma addObject:[FHS_INSTALL_ROOT stringByAppendingPathComponent:p]]; #endif [ma addObject:[@"/usr/local/" stringByAppendingString:p]]; [ma addObject:[@"/usr/" stringByAppendingString:p]]; } searchPathes = [ma copy]; if ([searchPathes count] == 0) NSLog(@"%s: no search pathes were found!", __PRETTY_FUNCTION__); } return searchPathes; } + (NSString *)libraryDriversSubDir { return [NSString stringWithFormat:@"SaxMappings"]; } + (id)modelWithName:(NSString *)_name { NSFileManager *fileManager; NSEnumerator *pathes; NSString *path; /* first look in main bundle */ if ((path = [[NSBundle mainBundle] pathForResource:_name ofType:@"xmap"])) return [self modelWithContentsOfFile:path]; /* then in Library */ fileManager = [NSFileManager defaultManager]; pathes = [[[self class] saxMappingSearchPathes] objectEnumerator]; _name = [_name stringByAppendingPathExtension:@"xmap"]; while ((path = [pathes nextObject])) { BOOL isDir; path = [path stringByAppendingPathComponent:_name]; if (![fileManager fileExistsAtPath:path isDirectory:&isDir]) continue; if (isDir) continue; break; } return [self modelWithContentsOfFile:path]; } + (id)modelWithContentsOfFile:(NSString *)_path { NSDictionary *dict; if ((dict = [NSDictionary dictionaryWithContentsOfFile:_path]) == nil) return nil; return [[[self alloc] initWithDictionary:dict] autorelease]; } - (id)initWithDictionary:(NSDictionary *)_dict { self->nsToModel = [mapDictsToObjects(_dict, [SaxNamespaceModel class]) retain]; return self; } - (void)dealloc { [self->nsToModel release]; [super dealloc]; } /* queries */ - (SaxTagModel *)modelForTag:(NSString *)_localName namespace:(NSString *)_ns { SaxNamespaceModel *nsmap; if ((nsmap = [self->nsToModel objectForKey:_ns]) == nil) { if ((nsmap = [self->nsToModel objectForKey:@"*"]) == nil) return nil; } return [nsmap modelForTag:_localName]; } /* faking dictionary */ - (id)objectForKey:(id)_key { return [self->nsToModel objectForKey:_key]; } @end /* SaxMappingModel */ @implementation SaxNamespaceModel - (id)initWithDictionary:(NSDictionary *)_dict { self->tagToModel = [mapDictsToObjects(_dict, [SaxTagModel class]) retain]; return self; } - (void)dealloc { [self->tagToModel release]; [super dealloc]; } /* queries */ - (SaxTagModel *)modelForTag:(NSString *)_localName { SaxTagModel *map; if ((map = [self->tagToModel objectForKey:_localName])) return map; if ((map = [self->tagToModel objectForKey:@"*"])) return map; return nil; } /* faking dictionary */ - (id)objectForKey:(id)_key { return [self->tagToModel objectForKey:_key]; } @end /* SaxNamespaceModel */ @implementation SaxTagModel - (NSDictionary *)_extractAttributeMapping:(NSDictionary *)as { NSMutableDictionary *md; NSEnumerator *keys; NSString *k; NSDictionary *result; md = [[NSMutableDictionary alloc] initWithCapacity:16]; keys = [as keyEnumerator]; while ((k = [keys nextObject])) { id val; val = [as objectForKey:k]; if ([val isKindOfClass:[NSString class]]) [md setObject:val forKey:k]; else if ([val count] == 0) [md setObject:k forKey:k]; else [md setObject:[(NSDictionary *)val objectForKey:@"key"] forKey:k]; } result = [md copy]; [md release]; return result; } - (id)initWithDictionary:(NSDictionary *)_dict { if ((self = [super init])) { NSDictionary *rels; NSDictionary *as; self->className = [[_dict objectForKey:@"class"] copy]; self->key = [[_dict objectForKey:@"key"] copy]; self->tagKey = [[_dict objectForKey:@"tagKey"] copy]; self->namespaceKey = [[_dict objectForKey:@"namespaceKey"] copy]; self->parentKey = [[_dict objectForKey:@"parentKey"] copy]; self->contentKey = [[_dict objectForKey:@"contentKey"] copy]; self->defaultValues = [[_dict objectForKey:@"defaultValues"] copy]; if ((as = [_dict objectForKey:@"attributes"])) self->attrToKey = [self _extractAttributeMapping:as]; if ((rels = [_dict objectForKey:@"ToManyRelationships"])) { NSMutableDictionary *md; NSEnumerator *keys; NSString *k; self->toManyRelationshipKeys = [[rels allKeys] copy]; md = [[NSMutableDictionary alloc] initWithCapacity:16]; keys = [self->toManyRelationshipKeys objectEnumerator]; while ((k = [keys nextObject])) { id tags; NSString *tag; tags = [rels objectForKey:k]; if ([tags isKindOfClass:[NSString class]]) tags = [NSArray arrayWithObject:tags]; tags = [tags objectEnumerator]; while ((tag = [tags nextObject])) { NSString *t; if ((t = [md objectForKey:tag])) { NSLog(@"SaxObjectModel: cannot map tag '%@' to key '%@', " @"it is already mapped to key '%@'.", tag, k, t); } else { [md setObject:k forKey:tag]; } } } self->tagToKey = [md copy]; [md release]; } } return self; } - (void)dealloc { [self->defaultValues release]; [self->toManyRelationshipKeys release]; [self->tagToKey release]; [self->className release]; [self->tagKey release]; [self->namespaceKey release]; [self->parentKey release]; [self->contentKey release]; [self->key release]; [self->attrToKey release]; [super dealloc]; } /* accessors */ - (NSString *)className { return self->className; } - (NSString *)key { return self->key; } - (NSString *)tagKey { return self->tagKey; } - (NSString *)namespaceKey { return self->namespaceKey; } - (NSString *)parentKey { return self->parentKey; } - (NSString *)contentKey { return self->contentKey; } - (NSDictionary *)defaultValues { return self->defaultValues; } - (BOOL)isToManyKey:(NSString *)_key { return [self->toManyRelationshipKeys containsObject:_key]; } - (NSArray *)toManyRelationshipKeys { return self->toManyRelationshipKeys; } - (BOOL)isToManyTag:(NSString *)_tag { return ([self->tagToKey objectForKey:_tag] != nil) ? YES : NO; } - (NSString *)propertyKeyForChildTag:(NSString *)_tag { return [self->tagToKey objectForKey:_tag]; } - (NSArray *)attributeKeys { return [self->attrToKey allKeys]; } - (NSString *)propertyKeyForAttribute:(NSString *)_attr { return [self->attrToKey objectForKey:_attr]; } /* object operations */ - (void)addValue:(id)_value toPropertyWithKey:(NSString *)_key ofObject:(id)_object { NSString *selname; SEL sel; selname = [[NSString alloc] initWithFormat:@"addTo%@:", [_key capitalizedString]]; if ((sel = NSSelectorFromString(selname)) == NULL) { if (doDebug) { NSLog(@"got no selector for key '%@', selname '%@' !", _key, selname); } } [selname release]; selname = nil; if (doDebug) { NSLog(@"%s: adding value %@ to %@ of %@", __PRETTY_FUNCTION__, _value, _key, _object); NSLog(@" selector: %@", NSStringFromSelector(sel)); } if ((sel != NULL) && [_object respondsToSelector:sel]) { [_object performSelector:sel withObject:_value]; } else { id v; v = [_object valueForKey:_key]; if ([self isToManyKey:_key]) { /* to-many relationship */ if (v == nil) { [_object takeValue:[NSArray arrayWithObject:_value] forKey:_key]; } else { #if NeXT_Foundation_LIBRARY || COCOA_Foundation_LIBRARY || \ APPLE_FOUNDATION_LIBRARY if ([v isKindOfClass:NSCFArrayClass] && _CFArrayIsMutable((CFArrayRef)v)) #else if ([v respondsToSelector:@selector(addObject:)]) #endif /* the value is mutable */ [v addObject:_value]; else { /* the value is immutable */ v = [v arrayByAddingObject:_value]; [_object takeValue:v forKey:_key]; } } } else { NSLog(@" APPLIED ON TO-ONE (%@) !", _key); /* to-one relationship */ if (v != _value) [_object takeValue:v forKey:_key]; } } } @end /* SaxTagModel */ SOPE/sope-xml/SaxObjC/COPYRIGHT0000644000000000000000000000010612242733417014654 0ustar rootrootCopyright (C) 2000-2005 SKYRIX Software AG Contact: info@skyrix.com SOPE/sope-xml/SaxObjC/ChangeLog0000644000000000000000000003112212242733417015135 0ustar rootroot2007-03-28 Helge Hess * XMLNamespaces.h: added XMLNS_MXML_2006 namespace (4.7.66) 2007-02-08 Helge Hess * XMLNamespaces.h: added XMLNS_CARDDAV namespace (v4.5.65) * XMLNamespaces.h: added XMLNS_AppleCalApp namespace (v4.5.64) * XMLNamespaces.h: added XMLNS_GROUPDAV namespace (v4.5.63) * XMLNamespaces.h: added XMLNS_AppleCalServer namespace (v4.5.62) 2006-09-20 Helge Hess * GNUmakefile.preamble: filter out -O% flags for files using exception handlers, enable -O2 per default (v4.5.61) 2006-07-05 Helge Hess * SaxObjectModel.m: added FHS_INSTALL_ROOT to lookup path (v4.5.60) * SaxXMLReaderFactory.m: changed to find SAX drivers on 64bit systems in lib64, added FHS_INSTALL_ROOT to lookup path (v4.5.59) 2006-07-03 Helge Hess * v4.5.58 * SaxAttributes.m: fixed gcc 4.1 warnings * use %p for pointer formats 2006-07-02 Helge Hess * XMLNamespaces.h: added ATOM namespace, gCal namespace, OpenSearch namespace (v4.5.57) 2006-06-04 Helge Hess * XMLNamespaces.h (XMLNS_CALDAV): added CalDAV namespace (v4.5.56) 2006-04-23 Helge Hess * XMLNamespaces.h: added Google namespace (v4.5.55) 2005-12-27 Marcus Mueller * SaxObjectDecoder.m: trigger debug logging via new SaxObjectDecoderDebugEnabled default (v4.5.54) 2005-11-25 Helge Hess * SaxMethodCallHandler.m: rewrote tag=>selector mapping function to be Unicode safe (v4.5.53) 2005-08-16 Helge Hess * v4.5.52 * SaxXMLReaderFactory.m: improved bundle-info.plist lookup (first look in bundle directory, then try to lookup as a NSBundle resource), log searched pathes if no XML reader could be found * GNUmakefile.preamble: set framework/cocoa defines when compiling with frameworks support 2005-05-08 Helge Hess * XMLNamespaces.h: added namespace declaration for XML vCards (v4.5.51) 2005-04-23 Helge Hess * SaxMethodCallHandler.m: fixed a gcc 4.0 warning (v4.5.50) 2005-03-23 Marcus Mueller * SaxObjectDecoder.m: fixed remaining leaks (v4.5.49) 2005-01-29 Marcus Mueller * SaxObjectDecoder.m: fixed hard to spot autorelease bug (v4.5.48) 2004-11-12 Max Berger * SaxXMLReaderFactory.m: fixed SaxDriver lookup for gstep-base on MingW32 (OGo bug #979) (v4.5.47) 2004-11-12 Helge Hess * SaxXMLReaderFactory.m: cleanup of driver path processing (v4.5.46) 2004-11-07 Marcus Mueller * SaxObjC.xcode: added SOPE_MAJOR/MINOR definitions for the build 2004-11-07 Helge Hess * SaxXMLReaderFactory.m: fixed a bug in FHS bundle lookup (v4.5.45) 2004-11-06 Helge Hess * SaxObjectModel.m, SaxXMLReaderFactory.m: use SOPE version defines for object model lookup (v4.5.44) 2004-10-30 Marcus Mueller * SaxObjectDecoder.m: fixed typo that prevented compile on non Apple Foundation (v4.3.43) * SaxObjectDecoder.m: provide fix for discovering mutable array on Apple/CoreFoundation - this is rather disturbing, but Apple really broke the concept of mutability for NSArray/NSDictionary. (v4.3.42) 2004-09-22 Marcus Mueller * SaxObjC.xcode: minor fixes 2004-09-21 Marcus Mueller * SaxObjC.xcode: Fixed dependencies to resemble the make process more closely. Our aim should be to stick to the make process as closely as possible, so we shouldn't introduce dependencies in non-toplevel projects. Also fixed cyclic dependency between the framework and the libxmlSAXDriver, which gets copied into the framework wrapper after compilation. This now gets achieved by two shellscript phases, one in the framework and one as a separate shellscript target. 2004-08-29 Helge Hess * v4.3.41 * SaxXMLReaderFactory.m: look in /usr/local/lib/sope-4.3/saxdrivers/ and /usr/lib/sope-4.3/saxdrivers/ for SAX drivers * SaxObjectModel.m: also look in /usr/local/share/sope-4.3/saxmappings/ and /usr/share/sope-4.3/saxmappings/ for models * added hack to install the project in FHS locations - the library, its headers, the tools and the resources will be installed in FHS_INSTALL_ROOT if specified (eg make FHS_INSTALL_ROOT=/usr/local) 2004-08-26 Marcus Mueller * SaxObjC.xcode: new Xcode project 2004-08-24 Helge Hess * changed lookup path to SaxDrivers-4.3 to be consistent with OGo (v4.3.40) * SaxXMLReaderFactory.m: lookup SAX drivers in Library/SaxDrivers/4.3 (v4.3.39) 2004-08-20 Helge Hess * moved to SOPE 4.3 (v4.3.38) 2004-08-03 Marcus Mueller * SaxXMLReaderFactory.m: fixed multiple registration of sax drivers in the search path. Also, when built as a framework, the frameworks's SaxDriver directory is added to the search path (with least significance, so it doesn't interfere with development and custom deployments). (v4.2.37) 2004-07-17 Helge Hess * XMLNamespaces.h: added OOo WebDAV namespace (v4.2.36) 2004-07-16 Helge Hess * XMLNamespaces.h: added namespace declaration for Kupu and XInclude (v4.2.35) 2004-07-15 Helge Hess * XMLNamespaces.h: added relaxng structure namespace as used by Kupu (v4.2.34) 2004-07-07 Helge Hess * XMLNamespaces.h: added namespace declarations for SOAP, XMLSchema and some Novell namespaces (v4.2.33) 2004-06-27 Helge Hess * XMLNamespaces.h: added namespace declaration for OOo meta (v4.2.32) 2004-06-10 Helge Hess * SaxObjectModel.m: fixed a warning with gcc 3.4 (v4.2.31) 2004-06-09 Helge Hess * v4.2.30 * GNUmakefile: also build SaxObjC.framework on non-libFoundation systems * GNUmakefile.preamble: added prebinding segaddr 2004-03-16 Helge Hess * SaxXMLReaderFactory.m: added SaxDebugReaderFactory default to enable debug logs, added more debug logging (v4.2.29) * XMLNamespaces.h: added namespace declaration for Zope METAL (v4.2.28) 2004-03-15 Helge Hess * XMLNamespaces.h: added namespace declaration for Zope TAL (v4.2.27) 2004-02-27 Helge Hess * SaxXMLReaderFactory.m: subminbor improvement to warn-log in case multiple XML parsers are found for a single type (v4.2.26) 2004-02-16 Helge Hess * SaxXMLReaderFactory.m: subminor code cleanup and fixes to log messages (v4.2.25) 2003-12-26 Helge Hess * SaxXMLReaderFactory.m: cleaned up logging for missing parsers (v4.2.24) 2003-11-20 Helge Hess * XMLNamespaces.h: added namespace declaration for some proprietary groupware server (v4.2.23) 2003-11-19 Helge Hess * GNUmakefile: removed autodoc target 2003-11-09 Helge Hess * v4.2.22 * SaxAttributes.m: added -initWithDictionary method necessary for the NSXMLParser support (Note: Panther NSXMLParser currently doesn't seem to be able to do proper namespace processing for attributes?) * added the SaxDefaultHandler+NSXML category which allows any SAX handler inheriting from SaxDefaultHandler to be used as a delegate for the new NSXMLParser in Panther 2003-10-30 Helge Hess * SaxAttributes.m: fixed an Xcode warning (v4.2.21) 2003-10-15 Helge Hess * XMLNamespaces.h: added MS WordML namespace, added Dublin Core namespace (v4.2.20) 2003-10-12 Helge Hess * SaxObjectModel.m, SaxXMLReaderFactory.m: added support for GNUSTEP_PATHLIST (apparently replaces GNUSTEP_PATHPREFIX_LIST in newer gstep-make versions (v4.2.19) 2003-08-19 Helge Hess * SaxObjectDecoder.m: fixed OGo bug 133, decoder did not properly check value classes on Cocoa (v4.2.18) 2003-07-18 Helge Hess * SaxXMLReaderFactory.m: added a missing @end for gstep-base, patch provided by Filip Van Raemdonck (v4.2.17) 2003-07-03 Helge Hess * XMLNamespaces.h: added defines for the various XML namespaces used in OpenOffice.org emitted XML files (v4.2.16) 2003-06-18 Helge Hess * v4.2.15 * SaxXMLReaderFactory.m: added SaxCoreOnMissingParser default to trigger a coredump for debugging purposes * fixed some signed/unsigned warnings 2003-02-11 Helge Hess * moved saxxml and xmln tools to ../samples/ 2003-01-23 Helge Hess * SaxMethodCallHandler.m, SaxObjectDecoder.m: reduced logging if debugOn is off (v4.2.14) Thu Jan 2 10:40:19 2003 Helge Hess * v4.2.13 * saxxml.m: replaced RELEASE macros with method calls * common.h: define ASSIGN macro if missing, do not include headers from FoundationExt * SaxNamespaceSupport.m: replaced -notImplemented: with -doesNotRecognizeSelector: since -notImplemented: is not available on MacOSX 2002-11-27 Helge Hess * SaxObjectModel.m: fixed a bug with parsing toMany keys (addToRel: was not properly called) (v4.2.12) 2002-11-05 Helge Hess * XMLNamespaces.h: added Nautilus namespace (v4.2.11) 2002-11-04 Helge Hess * XMLNamespaces.h: added the cadaver namespaces (v4.2.10) 2002-10-24 Helge Hess * XMLNamespaces.h: added various namespace declarations (v4.2.9) 2002-10-23 Helge Hess * SaxObjectModel.m, SaxObjectDecoder.m: added a namespaceKey to the model (allows you to track the namespace in your parsed objects) * XMLNamespaces.h: added the hotmail and httpmail namespaces (v4.2.8) Thu Oct 17 20:24:53 2002 Helge Hess * SaxObjectDecoder.m ([_SaxObjTagInfo -unableToSetValue:forKey:withTag:toParent:exception:]): now logs, why it was unable to set the key (exception) (v4.2.7) 2002-10-17 Helge Hess * SaxObjectModel.m: when searching for a model the mainbundle resources are checked before traversing the Library/SaxMappings pathes (v4.2.6) 2002-10-14 Helge Hess * SaxObjectDecoder.m: added support for contentKey (v4.2.5) 2002-10-13 Helge Hess * added SaxObjectDecoder, a SAX handler which constructs object trees by consulting a XML<->object mapping model (v4.2.4) 2002-10-10 Helge Hess * XMLNamespaces.h: added namespace declaration for xcal 01 (v4.2.3) 2002-08-29 Helge Hess * SaxXMLReaderFactory.m: small fix for OSX, renamed COCOA_FRAMEWORK define to COCOA_Foundation_LIBRARY 2002-05-31 Helge Hess * SaxXMLReaderFactory.m: added NSBundle -copyWithZone: when compiling for gstep-base compatibility Sun May 5 18:01:32 2002 Helge Hess * removed SAX1<->SAX2 adaptor classes, SAX1 stuff in general Tue Feb 12 20:24:59 2002 Helge Hess * SaxXMLReaderFactory.m: modified to be usable without NGBundleManager (but uses same bundle-info.plist ...) Sat Feb 9 11:35:27 2002 Helge Hess * moved XML test files to Examples/xmlsamples Wed Jan 9 13:24:40 2002 Helge Hess * SaxXMLReaderFactory.m: ensure that a text/xml reader is created ... Mon Dec 17 17:02:15 2001 Helge Hess * added namespaces-declaration header Wed Oct 24 18:45:05 2001 Helge Hess * ExpatSaxDriver/ExpatSaxDriver.m: fixed UTF8->UTF16 conversion bug (incorrect string length was passed to Sax callbacks) Mon Oct 1 15:47:31 2001 Helge Hess * SaxXMLReaderFactory.m: added capability to create SAX parsers based on MIME-type Thu Aug 16 13:48:01 2001 Helge Hess * SaxAttributes.m: added NSCopying SOPE/sope-xml/SaxObjC/SaxLexicalHandler.h0000644000000000000000000000643712242733417017102 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __SaxLexicalHandler_H__ #define __SaxLexicalHandler_H__ #import /* new in SAX 2.0beta SAX2 extension handler for lexical events. This is an optional extension handler for SAX2 to provide lexical information about an XML document, such as comments and CDATA section boundaries; XML readers are not required to support this handler. The events in the lexical handler apply to the entire document, not just to the document element, and all lexical handler events must appear between the content handler's startDocument and endDocument events. To set the LexicalHandler for an XML reader, use the setProperty method with the propertyId "http://xml.org/sax/handlers/LexicalHandler". If the reader does not support lexical events, it will throw a SAXNotRecognizedException or a SAXNotSupportedException when you attempt to register the handler. */ @protocol SaxLexicalHandler /* Report an XML comment anywhere in the document. This callback will be used for comments inside or outside the document element, including comments in the external DTD subset (if read). */ - (void)comment:(unichar *)_chars length:(int)_len; /* Report the start of DTD declarations, if any. Any declarations are assumed to be in the internal subset unless otherwise indicated by a startEntity event. Note that the start/endDTD events will appear within the start/endDocument events from ContentHandler and before the first startElement event. */ - (void)startDTD:(NSString *)_name publicId:(NSString *)_pub systemId:(NSString *)_sys; /* Report the end of DTD declarations. */ - (void)endDTD; /* Report the beginning of an entity in content. NOTE: entity references in attribute values -- and the start and end of the document entity -- are never reported. The start and end of the external DTD subset are reported using the pseudo-name "[dtd]". All other events must be properly nested within start/end entity events. Note that skipped entities will be reported through the skippedEntity event, which is part of the ContentHandler interface. If it is a parameter entity, the name will begin with '%'. */ - (void)startEntity:(NSString *)_name; /* report the end of an entity */ - (void)endEntity:(NSString *)_name; /* Report the start of a CDATA section. The contents of the CDATA section will be reported through the regular characters event. */ - (void)startCDATA; /* Report the end of a CDATA section */ - (void)endCDATA; @end #endif /* __SaxLexicalHandler_H__ */ SOPE/sope-xml/SaxObjC/SaxHandlerBase.m0000644000000000000000000000370012242733417016366 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "SaxHandlerBase.h" #include "SaxException.h" @implementation SaxHandlerBase /* SaxDocumentHandler */ - (void)startDocument { } - (void)endDocument { } - (void)startElement:(NSString *)_tagName attributes:(id)_attrs { } - (void)endElement:(NSString *)_tagName { } - (void)characters:(unichar *)_chars length:(int)_len { } - (void)ignorableWhitespace:(unichar *)_chars length:(int)_len { } - (void)processingInstruction:(NSString *)_pi data:(NSString *)_data { } - (void)setDocumentLocator:(id)_locator { } /* SaxDTDHandler */ - (void)notationDeclaration:(NSString *)_name publicId:(NSString *)_pubId systemId:(NSString *)_sysId { } - (void)unparsedEntityDeclaration:(NSString *)_name publicId:(NSString *)_pubId systemId:(NSString *)_sysId notationName:(NSString *)_notName { } /* SaxEntityResolver */ - (id)resolveEntityWithPublicId:(NSString *)_pubId systemId:(NSString *)_sysId { return nil; } /* SaxErrorHandler */ - (void)warning:(SaxParseException *)_exception { } - (void)error:(SaxParseException *)_exception { } - (void)fatalError:(SaxParseException *)_exception { [_exception raise]; } @end /* SaxHandlerBase */ SOPE/sope-xml/SaxObjC/SaxXMLFilter.m0000644000000000000000000001266512242733417016036 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "SaxXMLFilter.h" #include "common.h" @implementation SaxXMLFilter - (id)initWithParent:(id)_parent { if ((self = [self init])) { [self setParent:_parent]; } return self; } - (void)dealloc { [self->parent release]; [super dealloc]; } - (void)setParent:(id)_parent { if (self->parent == _parent) return; [self->parent setContentHandler:nil]; [self->parent setDTDHandler:nil]; [self->parent setErrorHandler:nil]; [self->parent setEntityResolver:nil]; ASSIGN(self->parent, _parent); [self->parent setContentHandler:self]; [self->parent setDTDHandler:self]; [self->parent setErrorHandler:self]; [self->parent setEntityResolver:self]; } - (id)parent { return self->parent; } /* features & properties */ - (void)setFeature:(NSString *)_name to:(BOOL)_value { [self->parent setFeature:_name to:_value]; } - (BOOL)feature:(NSString *)_name { return [self->parent feature:_name]; } - (void)setProperty:(NSString *)_name to:(id)_value { [self->parent setProperty:_name to:_value]; } - (id)property:(NSString *)_name { return [self->parent property:_name]; } /* handlers */ - (void)setDTDHandler:(id)_handler { ASSIGN(self->dtdHandler, _handler); } - (id)dtdHandler { return self->dtdHandler; } - (void)setErrorHandler:(id)_handler { ASSIGN(self->errorHandler, _handler); } - (id)errorHandler { return self->errorHandler; } - (void)setEntityResolver:(id)_handler { ASSIGN(self->entityResolver, _handler); } - (id)entityResolver { return self->entityResolver; } - (void)setContentHandler:(id)_handler { ASSIGN(self->contentHandler, _handler); } - (id)contentHandler { return self->contentHandler; } /* parsing */ - (void)parseFromSource:(id)_source { [self->parent parseFromSource:_source]; } - (void)parseFromSystemId:(NSString *)_sysId { [self->parent parseFromSystemId:_sysId]; } - (void)parseFromSource:(id)_source systemId:(NSString *)_sysId { [self->parent parseFromSource:_source systemId:_sysId]; } /* SaxEntityResolver */ - (id)resolveEntityWithPublicId:(NSString *)_pubId systemId:(NSString *)_sysId { return [self->entityResolver resolveEntityWithPublicId:_pubId systemId:_sysId]; } /* SaxContentHandler */ - (void)startDocument { [self->contentHandler startDocument]; } - (void)endDocument { [self->contentHandler endDocument]; } - (void)startPrefixMapping:(NSString *)_prefix uri:(NSString *)_uri { [self->contentHandler startPrefixMapping:_prefix uri:_uri]; } - (void)endPrefixMapping:(NSString *)_prefix { [self->contentHandler endPrefixMapping:_prefix]; } - (void)startElement:(NSString *)_localName namespace:(NSString *)_ns rawName:(NSString *)_rawName attributes:(id)_attributes { [self->contentHandler startElement:_localName namespace:_ns rawName:_rawName attributes:_attributes]; } - (void)endElement:(NSString *)_localName namespace:(NSString *)_ns rawName:(NSString *)_rawName { [self->contentHandler endElement:_localName namespace:_ns rawName:_rawName]; } - (void)characters:(unichar *)_chars length:(int)_len { [self->contentHandler characters:_chars length:_len]; } - (void)ignorableWhitespace:(unichar *)_chars length:(int)_len { [self->contentHandler ignorableWhitespace:_chars length:_len]; } - (void)processingInstruction:(NSString *)_pi data:(NSString *)_data { [self->contentHandler processingInstruction:_pi data:_data]; } - (void)setDocumentLocator:(id)_locator { [self->contentHandler setDocumentLocator:_locator]; } - (void)skippedEntity:(NSString *)_entityName { [self->contentHandler skippedEntity:_entityName]; } /* error-handler */ - (void)warning:(SaxParseException *)_exception { [self->errorHandler warning:_exception]; } - (void)error:(SaxParseException *)_exception { [self->errorHandler error:_exception]; } - (void)fatalError:(SaxParseException *)_exception { [self->errorHandler fatalError:_exception]; } /* dtd-handler */ - (void)notationDeclaration:(NSString *)_name publicId:(NSString *)_pubId systemId:(NSString *)_sysId { [self->dtdHandler notationDeclaration:_name publicId:_pubId systemId:_sysId]; } - (void)unparsedEntityDeclaration:(NSString *)_name publicId:(NSString *)_pubId systemId:(NSString *)_sysId notationName:(NSString *)_notName { [self->dtdHandler unparsedEntityDeclaration:_name publicId:_pubId systemId:_sysId notationName:_notName]; } @end /* SaxXMLFilter */ SOPE/sope-xml/SaxObjC/SaxObjC-Info.plist0000644000000000000000000000133712242733417016627 0ustar rootroot CFBundleDevelopmentRegion English CFBundleExecutable SaxObjC CFBundleGetInfoString CFBundleIdentifier org.OpenGroupware.sope-xml.SaxObjC CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType FMWK CFBundleShortVersionString CFBundleSignature ???? CFBundleVersion 4.7 SOPE/sope-xml/SaxObjC/SaxXMLReaderFactory.h0000644000000000000000000000315112242733417017324 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __SaxXMLReaderFactory_H__ #define __SaxXMLReaderFactory_H__ #import #include /* To get a reader for HTML files: reader = [factory createXMLReaderForMimeType:@"text/html"]; for XML files: reader = [factory createXMLReaderForMimeType:@"text/xml"]; a specific reader: reader = [factory createXMLReaderWithName:@"libxmlSAXDriver"]; */ @class NSDictionary; @interface SaxXMLReaderFactory : NSObject { NSDictionary *nameToBundle; NSDictionary *mimeTypeToName; } + (id)standardXMLReaderFactory; - (id)createXMLReader; - (id)createXMLReaderWithName:(NSString *)_name; - (id)createXMLReaderForMimeType:(NSString *)_mtype; - (NSArray *)availableXMLReaders; @end #endif /* __SaxXMLReaderFactory_H__ */ SOPE/sope-xml/SaxObjC/SaxException.h0000644000000000000000000000216512242733417016153 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __SaxException_H__ #define __SaxException_H__ #import @interface SaxException : NSException @end @interface SaxParseException : SaxException @end /* new in SAX 2.0beta */ @interface SaxNotSupportedException : SaxException @end @interface SaxNotRecognizedException : SaxException @end #endif /* __SaxException_H__ */ SOPE/sope-xml/SaxObjC/SaxXMLReaderFactory.m0000644000000000000000000003207712242733417017342 0ustar rootroot/* Copyright (C) 2000-2006 SKYRIX Software AG Copyright (C) 2006 Helge Hess This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "SaxXMLReaderFactory.h" #include "common.h" #if GNUSTEP_BASE_LIBRARY @implementation NSBundle(Copying) - (id)copyWithZone:(NSZone *)_zone { return [self retain]; } @end #endif @implementation SaxXMLReaderFactory static BOOL coreOnMissingParser = NO; static BOOL debugOn = NO; static NSArray *searchPathes = nil; static NSNull *null = nil; static id factory = nil; + (void)initialize { NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; coreOnMissingParser = [ud boolForKey:@"SaxCoreOnMissingParser"]; debugOn = [ud boolForKey:@"SaxDebugReaderFactory"]; } + (id)standardXMLReaderFactory { if (factory == nil) factory = [[self alloc] init]; return factory; } - (void)dealloc { [self->nameToBundle release]; [self->mimeTypeToName release]; [super dealloc]; } /* operations */ - (void)flush { [self->nameToBundle release]; self->nameToBundle = nil; [self->mimeTypeToName release]; self->mimeTypeToName = nil; } /* search path construction */ - (BOOL)searchFrameworkBundle { #if COMPILE_AS_FRAMEWORK return YES; #else return NO; #endif } - (NSString *)libraryDriversSubDir { return [NSString stringWithFormat:@"SaxDrivers-%i.%i", SOPE_MAJOR_VERSION, SOPE_MINOR_VERSION]; } - (void)addSearchPathesForCocoa:(NSMutableArray *)ma { /* for Cocoa */ id tmp; tmp = NSSearchPathForDirectoriesInDomains(NSAllLibrariesDirectory, NSAllDomainsMask, YES); if ([tmp count] > 0) { NSEnumerator *e; NSString *subdir; subdir = [self libraryDriversSubDir]; e = [tmp objectEnumerator]; while ((tmp = [e nextObject]) != nil) { tmp = [tmp stringByAppendingPathComponent:subdir]; if (![ma containsObject:tmp]) [ma addObject:tmp]; } } if ([self searchFrameworkBundle]) { NSBundle *fwBundle; /* no need to add 4.5 here, right? */ fwBundle = [NSBundle bundleForClass:[self class]]; tmp = [[fwBundle resourcePath] stringByAppendingPathComponent: @"SaxDrivers"]; [ma addObject:tmp]; } } - (void)addSearchPathesForStdLibPathes:(NSMutableArray *)ma { /* for gstep-base */ NSEnumerator *e; NSString *subdir; id tmp; #if !COCOA_Foundation_LIBRARY && !NeXT_Foundation_LIBRARY tmp = NSStandardLibraryPaths(); #else tmp = nil; /* not available on Cocoa? */ #endif if ([tmp count] == 0) return; subdir = [self libraryDriversSubDir]; e = [tmp objectEnumerator]; while ((tmp = [e nextObject]) != nil) { tmp = [tmp stringByAppendingPathComponent:subdir]; if ([ma containsObject:tmp]) continue; [ma addObject:tmp]; } } - (void)addSearchPathesForGNUstepEnv:(NSMutableArray *)ma { /* for libFoundation */ #if GNUSTEP_BASE_LIBRARY NSEnumerator *libraryPaths; NSString *directory, *suffix; suffix = [self libraryDriversSubDir]; libraryPaths = [NSStandardLibraryPaths() objectEnumerator]; while ((directory = [libraryPaths nextObject])) [ma addObject: [directory stringByAppendingPathComponent: suffix]]; #else NSString *subdir; NSEnumerator *e; NSDictionary *env; id tmp; env = [[NSProcessInfo processInfo] environment]; if ((tmp = [env objectForKey:@"GNUSTEP_PATHPREFIX_LIST"]) == nil) tmp = [env objectForKey:@"GNUSTEP_PATHLIST"]; tmp = [tmp componentsSeparatedByString:@":"]; if ([tmp count] == 0) return; subdir = [@"Library/" stringByAppendingString:[self libraryDriversSubDir]]; e = [tmp objectEnumerator]; while ((tmp = [e nextObject]) != nil) { tmp = [tmp stringByAppendingPathComponent:subdir]; if ([ma containsObject:tmp]) continue; [ma addObject:tmp]; } #endif } - (NSArray *)saxReaderSearchPathes { NSMutableArray *ma; id tmp; if (searchPathes != nil) return searchPathes; ma = [NSMutableArray arrayWithCapacity:8]; #if COCOA_Foundation_LIBRARY /* Note: do not use NeXT_Foundation_LIBRARY, this is only for Xcode! */ [self addSearchPathesForCocoa:ma]; #elif GNUSTEP_BASE_LIBRARY [self addSearchPathesForStdLibPathes:ma]; #else [self addSearchPathesForGNUstepEnv:ma]; #endif /* FHS fallback */ tmp = [[NSString alloc] initWithFormat: #ifdef CGS_LIBDIR_NAME [CGS_LIBDIR_NAME stringByAppendingString:@"/sope-%i.%i/saxdrivers/"], #else @"lib/sope-%i.%i/saxdrivers/", #endif SOPE_MAJOR_VERSION, SOPE_MINOR_VERSION]; #ifdef FHS_INSTALL_ROOT [ma addObject:[FHS_INSTALL_ROOT stringByAppendingPathComponent:tmp]]; #endif // TODO: should we always add those? or maybe derive from PATH or // LD_LIBRARY_PATH? [ma addObject:[@"/usr/local/" stringByAppendingString:tmp]]; [ma addObject:[@"/usr/" stringByAppendingString:tmp]]; [tmp release]; tmp = nil; searchPathes = [ma copy]; if ([searchPathes count] == 0) NSLog(@"%s: no search pathes were found!", __PRETTY_FUNCTION__); return searchPathes; } /* loading */ - (void)_loadBundlePath:(NSString *)_bundlePath infoDictionary:(NSDictionary *)_info nameMap:(NSMutableDictionary *)_nameMap typeMap:(NSMutableDictionary *)_typeMap { NSArray *drivers; NSEnumerator *e; NSDictionary *driverInfo; NSBundle *bundle; _info = [_info objectForKey:@"provides"]; if ((drivers = [_info objectForKey:@"SAXDrivers"]) == nil) { NSLog(@"%s: .sax bundle '%@' does not provide any SAX drivers ...", __PRETTY_FUNCTION__, _bundlePath); return; } if ((bundle = [NSBundle bundleWithPath:_bundlePath]) == nil) { NSLog(@"%s: could not create bundle from path '%@'", __PRETTY_FUNCTION__, _bundlePath); return; } /* found a driver with valid info dict, process it ... */ e = [drivers objectEnumerator]; while ((driverInfo = [e nextObject]) != nil) { NSString *name, *tname; NSEnumerator *te; name = [driverInfo objectForKey:@"name"]; if ([name length] == 0) { NSLog(@"%s: missing name in sax driver section of bundle %@ ...", __PRETTY_FUNCTION__, _bundlePath); continue; } /* check if name is already registered */ if ([_nameMap objectForKey:name]) { if (debugOn) NSLog(@"%s: already have sax driver named '%@' ...", __PRETTY_FUNCTION__, name); continue; } /* register bundle for name */ [_nameMap setObject:bundle forKey:name]; /* register MIME-types */ te = [[driverInfo objectForKey:@"sourceTypes"] objectEnumerator]; while ((tname = [te nextObject])) { NSString *tmp; if ((tmp = [_typeMap objectForKey:tname])) { NSLog(@"WARNING(%s): multiple parsers available for MIME type '%@', " @"using '%@' as default for type %@.", __PRETTY_FUNCTION__, tname, tmp, tname); continue; } [_typeMap setObject:name forKey:tname]; } } } - (void)_loadLibraryPath:(NSString *)_libraryPath nameMap:(NSMutableDictionary *)_nameMap typeMap:(NSMutableDictionary *)_typeMap { NSFileManager *fm = [NSFileManager defaultManager]; NSEnumerator *e; NSString *p; e = [[fm directoryContentsAtPath:_libraryPath] objectEnumerator]; while ((p = [e nextObject]) != nil) { NSDictionary *info; NSString *infoPath; BOOL isDir; if (![p hasSuffix:@".sax"]) continue; p = [_libraryPath stringByAppendingPathComponent:p]; if (![fm fileExistsAtPath:p isDirectory:&isDir]) continue; if (!isDir) { /* info file is a directory ??? */ NSLog(@"%s: .sax is not a dir: '%@' ???", __PRETTY_FUNCTION__, p); continue; } infoPath = [p stringByAppendingPathComponent:@"bundle-info.plist"]; if (![fm fileExistsAtPath:infoPath]) { NSBundle *b; b = [NSBundle bundleWithPath:p]; infoPath = [b pathForResource:@"bundle-info" ofType:@"plist"]; if (![fm fileExistsAtPath:infoPath]) { NSLog(@"%s: did not find bundle-info dictionary in driver: '%@'", __PRETTY_FUNCTION__, infoPath); continue; } } if ((info = [NSDictionary dictionaryWithContentsOfFile:infoPath]) == nil) { NSLog(@"%s: could not parse bundle-info dictionary: '%@'", __PRETTY_FUNCTION__, infoPath); continue; } [self _loadBundlePath:p infoDictionary:info nameMap:_nameMap typeMap:_typeMap]; } } - (void)_loadAvailableBundles { NSAutoreleasePool *pool; /* setup globals */ if (null == nil) null = [[NSNull null] retain]; #if DEBUG NSAssert(self->nameToBundle == nil, @"already set up !"); NSAssert(self->mimeTypeToName == nil, @"partially set up !"); #else if (self->nameToBundle != nil) return; #endif pool = [[NSAutoreleasePool alloc] init]; { /* lookup bundle in Libary/SaxDrivers pathes */ NSEnumerator *pathes; NSString *path; NSMutableDictionary *nameMap, *typeMap; nameMap = [NSMutableDictionary dictionaryWithCapacity:16]; typeMap = [NSMutableDictionary dictionaryWithCapacity:16]; pathes = [[self saxReaderSearchPathes] objectEnumerator]; while ((path = [pathes nextObject])) [self _loadLibraryPath:path nameMap:nameMap typeMap:typeMap]; self->nameToBundle = [nameMap copy]; self->mimeTypeToName = [typeMap copy]; #if DEBUG if ([self->nameToBundle count] == 0) { NSLog(@"%s: no XML parser could be found in pathes: %@", __PRETTY_FUNCTION__, [self saxReaderSearchPathes]); } else if ([self->mimeTypeToName count] == 0) { NSLog(@"%s: no XML parser declared a MIME type ...",__PRETTY_FUNCTION__); } #endif } [pool release]; } - (id)createXMLReader { NSString *defReader; id reader; if (debugOn) NSLog(@"%s: lookup default XML reader ...",__PRETTY_FUNCTION__); defReader = [[NSUserDefaults standardUserDefaults] stringForKey:@"XMLReader"]; if (debugOn) NSLog(@"%s: default name ...",__PRETTY_FUNCTION__, defReader); if (defReader) { if ((reader = [self createXMLReaderWithName:defReader])) return reader; NSLog(@"%s: could not create default XMLReader '%@' !", __PRETTY_FUNCTION__, defReader); } return [self createXMLReaderForMimeType:@"text/xml"]; } - (id)createXMLReaderWithName:(NSString *)_name { NSBundle *bundle; Class readerClass; if (debugOn) NSLog(@"%s: lookup XML reader with name: '%@'",__PRETTY_FUNCTION__,_name); if ([_name length] == 0) return [self createXMLReader]; if (self->nameToBundle == nil) [self _loadAvailableBundles]; if ((bundle = [self->nameToBundle objectForKey:_name]) == nil) return nil; /* load bundle executable code */ if (![bundle load]) { NSLog(@"%s: could not load SaxDriver bundle %@ !", __PRETTY_FUNCTION__, bundle); return nil; } NSAssert(bundle, @"should have a loaded bundle at this stage ..."); /* lookup class */ if ((readerClass = NSClassFromString(_name)) == Nil) { NSLog(@"WARNING(%s): could not find SAX reader class %@ (SAX bundle=%@)", __PRETTY_FUNCTION__, _name, bundle); return nil; } /* create instance */ return [[[readerClass alloc] init] autorelease]; } - (id)createXMLReaderForMimeType:(NSString *)_mtype { id reader; NSString *name; if (self->mimeTypeToName == nil) [self _loadAvailableBundles]; if (debugOn) NSLog(@"%s: lookup XML reader for type: '%@'",__PRETTY_FUNCTION__, _mtype); if ([_mtype respondsToSelector:@selector(stringValue)]) _mtype = [(id)_mtype stringValue]; if ([_mtype length] == 0) _mtype = @"text/xml"; if ((name = [self->mimeTypeToName objectForKey:_mtype]) == nil) { if (debugOn) { NSLog(@"%s: did not find SAX parser for MIME type %@ map: \n%@", __PRETTY_FUNCTION__, _mtype, self->mimeTypeToName); NSLog(@"%s: parsers: %@", __PRETTY_FUNCTION__, [self->nameToBundle allKeys]); } if (coreOnMissingParser) { NSLog(@"%s: aborting, because 'SaxCoreOnMissingParser' " @"default is enabled!", __PRETTY_FUNCTION__); abort(); } return nil; } if (debugOn) NSLog(@"%s: found XML reader named: '%@'", __PRETTY_FUNCTION__, name); reader = [self createXMLReaderWithName:name]; if (debugOn) NSLog(@"%s: created XML reader: %@", __PRETTY_FUNCTION__, reader); return reader; } - (NSArray *)availableXMLReaders { return [self->nameToBundle allKeys]; } @end /* SaxXMLReaderFactory */ SOPE/sope-xml/SaxObjC/SaxAttributes.m0000644000000000000000000001362012242733417016346 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "SaxAttributes.h" #include "common.h" @implementation SaxAttributes - (id)init { Class c = [NSMutableArray class]; self->names = [[c alloc] init]; self->uris = [[c alloc] init]; self->rawNames = [[c alloc] init]; self->types = [[c alloc] init]; self->values = [[c alloc] init]; return self; } - (id)initWithAttributes:(id)_attrs { if ((self = [self init])) { NSUInteger i, c; for (i = 0, c = [_attrs count]; i < c; i++) { [self addAttribute:[_attrs nameAtIndex:i] uri:[_attrs uriAtIndex:i] rawName:[_attrs rawNameAtIndex:i] type:[_attrs typeAtIndex:i] value:[_attrs valueAtIndex:i]]; } } return self; } - (id)initWithAttributeList:(id)_attrList { if ((self = [self init])) { NSUInteger i; for (i = 0; i < [_attrList count]; i++) { [self addAttribute:[_attrList nameAtIndex:i] uri:@"" rawName:[_attrList nameAtIndex:i] type:[_attrList typeAtIndex:i] value:[_attrList valueAtIndex:i]]; } } return self; } - (id)initWithDictionary:(NSDictionary *)_dict { if ((self = [self init])) { NSEnumerator *keys; NSString *key; keys = [_dict keyEnumerator]; while ((key = [keys nextObject])) { [self addAttribute:key uri:nil rawName:key type:nil value:[_dict objectForKey:key]]; } } return self; } - (void)dealloc { [self->names release]; [self->uris release]; [self->rawNames release]; [self->types release]; [self->values release]; [super dealloc]; } /* modifications */ - (void)addAttribute:(NSString *)_localName uri:(NSString *)_uri rawName:(NSString *)_rawName type:(NSString *)_type value:(NSString *)_value { [self->names addObject:_localName ? _localName : _rawName]; [self->uris addObject:_uri ? _uri : (NSString *)@""]; [self->rawNames addObject:_rawName ? _rawName : (NSString *)@""]; [self->types addObject:_type ? _type : (NSString *)@"CDATA"]; [self->values addObject:_value]; } - (void)clear { [self->names removeAllObjects]; [self->uris removeAllObjects]; [self->rawNames removeAllObjects]; [self->types removeAllObjects]; [self->values removeAllObjects]; } /* lookup indices */ - (NSUInteger)indexOfRawName:(NSString *)_rawName { return [self->rawNames indexOfObject:_rawName]; } - (NSUInteger)indexOfName:(NSString *)_localPart uri:(NSString *)_uri { NSUInteger i, c; for (i = 0, c = [self count]; i < c; i++) { NSString *name; name = [self nameAtIndex:i]; if ([name isEqualToString:_localPart]) { NSString *auri; auri = [self uriAtIndex:i]; //NSLog(@"found name %@", name); if (([auri length] == 0) && ([_uri length] == 0)) return i; if ([_uri isEqualToString:auri]) return i; } } return NSNotFound; } /* lookup data by index */ - (NSString *)nameAtIndex:(NSUInteger)_idx { return [self->names objectAtIndex:_idx]; } - (NSString *)rawNameAtIndex:(NSUInteger)_idx { return [self->rawNames objectAtIndex:_idx]; } - (NSString *)typeAtIndex:(NSUInteger)_idx { return [self->types objectAtIndex:_idx]; } - (NSString *)uriAtIndex:(NSUInteger)_idx { return [self->uris objectAtIndex:_idx]; } - (NSString *)valueAtIndex:(NSUInteger)_idx { return [self->values objectAtIndex:_idx]; } /* lookup data by name */ - (NSString *)typeForRawName:(NSString *)_rawName { NSUInteger i; if ((i = [self indexOfRawName:_rawName]) == NSNotFound) return nil; return [self typeAtIndex:i]; } - (NSString *)typeForName:(NSString *)_localName uri:(NSString *)_uri { NSUInteger i; if ((i = [self indexOfName:_localName uri:_uri]) == NSNotFound) return nil; return [self typeAtIndex:i]; } - (NSString *)valueForRawName:(NSString *)_rawName { NSUInteger i; if ((i = [self indexOfRawName:_rawName]) == NSNotFound) return nil; return [self valueAtIndex:i]; } - (NSString *)valueForName:(NSString *)_localName uri:(NSString *)_uri { NSUInteger i; if ((i = [self indexOfName:_localName uri:_uri]) == NSNotFound) return nil; return [self valueAtIndex:i]; } /* list size */ - (NSUInteger)count { return [self->names count]; } /* NSCopying */ - (id)copyWithZone:(NSZone *)_zone { return [(SaxAttributes *)[[self class] alloc] initWithAttributes:self]; } /* description */ - (NSString *)description { NSMutableString *s; NSString *is; NSUInteger i, c; s = [[NSMutableString alloc] init]; [s appendFormat:@"<%08X[%@]:", self, NSStringFromClass([self class])]; for (i = 0, c = [self count]; i < c; i++) { NSString *type; [s appendString:@" "]; [s appendString:[self nameAtIndex:i]]; [s appendString:@"='"]; [s appendString:[self valueAtIndex:i]]; [s appendString:@"'"]; type = [self typeAtIndex:i]; if (![type isEqualToString:@"CDATA"]) { [s appendString:@"["]; [s appendString:type]; [s appendString:@"]"]; } } [s appendString:@">"]; is = [s copy]; [s release]; return [is autorelease]; } @end /* SaxAttributes */ SOPE/sope-xml/SaxObjC/SaxHandlerBase.h0000644000000000000000000000232212242733417016360 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __SaxHandlerBase_H__ #define __SaxHandlerBase_H__ #import #include #include #include #include /* deprecated in SAX 2.0beta */ @interface SaxHandlerBase : NSObject < SaxEntityResolver, SaxDTDHandler, SaxDocumentHandler, SaxErrorHandler > @end /* SaxHandlerBase */ #endif /* __SaxHandlerBase_H__ */ SOPE/sope-xml/SaxObjC/GNUmakefile.preamble0000644000000000000000000000350112242733417017223 0ustar rootroot# compilation settings include ./Version libSaxObjC_DLL_DEF = libSaxObjC.def libSaxObjC_INTERFACE_VERSION=$(MAJOR_VERSION).$(MINOR_VERSION) libSaxObjC_INSTALL_DIR=$(SOPE_SYSLIBDIR) libSaxObjC_VERSION=$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBMINOR_VERSION) SaxObjC_INTERFACE_VERSION=$(MAJOR_VERSION).$(MINOR_VERSION) SaxObjC_VERSION=$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBMINOR_VERSION) libSaxObjC_HEADER_FILES_DIR = . libSaxObjC_HEADER_FILES_INSTALL_DIR = /SaxObjC # framework support SaxObjC_HEADER_FILES = $(libSaxObjC_HEADER_FILES) SaxObjC_OBJC_FILES = $(libSaxObjC_OBJC_FILES) ADDITIONAL_CPPFLAGS += \ -O2 \ -Wall -DCOMPILE_FOR_GSTEP_MAKE=1 \ -DSOPE_MAJOR_VERSION=$(MAJOR_VERSION) \ -DSOPE_MINOR_VERSION=$(MINOR_VERSION) \ -DSOPE_SUBMINOR_VERSION=$(SUBMINOR_VERSION) ADDITIONAL_CPPFLAGS += -Wno-protocol ifeq ($(frameworks),yes) ADDITIONAL_CPPFLAGS += -DCOMPILE_AS_FRAMEWORK=1 ifeq ($(FOUNDATION_LIB),apple) ADDITIONAL_CPPFLAGS += -DCOCOA_Foundation_LIBRARY=1 endif endif saxxml_INCLUDE_DIRS += -I.. saxxml_LIB_DIRS += -L./$(GNUSTEP_OBJ_DIR) saxxml_TOOL_LIBS += -lSaxObjC xmln_INCLUDE_DIRS += -I.. xmln_LIB_DIRS += -L./$(GNUSTEP_OBJ_DIR) xmln_TOOL_LIBS += -lSaxObjC # Parameters for SaxDriver lookup ifneq ($(FHS_INSTALL_ROOT),) ADDITIONAL_CPPFLAGS += -DFHS_INSTALL_ROOT=\@\"$(FHS_INSTALL_ROOT)\" endif ifneq ($(CGS_LIBDIR_NAME),) ADDITIONAL_CPPFLAGS += -DCGS_LIBDIR_NAME=\@\"$(CGS_LIBDIR_NAME)\" endif # Apple ifeq ($(FOUNDATION_LIB),apple) libSaxObjC_PREBIND_ADDR="0xC0000000" libSaxObjC_LDFLAGS += -seg1addr $(libSaxObjC_PREBIND_ADDR) SaxObjC_LDFLAGS += -seg1addr $(libSaxObjC_PREBIND_ADDR) endif ifeq ($(FOUNDATION_LIB),nx) saxxml_LDFLAGS += -framework Foundation xmln_LDFLAGS += -framework Foundation endif libSaxObjC_LIBRARIES_DEPEND_UPON += $(BASE_LIBS) SOPE/sope-xml/SaxObjC/SaxDefaultHandler+NSXML.m0000644000000000000000000001245012242733417017777 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "SaxDefaultHandler.h" #include "SaxException.h" @implementation SaxDefaultHandler(NSXML) static BOOL doDebug = NO; - (void)parserDidStartDocument:(id)_parser { if (doDebug) NSLog(@"parser: startdoc %@", _parser); [self startDocument]; } - (void)parserDidEndDocument:(id)_parser { if (doDebug) NSLog(@"parser: endoc %@", _parser); [self endDocument]; } - (id)_wrapAttributes:(NSDictionary *)_attrs { // TODO: implement .. return [[SaxAttributes alloc] initWithDictionary:_attrs]; } - (void)parser:(id)_parser didStartElement:(NSString *)_tag namespaceURI:(NSString *)_nsuri qualifiedName:(NSString *)_rawName attributes:(NSDictionary *)_attrs { id attrs; if ([_rawName length] == 0) _rawName = _tag; if (doDebug) NSLog(@"parser: start %@ raw %@ uri %@", _tag, _rawName, _nsuri); attrs = [self _wrapAttributes:_attrs]; [self startElement:_tag namespace:_nsuri rawName:_rawName attributes:attrs]; [attrs release]; } - (void)parser:(id)_parser didEndElement:(NSString *)_tag namespaceURI:(NSString *)_nsuri qualifiedName:(NSString *)_rawName { if ([_rawName length] == 0) _rawName = _tag; if (doDebug) NSLog(@"parser: end %@ raw %@ uri %@", _tag, _rawName, _nsuri); [self endElement:_tag namespace:_nsuri rawName:_rawName]; } - (void)parser:(id)_parser didStartMappingPrefix:(NSString *)_prefix toURI:(NSString *)_uri { [self startPrefixMapping:_prefix uri:_uri]; } - (void)parser:(id)_parser didEndMappingPrefix:(NSString *)_prefix { [self endPrefixMapping:_prefix]; } - (void)parser:(id)_parser foundCharacters:(NSString *)_string { /* Note: expensive ..., decompose string into chars */ int len; unichar *buf = NULL; if ((len = [_string length]) > 0) { buf = calloc(len + 2, sizeof(unichar)); [_string getCharacters:buf]; } [self characters:buf length:len]; if (buf) free(buf); } - (void)parser:(id)_parser foundIgnorableWhitespace:(NSString *)_ws { /* Note: expensive ..., decompose string into chars */ int len; unichar *buf = NULL; if ((len = [_ws length]) > 0) { buf = calloc(len + 2, sizeof(unichar)); [_ws getCharacters:buf]; } [self ignorableWhitespace:buf length:len]; if (buf) free(buf); } - (void)parser:(id)_parser foundCDATA:(NSData *)_data { /* TODO: what about that? */ NSLog(@"ERROR(%s): CDATA section ignored!", __PRETTY_FUNCTION__); } #if 0 /* TODO: implement */ - (void)parser:(id)_parser foundComment:(NSString *)comment { } #endif - (void)parser:(id)_parser foundProcessingInstructionWithTarget:(NSString *)_target data:(NSString *)_data { [self processingInstruction:_target data:_data]; } /* entity resolver */ - (NSData *)parser:(id)_parser resolveExternalEntityName:(NSString *)_name systemID:(NSString *)_sysId { return [self resolveEntityWithPublicId:_name systemId:_sysId]; } /* handle errors */ - (SaxParseException *)_wrapErrorIntoException:(NSError *)_error { // TODO: perform proper wrapping or conversion return (id)_error; } - (void)parser:(id)_parser parseErrorOccurred:(NSError *)_error { if (doDebug) NSLog(@"parser: error %@", _error); [self error:[self _wrapErrorIntoException:_error]]; } - (void)parser:(id)_parser validationErrorOccurred:(NSError *)_error { if (doDebug) NSLog(@"parser: validation error %@", _error); [self error:[self _wrapErrorIntoException:_error]]; } /* DTD processing */ - (void)parser:(id)_parser foundNotationDeclarationWithName:(NSString *)_name publicID:(NSString *)_pubId systemID:(NSString *)_sysId { [self notationDeclaration:_name publicId:_pubId systemId:_sysId]; } - (void)parser:(id)_parser foundUnparsedEntityDeclarationWithName:(NSString *)_name publicID:(NSString *)_pubId systemID:(NSString *)_sysId notationName:(NSString *)_notName { [self unparsedEntityDeclaration:_name publicId:_pubId systemId:_sysId notationName:_notName]; } #if 0 /* TODO: DTD processing ... */ - (void)parser:(id)_parser foundAttributeDeclarationWithName:(NSString *)attributeName forElement:(NSString *)_tag type:(NSString *)type defaultValue:(NSString *)defaultValue; - (void)parser:(id)_parser foundElementDeclarationWithName:(NSString *)_tag model:(NSString *)model; - (void)parser:(id)_parser foundInternalEntityDeclarationWithName:(NSString *)name value:(NSString *)value; - (void)parser:(id)_parser foundExternalEntityDeclarationWithName:(NSString *)name publicID:(NSString *)publicID systemID:(NSString *)systemID; #endif @end /* SaxDefaultHandler(NSXML) */ SOPE/sope-xml/SaxObjC/SaxEntityResolver.h0000644000000000000000000000202512242733417017206 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __SaxEntityResolver_H__ #define __SaxEntityResolver_H__ @class NSString; @protocol SaxEntityResolver - (id)resolveEntityWithPublicId:(NSString *)_pubId systemId:(NSString *)_sysId; @end /* SaxEntityResolver */ #endif /* __SaxEntityResolver_H__ */ SOPE/sope-xml/SaxObjC/TODO0000644000000000000000000000016512242733417014056 0ustar rootrootTODOs for SaxObjC ================= - find out whether SaxObjC is deprecated due to NSXMLParser (probably not ;-) SOPE/sope-xml/SaxObjC/libSAXObjC.def0000644000000000000000000000071212242733417015724 0ustar rootrootEXPORTS __objc_class_name_SaxAttributeList; __objc_class_name_SaxAttributes; __objc_class_name_SaxDefaultHandler; __objc_class_name_SaxException; __objc_class_name_SaxHandlerBase; __objc_class_name_SaxLocator; __objc_class_name_SaxNamespaceSupport; __objc_class_name_SaxNotRecognizedException; __objc_class_name_SaxNotSupportedException; __objc_class_name_SaxParseException; __objc_class_name_SaxXMLFilter; __objc_class_name_SaxXMLReaderFactory; SOPE/sope-xml/SaxObjC/SaxLocator.h0000644000000000000000000000300612242733417015613 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __SaxLocator_H__ #define __SaxLocator_H__ #import @class NSString; @protocol SaxLocator - (NSInteger)columnNumber; - (NSInteger)lineNumber; - (NSString *)publicId; - (NSString *)systemId; @end /* sample locator */ @interface SaxLocator : NSObject < SaxLocator, NSCopying > { @private int column; int line; NSString *pubId; NSString *sysId; } - (id)init; - (id)initWithLocator:(id)_locator; - (void)setColumnNumber:(NSInteger)_col; - (NSInteger)columnNumber; - (void)setLineNumber:(NSInteger)_line; - (NSInteger)lineNumber; - (void)setPublicId:(NSString *)_pubId; - (NSString *)publicId; - (void)setSystemId:(NSString *)_sysId; - (NSString *)systemId; @end #endif /* __SaxLocator_H__ */ SOPE/sope-xml/SaxObjC/SaxAttributeList.h0000644000000000000000000000347312242733417017017 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __SaxAttributeList_H__ #define __SaxAttributeList_H__ #import @class NSString, NSMutableArray; /* deprecated in SAX 2.0beta */ @protocol SaxAttributeList - (NSString *)nameAtIndex:(NSUInteger)_idx; - (NSString *)typeAtIndex:(NSUInteger)_idx; - (NSString *)valueAtIndex:(NSUInteger)_idx; - (NSString *)typeForName:(NSString *)_name; - (NSString *)valueForName:(NSString *)_name; - (NSUInteger)count; @end @interface SaxAttributeList : NSObject < SaxAttributeList, NSCopying > { @private NSMutableArray *names; NSMutableArray *types; NSMutableArray *values; } - (id)init; - (id)initWithAttributeList:(id)_attrList; - (void)setAttributeList:(id)_attrList; - (void)clear; - (void)addAttribute:(NSString *)_name type:(NSString *)_type value:(NSString *)_value; - (void)removeAttribute:(NSString *)_attr; @end #include @interface SaxAttributeList(Compatibility) - (id)initWithAttributes:(id)_attrs; @end #endif /* __SaxAttributeList_H__ */ SOPE/sope-xml/SaxObjC/shared_debug_obj/0000755000000000000000000000000012242733420016624 5ustar rootrootSOPE/sope-xml/SaxObjC/shared_debug_obj/SaxException.d0000644000000000000000000000243712242733417021417 0ustar rootrootobj/SaxException.o: SaxException.m SaxException.h \ /usr/include/GNUstep/Foundation/NSException.h \ /usr/include/GNUstep/GNUstepBase/GSVersionMacros.h \ /usr/include/GNUstep/Foundation/NSString.h \ /usr/include/GNUstep/Foundation/NSObject.h \ /usr/include/GNUstep/Foundation/NSObjCRuntime.h \ /usr/include/GNUstep/GNUstepBase/preface.h \ /usr/include/GNUstep/GNUstepBase/objc-gnu2next.h \ /usr/include/GNUstep/GNUstepBase/GSConfig.h \ /usr/include/GNUstep/GNUstepBase/GSObjCRuntime.h \ /usr/include/GNUstep/Foundation/NSZone.h \ /usr/include/GNUstep/GNUstepBase/GNUstep.h \ /usr/include/GNUstep/Foundation/NSDate.h \ /usr/include/GNUstep/Foundation/NSRange.h SaxException.h: /usr/include/GNUstep/Foundation/NSException.h: /usr/include/GNUstep/GNUstepBase/GSVersionMacros.h: /usr/include/GNUstep/Foundation/NSString.h: /usr/include/GNUstep/Foundation/NSObject.h: /usr/include/GNUstep/Foundation/NSObjCRuntime.h: /usr/include/GNUstep/GNUstepBase/preface.h: /usr/include/GNUstep/GNUstepBase/objc-gnu2next.h: /usr/include/GNUstep/GNUstepBase/GSConfig.h: /usr/include/GNUstep/GNUstepBase/GSObjCRuntime.h: /usr/include/GNUstep/Foundation/NSZone.h: /usr/include/GNUstep/GNUstepBase/GNUstep.h: /usr/include/GNUstep/Foundation/NSDate.h: /usr/include/GNUstep/Foundation/NSRange.h: SOPE/sope-xml/SaxObjC/shared_debug_obj/SaxLocator.d0000644000000000000000000002400312242733417021055 0ustar rootrootobj/SaxLocator.o: SaxLocator.m SaxLocator.h \ /usr/include/GNUstep/Foundation/NSObject.h \ /usr/include/GNUstep/Foundation/NSObjCRuntime.h \ /usr/include/GNUstep/GNUstepBase/GSVersionMacros.h \ /usr/include/GNUstep/GNUstepBase/preface.h \ /usr/include/GNUstep/GNUstepBase/objc-gnu2next.h \ /usr/include/GNUstep/GNUstepBase/GSConfig.h \ /usr/include/GNUstep/GNUstepBase/GSObjCRuntime.h \ /usr/include/GNUstep/Foundation/NSZone.h \ /usr/include/GNUstep/GNUstepBase/GNUstep.h \ /usr/include/GNUstep/Foundation/NSDate.h common.h \ /usr/include/GNUstep/Foundation/Foundation.h \ /usr/include/GNUstep/Foundation/FoundationErrors.h \ /usr/include/GNUstep/Foundation/NSDebug.h \ /usr/include/GNUstep/Foundation/NSProcessInfo.h \ /usr/include/GNUstep/Foundation/NSAffineTransform.h \ /usr/include/GNUstep/Foundation/NSGeometry.h \ /usr/include/GNUstep/Foundation/NSString.h \ /usr/include/GNUstep/Foundation/NSRange.h \ /usr/include/GNUstep/Foundation/NSArchiver.h \ /usr/include/GNUstep/Foundation/NSCoder.h \ /usr/include/GNUstep/Foundation/NSArray.h \ /usr/include/GNUstep/Foundation/NSAttributedString.h \ /usr/include/GNUstep/Foundation/NSDictionary.h \ /usr/include/GNUstep/Foundation/NSAutoreleasePool.h \ /usr/include/GNUstep/Foundation/NSBundle.h \ /usr/include/GNUstep/Foundation/NSByteOrder.h \ /usr/include/GNUstep/Foundation/NSCalendarDate.h \ /usr/include/GNUstep/Foundation/NSCharacterSet.h \ /usr/include/GNUstep/Foundation/NSClassDescription.h \ /usr/include/GNUstep/Foundation/NSException.h \ /usr/include/GNUstep/Foundation/NSComparisonPredicate.h \ /usr/include/GNUstep/Foundation/NSExpression.h \ /usr/include/GNUstep/Foundation/NSPredicate.h \ /usr/include/GNUstep/Foundation/NSCompoundPredicate.h \ /usr/include/GNUstep/Foundation/NSConnection.h \ /usr/include/GNUstep/Foundation/NSTimer.h \ /usr/include/GNUstep/Foundation/NSRunLoop.h \ /usr/include/GNUstep/Foundation/NSMapTable.h \ /usr/include/GNUstep/Foundation/NSData.h \ /usr/include/GNUstep/Foundation/NSSerialization.h \ /usr/include/GNUstep/Foundation/NSDateFormatter.h \ /usr/include/GNUstep/Foundation/NSFormatter.h \ /usr/include/GNUstep/Foundation/NSDecimalNumber.h \ /usr/include/GNUstep/Foundation/NSDecimal.h \ /usr/include/GNUstep/Foundation/NSValue.h \ /usr/include/GNUstep/Foundation/NSDistantObject.h \ /usr/include/GNUstep/Foundation/NSProxy.h \ /usr/include/GNUstep/Foundation/NSDistributedLock.h \ /usr/include/GNUstep/Foundation/NSDistributedNotificationCenter.h \ /usr/include/GNUstep/Foundation/NSLock.h \ /usr/include/GNUstep/Foundation/NSNotification.h \ /usr/include/GNUstep/Foundation/NSEnumerator.h \ /usr/include/GNUstep/Foundation/NSError.h \ /usr/include/GNUstep/Foundation/NSFileHandle.h \ /usr/include/GNUstep/Foundation/NSFileManager.h \ /usr/include/GNUstep/Foundation/NSHashTable.h \ /usr/include/GNUstep/Foundation/NSHost.h \ /usr/include/GNUstep/Foundation/NSHTTPCookie.h \ /usr/include/GNUstep/Foundation/NSHTTPCookieStorage.h \ /usr/include/GNUstep/Foundation/NSIndexPath.h \ /usr/include/GNUstep/Foundation/NSIndexSet.h \ /usr/include/GNUstep/Foundation/NSInvocation.h \ /usr/include/GNUstep/Foundation/NSMethodSignature.h \ /usr/include/GNUstep/Foundation/NSKeyedArchiver.h \ /usr/include/GNUstep/Foundation/NSPropertyList.h \ /usr/include/GNUstep/Foundation/NSKeyValueCoding.h \ /usr/include/GNUstep/Foundation/NSNotificationQueue.h \ /usr/include/GNUstep/Foundation/NSNetServices.h \ /usr/include/GNUstep/Foundation/NSNull.h \ /usr/include/GNUstep/Foundation/NSNumberFormatter.h \ /usr/include/GNUstep/Foundation/NSPathUtilities.h \ /usr/include/GNUstep/Foundation/NSPortCoder.h \ /usr/include/GNUstep/Foundation/NSPortMessage.h \ /usr/include/GNUstep/Foundation/NSPort.h \ /usr/include/GNUstep/Foundation/NSPortNameServer.h \ /usr/include/GNUstep/Foundation/NSProtocolChecker.h \ /usr/include/GNUstep/Foundation/NSScanner.h \ /usr/include/GNUstep/Foundation/NSSet.h \ /usr/include/GNUstep/Foundation/NSSortDescriptor.h \ /usr/include/GNUstep/Foundation/NSSpellServer.h \ /usr/include/GNUstep/Foundation/NSStream.h \ /usr/include/GNUstep/Foundation/NSTask.h \ /usr/include/GNUstep/Foundation/NSThread.h \ /usr/include/GNUstep/Foundation/NSTimeZone.h \ /usr/include/GNUstep/Foundation/NSUndoManager.h \ /usr/include/GNUstep/Foundation/NSURLAuthenticationChallenge.h \ /usr/include/GNUstep/Foundation/NSURLCache.h \ /usr/include/GNUstep/Foundation/NSURLConnection.h \ /usr/include/GNUstep/Foundation/NSURLCredential.h \ /usr/include/GNUstep/Foundation/NSURLCredentialStorage.h \ /usr/include/GNUstep/Foundation/NSURLDownload.h \ /usr/include/GNUstep/Foundation/NSURLError.h \ /usr/include/GNUstep/Foundation/NSURL.h \ /usr/include/GNUstep/Foundation/NSURLHandle.h \ /usr/include/GNUstep/Foundation/NSURLProtectionSpace.h \ /usr/include/GNUstep/Foundation/NSURLProtocol.h \ /usr/include/GNUstep/Foundation/NSURLRequest.h \ /usr/include/GNUstep/Foundation/NSURLResponse.h \ /usr/include/GNUstep/Foundation/NSUserDefaults.h \ /usr/include/GNUstep/Foundation/NSValueTransformer.h \ /usr/include/GNUstep/Foundation/NSXMLParser.h SaxLocator.h: /usr/include/GNUstep/Foundation/NSObject.h: /usr/include/GNUstep/Foundation/NSObjCRuntime.h: /usr/include/GNUstep/GNUstepBase/GSVersionMacros.h: /usr/include/GNUstep/GNUstepBase/preface.h: /usr/include/GNUstep/GNUstepBase/objc-gnu2next.h: /usr/include/GNUstep/GNUstepBase/GSConfig.h: /usr/include/GNUstep/GNUstepBase/GSObjCRuntime.h: /usr/include/GNUstep/Foundation/NSZone.h: /usr/include/GNUstep/GNUstepBase/GNUstep.h: /usr/include/GNUstep/Foundation/NSDate.h: common.h: /usr/include/GNUstep/Foundation/Foundation.h: /usr/include/GNUstep/Foundation/FoundationErrors.h: /usr/include/GNUstep/Foundation/NSDebug.h: /usr/include/GNUstep/Foundation/NSProcessInfo.h: /usr/include/GNUstep/Foundation/NSAffineTransform.h: /usr/include/GNUstep/Foundation/NSGeometry.h: /usr/include/GNUstep/Foundation/NSString.h: /usr/include/GNUstep/Foundation/NSRange.h: /usr/include/GNUstep/Foundation/NSArchiver.h: /usr/include/GNUstep/Foundation/NSCoder.h: /usr/include/GNUstep/Foundation/NSArray.h: /usr/include/GNUstep/Foundation/NSAttributedString.h: /usr/include/GNUstep/Foundation/NSDictionary.h: /usr/include/GNUstep/Foundation/NSAutoreleasePool.h: /usr/include/GNUstep/Foundation/NSBundle.h: /usr/include/GNUstep/Foundation/NSByteOrder.h: /usr/include/GNUstep/Foundation/NSCalendarDate.h: /usr/include/GNUstep/Foundation/NSCharacterSet.h: /usr/include/GNUstep/Foundation/NSClassDescription.h: /usr/include/GNUstep/Foundation/NSException.h: /usr/include/GNUstep/Foundation/NSComparisonPredicate.h: /usr/include/GNUstep/Foundation/NSExpression.h: /usr/include/GNUstep/Foundation/NSPredicate.h: /usr/include/GNUstep/Foundation/NSCompoundPredicate.h: /usr/include/GNUstep/Foundation/NSConnection.h: /usr/include/GNUstep/Foundation/NSTimer.h: /usr/include/GNUstep/Foundation/NSRunLoop.h: /usr/include/GNUstep/Foundation/NSMapTable.h: /usr/include/GNUstep/Foundation/NSData.h: /usr/include/GNUstep/Foundation/NSSerialization.h: /usr/include/GNUstep/Foundation/NSDateFormatter.h: /usr/include/GNUstep/Foundation/NSFormatter.h: /usr/include/GNUstep/Foundation/NSDecimalNumber.h: /usr/include/GNUstep/Foundation/NSDecimal.h: /usr/include/GNUstep/Foundation/NSValue.h: /usr/include/GNUstep/Foundation/NSDistantObject.h: /usr/include/GNUstep/Foundation/NSProxy.h: /usr/include/GNUstep/Foundation/NSDistributedLock.h: /usr/include/GNUstep/Foundation/NSDistributedNotificationCenter.h: /usr/include/GNUstep/Foundation/NSLock.h: /usr/include/GNUstep/Foundation/NSNotification.h: /usr/include/GNUstep/Foundation/NSEnumerator.h: /usr/include/GNUstep/Foundation/NSError.h: /usr/include/GNUstep/Foundation/NSFileHandle.h: /usr/include/GNUstep/Foundation/NSFileManager.h: /usr/include/GNUstep/Foundation/NSHashTable.h: /usr/include/GNUstep/Foundation/NSHost.h: /usr/include/GNUstep/Foundation/NSHTTPCookie.h: /usr/include/GNUstep/Foundation/NSHTTPCookieStorage.h: /usr/include/GNUstep/Foundation/NSIndexPath.h: /usr/include/GNUstep/Foundation/NSIndexSet.h: /usr/include/GNUstep/Foundation/NSInvocation.h: /usr/include/GNUstep/Foundation/NSMethodSignature.h: /usr/include/GNUstep/Foundation/NSKeyedArchiver.h: /usr/include/GNUstep/Foundation/NSPropertyList.h: /usr/include/GNUstep/Foundation/NSKeyValueCoding.h: /usr/include/GNUstep/Foundation/NSNotificationQueue.h: /usr/include/GNUstep/Foundation/NSNetServices.h: /usr/include/GNUstep/Foundation/NSNull.h: /usr/include/GNUstep/Foundation/NSNumberFormatter.h: /usr/include/GNUstep/Foundation/NSPathUtilities.h: /usr/include/GNUstep/Foundation/NSPortCoder.h: /usr/include/GNUstep/Foundation/NSPortMessage.h: /usr/include/GNUstep/Foundation/NSPort.h: /usr/include/GNUstep/Foundation/NSPortNameServer.h: /usr/include/GNUstep/Foundation/NSProtocolChecker.h: /usr/include/GNUstep/Foundation/NSScanner.h: /usr/include/GNUstep/Foundation/NSSet.h: /usr/include/GNUstep/Foundation/NSSortDescriptor.h: /usr/include/GNUstep/Foundation/NSSpellServer.h: /usr/include/GNUstep/Foundation/NSStream.h: /usr/include/GNUstep/Foundation/NSTask.h: /usr/include/GNUstep/Foundation/NSThread.h: /usr/include/GNUstep/Foundation/NSTimeZone.h: /usr/include/GNUstep/Foundation/NSUndoManager.h: /usr/include/GNUstep/Foundation/NSURLAuthenticationChallenge.h: /usr/include/GNUstep/Foundation/NSURLCache.h: /usr/include/GNUstep/Foundation/NSURLConnection.h: /usr/include/GNUstep/Foundation/NSURLCredential.h: /usr/include/GNUstep/Foundation/NSURLCredentialStorage.h: /usr/include/GNUstep/Foundation/NSURLDownload.h: /usr/include/GNUstep/Foundation/NSURLError.h: /usr/include/GNUstep/Foundation/NSURL.h: /usr/include/GNUstep/Foundation/NSURLHandle.h: /usr/include/GNUstep/Foundation/NSURLProtectionSpace.h: /usr/include/GNUstep/Foundation/NSURLProtocol.h: /usr/include/GNUstep/Foundation/NSURLRequest.h: /usr/include/GNUstep/Foundation/NSURLResponse.h: /usr/include/GNUstep/Foundation/NSUserDefaults.h: /usr/include/GNUstep/Foundation/NSValueTransformer.h: /usr/include/GNUstep/Foundation/NSXMLParser.h: SOPE/sope-xml/SaxObjC/shared_debug_obj/SaxXMLReaderFactory.d0000644000000000000000000002501112242733420022557 0ustar rootrootobj/SaxXMLReaderFactory.o: SaxXMLReaderFactory.m SaxXMLReaderFactory.h \ /usr/include/GNUstep/Foundation/NSObject.h \ /usr/include/GNUstep/Foundation/NSObjCRuntime.h \ /usr/include/GNUstep/GNUstepBase/GSVersionMacros.h \ /usr/include/GNUstep/GNUstepBase/preface.h \ /usr/include/GNUstep/GNUstepBase/objc-gnu2next.h \ /usr/include/GNUstep/GNUstepBase/GSConfig.h \ /usr/include/GNUstep/GNUstepBase/GSObjCRuntime.h \ /usr/include/GNUstep/Foundation/NSZone.h \ /usr/include/GNUstep/GNUstepBase/GNUstep.h \ /usr/include/GNUstep/Foundation/NSDate.h ../SaxObjC/SaxXMLReader.h \ ../SaxObjC/SaxContentHandler.h \ /usr/include/GNUstep/Foundation/NSString.h \ /usr/include/GNUstep/Foundation/NSRange.h ../SaxObjC/SaxAttributes.h \ ../SaxObjC/SaxAttributeList.h ../SaxObjC/SaxLocator.h \ ../SaxObjC/SaxDTDHandler.h ../SaxObjC/SaxErrorHandler.h \ ../SaxObjC/SaxEntityResolver.h common.h \ /usr/include/GNUstep/Foundation/Foundation.h \ /usr/include/GNUstep/Foundation/FoundationErrors.h \ /usr/include/GNUstep/Foundation/NSDebug.h \ /usr/include/GNUstep/Foundation/NSProcessInfo.h \ /usr/include/GNUstep/Foundation/NSAffineTransform.h \ /usr/include/GNUstep/Foundation/NSGeometry.h \ /usr/include/GNUstep/Foundation/NSArchiver.h \ /usr/include/GNUstep/Foundation/NSCoder.h \ /usr/include/GNUstep/Foundation/NSArray.h \ /usr/include/GNUstep/Foundation/NSAttributedString.h \ /usr/include/GNUstep/Foundation/NSDictionary.h \ /usr/include/GNUstep/Foundation/NSAutoreleasePool.h \ /usr/include/GNUstep/Foundation/NSBundle.h \ /usr/include/GNUstep/Foundation/NSByteOrder.h \ /usr/include/GNUstep/Foundation/NSCalendarDate.h \ /usr/include/GNUstep/Foundation/NSCharacterSet.h \ /usr/include/GNUstep/Foundation/NSClassDescription.h \ /usr/include/GNUstep/Foundation/NSException.h \ /usr/include/GNUstep/Foundation/NSComparisonPredicate.h \ /usr/include/GNUstep/Foundation/NSExpression.h \ /usr/include/GNUstep/Foundation/NSPredicate.h \ /usr/include/GNUstep/Foundation/NSCompoundPredicate.h \ /usr/include/GNUstep/Foundation/NSConnection.h \ /usr/include/GNUstep/Foundation/NSTimer.h \ /usr/include/GNUstep/Foundation/NSRunLoop.h \ /usr/include/GNUstep/Foundation/NSMapTable.h \ /usr/include/GNUstep/Foundation/NSData.h \ /usr/include/GNUstep/Foundation/NSSerialization.h \ /usr/include/GNUstep/Foundation/NSDateFormatter.h \ /usr/include/GNUstep/Foundation/NSFormatter.h \ /usr/include/GNUstep/Foundation/NSDecimalNumber.h \ /usr/include/GNUstep/Foundation/NSDecimal.h \ /usr/include/GNUstep/Foundation/NSValue.h \ /usr/include/GNUstep/Foundation/NSDistantObject.h \ /usr/include/GNUstep/Foundation/NSProxy.h \ /usr/include/GNUstep/Foundation/NSDistributedLock.h \ /usr/include/GNUstep/Foundation/NSDistributedNotificationCenter.h \ /usr/include/GNUstep/Foundation/NSLock.h \ /usr/include/GNUstep/Foundation/NSNotification.h \ /usr/include/GNUstep/Foundation/NSEnumerator.h \ /usr/include/GNUstep/Foundation/NSError.h \ /usr/include/GNUstep/Foundation/NSFileHandle.h \ /usr/include/GNUstep/Foundation/NSFileManager.h \ /usr/include/GNUstep/Foundation/NSHashTable.h \ /usr/include/GNUstep/Foundation/NSHost.h \ /usr/include/GNUstep/Foundation/NSHTTPCookie.h \ /usr/include/GNUstep/Foundation/NSHTTPCookieStorage.h \ /usr/include/GNUstep/Foundation/NSIndexPath.h \ /usr/include/GNUstep/Foundation/NSIndexSet.h \ /usr/include/GNUstep/Foundation/NSInvocation.h \ /usr/include/GNUstep/Foundation/NSMethodSignature.h \ /usr/include/GNUstep/Foundation/NSKeyedArchiver.h \ /usr/include/GNUstep/Foundation/NSPropertyList.h \ /usr/include/GNUstep/Foundation/NSKeyValueCoding.h \ /usr/include/GNUstep/Foundation/NSNotificationQueue.h \ /usr/include/GNUstep/Foundation/NSNetServices.h \ /usr/include/GNUstep/Foundation/NSNull.h \ /usr/include/GNUstep/Foundation/NSNumberFormatter.h \ /usr/include/GNUstep/Foundation/NSPathUtilities.h \ /usr/include/GNUstep/Foundation/NSPortCoder.h \ /usr/include/GNUstep/Foundation/NSPortMessage.h \ /usr/include/GNUstep/Foundation/NSPort.h \ /usr/include/GNUstep/Foundation/NSPortNameServer.h \ /usr/include/GNUstep/Foundation/NSProtocolChecker.h \ /usr/include/GNUstep/Foundation/NSScanner.h \ /usr/include/GNUstep/Foundation/NSSet.h \ /usr/include/GNUstep/Foundation/NSSortDescriptor.h \ /usr/include/GNUstep/Foundation/NSSpellServer.h \ /usr/include/GNUstep/Foundation/NSStream.h \ /usr/include/GNUstep/Foundation/NSTask.h \ /usr/include/GNUstep/Foundation/NSThread.h \ /usr/include/GNUstep/Foundation/NSTimeZone.h \ /usr/include/GNUstep/Foundation/NSUndoManager.h \ /usr/include/GNUstep/Foundation/NSURLAuthenticationChallenge.h \ /usr/include/GNUstep/Foundation/NSURLCache.h \ /usr/include/GNUstep/Foundation/NSURLConnection.h \ /usr/include/GNUstep/Foundation/NSURLCredential.h \ /usr/include/GNUstep/Foundation/NSURLCredentialStorage.h \ /usr/include/GNUstep/Foundation/NSURLDownload.h \ /usr/include/GNUstep/Foundation/NSURLError.h \ /usr/include/GNUstep/Foundation/NSURL.h \ /usr/include/GNUstep/Foundation/NSURLHandle.h \ /usr/include/GNUstep/Foundation/NSURLProtectionSpace.h \ /usr/include/GNUstep/Foundation/NSURLProtocol.h \ /usr/include/GNUstep/Foundation/NSURLRequest.h \ /usr/include/GNUstep/Foundation/NSURLResponse.h \ /usr/include/GNUstep/Foundation/NSUserDefaults.h \ /usr/include/GNUstep/Foundation/NSValueTransformer.h \ /usr/include/GNUstep/Foundation/NSXMLParser.h SaxXMLReaderFactory.h: /usr/include/GNUstep/Foundation/NSObject.h: /usr/include/GNUstep/Foundation/NSObjCRuntime.h: /usr/include/GNUstep/GNUstepBase/GSVersionMacros.h: /usr/include/GNUstep/GNUstepBase/preface.h: /usr/include/GNUstep/GNUstepBase/objc-gnu2next.h: /usr/include/GNUstep/GNUstepBase/GSConfig.h: /usr/include/GNUstep/GNUstepBase/GSObjCRuntime.h: /usr/include/GNUstep/Foundation/NSZone.h: /usr/include/GNUstep/GNUstepBase/GNUstep.h: /usr/include/GNUstep/Foundation/NSDate.h: ../SaxObjC/SaxXMLReader.h: ../SaxObjC/SaxContentHandler.h: /usr/include/GNUstep/Foundation/NSString.h: /usr/include/GNUstep/Foundation/NSRange.h: ../SaxObjC/SaxAttributes.h: ../SaxObjC/SaxAttributeList.h: ../SaxObjC/SaxLocator.h: ../SaxObjC/SaxDTDHandler.h: ../SaxObjC/SaxErrorHandler.h: ../SaxObjC/SaxEntityResolver.h: common.h: /usr/include/GNUstep/Foundation/Foundation.h: /usr/include/GNUstep/Foundation/FoundationErrors.h: /usr/include/GNUstep/Foundation/NSDebug.h: /usr/include/GNUstep/Foundation/NSProcessInfo.h: /usr/include/GNUstep/Foundation/NSAffineTransform.h: /usr/include/GNUstep/Foundation/NSGeometry.h: /usr/include/GNUstep/Foundation/NSArchiver.h: /usr/include/GNUstep/Foundation/NSCoder.h: /usr/include/GNUstep/Foundation/NSArray.h: /usr/include/GNUstep/Foundation/NSAttributedString.h: /usr/include/GNUstep/Foundation/NSDictionary.h: /usr/include/GNUstep/Foundation/NSAutoreleasePool.h: /usr/include/GNUstep/Foundation/NSBundle.h: /usr/include/GNUstep/Foundation/NSByteOrder.h: /usr/include/GNUstep/Foundation/NSCalendarDate.h: /usr/include/GNUstep/Foundation/NSCharacterSet.h: /usr/include/GNUstep/Foundation/NSClassDescription.h: /usr/include/GNUstep/Foundation/NSException.h: /usr/include/GNUstep/Foundation/NSComparisonPredicate.h: /usr/include/GNUstep/Foundation/NSExpression.h: /usr/include/GNUstep/Foundation/NSPredicate.h: /usr/include/GNUstep/Foundation/NSCompoundPredicate.h: /usr/include/GNUstep/Foundation/NSConnection.h: /usr/include/GNUstep/Foundation/NSTimer.h: /usr/include/GNUstep/Foundation/NSRunLoop.h: /usr/include/GNUstep/Foundation/NSMapTable.h: /usr/include/GNUstep/Foundation/NSData.h: /usr/include/GNUstep/Foundation/NSSerialization.h: /usr/include/GNUstep/Foundation/NSDateFormatter.h: /usr/include/GNUstep/Foundation/NSFormatter.h: /usr/include/GNUstep/Foundation/NSDecimalNumber.h: /usr/include/GNUstep/Foundation/NSDecimal.h: /usr/include/GNUstep/Foundation/NSValue.h: /usr/include/GNUstep/Foundation/NSDistantObject.h: /usr/include/GNUstep/Foundation/NSProxy.h: /usr/include/GNUstep/Foundation/NSDistributedLock.h: /usr/include/GNUstep/Foundation/NSDistributedNotificationCenter.h: /usr/include/GNUstep/Foundation/NSLock.h: /usr/include/GNUstep/Foundation/NSNotification.h: /usr/include/GNUstep/Foundation/NSEnumerator.h: /usr/include/GNUstep/Foundation/NSError.h: /usr/include/GNUstep/Foundation/NSFileHandle.h: /usr/include/GNUstep/Foundation/NSFileManager.h: /usr/include/GNUstep/Foundation/NSHashTable.h: /usr/include/GNUstep/Foundation/NSHost.h: /usr/include/GNUstep/Foundation/NSHTTPCookie.h: /usr/include/GNUstep/Foundation/NSHTTPCookieStorage.h: /usr/include/GNUstep/Foundation/NSIndexPath.h: /usr/include/GNUstep/Foundation/NSIndexSet.h: /usr/include/GNUstep/Foundation/NSInvocation.h: /usr/include/GNUstep/Foundation/NSMethodSignature.h: /usr/include/GNUstep/Foundation/NSKeyedArchiver.h: /usr/include/GNUstep/Foundation/NSPropertyList.h: /usr/include/GNUstep/Foundation/NSKeyValueCoding.h: /usr/include/GNUstep/Foundation/NSNotificationQueue.h: /usr/include/GNUstep/Foundation/NSNetServices.h: /usr/include/GNUstep/Foundation/NSNull.h: /usr/include/GNUstep/Foundation/NSNumberFormatter.h: /usr/include/GNUstep/Foundation/NSPathUtilities.h: /usr/include/GNUstep/Foundation/NSPortCoder.h: /usr/include/GNUstep/Foundation/NSPortMessage.h: /usr/include/GNUstep/Foundation/NSPort.h: /usr/include/GNUstep/Foundation/NSPortNameServer.h: /usr/include/GNUstep/Foundation/NSProtocolChecker.h: /usr/include/GNUstep/Foundation/NSScanner.h: /usr/include/GNUstep/Foundation/NSSet.h: /usr/include/GNUstep/Foundation/NSSortDescriptor.h: /usr/include/GNUstep/Foundation/NSSpellServer.h: /usr/include/GNUstep/Foundation/NSStream.h: /usr/include/GNUstep/Foundation/NSTask.h: /usr/include/GNUstep/Foundation/NSThread.h: /usr/include/GNUstep/Foundation/NSTimeZone.h: /usr/include/GNUstep/Foundation/NSUndoManager.h: /usr/include/GNUstep/Foundation/NSURLAuthenticationChallenge.h: /usr/include/GNUstep/Foundation/NSURLCache.h: /usr/include/GNUstep/Foundation/NSURLConnection.h: /usr/include/GNUstep/Foundation/NSURLCredential.h: /usr/include/GNUstep/Foundation/NSURLCredentialStorage.h: /usr/include/GNUstep/Foundation/NSURLDownload.h: /usr/include/GNUstep/Foundation/NSURLError.h: /usr/include/GNUstep/Foundation/NSURL.h: /usr/include/GNUstep/Foundation/NSURLHandle.h: /usr/include/GNUstep/Foundation/NSURLProtectionSpace.h: /usr/include/GNUstep/Foundation/NSURLProtocol.h: /usr/include/GNUstep/Foundation/NSURLRequest.h: /usr/include/GNUstep/Foundation/NSURLResponse.h: /usr/include/GNUstep/Foundation/NSUserDefaults.h: /usr/include/GNUstep/Foundation/NSValueTransformer.h: /usr/include/GNUstep/Foundation/NSXMLParser.h: SOPE/sope-xml/SaxObjC/shared_debug_obj/SaxNamespaceSupport.d0000644000000000000000000002404712242733417022753 0ustar rootrootobj/SaxNamespaceSupport.o: SaxNamespaceSupport.m SaxNamespaceSupport.h \ /usr/include/GNUstep/Foundation/NSObject.h \ /usr/include/GNUstep/Foundation/NSObjCRuntime.h \ /usr/include/GNUstep/GNUstepBase/GSVersionMacros.h \ /usr/include/GNUstep/GNUstepBase/preface.h \ /usr/include/GNUstep/GNUstepBase/objc-gnu2next.h \ /usr/include/GNUstep/GNUstepBase/GSConfig.h \ /usr/include/GNUstep/GNUstepBase/GSObjCRuntime.h \ /usr/include/GNUstep/Foundation/NSZone.h \ /usr/include/GNUstep/GNUstepBase/GNUstep.h \ /usr/include/GNUstep/Foundation/NSDate.h common.h \ /usr/include/GNUstep/Foundation/Foundation.h \ /usr/include/GNUstep/Foundation/FoundationErrors.h \ /usr/include/GNUstep/Foundation/NSDebug.h \ /usr/include/GNUstep/Foundation/NSProcessInfo.h \ /usr/include/GNUstep/Foundation/NSAffineTransform.h \ /usr/include/GNUstep/Foundation/NSGeometry.h \ /usr/include/GNUstep/Foundation/NSString.h \ /usr/include/GNUstep/Foundation/NSRange.h \ /usr/include/GNUstep/Foundation/NSArchiver.h \ /usr/include/GNUstep/Foundation/NSCoder.h \ /usr/include/GNUstep/Foundation/NSArray.h \ /usr/include/GNUstep/Foundation/NSAttributedString.h \ /usr/include/GNUstep/Foundation/NSDictionary.h \ /usr/include/GNUstep/Foundation/NSAutoreleasePool.h \ /usr/include/GNUstep/Foundation/NSBundle.h \ /usr/include/GNUstep/Foundation/NSByteOrder.h \ /usr/include/GNUstep/Foundation/NSCalendarDate.h \ /usr/include/GNUstep/Foundation/NSCharacterSet.h \ /usr/include/GNUstep/Foundation/NSClassDescription.h \ /usr/include/GNUstep/Foundation/NSException.h \ /usr/include/GNUstep/Foundation/NSComparisonPredicate.h \ /usr/include/GNUstep/Foundation/NSExpression.h \ /usr/include/GNUstep/Foundation/NSPredicate.h \ /usr/include/GNUstep/Foundation/NSCompoundPredicate.h \ /usr/include/GNUstep/Foundation/NSConnection.h \ /usr/include/GNUstep/Foundation/NSTimer.h \ /usr/include/GNUstep/Foundation/NSRunLoop.h \ /usr/include/GNUstep/Foundation/NSMapTable.h \ /usr/include/GNUstep/Foundation/NSData.h \ /usr/include/GNUstep/Foundation/NSSerialization.h \ /usr/include/GNUstep/Foundation/NSDateFormatter.h \ /usr/include/GNUstep/Foundation/NSFormatter.h \ /usr/include/GNUstep/Foundation/NSDecimalNumber.h \ /usr/include/GNUstep/Foundation/NSDecimal.h \ /usr/include/GNUstep/Foundation/NSValue.h \ /usr/include/GNUstep/Foundation/NSDistantObject.h \ /usr/include/GNUstep/Foundation/NSProxy.h \ /usr/include/GNUstep/Foundation/NSDistributedLock.h \ /usr/include/GNUstep/Foundation/NSDistributedNotificationCenter.h \ /usr/include/GNUstep/Foundation/NSLock.h \ /usr/include/GNUstep/Foundation/NSNotification.h \ /usr/include/GNUstep/Foundation/NSEnumerator.h \ /usr/include/GNUstep/Foundation/NSError.h \ /usr/include/GNUstep/Foundation/NSFileHandle.h \ /usr/include/GNUstep/Foundation/NSFileManager.h \ /usr/include/GNUstep/Foundation/NSHashTable.h \ /usr/include/GNUstep/Foundation/NSHost.h \ /usr/include/GNUstep/Foundation/NSHTTPCookie.h \ /usr/include/GNUstep/Foundation/NSHTTPCookieStorage.h \ /usr/include/GNUstep/Foundation/NSIndexPath.h \ /usr/include/GNUstep/Foundation/NSIndexSet.h \ /usr/include/GNUstep/Foundation/NSInvocation.h \ /usr/include/GNUstep/Foundation/NSMethodSignature.h \ /usr/include/GNUstep/Foundation/NSKeyedArchiver.h \ /usr/include/GNUstep/Foundation/NSPropertyList.h \ /usr/include/GNUstep/Foundation/NSKeyValueCoding.h \ /usr/include/GNUstep/Foundation/NSNotificationQueue.h \ /usr/include/GNUstep/Foundation/NSNetServices.h \ /usr/include/GNUstep/Foundation/NSNull.h \ /usr/include/GNUstep/Foundation/NSNumberFormatter.h \ /usr/include/GNUstep/Foundation/NSPathUtilities.h \ /usr/include/GNUstep/Foundation/NSPortCoder.h \ /usr/include/GNUstep/Foundation/NSPortMessage.h \ /usr/include/GNUstep/Foundation/NSPort.h \ /usr/include/GNUstep/Foundation/NSPortNameServer.h \ /usr/include/GNUstep/Foundation/NSProtocolChecker.h \ /usr/include/GNUstep/Foundation/NSScanner.h \ /usr/include/GNUstep/Foundation/NSSet.h \ /usr/include/GNUstep/Foundation/NSSortDescriptor.h \ /usr/include/GNUstep/Foundation/NSSpellServer.h \ /usr/include/GNUstep/Foundation/NSStream.h \ /usr/include/GNUstep/Foundation/NSTask.h \ /usr/include/GNUstep/Foundation/NSThread.h \ /usr/include/GNUstep/Foundation/NSTimeZone.h \ /usr/include/GNUstep/Foundation/NSUndoManager.h \ /usr/include/GNUstep/Foundation/NSURLAuthenticationChallenge.h \ /usr/include/GNUstep/Foundation/NSURLCache.h \ /usr/include/GNUstep/Foundation/NSURLConnection.h \ /usr/include/GNUstep/Foundation/NSURLCredential.h \ /usr/include/GNUstep/Foundation/NSURLCredentialStorage.h \ /usr/include/GNUstep/Foundation/NSURLDownload.h \ /usr/include/GNUstep/Foundation/NSURLError.h \ /usr/include/GNUstep/Foundation/NSURL.h \ /usr/include/GNUstep/Foundation/NSURLHandle.h \ /usr/include/GNUstep/Foundation/NSURLProtectionSpace.h \ /usr/include/GNUstep/Foundation/NSURLProtocol.h \ /usr/include/GNUstep/Foundation/NSURLRequest.h \ /usr/include/GNUstep/Foundation/NSURLResponse.h \ /usr/include/GNUstep/Foundation/NSUserDefaults.h \ /usr/include/GNUstep/Foundation/NSValueTransformer.h \ /usr/include/GNUstep/Foundation/NSXMLParser.h SaxNamespaceSupport.h: /usr/include/GNUstep/Foundation/NSObject.h: /usr/include/GNUstep/Foundation/NSObjCRuntime.h: /usr/include/GNUstep/GNUstepBase/GSVersionMacros.h: /usr/include/GNUstep/GNUstepBase/preface.h: /usr/include/GNUstep/GNUstepBase/objc-gnu2next.h: /usr/include/GNUstep/GNUstepBase/GSConfig.h: /usr/include/GNUstep/GNUstepBase/GSObjCRuntime.h: /usr/include/GNUstep/Foundation/NSZone.h: /usr/include/GNUstep/GNUstepBase/GNUstep.h: /usr/include/GNUstep/Foundation/NSDate.h: common.h: /usr/include/GNUstep/Foundation/Foundation.h: /usr/include/GNUstep/Foundation/FoundationErrors.h: /usr/include/GNUstep/Foundation/NSDebug.h: /usr/include/GNUstep/Foundation/NSProcessInfo.h: /usr/include/GNUstep/Foundation/NSAffineTransform.h: /usr/include/GNUstep/Foundation/NSGeometry.h: /usr/include/GNUstep/Foundation/NSString.h: /usr/include/GNUstep/Foundation/NSRange.h: /usr/include/GNUstep/Foundation/NSArchiver.h: /usr/include/GNUstep/Foundation/NSCoder.h: /usr/include/GNUstep/Foundation/NSArray.h: /usr/include/GNUstep/Foundation/NSAttributedString.h: /usr/include/GNUstep/Foundation/NSDictionary.h: /usr/include/GNUstep/Foundation/NSAutoreleasePool.h: /usr/include/GNUstep/Foundation/NSBundle.h: /usr/include/GNUstep/Foundation/NSByteOrder.h: /usr/include/GNUstep/Foundation/NSCalendarDate.h: /usr/include/GNUstep/Foundation/NSCharacterSet.h: /usr/include/GNUstep/Foundation/NSClassDescription.h: /usr/include/GNUstep/Foundation/NSException.h: /usr/include/GNUstep/Foundation/NSComparisonPredicate.h: /usr/include/GNUstep/Foundation/NSExpression.h: /usr/include/GNUstep/Foundation/NSPredicate.h: /usr/include/GNUstep/Foundation/NSCompoundPredicate.h: /usr/include/GNUstep/Foundation/NSConnection.h: /usr/include/GNUstep/Foundation/NSTimer.h: /usr/include/GNUstep/Foundation/NSRunLoop.h: /usr/include/GNUstep/Foundation/NSMapTable.h: /usr/include/GNUstep/Foundation/NSData.h: /usr/include/GNUstep/Foundation/NSSerialization.h: /usr/include/GNUstep/Foundation/NSDateFormatter.h: /usr/include/GNUstep/Foundation/NSFormatter.h: /usr/include/GNUstep/Foundation/NSDecimalNumber.h: /usr/include/GNUstep/Foundation/NSDecimal.h: /usr/include/GNUstep/Foundation/NSValue.h: /usr/include/GNUstep/Foundation/NSDistantObject.h: /usr/include/GNUstep/Foundation/NSProxy.h: /usr/include/GNUstep/Foundation/NSDistributedLock.h: /usr/include/GNUstep/Foundation/NSDistributedNotificationCenter.h: /usr/include/GNUstep/Foundation/NSLock.h: /usr/include/GNUstep/Foundation/NSNotification.h: /usr/include/GNUstep/Foundation/NSEnumerator.h: /usr/include/GNUstep/Foundation/NSError.h: /usr/include/GNUstep/Foundation/NSFileHandle.h: /usr/include/GNUstep/Foundation/NSFileManager.h: /usr/include/GNUstep/Foundation/NSHashTable.h: /usr/include/GNUstep/Foundation/NSHost.h: /usr/include/GNUstep/Foundation/NSHTTPCookie.h: /usr/include/GNUstep/Foundation/NSHTTPCookieStorage.h: /usr/include/GNUstep/Foundation/NSIndexPath.h: /usr/include/GNUstep/Foundation/NSIndexSet.h: /usr/include/GNUstep/Foundation/NSInvocation.h: /usr/include/GNUstep/Foundation/NSMethodSignature.h: /usr/include/GNUstep/Foundation/NSKeyedArchiver.h: /usr/include/GNUstep/Foundation/NSPropertyList.h: /usr/include/GNUstep/Foundation/NSKeyValueCoding.h: /usr/include/GNUstep/Foundation/NSNotificationQueue.h: /usr/include/GNUstep/Foundation/NSNetServices.h: /usr/include/GNUstep/Foundation/NSNull.h: /usr/include/GNUstep/Foundation/NSNumberFormatter.h: /usr/include/GNUstep/Foundation/NSPathUtilities.h: /usr/include/GNUstep/Foundation/NSPortCoder.h: /usr/include/GNUstep/Foundation/NSPortMessage.h: /usr/include/GNUstep/Foundation/NSPort.h: /usr/include/GNUstep/Foundation/NSPortNameServer.h: /usr/include/GNUstep/Foundation/NSProtocolChecker.h: /usr/include/GNUstep/Foundation/NSScanner.h: /usr/include/GNUstep/Foundation/NSSet.h: /usr/include/GNUstep/Foundation/NSSortDescriptor.h: /usr/include/GNUstep/Foundation/NSSpellServer.h: /usr/include/GNUstep/Foundation/NSStream.h: /usr/include/GNUstep/Foundation/NSTask.h: /usr/include/GNUstep/Foundation/NSThread.h: /usr/include/GNUstep/Foundation/NSTimeZone.h: /usr/include/GNUstep/Foundation/NSUndoManager.h: /usr/include/GNUstep/Foundation/NSURLAuthenticationChallenge.h: /usr/include/GNUstep/Foundation/NSURLCache.h: /usr/include/GNUstep/Foundation/NSURLConnection.h: /usr/include/GNUstep/Foundation/NSURLCredential.h: /usr/include/GNUstep/Foundation/NSURLCredentialStorage.h: /usr/include/GNUstep/Foundation/NSURLDownload.h: /usr/include/GNUstep/Foundation/NSURLError.h: /usr/include/GNUstep/Foundation/NSURL.h: /usr/include/GNUstep/Foundation/NSURLHandle.h: /usr/include/GNUstep/Foundation/NSURLProtectionSpace.h: /usr/include/GNUstep/Foundation/NSURLProtocol.h: /usr/include/GNUstep/Foundation/NSURLRequest.h: /usr/include/GNUstep/Foundation/NSURLResponse.h: /usr/include/GNUstep/Foundation/NSUserDefaults.h: /usr/include/GNUstep/Foundation/NSValueTransformer.h: /usr/include/GNUstep/Foundation/NSXMLParser.h: SOPE/sope-xml/SaxObjC/shared_debug_obj/SaxHandlerBase.d0000644000000000000000000000336112242733417021626 0ustar rootrootobj/SaxHandlerBase.o: SaxHandlerBase.m SaxHandlerBase.h \ /usr/include/GNUstep/Foundation/NSObject.h \ /usr/include/GNUstep/Foundation/NSObjCRuntime.h \ /usr/include/GNUstep/GNUstepBase/GSVersionMacros.h \ /usr/include/GNUstep/GNUstepBase/preface.h \ /usr/include/GNUstep/GNUstepBase/objc-gnu2next.h \ /usr/include/GNUstep/GNUstepBase/GSConfig.h \ /usr/include/GNUstep/GNUstepBase/GSObjCRuntime.h \ /usr/include/GNUstep/Foundation/NSZone.h \ /usr/include/GNUstep/GNUstepBase/GNUstep.h \ /usr/include/GNUstep/Foundation/NSDate.h ../SaxObjC/SaxEntityResolver.h \ ../SaxObjC/SaxDTDHandler.h ../SaxObjC/SaxDocumentHandler.h \ /usr/include/GNUstep/Foundation/NSString.h \ /usr/include/GNUstep/Foundation/NSRange.h ../SaxObjC/SaxAttributeList.h \ ../SaxObjC/SaxAttributes.h ../SaxObjC/SaxLocator.h \ ../SaxObjC/SaxErrorHandler.h SaxException.h \ /usr/include/GNUstep/Foundation/NSException.h SaxHandlerBase.h: /usr/include/GNUstep/Foundation/NSObject.h: /usr/include/GNUstep/Foundation/NSObjCRuntime.h: /usr/include/GNUstep/GNUstepBase/GSVersionMacros.h: /usr/include/GNUstep/GNUstepBase/preface.h: /usr/include/GNUstep/GNUstepBase/objc-gnu2next.h: /usr/include/GNUstep/GNUstepBase/GSConfig.h: /usr/include/GNUstep/GNUstepBase/GSObjCRuntime.h: /usr/include/GNUstep/Foundation/NSZone.h: /usr/include/GNUstep/GNUstepBase/GNUstep.h: /usr/include/GNUstep/Foundation/NSDate.h: ../SaxObjC/SaxEntityResolver.h: ../SaxObjC/SaxDTDHandler.h: ../SaxObjC/SaxDocumentHandler.h: /usr/include/GNUstep/Foundation/NSString.h: /usr/include/GNUstep/Foundation/NSRange.h: ../SaxObjC/SaxAttributeList.h: ../SaxObjC/SaxAttributes.h: ../SaxObjC/SaxLocator.h: ../SaxObjC/SaxErrorHandler.h: SaxException.h: /usr/include/GNUstep/Foundation/NSException.h: SOPE/sope-xml/SaxObjC/shared_debug_obj/SaxAttributeList.d0000644000000000000000000002426712242733417022265 0ustar rootrootobj/SaxAttributeList.o: SaxAttributeList.m SaxAttributeList.h \ /usr/include/GNUstep/Foundation/NSObject.h \ /usr/include/GNUstep/Foundation/NSObjCRuntime.h \ /usr/include/GNUstep/GNUstepBase/GSVersionMacros.h \ /usr/include/GNUstep/GNUstepBase/preface.h \ /usr/include/GNUstep/GNUstepBase/objc-gnu2next.h \ /usr/include/GNUstep/GNUstepBase/GSConfig.h \ /usr/include/GNUstep/GNUstepBase/GSObjCRuntime.h \ /usr/include/GNUstep/Foundation/NSZone.h \ /usr/include/GNUstep/GNUstepBase/GNUstep.h \ /usr/include/GNUstep/Foundation/NSDate.h ../SaxObjC/SaxAttributes.h \ ../SaxObjC/SaxAttributeList.h SaxAttributes.h common.h \ /usr/include/GNUstep/Foundation/Foundation.h \ /usr/include/GNUstep/Foundation/FoundationErrors.h \ /usr/include/GNUstep/Foundation/NSDebug.h \ /usr/include/GNUstep/Foundation/NSProcessInfo.h \ /usr/include/GNUstep/Foundation/NSAffineTransform.h \ /usr/include/GNUstep/Foundation/NSGeometry.h \ /usr/include/GNUstep/Foundation/NSString.h \ /usr/include/GNUstep/Foundation/NSRange.h \ /usr/include/GNUstep/Foundation/NSArchiver.h \ /usr/include/GNUstep/Foundation/NSCoder.h \ /usr/include/GNUstep/Foundation/NSArray.h \ /usr/include/GNUstep/Foundation/NSAttributedString.h \ /usr/include/GNUstep/Foundation/NSDictionary.h \ /usr/include/GNUstep/Foundation/NSAutoreleasePool.h \ /usr/include/GNUstep/Foundation/NSBundle.h \ /usr/include/GNUstep/Foundation/NSByteOrder.h \ /usr/include/GNUstep/Foundation/NSCalendarDate.h \ /usr/include/GNUstep/Foundation/NSCharacterSet.h \ /usr/include/GNUstep/Foundation/NSClassDescription.h \ /usr/include/GNUstep/Foundation/NSException.h \ /usr/include/GNUstep/Foundation/NSComparisonPredicate.h \ /usr/include/GNUstep/Foundation/NSExpression.h \ /usr/include/GNUstep/Foundation/NSPredicate.h \ /usr/include/GNUstep/Foundation/NSCompoundPredicate.h \ /usr/include/GNUstep/Foundation/NSConnection.h \ /usr/include/GNUstep/Foundation/NSTimer.h \ /usr/include/GNUstep/Foundation/NSRunLoop.h \ /usr/include/GNUstep/Foundation/NSMapTable.h \ /usr/include/GNUstep/Foundation/NSData.h \ /usr/include/GNUstep/Foundation/NSSerialization.h \ /usr/include/GNUstep/Foundation/NSDateFormatter.h \ /usr/include/GNUstep/Foundation/NSFormatter.h \ /usr/include/GNUstep/Foundation/NSDecimalNumber.h \ /usr/include/GNUstep/Foundation/NSDecimal.h \ /usr/include/GNUstep/Foundation/NSValue.h \ /usr/include/GNUstep/Foundation/NSDistantObject.h \ /usr/include/GNUstep/Foundation/NSProxy.h \ /usr/include/GNUstep/Foundation/NSDistributedLock.h \ /usr/include/GNUstep/Foundation/NSDistributedNotificationCenter.h \ /usr/include/GNUstep/Foundation/NSLock.h \ /usr/include/GNUstep/Foundation/NSNotification.h \ /usr/include/GNUstep/Foundation/NSEnumerator.h \ /usr/include/GNUstep/Foundation/NSError.h \ /usr/include/GNUstep/Foundation/NSFileHandle.h \ /usr/include/GNUstep/Foundation/NSFileManager.h \ /usr/include/GNUstep/Foundation/NSHashTable.h \ /usr/include/GNUstep/Foundation/NSHost.h \ /usr/include/GNUstep/Foundation/NSHTTPCookie.h \ /usr/include/GNUstep/Foundation/NSHTTPCookieStorage.h \ /usr/include/GNUstep/Foundation/NSIndexPath.h \ /usr/include/GNUstep/Foundation/NSIndexSet.h \ /usr/include/GNUstep/Foundation/NSInvocation.h \ /usr/include/GNUstep/Foundation/NSMethodSignature.h \ /usr/include/GNUstep/Foundation/NSKeyedArchiver.h \ /usr/include/GNUstep/Foundation/NSPropertyList.h \ /usr/include/GNUstep/Foundation/NSKeyValueCoding.h \ /usr/include/GNUstep/Foundation/NSNotificationQueue.h \ /usr/include/GNUstep/Foundation/NSNetServices.h \ /usr/include/GNUstep/Foundation/NSNull.h \ /usr/include/GNUstep/Foundation/NSNumberFormatter.h \ /usr/include/GNUstep/Foundation/NSPathUtilities.h \ /usr/include/GNUstep/Foundation/NSPortCoder.h \ /usr/include/GNUstep/Foundation/NSPortMessage.h \ /usr/include/GNUstep/Foundation/NSPort.h \ /usr/include/GNUstep/Foundation/NSPortNameServer.h \ /usr/include/GNUstep/Foundation/NSProtocolChecker.h \ /usr/include/GNUstep/Foundation/NSScanner.h \ /usr/include/GNUstep/Foundation/NSSet.h \ /usr/include/GNUstep/Foundation/NSSortDescriptor.h \ /usr/include/GNUstep/Foundation/NSSpellServer.h \ /usr/include/GNUstep/Foundation/NSStream.h \ /usr/include/GNUstep/Foundation/NSTask.h \ /usr/include/GNUstep/Foundation/NSThread.h \ /usr/include/GNUstep/Foundation/NSTimeZone.h \ /usr/include/GNUstep/Foundation/NSUndoManager.h \ /usr/include/GNUstep/Foundation/NSURLAuthenticationChallenge.h \ /usr/include/GNUstep/Foundation/NSURLCache.h \ /usr/include/GNUstep/Foundation/NSURLConnection.h \ /usr/include/GNUstep/Foundation/NSURLCredential.h \ /usr/include/GNUstep/Foundation/NSURLCredentialStorage.h \ /usr/include/GNUstep/Foundation/NSURLDownload.h \ /usr/include/GNUstep/Foundation/NSURLError.h \ /usr/include/GNUstep/Foundation/NSURL.h \ /usr/include/GNUstep/Foundation/NSURLHandle.h \ /usr/include/GNUstep/Foundation/NSURLProtectionSpace.h \ /usr/include/GNUstep/Foundation/NSURLProtocol.h \ /usr/include/GNUstep/Foundation/NSURLRequest.h \ /usr/include/GNUstep/Foundation/NSURLResponse.h \ /usr/include/GNUstep/Foundation/NSUserDefaults.h \ /usr/include/GNUstep/Foundation/NSValueTransformer.h \ /usr/include/GNUstep/Foundation/NSXMLParser.h SaxAttributeList.h: /usr/include/GNUstep/Foundation/NSObject.h: /usr/include/GNUstep/Foundation/NSObjCRuntime.h: /usr/include/GNUstep/GNUstepBase/GSVersionMacros.h: /usr/include/GNUstep/GNUstepBase/preface.h: /usr/include/GNUstep/GNUstepBase/objc-gnu2next.h: /usr/include/GNUstep/GNUstepBase/GSConfig.h: /usr/include/GNUstep/GNUstepBase/GSObjCRuntime.h: /usr/include/GNUstep/Foundation/NSZone.h: /usr/include/GNUstep/GNUstepBase/GNUstep.h: /usr/include/GNUstep/Foundation/NSDate.h: ../SaxObjC/SaxAttributes.h: ../SaxObjC/SaxAttributeList.h: SaxAttributes.h: common.h: /usr/include/GNUstep/Foundation/Foundation.h: /usr/include/GNUstep/Foundation/FoundationErrors.h: /usr/include/GNUstep/Foundation/NSDebug.h: /usr/include/GNUstep/Foundation/NSProcessInfo.h: /usr/include/GNUstep/Foundation/NSAffineTransform.h: /usr/include/GNUstep/Foundation/NSGeometry.h: /usr/include/GNUstep/Foundation/NSString.h: /usr/include/GNUstep/Foundation/NSRange.h: /usr/include/GNUstep/Foundation/NSArchiver.h: /usr/include/GNUstep/Foundation/NSCoder.h: /usr/include/GNUstep/Foundation/NSArray.h: /usr/include/GNUstep/Foundation/NSAttributedString.h: /usr/include/GNUstep/Foundation/NSDictionary.h: /usr/include/GNUstep/Foundation/NSAutoreleasePool.h: /usr/include/GNUstep/Foundation/NSBundle.h: /usr/include/GNUstep/Foundation/NSByteOrder.h: /usr/include/GNUstep/Foundation/NSCalendarDate.h: /usr/include/GNUstep/Foundation/NSCharacterSet.h: /usr/include/GNUstep/Foundation/NSClassDescription.h: /usr/include/GNUstep/Foundation/NSException.h: /usr/include/GNUstep/Foundation/NSComparisonPredicate.h: /usr/include/GNUstep/Foundation/NSExpression.h: /usr/include/GNUstep/Foundation/NSPredicate.h: /usr/include/GNUstep/Foundation/NSCompoundPredicate.h: /usr/include/GNUstep/Foundation/NSConnection.h: /usr/include/GNUstep/Foundation/NSTimer.h: /usr/include/GNUstep/Foundation/NSRunLoop.h: /usr/include/GNUstep/Foundation/NSMapTable.h: /usr/include/GNUstep/Foundation/NSData.h: /usr/include/GNUstep/Foundation/NSSerialization.h: /usr/include/GNUstep/Foundation/NSDateFormatter.h: /usr/include/GNUstep/Foundation/NSFormatter.h: /usr/include/GNUstep/Foundation/NSDecimalNumber.h: /usr/include/GNUstep/Foundation/NSDecimal.h: /usr/include/GNUstep/Foundation/NSValue.h: /usr/include/GNUstep/Foundation/NSDistantObject.h: /usr/include/GNUstep/Foundation/NSProxy.h: /usr/include/GNUstep/Foundation/NSDistributedLock.h: /usr/include/GNUstep/Foundation/NSDistributedNotificationCenter.h: /usr/include/GNUstep/Foundation/NSLock.h: /usr/include/GNUstep/Foundation/NSNotification.h: /usr/include/GNUstep/Foundation/NSEnumerator.h: /usr/include/GNUstep/Foundation/NSError.h: /usr/include/GNUstep/Foundation/NSFileHandle.h: /usr/include/GNUstep/Foundation/NSFileManager.h: /usr/include/GNUstep/Foundation/NSHashTable.h: /usr/include/GNUstep/Foundation/NSHost.h: /usr/include/GNUstep/Foundation/NSHTTPCookie.h: /usr/include/GNUstep/Foundation/NSHTTPCookieStorage.h: /usr/include/GNUstep/Foundation/NSIndexPath.h: /usr/include/GNUstep/Foundation/NSIndexSet.h: /usr/include/GNUstep/Foundation/NSInvocation.h: /usr/include/GNUstep/Foundation/NSMethodSignature.h: /usr/include/GNUstep/Foundation/NSKeyedArchiver.h: /usr/include/GNUstep/Foundation/NSPropertyList.h: /usr/include/GNUstep/Foundation/NSKeyValueCoding.h: /usr/include/GNUstep/Foundation/NSNotificationQueue.h: /usr/include/GNUstep/Foundation/NSNetServices.h: /usr/include/GNUstep/Foundation/NSNull.h: /usr/include/GNUstep/Foundation/NSNumberFormatter.h: /usr/include/GNUstep/Foundation/NSPathUtilities.h: /usr/include/GNUstep/Foundation/NSPortCoder.h: /usr/include/GNUstep/Foundation/NSPortMessage.h: /usr/include/GNUstep/Foundation/NSPort.h: /usr/include/GNUstep/Foundation/NSPortNameServer.h: /usr/include/GNUstep/Foundation/NSProtocolChecker.h: /usr/include/GNUstep/Foundation/NSScanner.h: /usr/include/GNUstep/Foundation/NSSet.h: /usr/include/GNUstep/Foundation/NSSortDescriptor.h: /usr/include/GNUstep/Foundation/NSSpellServer.h: /usr/include/GNUstep/Foundation/NSStream.h: /usr/include/GNUstep/Foundation/NSTask.h: /usr/include/GNUstep/Foundation/NSThread.h: /usr/include/GNUstep/Foundation/NSTimeZone.h: /usr/include/GNUstep/Foundation/NSUndoManager.h: /usr/include/GNUstep/Foundation/NSURLAuthenticationChallenge.h: /usr/include/GNUstep/Foundation/NSURLCache.h: /usr/include/GNUstep/Foundation/NSURLConnection.h: /usr/include/GNUstep/Foundation/NSURLCredential.h: /usr/include/GNUstep/Foundation/NSURLCredentialStorage.h: /usr/include/GNUstep/Foundation/NSURLDownload.h: /usr/include/GNUstep/Foundation/NSURLError.h: /usr/include/GNUstep/Foundation/NSURL.h: /usr/include/GNUstep/Foundation/NSURLHandle.h: /usr/include/GNUstep/Foundation/NSURLProtectionSpace.h: /usr/include/GNUstep/Foundation/NSURLProtocol.h: /usr/include/GNUstep/Foundation/NSURLRequest.h: /usr/include/GNUstep/Foundation/NSURLResponse.h: /usr/include/GNUstep/Foundation/NSUserDefaults.h: /usr/include/GNUstep/Foundation/NSValueTransformer.h: /usr/include/GNUstep/Foundation/NSXMLParser.h: SOPE/sope-xml/SaxObjC/shared_debug_obj/SaxXMLFilter.d0000644000000000000000000002521512242733420021260 0ustar rootrootobj/SaxXMLFilter.o: SaxXMLFilter.m SaxXMLFilter.h \ /usr/include/GNUstep/Foundation/NSObject.h \ /usr/include/GNUstep/Foundation/NSObjCRuntime.h \ /usr/include/GNUstep/GNUstepBase/GSVersionMacros.h \ /usr/include/GNUstep/GNUstepBase/preface.h \ /usr/include/GNUstep/GNUstepBase/objc-gnu2next.h \ /usr/include/GNUstep/GNUstepBase/GSConfig.h \ /usr/include/GNUstep/GNUstepBase/GSObjCRuntime.h \ /usr/include/GNUstep/Foundation/NSZone.h \ /usr/include/GNUstep/GNUstepBase/GNUstep.h \ /usr/include/GNUstep/Foundation/NSDate.h ../SaxObjC/SaxXMLReader.h \ ../SaxObjC/SaxContentHandler.h \ /usr/include/GNUstep/Foundation/NSString.h \ /usr/include/GNUstep/Foundation/NSRange.h ../SaxObjC/SaxAttributes.h \ ../SaxObjC/SaxAttributeList.h ../SaxObjC/SaxLocator.h \ ../SaxObjC/SaxDTDHandler.h ../SaxObjC/SaxErrorHandler.h \ ../SaxObjC/SaxEntityResolver.h SaxEntityResolver.h SaxDTDHandler.h \ SaxContentHandler.h SaxErrorHandler.h common.h \ /usr/include/GNUstep/Foundation/Foundation.h \ /usr/include/GNUstep/Foundation/FoundationErrors.h \ /usr/include/GNUstep/Foundation/NSDebug.h \ /usr/include/GNUstep/Foundation/NSProcessInfo.h \ /usr/include/GNUstep/Foundation/NSAffineTransform.h \ /usr/include/GNUstep/Foundation/NSGeometry.h \ /usr/include/GNUstep/Foundation/NSArchiver.h \ /usr/include/GNUstep/Foundation/NSCoder.h \ /usr/include/GNUstep/Foundation/NSArray.h \ /usr/include/GNUstep/Foundation/NSAttributedString.h \ /usr/include/GNUstep/Foundation/NSDictionary.h \ /usr/include/GNUstep/Foundation/NSAutoreleasePool.h \ /usr/include/GNUstep/Foundation/NSBundle.h \ /usr/include/GNUstep/Foundation/NSByteOrder.h \ /usr/include/GNUstep/Foundation/NSCalendarDate.h \ /usr/include/GNUstep/Foundation/NSCharacterSet.h \ /usr/include/GNUstep/Foundation/NSClassDescription.h \ /usr/include/GNUstep/Foundation/NSException.h \ /usr/include/GNUstep/Foundation/NSComparisonPredicate.h \ /usr/include/GNUstep/Foundation/NSExpression.h \ /usr/include/GNUstep/Foundation/NSPredicate.h \ /usr/include/GNUstep/Foundation/NSCompoundPredicate.h \ /usr/include/GNUstep/Foundation/NSConnection.h \ /usr/include/GNUstep/Foundation/NSTimer.h \ /usr/include/GNUstep/Foundation/NSRunLoop.h \ /usr/include/GNUstep/Foundation/NSMapTable.h \ /usr/include/GNUstep/Foundation/NSData.h \ /usr/include/GNUstep/Foundation/NSSerialization.h \ /usr/include/GNUstep/Foundation/NSDateFormatter.h \ /usr/include/GNUstep/Foundation/NSFormatter.h \ /usr/include/GNUstep/Foundation/NSDecimalNumber.h \ /usr/include/GNUstep/Foundation/NSDecimal.h \ /usr/include/GNUstep/Foundation/NSValue.h \ /usr/include/GNUstep/Foundation/NSDistantObject.h \ /usr/include/GNUstep/Foundation/NSProxy.h \ /usr/include/GNUstep/Foundation/NSDistributedLock.h \ /usr/include/GNUstep/Foundation/NSDistributedNotificationCenter.h \ /usr/include/GNUstep/Foundation/NSLock.h \ /usr/include/GNUstep/Foundation/NSNotification.h \ /usr/include/GNUstep/Foundation/NSEnumerator.h \ /usr/include/GNUstep/Foundation/NSError.h \ /usr/include/GNUstep/Foundation/NSFileHandle.h \ /usr/include/GNUstep/Foundation/NSFileManager.h \ /usr/include/GNUstep/Foundation/NSHashTable.h \ /usr/include/GNUstep/Foundation/NSHost.h \ /usr/include/GNUstep/Foundation/NSHTTPCookie.h \ /usr/include/GNUstep/Foundation/NSHTTPCookieStorage.h \ /usr/include/GNUstep/Foundation/NSIndexPath.h \ /usr/include/GNUstep/Foundation/NSIndexSet.h \ /usr/include/GNUstep/Foundation/NSInvocation.h \ /usr/include/GNUstep/Foundation/NSMethodSignature.h \ /usr/include/GNUstep/Foundation/NSKeyedArchiver.h \ /usr/include/GNUstep/Foundation/NSPropertyList.h \ /usr/include/GNUstep/Foundation/NSKeyValueCoding.h \ /usr/include/GNUstep/Foundation/NSNotificationQueue.h \ /usr/include/GNUstep/Foundation/NSNetServices.h \ /usr/include/GNUstep/Foundation/NSNull.h \ /usr/include/GNUstep/Foundation/NSNumberFormatter.h \ /usr/include/GNUstep/Foundation/NSPathUtilities.h \ /usr/include/GNUstep/Foundation/NSPortCoder.h \ /usr/include/GNUstep/Foundation/NSPortMessage.h \ /usr/include/GNUstep/Foundation/NSPort.h \ /usr/include/GNUstep/Foundation/NSPortNameServer.h \ /usr/include/GNUstep/Foundation/NSProtocolChecker.h \ /usr/include/GNUstep/Foundation/NSScanner.h \ /usr/include/GNUstep/Foundation/NSSet.h \ /usr/include/GNUstep/Foundation/NSSortDescriptor.h \ /usr/include/GNUstep/Foundation/NSSpellServer.h \ /usr/include/GNUstep/Foundation/NSStream.h \ /usr/include/GNUstep/Foundation/NSTask.h \ /usr/include/GNUstep/Foundation/NSThread.h \ /usr/include/GNUstep/Foundation/NSTimeZone.h \ /usr/include/GNUstep/Foundation/NSUndoManager.h \ /usr/include/GNUstep/Foundation/NSURLAuthenticationChallenge.h \ /usr/include/GNUstep/Foundation/NSURLCache.h \ /usr/include/GNUstep/Foundation/NSURLConnection.h \ /usr/include/GNUstep/Foundation/NSURLCredential.h \ /usr/include/GNUstep/Foundation/NSURLCredentialStorage.h \ /usr/include/GNUstep/Foundation/NSURLDownload.h \ /usr/include/GNUstep/Foundation/NSURLError.h \ /usr/include/GNUstep/Foundation/NSURL.h \ /usr/include/GNUstep/Foundation/NSURLHandle.h \ /usr/include/GNUstep/Foundation/NSURLProtectionSpace.h \ /usr/include/GNUstep/Foundation/NSURLProtocol.h \ /usr/include/GNUstep/Foundation/NSURLRequest.h \ /usr/include/GNUstep/Foundation/NSURLResponse.h \ /usr/include/GNUstep/Foundation/NSUserDefaults.h \ /usr/include/GNUstep/Foundation/NSValueTransformer.h \ /usr/include/GNUstep/Foundation/NSXMLParser.h SaxXMLFilter.h: /usr/include/GNUstep/Foundation/NSObject.h: /usr/include/GNUstep/Foundation/NSObjCRuntime.h: /usr/include/GNUstep/GNUstepBase/GSVersionMacros.h: /usr/include/GNUstep/GNUstepBase/preface.h: /usr/include/GNUstep/GNUstepBase/objc-gnu2next.h: /usr/include/GNUstep/GNUstepBase/GSConfig.h: /usr/include/GNUstep/GNUstepBase/GSObjCRuntime.h: /usr/include/GNUstep/Foundation/NSZone.h: /usr/include/GNUstep/GNUstepBase/GNUstep.h: /usr/include/GNUstep/Foundation/NSDate.h: ../SaxObjC/SaxXMLReader.h: ../SaxObjC/SaxContentHandler.h: /usr/include/GNUstep/Foundation/NSString.h: /usr/include/GNUstep/Foundation/NSRange.h: ../SaxObjC/SaxAttributes.h: ../SaxObjC/SaxAttributeList.h: ../SaxObjC/SaxLocator.h: ../SaxObjC/SaxDTDHandler.h: ../SaxObjC/SaxErrorHandler.h: ../SaxObjC/SaxEntityResolver.h: SaxEntityResolver.h: SaxDTDHandler.h: SaxContentHandler.h: SaxErrorHandler.h: common.h: /usr/include/GNUstep/Foundation/Foundation.h: /usr/include/GNUstep/Foundation/FoundationErrors.h: /usr/include/GNUstep/Foundation/NSDebug.h: /usr/include/GNUstep/Foundation/NSProcessInfo.h: /usr/include/GNUstep/Foundation/NSAffineTransform.h: /usr/include/GNUstep/Foundation/NSGeometry.h: /usr/include/GNUstep/Foundation/NSArchiver.h: /usr/include/GNUstep/Foundation/NSCoder.h: /usr/include/GNUstep/Foundation/NSArray.h: /usr/include/GNUstep/Foundation/NSAttributedString.h: /usr/include/GNUstep/Foundation/NSDictionary.h: /usr/include/GNUstep/Foundation/NSAutoreleasePool.h: /usr/include/GNUstep/Foundation/NSBundle.h: /usr/include/GNUstep/Foundation/NSByteOrder.h: /usr/include/GNUstep/Foundation/NSCalendarDate.h: /usr/include/GNUstep/Foundation/NSCharacterSet.h: /usr/include/GNUstep/Foundation/NSClassDescription.h: /usr/include/GNUstep/Foundation/NSException.h: /usr/include/GNUstep/Foundation/NSComparisonPredicate.h: /usr/include/GNUstep/Foundation/NSExpression.h: /usr/include/GNUstep/Foundation/NSPredicate.h: /usr/include/GNUstep/Foundation/NSCompoundPredicate.h: /usr/include/GNUstep/Foundation/NSConnection.h: /usr/include/GNUstep/Foundation/NSTimer.h: /usr/include/GNUstep/Foundation/NSRunLoop.h: /usr/include/GNUstep/Foundation/NSMapTable.h: /usr/include/GNUstep/Foundation/NSData.h: /usr/include/GNUstep/Foundation/NSSerialization.h: /usr/include/GNUstep/Foundation/NSDateFormatter.h: /usr/include/GNUstep/Foundation/NSFormatter.h: /usr/include/GNUstep/Foundation/NSDecimalNumber.h: /usr/include/GNUstep/Foundation/NSDecimal.h: /usr/include/GNUstep/Foundation/NSValue.h: /usr/include/GNUstep/Foundation/NSDistantObject.h: /usr/include/GNUstep/Foundation/NSProxy.h: /usr/include/GNUstep/Foundation/NSDistributedLock.h: /usr/include/GNUstep/Foundation/NSDistributedNotificationCenter.h: /usr/include/GNUstep/Foundation/NSLock.h: /usr/include/GNUstep/Foundation/NSNotification.h: /usr/include/GNUstep/Foundation/NSEnumerator.h: /usr/include/GNUstep/Foundation/NSError.h: /usr/include/GNUstep/Foundation/NSFileHandle.h: /usr/include/GNUstep/Foundation/NSFileManager.h: /usr/include/GNUstep/Foundation/NSHashTable.h: /usr/include/GNUstep/Foundation/NSHost.h: /usr/include/GNUstep/Foundation/NSHTTPCookie.h: /usr/include/GNUstep/Foundation/NSHTTPCookieStorage.h: /usr/include/GNUstep/Foundation/NSIndexPath.h: /usr/include/GNUstep/Foundation/NSIndexSet.h: /usr/include/GNUstep/Foundation/NSInvocation.h: /usr/include/GNUstep/Foundation/NSMethodSignature.h: /usr/include/GNUstep/Foundation/NSKeyedArchiver.h: /usr/include/GNUstep/Foundation/NSPropertyList.h: /usr/include/GNUstep/Foundation/NSKeyValueCoding.h: /usr/include/GNUstep/Foundation/NSNotificationQueue.h: /usr/include/GNUstep/Foundation/NSNetServices.h: /usr/include/GNUstep/Foundation/NSNull.h: /usr/include/GNUstep/Foundation/NSNumberFormatter.h: /usr/include/GNUstep/Foundation/NSPathUtilities.h: /usr/include/GNUstep/Foundation/NSPortCoder.h: /usr/include/GNUstep/Foundation/NSPortMessage.h: /usr/include/GNUstep/Foundation/NSPort.h: /usr/include/GNUstep/Foundation/NSPortNameServer.h: /usr/include/GNUstep/Foundation/NSProtocolChecker.h: /usr/include/GNUstep/Foundation/NSScanner.h: /usr/include/GNUstep/Foundation/NSSet.h: /usr/include/GNUstep/Foundation/NSSortDescriptor.h: /usr/include/GNUstep/Foundation/NSSpellServer.h: /usr/include/GNUstep/Foundation/NSStream.h: /usr/include/GNUstep/Foundation/NSTask.h: /usr/include/GNUstep/Foundation/NSThread.h: /usr/include/GNUstep/Foundation/NSTimeZone.h: /usr/include/GNUstep/Foundation/NSUndoManager.h: /usr/include/GNUstep/Foundation/NSURLAuthenticationChallenge.h: /usr/include/GNUstep/Foundation/NSURLCache.h: /usr/include/GNUstep/Foundation/NSURLConnection.h: /usr/include/GNUstep/Foundation/NSURLCredential.h: /usr/include/GNUstep/Foundation/NSURLCredentialStorage.h: /usr/include/GNUstep/Foundation/NSURLDownload.h: /usr/include/GNUstep/Foundation/NSURLError.h: /usr/include/GNUstep/Foundation/NSURL.h: /usr/include/GNUstep/Foundation/NSURLHandle.h: /usr/include/GNUstep/Foundation/NSURLProtectionSpace.h: /usr/include/GNUstep/Foundation/NSURLProtocol.h: /usr/include/GNUstep/Foundation/NSURLRequest.h: /usr/include/GNUstep/Foundation/NSURLResponse.h: /usr/include/GNUstep/Foundation/NSUserDefaults.h: /usr/include/GNUstep/Foundation/NSValueTransformer.h: /usr/include/GNUstep/Foundation/NSXMLParser.h: SOPE/sope-xml/SaxObjC/shared_debug_obj/SaxMethodCallHandler.d0000644000000000000000000002502712242733417022773 0ustar rootrootobj/SaxMethodCallHandler.o: SaxMethodCallHandler.m SaxMethodCallHandler.h \ ../SaxObjC/SaxDefaultHandler.h \ /usr/include/GNUstep/Foundation/NSObject.h \ /usr/include/GNUstep/Foundation/NSObjCRuntime.h \ /usr/include/GNUstep/GNUstepBase/GSVersionMacros.h \ /usr/include/GNUstep/GNUstepBase/preface.h \ /usr/include/GNUstep/GNUstepBase/objc-gnu2next.h \ /usr/include/GNUstep/GNUstepBase/GSConfig.h \ /usr/include/GNUstep/GNUstepBase/GSObjCRuntime.h \ /usr/include/GNUstep/Foundation/NSZone.h \ /usr/include/GNUstep/GNUstepBase/GNUstep.h \ /usr/include/GNUstep/Foundation/NSDate.h ../SaxObjC/SaxEntityResolver.h \ ../SaxObjC/SaxDTDHandler.h ../SaxObjC/SaxContentHandler.h \ /usr/include/GNUstep/Foundation/NSString.h \ /usr/include/GNUstep/Foundation/NSRange.h ../SaxObjC/SaxAttributes.h \ ../SaxObjC/SaxAttributeList.h ../SaxObjC/SaxLocator.h \ ../SaxObjC/SaxErrorHandler.h \ /usr/include/GNUstep/Foundation/NSMapTable.h \ /usr/include/GNUstep/Foundation/NSArray.h common.h \ /usr/include/GNUstep/Foundation/Foundation.h \ /usr/include/GNUstep/Foundation/FoundationErrors.h \ /usr/include/GNUstep/Foundation/NSDebug.h \ /usr/include/GNUstep/Foundation/NSProcessInfo.h \ /usr/include/GNUstep/Foundation/NSAffineTransform.h \ /usr/include/GNUstep/Foundation/NSGeometry.h \ /usr/include/GNUstep/Foundation/NSArchiver.h \ /usr/include/GNUstep/Foundation/NSCoder.h \ /usr/include/GNUstep/Foundation/NSAttributedString.h \ /usr/include/GNUstep/Foundation/NSDictionary.h \ /usr/include/GNUstep/Foundation/NSAutoreleasePool.h \ /usr/include/GNUstep/Foundation/NSBundle.h \ /usr/include/GNUstep/Foundation/NSByteOrder.h \ /usr/include/GNUstep/Foundation/NSCalendarDate.h \ /usr/include/GNUstep/Foundation/NSCharacterSet.h \ /usr/include/GNUstep/Foundation/NSClassDescription.h \ /usr/include/GNUstep/Foundation/NSException.h \ /usr/include/GNUstep/Foundation/NSComparisonPredicate.h \ /usr/include/GNUstep/Foundation/NSExpression.h \ /usr/include/GNUstep/Foundation/NSPredicate.h \ /usr/include/GNUstep/Foundation/NSCompoundPredicate.h \ /usr/include/GNUstep/Foundation/NSConnection.h \ /usr/include/GNUstep/Foundation/NSTimer.h \ /usr/include/GNUstep/Foundation/NSRunLoop.h \ /usr/include/GNUstep/Foundation/NSData.h \ /usr/include/GNUstep/Foundation/NSSerialization.h \ /usr/include/GNUstep/Foundation/NSDateFormatter.h \ /usr/include/GNUstep/Foundation/NSFormatter.h \ /usr/include/GNUstep/Foundation/NSDecimalNumber.h \ /usr/include/GNUstep/Foundation/NSDecimal.h \ /usr/include/GNUstep/Foundation/NSValue.h \ /usr/include/GNUstep/Foundation/NSDistantObject.h \ /usr/include/GNUstep/Foundation/NSProxy.h \ /usr/include/GNUstep/Foundation/NSDistributedLock.h \ /usr/include/GNUstep/Foundation/NSDistributedNotificationCenter.h \ /usr/include/GNUstep/Foundation/NSLock.h \ /usr/include/GNUstep/Foundation/NSNotification.h \ /usr/include/GNUstep/Foundation/NSEnumerator.h \ /usr/include/GNUstep/Foundation/NSError.h \ /usr/include/GNUstep/Foundation/NSFileHandle.h \ /usr/include/GNUstep/Foundation/NSFileManager.h \ /usr/include/GNUstep/Foundation/NSHashTable.h \ /usr/include/GNUstep/Foundation/NSHost.h \ /usr/include/GNUstep/Foundation/NSHTTPCookie.h \ /usr/include/GNUstep/Foundation/NSHTTPCookieStorage.h \ /usr/include/GNUstep/Foundation/NSIndexPath.h \ /usr/include/GNUstep/Foundation/NSIndexSet.h \ /usr/include/GNUstep/Foundation/NSInvocation.h \ /usr/include/GNUstep/Foundation/NSMethodSignature.h \ /usr/include/GNUstep/Foundation/NSKeyedArchiver.h \ /usr/include/GNUstep/Foundation/NSPropertyList.h \ /usr/include/GNUstep/Foundation/NSKeyValueCoding.h \ /usr/include/GNUstep/Foundation/NSNotificationQueue.h \ /usr/include/GNUstep/Foundation/NSNetServices.h \ /usr/include/GNUstep/Foundation/NSNull.h \ /usr/include/GNUstep/Foundation/NSNumberFormatter.h \ /usr/include/GNUstep/Foundation/NSPathUtilities.h \ /usr/include/GNUstep/Foundation/NSPortCoder.h \ /usr/include/GNUstep/Foundation/NSPortMessage.h \ /usr/include/GNUstep/Foundation/NSPort.h \ /usr/include/GNUstep/Foundation/NSPortNameServer.h \ /usr/include/GNUstep/Foundation/NSProtocolChecker.h \ /usr/include/GNUstep/Foundation/NSScanner.h \ /usr/include/GNUstep/Foundation/NSSet.h \ /usr/include/GNUstep/Foundation/NSSortDescriptor.h \ /usr/include/GNUstep/Foundation/NSSpellServer.h \ /usr/include/GNUstep/Foundation/NSStream.h \ /usr/include/GNUstep/Foundation/NSTask.h \ /usr/include/GNUstep/Foundation/NSThread.h \ /usr/include/GNUstep/Foundation/NSTimeZone.h \ /usr/include/GNUstep/Foundation/NSUndoManager.h \ /usr/include/GNUstep/Foundation/NSURLAuthenticationChallenge.h \ /usr/include/GNUstep/Foundation/NSURLCache.h \ /usr/include/GNUstep/Foundation/NSURLConnection.h \ /usr/include/GNUstep/Foundation/NSURLCredential.h \ /usr/include/GNUstep/Foundation/NSURLCredentialStorage.h \ /usr/include/GNUstep/Foundation/NSURLDownload.h \ /usr/include/GNUstep/Foundation/NSURLError.h \ /usr/include/GNUstep/Foundation/NSURL.h \ /usr/include/GNUstep/Foundation/NSURLHandle.h \ /usr/include/GNUstep/Foundation/NSURLProtectionSpace.h \ /usr/include/GNUstep/Foundation/NSURLProtocol.h \ /usr/include/GNUstep/Foundation/NSURLRequest.h \ /usr/include/GNUstep/Foundation/NSURLResponse.h \ /usr/include/GNUstep/Foundation/NSUserDefaults.h \ /usr/include/GNUstep/Foundation/NSValueTransformer.h \ /usr/include/GNUstep/Foundation/NSXMLParser.h SaxMethodCallHandler.h: ../SaxObjC/SaxDefaultHandler.h: /usr/include/GNUstep/Foundation/NSObject.h: /usr/include/GNUstep/Foundation/NSObjCRuntime.h: /usr/include/GNUstep/GNUstepBase/GSVersionMacros.h: /usr/include/GNUstep/GNUstepBase/preface.h: /usr/include/GNUstep/GNUstepBase/objc-gnu2next.h: /usr/include/GNUstep/GNUstepBase/GSConfig.h: /usr/include/GNUstep/GNUstepBase/GSObjCRuntime.h: /usr/include/GNUstep/Foundation/NSZone.h: /usr/include/GNUstep/GNUstepBase/GNUstep.h: /usr/include/GNUstep/Foundation/NSDate.h: ../SaxObjC/SaxEntityResolver.h: ../SaxObjC/SaxDTDHandler.h: ../SaxObjC/SaxContentHandler.h: /usr/include/GNUstep/Foundation/NSString.h: /usr/include/GNUstep/Foundation/NSRange.h: ../SaxObjC/SaxAttributes.h: ../SaxObjC/SaxAttributeList.h: ../SaxObjC/SaxLocator.h: ../SaxObjC/SaxErrorHandler.h: /usr/include/GNUstep/Foundation/NSMapTable.h: /usr/include/GNUstep/Foundation/NSArray.h: common.h: /usr/include/GNUstep/Foundation/Foundation.h: /usr/include/GNUstep/Foundation/FoundationErrors.h: /usr/include/GNUstep/Foundation/NSDebug.h: /usr/include/GNUstep/Foundation/NSProcessInfo.h: /usr/include/GNUstep/Foundation/NSAffineTransform.h: /usr/include/GNUstep/Foundation/NSGeometry.h: /usr/include/GNUstep/Foundation/NSArchiver.h: /usr/include/GNUstep/Foundation/NSCoder.h: /usr/include/GNUstep/Foundation/NSAttributedString.h: /usr/include/GNUstep/Foundation/NSDictionary.h: /usr/include/GNUstep/Foundation/NSAutoreleasePool.h: /usr/include/GNUstep/Foundation/NSBundle.h: /usr/include/GNUstep/Foundation/NSByteOrder.h: /usr/include/GNUstep/Foundation/NSCalendarDate.h: /usr/include/GNUstep/Foundation/NSCharacterSet.h: /usr/include/GNUstep/Foundation/NSClassDescription.h: /usr/include/GNUstep/Foundation/NSException.h: /usr/include/GNUstep/Foundation/NSComparisonPredicate.h: /usr/include/GNUstep/Foundation/NSExpression.h: /usr/include/GNUstep/Foundation/NSPredicate.h: /usr/include/GNUstep/Foundation/NSCompoundPredicate.h: /usr/include/GNUstep/Foundation/NSConnection.h: /usr/include/GNUstep/Foundation/NSTimer.h: /usr/include/GNUstep/Foundation/NSRunLoop.h: /usr/include/GNUstep/Foundation/NSData.h: /usr/include/GNUstep/Foundation/NSSerialization.h: /usr/include/GNUstep/Foundation/NSDateFormatter.h: /usr/include/GNUstep/Foundation/NSFormatter.h: /usr/include/GNUstep/Foundation/NSDecimalNumber.h: /usr/include/GNUstep/Foundation/NSDecimal.h: /usr/include/GNUstep/Foundation/NSValue.h: /usr/include/GNUstep/Foundation/NSDistantObject.h: /usr/include/GNUstep/Foundation/NSProxy.h: /usr/include/GNUstep/Foundation/NSDistributedLock.h: /usr/include/GNUstep/Foundation/NSDistributedNotificationCenter.h: /usr/include/GNUstep/Foundation/NSLock.h: /usr/include/GNUstep/Foundation/NSNotification.h: /usr/include/GNUstep/Foundation/NSEnumerator.h: /usr/include/GNUstep/Foundation/NSError.h: /usr/include/GNUstep/Foundation/NSFileHandle.h: /usr/include/GNUstep/Foundation/NSFileManager.h: /usr/include/GNUstep/Foundation/NSHashTable.h: /usr/include/GNUstep/Foundation/NSHost.h: /usr/include/GNUstep/Foundation/NSHTTPCookie.h: /usr/include/GNUstep/Foundation/NSHTTPCookieStorage.h: /usr/include/GNUstep/Foundation/NSIndexPath.h: /usr/include/GNUstep/Foundation/NSIndexSet.h: /usr/include/GNUstep/Foundation/NSInvocation.h: /usr/include/GNUstep/Foundation/NSMethodSignature.h: /usr/include/GNUstep/Foundation/NSKeyedArchiver.h: /usr/include/GNUstep/Foundation/NSPropertyList.h: /usr/include/GNUstep/Foundation/NSKeyValueCoding.h: /usr/include/GNUstep/Foundation/NSNotificationQueue.h: /usr/include/GNUstep/Foundation/NSNetServices.h: /usr/include/GNUstep/Foundation/NSNull.h: /usr/include/GNUstep/Foundation/NSNumberFormatter.h: /usr/include/GNUstep/Foundation/NSPathUtilities.h: /usr/include/GNUstep/Foundation/NSPortCoder.h: /usr/include/GNUstep/Foundation/NSPortMessage.h: /usr/include/GNUstep/Foundation/NSPort.h: /usr/include/GNUstep/Foundation/NSPortNameServer.h: /usr/include/GNUstep/Foundation/NSProtocolChecker.h: /usr/include/GNUstep/Foundation/NSScanner.h: /usr/include/GNUstep/Foundation/NSSet.h: /usr/include/GNUstep/Foundation/NSSortDescriptor.h: /usr/include/GNUstep/Foundation/NSSpellServer.h: /usr/include/GNUstep/Foundation/NSStream.h: /usr/include/GNUstep/Foundation/NSTask.h: /usr/include/GNUstep/Foundation/NSThread.h: /usr/include/GNUstep/Foundation/NSTimeZone.h: /usr/include/GNUstep/Foundation/NSUndoManager.h: /usr/include/GNUstep/Foundation/NSURLAuthenticationChallenge.h: /usr/include/GNUstep/Foundation/NSURLCache.h: /usr/include/GNUstep/Foundation/NSURLConnection.h: /usr/include/GNUstep/Foundation/NSURLCredential.h: /usr/include/GNUstep/Foundation/NSURLCredentialStorage.h: /usr/include/GNUstep/Foundation/NSURLDownload.h: /usr/include/GNUstep/Foundation/NSURLError.h: /usr/include/GNUstep/Foundation/NSURL.h: /usr/include/GNUstep/Foundation/NSURLHandle.h: /usr/include/GNUstep/Foundation/NSURLProtectionSpace.h: /usr/include/GNUstep/Foundation/NSURLProtocol.h: /usr/include/GNUstep/Foundation/NSURLRequest.h: /usr/include/GNUstep/Foundation/NSURLResponse.h: /usr/include/GNUstep/Foundation/NSUserDefaults.h: /usr/include/GNUstep/Foundation/NSValueTransformer.h: /usr/include/GNUstep/Foundation/NSXMLParser.h: SOPE/sope-xml/SaxObjC/shared_debug_obj/SaxObjectDecoder.d0000644000000000000000000002505312242733420022146 0ustar rootrootobj/SaxObjectDecoder.o: SaxObjectDecoder.m SaxObjectDecoder.h \ ../SaxObjC/SaxDefaultHandler.h \ /usr/include/GNUstep/Foundation/NSObject.h \ /usr/include/GNUstep/Foundation/NSObjCRuntime.h \ /usr/include/GNUstep/GNUstepBase/GSVersionMacros.h \ /usr/include/GNUstep/GNUstepBase/preface.h \ /usr/include/GNUstep/GNUstepBase/objc-gnu2next.h \ /usr/include/GNUstep/GNUstepBase/GSConfig.h \ /usr/include/GNUstep/GNUstepBase/GSObjCRuntime.h \ /usr/include/GNUstep/Foundation/NSZone.h \ /usr/include/GNUstep/GNUstepBase/GNUstep.h \ /usr/include/GNUstep/Foundation/NSDate.h ../SaxObjC/SaxEntityResolver.h \ ../SaxObjC/SaxDTDHandler.h ../SaxObjC/SaxContentHandler.h \ /usr/include/GNUstep/Foundation/NSString.h \ /usr/include/GNUstep/Foundation/NSRange.h ../SaxObjC/SaxAttributes.h \ ../SaxObjC/SaxAttributeList.h ../SaxObjC/SaxLocator.h \ ../SaxObjC/SaxErrorHandler.h SaxObjectModel.h common.h \ /usr/include/GNUstep/Foundation/Foundation.h \ /usr/include/GNUstep/Foundation/FoundationErrors.h \ /usr/include/GNUstep/Foundation/NSDebug.h \ /usr/include/GNUstep/Foundation/NSProcessInfo.h \ /usr/include/GNUstep/Foundation/NSAffineTransform.h \ /usr/include/GNUstep/Foundation/NSGeometry.h \ /usr/include/GNUstep/Foundation/NSArchiver.h \ /usr/include/GNUstep/Foundation/NSCoder.h \ /usr/include/GNUstep/Foundation/NSArray.h \ /usr/include/GNUstep/Foundation/NSAttributedString.h \ /usr/include/GNUstep/Foundation/NSDictionary.h \ /usr/include/GNUstep/Foundation/NSAutoreleasePool.h \ /usr/include/GNUstep/Foundation/NSBundle.h \ /usr/include/GNUstep/Foundation/NSByteOrder.h \ /usr/include/GNUstep/Foundation/NSCalendarDate.h \ /usr/include/GNUstep/Foundation/NSCharacterSet.h \ /usr/include/GNUstep/Foundation/NSClassDescription.h \ /usr/include/GNUstep/Foundation/NSException.h \ /usr/include/GNUstep/Foundation/NSComparisonPredicate.h \ /usr/include/GNUstep/Foundation/NSExpression.h \ /usr/include/GNUstep/Foundation/NSPredicate.h \ /usr/include/GNUstep/Foundation/NSCompoundPredicate.h \ /usr/include/GNUstep/Foundation/NSConnection.h \ /usr/include/GNUstep/Foundation/NSTimer.h \ /usr/include/GNUstep/Foundation/NSRunLoop.h \ /usr/include/GNUstep/Foundation/NSMapTable.h \ /usr/include/GNUstep/Foundation/NSData.h \ /usr/include/GNUstep/Foundation/NSSerialization.h \ /usr/include/GNUstep/Foundation/NSDateFormatter.h \ /usr/include/GNUstep/Foundation/NSFormatter.h \ /usr/include/GNUstep/Foundation/NSDecimalNumber.h \ /usr/include/GNUstep/Foundation/NSDecimal.h \ /usr/include/GNUstep/Foundation/NSValue.h \ /usr/include/GNUstep/Foundation/NSDistantObject.h \ /usr/include/GNUstep/Foundation/NSProxy.h \ /usr/include/GNUstep/Foundation/NSDistributedLock.h \ /usr/include/GNUstep/Foundation/NSDistributedNotificationCenter.h \ /usr/include/GNUstep/Foundation/NSLock.h \ /usr/include/GNUstep/Foundation/NSNotification.h \ /usr/include/GNUstep/Foundation/NSEnumerator.h \ /usr/include/GNUstep/Foundation/NSError.h \ /usr/include/GNUstep/Foundation/NSFileHandle.h \ /usr/include/GNUstep/Foundation/NSFileManager.h \ /usr/include/GNUstep/Foundation/NSHashTable.h \ /usr/include/GNUstep/Foundation/NSHost.h \ /usr/include/GNUstep/Foundation/NSHTTPCookie.h \ /usr/include/GNUstep/Foundation/NSHTTPCookieStorage.h \ /usr/include/GNUstep/Foundation/NSIndexPath.h \ /usr/include/GNUstep/Foundation/NSIndexSet.h \ /usr/include/GNUstep/Foundation/NSInvocation.h \ /usr/include/GNUstep/Foundation/NSMethodSignature.h \ /usr/include/GNUstep/Foundation/NSKeyedArchiver.h \ /usr/include/GNUstep/Foundation/NSPropertyList.h \ /usr/include/GNUstep/Foundation/NSKeyValueCoding.h \ /usr/include/GNUstep/Foundation/NSNotificationQueue.h \ /usr/include/GNUstep/Foundation/NSNetServices.h \ /usr/include/GNUstep/Foundation/NSNull.h \ /usr/include/GNUstep/Foundation/NSNumberFormatter.h \ /usr/include/GNUstep/Foundation/NSPathUtilities.h \ /usr/include/GNUstep/Foundation/NSPortCoder.h \ /usr/include/GNUstep/Foundation/NSPortMessage.h \ /usr/include/GNUstep/Foundation/NSPort.h \ /usr/include/GNUstep/Foundation/NSPortNameServer.h \ /usr/include/GNUstep/Foundation/NSProtocolChecker.h \ /usr/include/GNUstep/Foundation/NSScanner.h \ /usr/include/GNUstep/Foundation/NSSet.h \ /usr/include/GNUstep/Foundation/NSSortDescriptor.h \ /usr/include/GNUstep/Foundation/NSSpellServer.h \ /usr/include/GNUstep/Foundation/NSStream.h \ /usr/include/GNUstep/Foundation/NSTask.h \ /usr/include/GNUstep/Foundation/NSThread.h \ /usr/include/GNUstep/Foundation/NSTimeZone.h \ /usr/include/GNUstep/Foundation/NSUndoManager.h \ /usr/include/GNUstep/Foundation/NSURLAuthenticationChallenge.h \ /usr/include/GNUstep/Foundation/NSURLCache.h \ /usr/include/GNUstep/Foundation/NSURLConnection.h \ /usr/include/GNUstep/Foundation/NSURLCredential.h \ /usr/include/GNUstep/Foundation/NSURLCredentialStorage.h \ /usr/include/GNUstep/Foundation/NSURLDownload.h \ /usr/include/GNUstep/Foundation/NSURLError.h \ /usr/include/GNUstep/Foundation/NSURL.h \ /usr/include/GNUstep/Foundation/NSURLHandle.h \ /usr/include/GNUstep/Foundation/NSURLProtectionSpace.h \ /usr/include/GNUstep/Foundation/NSURLProtocol.h \ /usr/include/GNUstep/Foundation/NSURLRequest.h \ /usr/include/GNUstep/Foundation/NSURLResponse.h \ /usr/include/GNUstep/Foundation/NSUserDefaults.h \ /usr/include/GNUstep/Foundation/NSValueTransformer.h \ /usr/include/GNUstep/Foundation/NSXMLParser.h SaxObjectDecoder.h: ../SaxObjC/SaxDefaultHandler.h: /usr/include/GNUstep/Foundation/NSObject.h: /usr/include/GNUstep/Foundation/NSObjCRuntime.h: /usr/include/GNUstep/GNUstepBase/GSVersionMacros.h: /usr/include/GNUstep/GNUstepBase/preface.h: /usr/include/GNUstep/GNUstepBase/objc-gnu2next.h: /usr/include/GNUstep/GNUstepBase/GSConfig.h: /usr/include/GNUstep/GNUstepBase/GSObjCRuntime.h: /usr/include/GNUstep/Foundation/NSZone.h: /usr/include/GNUstep/GNUstepBase/GNUstep.h: /usr/include/GNUstep/Foundation/NSDate.h: ../SaxObjC/SaxEntityResolver.h: ../SaxObjC/SaxDTDHandler.h: ../SaxObjC/SaxContentHandler.h: /usr/include/GNUstep/Foundation/NSString.h: /usr/include/GNUstep/Foundation/NSRange.h: ../SaxObjC/SaxAttributes.h: ../SaxObjC/SaxAttributeList.h: ../SaxObjC/SaxLocator.h: ../SaxObjC/SaxErrorHandler.h: SaxObjectModel.h: common.h: /usr/include/GNUstep/Foundation/Foundation.h: /usr/include/GNUstep/Foundation/FoundationErrors.h: /usr/include/GNUstep/Foundation/NSDebug.h: /usr/include/GNUstep/Foundation/NSProcessInfo.h: /usr/include/GNUstep/Foundation/NSAffineTransform.h: /usr/include/GNUstep/Foundation/NSGeometry.h: /usr/include/GNUstep/Foundation/NSArchiver.h: /usr/include/GNUstep/Foundation/NSCoder.h: /usr/include/GNUstep/Foundation/NSArray.h: /usr/include/GNUstep/Foundation/NSAttributedString.h: /usr/include/GNUstep/Foundation/NSDictionary.h: /usr/include/GNUstep/Foundation/NSAutoreleasePool.h: /usr/include/GNUstep/Foundation/NSBundle.h: /usr/include/GNUstep/Foundation/NSByteOrder.h: /usr/include/GNUstep/Foundation/NSCalendarDate.h: /usr/include/GNUstep/Foundation/NSCharacterSet.h: /usr/include/GNUstep/Foundation/NSClassDescription.h: /usr/include/GNUstep/Foundation/NSException.h: /usr/include/GNUstep/Foundation/NSComparisonPredicate.h: /usr/include/GNUstep/Foundation/NSExpression.h: /usr/include/GNUstep/Foundation/NSPredicate.h: /usr/include/GNUstep/Foundation/NSCompoundPredicate.h: /usr/include/GNUstep/Foundation/NSConnection.h: /usr/include/GNUstep/Foundation/NSTimer.h: /usr/include/GNUstep/Foundation/NSRunLoop.h: /usr/include/GNUstep/Foundation/NSMapTable.h: /usr/include/GNUstep/Foundation/NSData.h: /usr/include/GNUstep/Foundation/NSSerialization.h: /usr/include/GNUstep/Foundation/NSDateFormatter.h: /usr/include/GNUstep/Foundation/NSFormatter.h: /usr/include/GNUstep/Foundation/NSDecimalNumber.h: /usr/include/GNUstep/Foundation/NSDecimal.h: /usr/include/GNUstep/Foundation/NSValue.h: /usr/include/GNUstep/Foundation/NSDistantObject.h: /usr/include/GNUstep/Foundation/NSProxy.h: /usr/include/GNUstep/Foundation/NSDistributedLock.h: /usr/include/GNUstep/Foundation/NSDistributedNotificationCenter.h: /usr/include/GNUstep/Foundation/NSLock.h: /usr/include/GNUstep/Foundation/NSNotification.h: /usr/include/GNUstep/Foundation/NSEnumerator.h: /usr/include/GNUstep/Foundation/NSError.h: /usr/include/GNUstep/Foundation/NSFileHandle.h: /usr/include/GNUstep/Foundation/NSFileManager.h: /usr/include/GNUstep/Foundation/NSHashTable.h: /usr/include/GNUstep/Foundation/NSHost.h: /usr/include/GNUstep/Foundation/NSHTTPCookie.h: /usr/include/GNUstep/Foundation/NSHTTPCookieStorage.h: /usr/include/GNUstep/Foundation/NSIndexPath.h: /usr/include/GNUstep/Foundation/NSIndexSet.h: /usr/include/GNUstep/Foundation/NSInvocation.h: /usr/include/GNUstep/Foundation/NSMethodSignature.h: /usr/include/GNUstep/Foundation/NSKeyedArchiver.h: /usr/include/GNUstep/Foundation/NSPropertyList.h: /usr/include/GNUstep/Foundation/NSKeyValueCoding.h: /usr/include/GNUstep/Foundation/NSNotificationQueue.h: /usr/include/GNUstep/Foundation/NSNetServices.h: /usr/include/GNUstep/Foundation/NSNull.h: /usr/include/GNUstep/Foundation/NSNumberFormatter.h: /usr/include/GNUstep/Foundation/NSPathUtilities.h: /usr/include/GNUstep/Foundation/NSPortCoder.h: /usr/include/GNUstep/Foundation/NSPortMessage.h: /usr/include/GNUstep/Foundation/NSPort.h: /usr/include/GNUstep/Foundation/NSPortNameServer.h: /usr/include/GNUstep/Foundation/NSProtocolChecker.h: /usr/include/GNUstep/Foundation/NSScanner.h: /usr/include/GNUstep/Foundation/NSSet.h: /usr/include/GNUstep/Foundation/NSSortDescriptor.h: /usr/include/GNUstep/Foundation/NSSpellServer.h: /usr/include/GNUstep/Foundation/NSStream.h: /usr/include/GNUstep/Foundation/NSTask.h: /usr/include/GNUstep/Foundation/NSThread.h: /usr/include/GNUstep/Foundation/NSTimeZone.h: /usr/include/GNUstep/Foundation/NSUndoManager.h: /usr/include/GNUstep/Foundation/NSURLAuthenticationChallenge.h: /usr/include/GNUstep/Foundation/NSURLCache.h: /usr/include/GNUstep/Foundation/NSURLConnection.h: /usr/include/GNUstep/Foundation/NSURLCredential.h: /usr/include/GNUstep/Foundation/NSURLCredentialStorage.h: /usr/include/GNUstep/Foundation/NSURLDownload.h: /usr/include/GNUstep/Foundation/NSURLError.h: /usr/include/GNUstep/Foundation/NSURL.h: /usr/include/GNUstep/Foundation/NSURLHandle.h: /usr/include/GNUstep/Foundation/NSURLProtectionSpace.h: /usr/include/GNUstep/Foundation/NSURLProtocol.h: /usr/include/GNUstep/Foundation/NSURLRequest.h: /usr/include/GNUstep/Foundation/NSURLResponse.h: /usr/include/GNUstep/Foundation/NSUserDefaults.h: /usr/include/GNUstep/Foundation/NSValueTransformer.h: /usr/include/GNUstep/Foundation/NSXMLParser.h: SOPE/sope-xml/SaxObjC/shared_debug_obj/SaxDefaultHandler.d0000644000000000000000000000337312242733417022343 0ustar rootrootobj/SaxDefaultHandler.o: SaxDefaultHandler.m SaxDefaultHandler.h \ /usr/include/GNUstep/Foundation/NSObject.h \ /usr/include/GNUstep/Foundation/NSObjCRuntime.h \ /usr/include/GNUstep/GNUstepBase/GSVersionMacros.h \ /usr/include/GNUstep/GNUstepBase/preface.h \ /usr/include/GNUstep/GNUstepBase/objc-gnu2next.h \ /usr/include/GNUstep/GNUstepBase/GSConfig.h \ /usr/include/GNUstep/GNUstepBase/GSObjCRuntime.h \ /usr/include/GNUstep/Foundation/NSZone.h \ /usr/include/GNUstep/GNUstepBase/GNUstep.h \ /usr/include/GNUstep/Foundation/NSDate.h ../SaxObjC/SaxEntityResolver.h \ ../SaxObjC/SaxDTDHandler.h ../SaxObjC/SaxContentHandler.h \ /usr/include/GNUstep/Foundation/NSString.h \ /usr/include/GNUstep/Foundation/NSRange.h ../SaxObjC/SaxAttributes.h \ ../SaxObjC/SaxAttributeList.h ../SaxObjC/SaxLocator.h \ ../SaxObjC/SaxErrorHandler.h SaxException.h \ /usr/include/GNUstep/Foundation/NSException.h SaxDefaultHandler.h: /usr/include/GNUstep/Foundation/NSObject.h: /usr/include/GNUstep/Foundation/NSObjCRuntime.h: /usr/include/GNUstep/GNUstepBase/GSVersionMacros.h: /usr/include/GNUstep/GNUstepBase/preface.h: /usr/include/GNUstep/GNUstepBase/objc-gnu2next.h: /usr/include/GNUstep/GNUstepBase/GSConfig.h: /usr/include/GNUstep/GNUstepBase/GSObjCRuntime.h: /usr/include/GNUstep/Foundation/NSZone.h: /usr/include/GNUstep/GNUstepBase/GNUstep.h: /usr/include/GNUstep/Foundation/NSDate.h: ../SaxObjC/SaxEntityResolver.h: ../SaxObjC/SaxDTDHandler.h: ../SaxObjC/SaxContentHandler.h: /usr/include/GNUstep/Foundation/NSString.h: /usr/include/GNUstep/Foundation/NSRange.h: ../SaxObjC/SaxAttributes.h: ../SaxObjC/SaxAttributeList.h: ../SaxObjC/SaxLocator.h: ../SaxObjC/SaxErrorHandler.h: SaxException.h: /usr/include/GNUstep/Foundation/NSException.h: SOPE/sope-xml/SaxObjC/shared_debug_obj/SaxAttributes.d0000644000000000000000000002421112242733417021601 0ustar rootrootobj/SaxAttributes.o: SaxAttributes.m SaxAttributes.h \ /usr/include/GNUstep/Foundation/NSObject.h \ /usr/include/GNUstep/Foundation/NSObjCRuntime.h \ /usr/include/GNUstep/GNUstepBase/GSVersionMacros.h \ /usr/include/GNUstep/GNUstepBase/preface.h \ /usr/include/GNUstep/GNUstepBase/objc-gnu2next.h \ /usr/include/GNUstep/GNUstepBase/GSConfig.h \ /usr/include/GNUstep/GNUstepBase/GSObjCRuntime.h \ /usr/include/GNUstep/Foundation/NSZone.h \ /usr/include/GNUstep/GNUstepBase/GNUstep.h \ /usr/include/GNUstep/Foundation/NSDate.h ../SaxObjC/SaxAttributeList.h \ ../SaxObjC/SaxAttributes.h common.h \ /usr/include/GNUstep/Foundation/Foundation.h \ /usr/include/GNUstep/Foundation/FoundationErrors.h \ /usr/include/GNUstep/Foundation/NSDebug.h \ /usr/include/GNUstep/Foundation/NSProcessInfo.h \ /usr/include/GNUstep/Foundation/NSAffineTransform.h \ /usr/include/GNUstep/Foundation/NSGeometry.h \ /usr/include/GNUstep/Foundation/NSString.h \ /usr/include/GNUstep/Foundation/NSRange.h \ /usr/include/GNUstep/Foundation/NSArchiver.h \ /usr/include/GNUstep/Foundation/NSCoder.h \ /usr/include/GNUstep/Foundation/NSArray.h \ /usr/include/GNUstep/Foundation/NSAttributedString.h \ /usr/include/GNUstep/Foundation/NSDictionary.h \ /usr/include/GNUstep/Foundation/NSAutoreleasePool.h \ /usr/include/GNUstep/Foundation/NSBundle.h \ /usr/include/GNUstep/Foundation/NSByteOrder.h \ /usr/include/GNUstep/Foundation/NSCalendarDate.h \ /usr/include/GNUstep/Foundation/NSCharacterSet.h \ /usr/include/GNUstep/Foundation/NSClassDescription.h \ /usr/include/GNUstep/Foundation/NSException.h \ /usr/include/GNUstep/Foundation/NSComparisonPredicate.h \ /usr/include/GNUstep/Foundation/NSExpression.h \ /usr/include/GNUstep/Foundation/NSPredicate.h \ /usr/include/GNUstep/Foundation/NSCompoundPredicate.h \ /usr/include/GNUstep/Foundation/NSConnection.h \ /usr/include/GNUstep/Foundation/NSTimer.h \ /usr/include/GNUstep/Foundation/NSRunLoop.h \ /usr/include/GNUstep/Foundation/NSMapTable.h \ /usr/include/GNUstep/Foundation/NSData.h \ /usr/include/GNUstep/Foundation/NSSerialization.h \ /usr/include/GNUstep/Foundation/NSDateFormatter.h \ /usr/include/GNUstep/Foundation/NSFormatter.h \ /usr/include/GNUstep/Foundation/NSDecimalNumber.h \ /usr/include/GNUstep/Foundation/NSDecimal.h \ /usr/include/GNUstep/Foundation/NSValue.h \ /usr/include/GNUstep/Foundation/NSDistantObject.h \ /usr/include/GNUstep/Foundation/NSProxy.h \ /usr/include/GNUstep/Foundation/NSDistributedLock.h \ /usr/include/GNUstep/Foundation/NSDistributedNotificationCenter.h \ /usr/include/GNUstep/Foundation/NSLock.h \ /usr/include/GNUstep/Foundation/NSNotification.h \ /usr/include/GNUstep/Foundation/NSEnumerator.h \ /usr/include/GNUstep/Foundation/NSError.h \ /usr/include/GNUstep/Foundation/NSFileHandle.h \ /usr/include/GNUstep/Foundation/NSFileManager.h \ /usr/include/GNUstep/Foundation/NSHashTable.h \ /usr/include/GNUstep/Foundation/NSHost.h \ /usr/include/GNUstep/Foundation/NSHTTPCookie.h \ /usr/include/GNUstep/Foundation/NSHTTPCookieStorage.h \ /usr/include/GNUstep/Foundation/NSIndexPath.h \ /usr/include/GNUstep/Foundation/NSIndexSet.h \ /usr/include/GNUstep/Foundation/NSInvocation.h \ /usr/include/GNUstep/Foundation/NSMethodSignature.h \ /usr/include/GNUstep/Foundation/NSKeyedArchiver.h \ /usr/include/GNUstep/Foundation/NSPropertyList.h \ /usr/include/GNUstep/Foundation/NSKeyValueCoding.h \ /usr/include/GNUstep/Foundation/NSNotificationQueue.h \ /usr/include/GNUstep/Foundation/NSNetServices.h \ /usr/include/GNUstep/Foundation/NSNull.h \ /usr/include/GNUstep/Foundation/NSNumberFormatter.h \ /usr/include/GNUstep/Foundation/NSPathUtilities.h \ /usr/include/GNUstep/Foundation/NSPortCoder.h \ /usr/include/GNUstep/Foundation/NSPortMessage.h \ /usr/include/GNUstep/Foundation/NSPort.h \ /usr/include/GNUstep/Foundation/NSPortNameServer.h \ /usr/include/GNUstep/Foundation/NSProtocolChecker.h \ /usr/include/GNUstep/Foundation/NSScanner.h \ /usr/include/GNUstep/Foundation/NSSet.h \ /usr/include/GNUstep/Foundation/NSSortDescriptor.h \ /usr/include/GNUstep/Foundation/NSSpellServer.h \ /usr/include/GNUstep/Foundation/NSStream.h \ /usr/include/GNUstep/Foundation/NSTask.h \ /usr/include/GNUstep/Foundation/NSThread.h \ /usr/include/GNUstep/Foundation/NSTimeZone.h \ /usr/include/GNUstep/Foundation/NSUndoManager.h \ /usr/include/GNUstep/Foundation/NSURLAuthenticationChallenge.h \ /usr/include/GNUstep/Foundation/NSURLCache.h \ /usr/include/GNUstep/Foundation/NSURLConnection.h \ /usr/include/GNUstep/Foundation/NSURLCredential.h \ /usr/include/GNUstep/Foundation/NSURLCredentialStorage.h \ /usr/include/GNUstep/Foundation/NSURLDownload.h \ /usr/include/GNUstep/Foundation/NSURLError.h \ /usr/include/GNUstep/Foundation/NSURL.h \ /usr/include/GNUstep/Foundation/NSURLHandle.h \ /usr/include/GNUstep/Foundation/NSURLProtectionSpace.h \ /usr/include/GNUstep/Foundation/NSURLProtocol.h \ /usr/include/GNUstep/Foundation/NSURLRequest.h \ /usr/include/GNUstep/Foundation/NSURLResponse.h \ /usr/include/GNUstep/Foundation/NSUserDefaults.h \ /usr/include/GNUstep/Foundation/NSValueTransformer.h \ /usr/include/GNUstep/Foundation/NSXMLParser.h SaxAttributes.h: /usr/include/GNUstep/Foundation/NSObject.h: /usr/include/GNUstep/Foundation/NSObjCRuntime.h: /usr/include/GNUstep/GNUstepBase/GSVersionMacros.h: /usr/include/GNUstep/GNUstepBase/preface.h: /usr/include/GNUstep/GNUstepBase/objc-gnu2next.h: /usr/include/GNUstep/GNUstepBase/GSConfig.h: /usr/include/GNUstep/GNUstepBase/GSObjCRuntime.h: /usr/include/GNUstep/Foundation/NSZone.h: /usr/include/GNUstep/GNUstepBase/GNUstep.h: /usr/include/GNUstep/Foundation/NSDate.h: ../SaxObjC/SaxAttributeList.h: ../SaxObjC/SaxAttributes.h: common.h: /usr/include/GNUstep/Foundation/Foundation.h: /usr/include/GNUstep/Foundation/FoundationErrors.h: /usr/include/GNUstep/Foundation/NSDebug.h: /usr/include/GNUstep/Foundation/NSProcessInfo.h: /usr/include/GNUstep/Foundation/NSAffineTransform.h: /usr/include/GNUstep/Foundation/NSGeometry.h: /usr/include/GNUstep/Foundation/NSString.h: /usr/include/GNUstep/Foundation/NSRange.h: /usr/include/GNUstep/Foundation/NSArchiver.h: /usr/include/GNUstep/Foundation/NSCoder.h: /usr/include/GNUstep/Foundation/NSArray.h: /usr/include/GNUstep/Foundation/NSAttributedString.h: /usr/include/GNUstep/Foundation/NSDictionary.h: /usr/include/GNUstep/Foundation/NSAutoreleasePool.h: /usr/include/GNUstep/Foundation/NSBundle.h: /usr/include/GNUstep/Foundation/NSByteOrder.h: /usr/include/GNUstep/Foundation/NSCalendarDate.h: /usr/include/GNUstep/Foundation/NSCharacterSet.h: /usr/include/GNUstep/Foundation/NSClassDescription.h: /usr/include/GNUstep/Foundation/NSException.h: /usr/include/GNUstep/Foundation/NSComparisonPredicate.h: /usr/include/GNUstep/Foundation/NSExpression.h: /usr/include/GNUstep/Foundation/NSPredicate.h: /usr/include/GNUstep/Foundation/NSCompoundPredicate.h: /usr/include/GNUstep/Foundation/NSConnection.h: /usr/include/GNUstep/Foundation/NSTimer.h: /usr/include/GNUstep/Foundation/NSRunLoop.h: /usr/include/GNUstep/Foundation/NSMapTable.h: /usr/include/GNUstep/Foundation/NSData.h: /usr/include/GNUstep/Foundation/NSSerialization.h: /usr/include/GNUstep/Foundation/NSDateFormatter.h: /usr/include/GNUstep/Foundation/NSFormatter.h: /usr/include/GNUstep/Foundation/NSDecimalNumber.h: /usr/include/GNUstep/Foundation/NSDecimal.h: /usr/include/GNUstep/Foundation/NSValue.h: /usr/include/GNUstep/Foundation/NSDistantObject.h: /usr/include/GNUstep/Foundation/NSProxy.h: /usr/include/GNUstep/Foundation/NSDistributedLock.h: /usr/include/GNUstep/Foundation/NSDistributedNotificationCenter.h: /usr/include/GNUstep/Foundation/NSLock.h: /usr/include/GNUstep/Foundation/NSNotification.h: /usr/include/GNUstep/Foundation/NSEnumerator.h: /usr/include/GNUstep/Foundation/NSError.h: /usr/include/GNUstep/Foundation/NSFileHandle.h: /usr/include/GNUstep/Foundation/NSFileManager.h: /usr/include/GNUstep/Foundation/NSHashTable.h: /usr/include/GNUstep/Foundation/NSHost.h: /usr/include/GNUstep/Foundation/NSHTTPCookie.h: /usr/include/GNUstep/Foundation/NSHTTPCookieStorage.h: /usr/include/GNUstep/Foundation/NSIndexPath.h: /usr/include/GNUstep/Foundation/NSIndexSet.h: /usr/include/GNUstep/Foundation/NSInvocation.h: /usr/include/GNUstep/Foundation/NSMethodSignature.h: /usr/include/GNUstep/Foundation/NSKeyedArchiver.h: /usr/include/GNUstep/Foundation/NSPropertyList.h: /usr/include/GNUstep/Foundation/NSKeyValueCoding.h: /usr/include/GNUstep/Foundation/NSNotificationQueue.h: /usr/include/GNUstep/Foundation/NSNetServices.h: /usr/include/GNUstep/Foundation/NSNull.h: /usr/include/GNUstep/Foundation/NSNumberFormatter.h: /usr/include/GNUstep/Foundation/NSPathUtilities.h: /usr/include/GNUstep/Foundation/NSPortCoder.h: /usr/include/GNUstep/Foundation/NSPortMessage.h: /usr/include/GNUstep/Foundation/NSPort.h: /usr/include/GNUstep/Foundation/NSPortNameServer.h: /usr/include/GNUstep/Foundation/NSProtocolChecker.h: /usr/include/GNUstep/Foundation/NSScanner.h: /usr/include/GNUstep/Foundation/NSSet.h: /usr/include/GNUstep/Foundation/NSSortDescriptor.h: /usr/include/GNUstep/Foundation/NSSpellServer.h: /usr/include/GNUstep/Foundation/NSStream.h: /usr/include/GNUstep/Foundation/NSTask.h: /usr/include/GNUstep/Foundation/NSThread.h: /usr/include/GNUstep/Foundation/NSTimeZone.h: /usr/include/GNUstep/Foundation/NSUndoManager.h: /usr/include/GNUstep/Foundation/NSURLAuthenticationChallenge.h: /usr/include/GNUstep/Foundation/NSURLCache.h: /usr/include/GNUstep/Foundation/NSURLConnection.h: /usr/include/GNUstep/Foundation/NSURLCredential.h: /usr/include/GNUstep/Foundation/NSURLCredentialStorage.h: /usr/include/GNUstep/Foundation/NSURLDownload.h: /usr/include/GNUstep/Foundation/NSURLError.h: /usr/include/GNUstep/Foundation/NSURL.h: /usr/include/GNUstep/Foundation/NSURLHandle.h: /usr/include/GNUstep/Foundation/NSURLProtectionSpace.h: /usr/include/GNUstep/Foundation/NSURLProtocol.h: /usr/include/GNUstep/Foundation/NSURLRequest.h: /usr/include/GNUstep/Foundation/NSURLResponse.h: /usr/include/GNUstep/Foundation/NSUserDefaults.h: /usr/include/GNUstep/Foundation/NSValueTransformer.h: /usr/include/GNUstep/Foundation/NSXMLParser.h: SOPE/sope-xml/SaxObjC/shared_debug_obj/SaxObjectModel.d0000644000000000000000000002402312242733420021635 0ustar rootrootobj/SaxObjectModel.o: SaxObjectModel.m SaxObjectModel.h \ /usr/include/GNUstep/Foundation/NSObject.h \ /usr/include/GNUstep/Foundation/NSObjCRuntime.h \ /usr/include/GNUstep/GNUstepBase/GSVersionMacros.h \ /usr/include/GNUstep/GNUstepBase/preface.h \ /usr/include/GNUstep/GNUstepBase/objc-gnu2next.h \ /usr/include/GNUstep/GNUstepBase/GSConfig.h \ /usr/include/GNUstep/GNUstepBase/GSObjCRuntime.h \ /usr/include/GNUstep/Foundation/NSZone.h \ /usr/include/GNUstep/GNUstepBase/GNUstep.h \ /usr/include/GNUstep/Foundation/NSDate.h common.h \ /usr/include/GNUstep/Foundation/Foundation.h \ /usr/include/GNUstep/Foundation/FoundationErrors.h \ /usr/include/GNUstep/Foundation/NSDebug.h \ /usr/include/GNUstep/Foundation/NSProcessInfo.h \ /usr/include/GNUstep/Foundation/NSAffineTransform.h \ /usr/include/GNUstep/Foundation/NSGeometry.h \ /usr/include/GNUstep/Foundation/NSString.h \ /usr/include/GNUstep/Foundation/NSRange.h \ /usr/include/GNUstep/Foundation/NSArchiver.h \ /usr/include/GNUstep/Foundation/NSCoder.h \ /usr/include/GNUstep/Foundation/NSArray.h \ /usr/include/GNUstep/Foundation/NSAttributedString.h \ /usr/include/GNUstep/Foundation/NSDictionary.h \ /usr/include/GNUstep/Foundation/NSAutoreleasePool.h \ /usr/include/GNUstep/Foundation/NSBundle.h \ /usr/include/GNUstep/Foundation/NSByteOrder.h \ /usr/include/GNUstep/Foundation/NSCalendarDate.h \ /usr/include/GNUstep/Foundation/NSCharacterSet.h \ /usr/include/GNUstep/Foundation/NSClassDescription.h \ /usr/include/GNUstep/Foundation/NSException.h \ /usr/include/GNUstep/Foundation/NSComparisonPredicate.h \ /usr/include/GNUstep/Foundation/NSExpression.h \ /usr/include/GNUstep/Foundation/NSPredicate.h \ /usr/include/GNUstep/Foundation/NSCompoundPredicate.h \ /usr/include/GNUstep/Foundation/NSConnection.h \ /usr/include/GNUstep/Foundation/NSTimer.h \ /usr/include/GNUstep/Foundation/NSRunLoop.h \ /usr/include/GNUstep/Foundation/NSMapTable.h \ /usr/include/GNUstep/Foundation/NSData.h \ /usr/include/GNUstep/Foundation/NSSerialization.h \ /usr/include/GNUstep/Foundation/NSDateFormatter.h \ /usr/include/GNUstep/Foundation/NSFormatter.h \ /usr/include/GNUstep/Foundation/NSDecimalNumber.h \ /usr/include/GNUstep/Foundation/NSDecimal.h \ /usr/include/GNUstep/Foundation/NSValue.h \ /usr/include/GNUstep/Foundation/NSDistantObject.h \ /usr/include/GNUstep/Foundation/NSProxy.h \ /usr/include/GNUstep/Foundation/NSDistributedLock.h \ /usr/include/GNUstep/Foundation/NSDistributedNotificationCenter.h \ /usr/include/GNUstep/Foundation/NSLock.h \ /usr/include/GNUstep/Foundation/NSNotification.h \ /usr/include/GNUstep/Foundation/NSEnumerator.h \ /usr/include/GNUstep/Foundation/NSError.h \ /usr/include/GNUstep/Foundation/NSFileHandle.h \ /usr/include/GNUstep/Foundation/NSFileManager.h \ /usr/include/GNUstep/Foundation/NSHashTable.h \ /usr/include/GNUstep/Foundation/NSHost.h \ /usr/include/GNUstep/Foundation/NSHTTPCookie.h \ /usr/include/GNUstep/Foundation/NSHTTPCookieStorage.h \ /usr/include/GNUstep/Foundation/NSIndexPath.h \ /usr/include/GNUstep/Foundation/NSIndexSet.h \ /usr/include/GNUstep/Foundation/NSInvocation.h \ /usr/include/GNUstep/Foundation/NSMethodSignature.h \ /usr/include/GNUstep/Foundation/NSKeyedArchiver.h \ /usr/include/GNUstep/Foundation/NSPropertyList.h \ /usr/include/GNUstep/Foundation/NSKeyValueCoding.h \ /usr/include/GNUstep/Foundation/NSNotificationQueue.h \ /usr/include/GNUstep/Foundation/NSNetServices.h \ /usr/include/GNUstep/Foundation/NSNull.h \ /usr/include/GNUstep/Foundation/NSNumberFormatter.h \ /usr/include/GNUstep/Foundation/NSPathUtilities.h \ /usr/include/GNUstep/Foundation/NSPortCoder.h \ /usr/include/GNUstep/Foundation/NSPortMessage.h \ /usr/include/GNUstep/Foundation/NSPort.h \ /usr/include/GNUstep/Foundation/NSPortNameServer.h \ /usr/include/GNUstep/Foundation/NSProtocolChecker.h \ /usr/include/GNUstep/Foundation/NSScanner.h \ /usr/include/GNUstep/Foundation/NSSet.h \ /usr/include/GNUstep/Foundation/NSSortDescriptor.h \ /usr/include/GNUstep/Foundation/NSSpellServer.h \ /usr/include/GNUstep/Foundation/NSStream.h \ /usr/include/GNUstep/Foundation/NSTask.h \ /usr/include/GNUstep/Foundation/NSThread.h \ /usr/include/GNUstep/Foundation/NSTimeZone.h \ /usr/include/GNUstep/Foundation/NSUndoManager.h \ /usr/include/GNUstep/Foundation/NSURLAuthenticationChallenge.h \ /usr/include/GNUstep/Foundation/NSURLCache.h \ /usr/include/GNUstep/Foundation/NSURLConnection.h \ /usr/include/GNUstep/Foundation/NSURLCredential.h \ /usr/include/GNUstep/Foundation/NSURLCredentialStorage.h \ /usr/include/GNUstep/Foundation/NSURLDownload.h \ /usr/include/GNUstep/Foundation/NSURLError.h \ /usr/include/GNUstep/Foundation/NSURL.h \ /usr/include/GNUstep/Foundation/NSURLHandle.h \ /usr/include/GNUstep/Foundation/NSURLProtectionSpace.h \ /usr/include/GNUstep/Foundation/NSURLProtocol.h \ /usr/include/GNUstep/Foundation/NSURLRequest.h \ /usr/include/GNUstep/Foundation/NSURLResponse.h \ /usr/include/GNUstep/Foundation/NSUserDefaults.h \ /usr/include/GNUstep/Foundation/NSValueTransformer.h \ /usr/include/GNUstep/Foundation/NSXMLParser.h SaxObjectModel.h: /usr/include/GNUstep/Foundation/NSObject.h: /usr/include/GNUstep/Foundation/NSObjCRuntime.h: /usr/include/GNUstep/GNUstepBase/GSVersionMacros.h: /usr/include/GNUstep/GNUstepBase/preface.h: /usr/include/GNUstep/GNUstepBase/objc-gnu2next.h: /usr/include/GNUstep/GNUstepBase/GSConfig.h: /usr/include/GNUstep/GNUstepBase/GSObjCRuntime.h: /usr/include/GNUstep/Foundation/NSZone.h: /usr/include/GNUstep/GNUstepBase/GNUstep.h: /usr/include/GNUstep/Foundation/NSDate.h: common.h: /usr/include/GNUstep/Foundation/Foundation.h: /usr/include/GNUstep/Foundation/FoundationErrors.h: /usr/include/GNUstep/Foundation/NSDebug.h: /usr/include/GNUstep/Foundation/NSProcessInfo.h: /usr/include/GNUstep/Foundation/NSAffineTransform.h: /usr/include/GNUstep/Foundation/NSGeometry.h: /usr/include/GNUstep/Foundation/NSString.h: /usr/include/GNUstep/Foundation/NSRange.h: /usr/include/GNUstep/Foundation/NSArchiver.h: /usr/include/GNUstep/Foundation/NSCoder.h: /usr/include/GNUstep/Foundation/NSArray.h: /usr/include/GNUstep/Foundation/NSAttributedString.h: /usr/include/GNUstep/Foundation/NSDictionary.h: /usr/include/GNUstep/Foundation/NSAutoreleasePool.h: /usr/include/GNUstep/Foundation/NSBundle.h: /usr/include/GNUstep/Foundation/NSByteOrder.h: /usr/include/GNUstep/Foundation/NSCalendarDate.h: /usr/include/GNUstep/Foundation/NSCharacterSet.h: /usr/include/GNUstep/Foundation/NSClassDescription.h: /usr/include/GNUstep/Foundation/NSException.h: /usr/include/GNUstep/Foundation/NSComparisonPredicate.h: /usr/include/GNUstep/Foundation/NSExpression.h: /usr/include/GNUstep/Foundation/NSPredicate.h: /usr/include/GNUstep/Foundation/NSCompoundPredicate.h: /usr/include/GNUstep/Foundation/NSConnection.h: /usr/include/GNUstep/Foundation/NSTimer.h: /usr/include/GNUstep/Foundation/NSRunLoop.h: /usr/include/GNUstep/Foundation/NSMapTable.h: /usr/include/GNUstep/Foundation/NSData.h: /usr/include/GNUstep/Foundation/NSSerialization.h: /usr/include/GNUstep/Foundation/NSDateFormatter.h: /usr/include/GNUstep/Foundation/NSFormatter.h: /usr/include/GNUstep/Foundation/NSDecimalNumber.h: /usr/include/GNUstep/Foundation/NSDecimal.h: /usr/include/GNUstep/Foundation/NSValue.h: /usr/include/GNUstep/Foundation/NSDistantObject.h: /usr/include/GNUstep/Foundation/NSProxy.h: /usr/include/GNUstep/Foundation/NSDistributedLock.h: /usr/include/GNUstep/Foundation/NSDistributedNotificationCenter.h: /usr/include/GNUstep/Foundation/NSLock.h: /usr/include/GNUstep/Foundation/NSNotification.h: /usr/include/GNUstep/Foundation/NSEnumerator.h: /usr/include/GNUstep/Foundation/NSError.h: /usr/include/GNUstep/Foundation/NSFileHandle.h: /usr/include/GNUstep/Foundation/NSFileManager.h: /usr/include/GNUstep/Foundation/NSHashTable.h: /usr/include/GNUstep/Foundation/NSHost.h: /usr/include/GNUstep/Foundation/NSHTTPCookie.h: /usr/include/GNUstep/Foundation/NSHTTPCookieStorage.h: /usr/include/GNUstep/Foundation/NSIndexPath.h: /usr/include/GNUstep/Foundation/NSIndexSet.h: /usr/include/GNUstep/Foundation/NSInvocation.h: /usr/include/GNUstep/Foundation/NSMethodSignature.h: /usr/include/GNUstep/Foundation/NSKeyedArchiver.h: /usr/include/GNUstep/Foundation/NSPropertyList.h: /usr/include/GNUstep/Foundation/NSKeyValueCoding.h: /usr/include/GNUstep/Foundation/NSNotificationQueue.h: /usr/include/GNUstep/Foundation/NSNetServices.h: /usr/include/GNUstep/Foundation/NSNull.h: /usr/include/GNUstep/Foundation/NSNumberFormatter.h: /usr/include/GNUstep/Foundation/NSPathUtilities.h: /usr/include/GNUstep/Foundation/NSPortCoder.h: /usr/include/GNUstep/Foundation/NSPortMessage.h: /usr/include/GNUstep/Foundation/NSPort.h: /usr/include/GNUstep/Foundation/NSPortNameServer.h: /usr/include/GNUstep/Foundation/NSProtocolChecker.h: /usr/include/GNUstep/Foundation/NSScanner.h: /usr/include/GNUstep/Foundation/NSSet.h: /usr/include/GNUstep/Foundation/NSSortDescriptor.h: /usr/include/GNUstep/Foundation/NSSpellServer.h: /usr/include/GNUstep/Foundation/NSStream.h: /usr/include/GNUstep/Foundation/NSTask.h: /usr/include/GNUstep/Foundation/NSThread.h: /usr/include/GNUstep/Foundation/NSTimeZone.h: /usr/include/GNUstep/Foundation/NSUndoManager.h: /usr/include/GNUstep/Foundation/NSURLAuthenticationChallenge.h: /usr/include/GNUstep/Foundation/NSURLCache.h: /usr/include/GNUstep/Foundation/NSURLConnection.h: /usr/include/GNUstep/Foundation/NSURLCredential.h: /usr/include/GNUstep/Foundation/NSURLCredentialStorage.h: /usr/include/GNUstep/Foundation/NSURLDownload.h: /usr/include/GNUstep/Foundation/NSURLError.h: /usr/include/GNUstep/Foundation/NSURL.h: /usr/include/GNUstep/Foundation/NSURLHandle.h: /usr/include/GNUstep/Foundation/NSURLProtectionSpace.h: /usr/include/GNUstep/Foundation/NSURLProtocol.h: /usr/include/GNUstep/Foundation/NSURLRequest.h: /usr/include/GNUstep/Foundation/NSURLResponse.h: /usr/include/GNUstep/Foundation/NSUserDefaults.h: /usr/include/GNUstep/Foundation/NSValueTransformer.h: /usr/include/GNUstep/Foundation/NSXMLParser.h: SOPE/sope-xml/SaxObjC/SaxNamespaceSupport.h0000644000000000000000000000754412242733417017514 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __SaxNamespaceSupport_H__ #define __SaxNamespaceSupport_H__ #import @class NSString, NSEnumerator, NSArray; /* New in SAX2, defined in helpers/NamespaceSupport Encapsulate Namespace logic for use by SAX drivers. This class encapsulates the logic of Namespace processing: it tracks the declarations currently in force for each context and automatically processing raw XML 1.0 names into their Namespace parts. Namespace support objects are reusable, but the reset method must be invoked between each session. Here is a simple session: String parts[] = new String[3]; SaxNamespaceSupport support; support = [[SaxNamespaceSupport alloc] init]; [support pushContext]; [support declarePrefix:@"" uri:@"http://www.w3.org/1999/xhtml"]; [support declarePrefix:@"dc" uri:@"http://www.purl.org/dc#"]; String parts[] = support.processName("p", parts, false); System.out.println("Namespace URI: " + parts[0]); System.out.println("Local name: " + parts[1]); System.out.println("Raw name: " + parts[2]); String parts[] = support.processName("dc:title", parts, false); System.out.println("Namespace URI: " + parts[0]); System.out.println("Local name: " + parts[1]); System.out.println("Raw name: " + parts[2]); [support popContext]; Note that this class is optimized for the use case where most elements do not contain Namespace declarations: if the same prefix/URI mapping is repeated for each context (for example), this class will be somewhat less efficient. */ extern NSString *SaxXMLNS; @interface SaxNamespaceSupport : NSObject { @private } /* start a new ns context */ - (void)pushContext; /* revert to previous ns context */ - (void)popContext; /* Declare a Namespace prefix. */ - (BOOL)declarePrefix:(NSString *)_prefix uri:(NSString *)_uri; /* Return an enumeration of all prefixes declared in this context. */ - (NSEnumerator *)prefixEnumerator; /* Look up a prefix and get the currently-mapped Namespace URI. */ - (NSString *)getUriForPrefix:(NSString *)_prefix; /* Reset this Namespace support object for reuse. */ - (void)reset; /* Process a raw XML 1.0 name. This method processes a raw XML 1.0 name in the current context by removing the prefix and looking it up among the prefixes currently declared. The return value will be the array supplied by the caller, filled in as follows: parts[0] The Namespace URI, or an empty string if none is in use. parts[1] The local name (without prefix). parts[2] The original raw name. All of the strings in the array will be internalized. If the raw name has a prefix that has not been declared, then the return value will be null. Note that attribute names are processed differently than element names: an unprefixed element name will received the default Namespace (if any), while an unprefixed element name will not. */ - (NSArray *)processName:(NSString *)_rawName parts:(NSArray *)_parts isAttribute:(BOOL)_isAttribute; @end #endif /* __SaxNamespaceSupport_H__ */ SOPE/sope-xml/SaxObjC/common.h0000644000000000000000000000225212242733417015026 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __SaxObjC_common_H__ #define __SaxObjC_common_H__ #import #ifndef ASSIGN # define ASSIGN(object, value) \ ({id __object = (id)object; \ id __value = (id)value; \ if (__value != __object) { if (__value) [__value retain]; \ if (__object) [__object release]; \ object = __value;}}) #endif #endif /* __SaxObjC_common_H__ */ SOPE/sope-xml/SaxObjC/SaxObjectDecoder.h0000644000000000000000000000331412242733417016706 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __SaxObjC_SaxObjectDecoder_H__ #define __SaxObjC_SaxObjectDecoder_H__ #include /* This SAX handler takes a model dictionary and maps the SAX events to object construction commands. [to be done: further description of format and function] */ @class SaxObjectModel; @interface SaxObjectDecoder : SaxDefaultHandler { id locator; id rootObject; id mapping; NSMutableArray *infoStack; NSMutableArray *mappingStack; NSMutableArray *objectStack; } - (id)initWithMappingModel:(SaxObjectModel *)_model; - (id)initWithMappingAtPath:(NSString *)_path; - (id)initWithMappingNamed:(NSString *)_name; /* parse results */ - (id)rootObject; /* cleanup */ - (void)reset; @end @interface NSObject(SaxObjectCoding) - (id)initWithSaxDecoder:(SaxObjectDecoder *)_decoder; - (id)awakeAfterUsingSaxDecoder:(SaxObjectDecoder *)_decoder; @end #endif /* __SaxObjC_SaxObjectDecoder_H__ */ SOPE/sope-xml/SaxObjC/SaxXMLFilter.h0000644000000000000000000000317212242733417016022 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __SaxXMLFilter_H__ #define __SaxXMLFilter_H__ #import #include /* new in SAX 2.0beta */ @protocol SaxXMLFilter < SaxXMLReader > - (void)setParent:(id)_parent; - (id)parent; @end #include "SaxEntityResolver.h" #include "SaxDTDHandler.h" #include "SaxContentHandler.h" #include "SaxErrorHandler.h" @interface SaxXMLFilter : NSObject < SaxXMLFilter, SaxEntityResolver, SaxDTDHandler, SaxContentHandler, SaxErrorHandler > { @private id parent; id contentHandler; id dtdHandler; id errorHandler; id entityResolver; } - (id)initWithParent:(id)_parent; @end #endif /* __SaxXMLFilter_H__ */ SOPE/sope-xml/SaxObjC/Version0000644000000000000000000000004512242733417014733 0ustar rootroot# version file SUBMINOR_VERSION:=66 SOPE/sope-xml/SaxObjC/SaxLocator.m0000644000000000000000000000367312242733417015632 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "SaxLocator.h" #include "common.h" @implementation SaxLocator - (id)init { return self; } - (id)initWithLocator:(id)_locator { if ((self = [self init])) { self->column = [_locator columnNumber]; self->line = [_locator lineNumber]; self->pubId = [[_locator publicId] copy]; self->sysId = [[_locator systemId] copy]; } return self; } - (void)dealloc { [self->pubId release]; [self->sysId release]; [super dealloc]; } /* accessors */ - (void)setColumnNumber:(NSInteger)_col { self->column = _col; } - (NSInteger)columnNumber { return self->column; } - (void)setLineNumber:(NSInteger)_line { self->line = _line; } - (NSInteger)lineNumber { return self->line; } - (void)setPublicId:(NSString *)_pubId { id o = self->pubId; self->pubId = [_pubId copy]; [o release]; } - (NSString *)publicId { return self->pubId; } - (void)setSystemId:(NSString *)_sysId { id o = self->sysId; self->sysId = [_sysId copy]; [o release]; } - (NSString *)systemId { return self->sysId; } /* NSCopying */ - (id)copyWithZone:(NSZone *)_zone { return [[[self class] allocWithZone:_zone] initWithLocator:self]; } @end /* SaxLocator */ SOPE/sope-xml/SaxObjC/XMLNamespaces.h0000644000000000000000000002016212242733417016176 0ustar rootroot/* Copyright (C) 2000-2007 SKYRIX Software AG Copyright (C) 2007 Helge Hess This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __SaxObjC_XML_Namespaces_H__ #define __SaxObjC_XML_Namespaces_H__ #ifndef XMLNS_OD_BIND # define XMLNS_OD_BIND @"http://www.skyrix.com/od/binding" #endif #ifndef XMLNS_OD_CONST # define XMLNS_OD_CONST @"http://www.skyrix.com/od/constant" #endif #ifndef XMLNS_OD_ACTION # define XMLNS_OD_ACTION @"http://www.skyrix.com/od/action" #endif #ifndef XMLNS_OD_EVALJS # define XMLNS_OD_EVALJS @"http://www.skyrix.com/od/javascript" #endif #ifndef XMLNS_XHTML # define XMLNS_XHTML @"http://www.w3.org/1999/xhtml" #endif #ifndef XMLNS_HTML40 # define XMLNS_HTML40 @"http://www.w3.org/TR/REC-html40" #endif #ifndef XMLNS_XLINK # define XMLNS_XLINK @"http://www.w3.org/1999/xlink" #endif #ifndef XMLNS_XSLT # define XMLNS_XSLT @"http://www.w3.org/1999/XSL/Transform" #endif #ifndef XMLNS_XSL_FO # define XMLNS_XSL_FO @"http://www.w3.org/1999/XSL/Format" #endif #ifndef XMLNS_RDF # define XMLNS_RDF \ @"http://www.w3.org/1999/02/22-rdf-syntax-ns#" #endif #ifndef XMLNS_XUL # define XMLNS_XUL \ @"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" #endif #ifndef XMLNS_XFORMS # define XMLNS_XFORMS @"http://www.w3.org/2001/06/xforms" #endif #ifndef XMLNS_SVG # define XMLNS_SVG @"http://www.w3.org/2000/svg" #endif #ifndef XMLNS_MATHML # define XMLNS_MATHML @"http://www.w3.org/1998/Math/MathML" #endif #ifndef XMLNS_WML12 # define XMLNS_WML12 @"http://www.wapforum.org/DTD/wml_1.2.xml" #endif #ifndef XMLNS_XUPDATE # define XMLNS_XUPDATE @"http://www.xmldb.org/xupdate" #endif #ifndef XMLNS_WEBDAV # define XMLNS_WEBDAV @"DAV:" #endif #ifndef XMLNS_XCAL_01 # define XMLNS_XCAL_01 \ @"http://www.ietf.org/internet-drafts/draft-ietf-calsch-many-xcal-01.txt" #endif #ifndef XMLNS_RELAXNG_STRUCTURE # define XMLNS_RELAXNG_STRUCTURE @"http://relaxng.org/ns/structure/1.0" #endif #ifndef XMLNS_XINCLUDE # define XMLNS_XINCLUDE @"http://www.w3.org/2001/XInclude" #endif #ifndef XMLNS_KUPU # define XMLNS_KUPU @"http://kupu.oscom.org/namespaces/dist" #endif /* Microsoft related namespaces */ #ifndef XMLNS_MS_OFFICE_WORDML # define XMLNS_MS_OFFICE_WORDML \ @"http://schemas.microsoft.com/office/word/2003/wordml" #endif #ifndef XMLNS_MS_OFFICE_OFFICE # define XMLNS_MS_OFFICE_OFFICE @"urn:schemas-microsoft-com:office:office" #endif #ifndef XMLNS_MS_OFFICE_WORD # define XMLNS_MS_OFFICE_WORD @"urn:schemas-microsoft-com:office:word" #endif #ifndef XMLNS_MS_HOTMAIL # define XMLNS_MS_HOTMAIL @"http://schemas.microsoft.com/hotmail/" #endif #ifndef XMLNS_MS_HTTPMAIL # define XMLNS_MS_HTTPMAIL @"urn:schemas:httpmail:" #endif #ifndef XMLNS_MS_EXCHANGE # define XMLNS_MS_EXCHANGE @"http://schemas.microsoft.com/exchange/" #endif #ifndef XMLNS_MS_EX_CALENDAR # define XMLNS_MS_EX_CALENDAR @"urn:schemas:calendar:" #endif #ifndef XMLNS_MS_EX_CONTACTS # define XMLNS_MS_EX_CONTACTS @"urn:schemas:contacts:" #endif /* WebDAV related namespaces */ #ifndef XMLNS_WEBDAV_APACHE # define XMLNS_WEBDAV_APACHE @"http://apache.org/dav/props/" #endif #ifndef XMLNS_CADAVER_PROPS # define XMLNS_CADAVER_PROPS @"http://webdav.org/cadaver/custom-properties/" #endif #ifndef XMLNS_NAUTILUS_PROPS # define XMLNS_NAUTILUS_PROPS @"http://services.eazel.com/namespaces" #endif /* OpenOffice.org namespaces */ #ifndef XMLNS_OOo_UCB_WEBDAV # define XMLNS_OOo_UCB_WEBDAV @"http://ucb.openoffice.org/dav/props/" #endif #ifndef XMLNS_OOo_MANIFEST # define XMLNS_OOo_MANIFEST @"http://openoffice.org/2001/manifest" #endif #ifndef XMLNS_OOo_OFFICE # define XMLNS_OOo_OFFICE @"http://openoffice.org/2000/office" #endif #ifndef XMLNS_OOo_TEXT # define XMLNS_OOo_TEXT @"http://openoffice.org/2000/text" #endif #ifndef XMLNS_OOo_META # define XMLNS_OOo_META @"http://openoffice.org/2000/meta" #endif #ifndef XMLNS_OOo_STYLE # define XMLNS_OOo_STYLE @"http://openoffice.org/2000/style" #endif #ifndef XMLNS_OOo_TABLE # define XMLNS_OOo_TABLE @"http://openoffice.org/2000/table" #endif #ifndef XMLNS_OOo_DRAWING # define XMLNS_OOo_DRAWING @"http://openoffice.org/2000/drawing" #endif #ifndef XMLNS_OOo_DATASTYLE # define XMLNS_OOo_DATASTYLE @"http://openoffice.org/2000/datastyle" #endif #ifndef XMLNS_OOo_PRESENTATION # define XMLNS_OOo_PRESENTATION @"http://openoffice.org/2000/presentation" #endif #ifndef XMLNS_OOo_CHART # define XMLNS_OOo_CHART @"http://openoffice.org/2000/chart" #endif #ifndef XMLNS_OOo_DRAW3D # define XMLNS_OOo_DRAW3D @"http://openoffice.org/2000/dr3d" #endif #ifndef XMLNS_OOo_FORM # define XMLNS_OOo_FORM @"http://openoffice.org/2000/form" #endif #ifndef XMLNS_OOo_SCRIPT # define XMLNS_OOo_SCRIPT @"http://openoffice.org/2000/script" #endif #ifndef XMLNS_DublinCore # define XMLNS_DublinCore @"http://purl.org/dc/elements/1.1/" #endif #ifndef XMLNS_PROPRIETARY_SLOX # define XMLNS_PROPRIETARY_SLOX @"SLOX:" #endif /* Zope */ #ifndef XMLNS_Zope_TAL # define XMLNS_Zope_TAL @"http://xml.zope.org/namespaces/tal" #endif #ifndef XMLNS_Zope_METAL # define XMLNS_Zope_METAL @"http://xml.zope.org/namespaces/metal" #endif /* SOAP */ #ifndef XMLNS_SOAP_ENVELOPE # define XMLNS_SOAP_ENVELOPE @"http://schemas.xmlsoap.org/soap/envelope/" #endif #ifndef XMLNS_SOAP_ENCODING # define XMLNS_SOAP_ENCODING @"http://schemas.xmlsoap.org/soap/encoding/" #endif #ifndef XMLNS_XMLSchema # define XMLNS_XMLSchema @"http://www.w3.org/1999/XMLSchema" #endif #ifndef XMLNS_XMLSchemaInstance1999 # define XMLNS_XMLSchemaInstance1999 \ @"http://www.w3.org/1999/XMLSchema-instance" #endif #ifndef XMLNS_XMLSchemaInstance2001 # define XMLNS_XMLSchemaInstance2001 \ @"http://www.w3.org/2001/XMLSchema-instance" #endif /* Novell */ #ifndef XMLNS_Novell_NCSP_Types # define XMLNS_Novell_NCSP_Types \ @"http://schemas.novell.com/2003/10/NCSP/types.xsd" #endif #ifndef XMLNS_Novell_NCSP_Methods # define XMLNS_Novell_NCSP_Methods \ @"http://schemas.novell.com/2003/10/NCSP/methods.xsd" #endif /* XML vCards */ #ifndef XMLNS_VCARD_XML_03 # define XMLNS_VCARD_XML_03 \ @"http://www.ietf.org/internet-drafts/draft-dawson-vcard-xml-dtd-03.txt" #endif /* ATOM */ #ifndef XMLNS_ATOM_2005 # define XMLNS_ATOM_2005 @"http://www.w3.org/2005/Atom" #endif /* Google */ #ifndef XMLNS_GOOGLE_2005 # define XMLNS_GOOGLE_2005 @"http://schemas.google.com/g/2005" #endif #ifndef XMLNS_GOOGLE_CAL_2005 # define XMLNS_GOOGLE_CAL_2005 @"http://schemas.google.com/gCal/2005" #endif #ifndef XMLNS_OPENSEARCH_RSS # define XMLNS_OPENSEARCH_RSS @"http://a9.com/-/spec/opensearchrss/1.0/" #endif /* GroupDAV */ #ifndef XMLNS_GROUPDAV # define XMLNS_GROUPDAV @"http://groupdav.org/" #endif /* CalDAV / CardDAV */ #ifndef XMLNS_CALDAV # define XMLNS_CALDAV @"urn:ietf:params:xml:ns:caldav" #endif #ifndef XMLNS_CARDDAV # define XMLNS_CARDDAV @"urn:ietf:params:xml:ns:carddav" #endif /* Apple CalServer */ #ifndef XMLNS_AppleCalServer # define XMLNS_AppleCalServer @"http://apple.com/ns/calendarserver/" #endif #ifndef XMLNS_CalendarServerOrg # define XMLNS_CalendarServerOrg @"http://calendarserver.org/ns/" #endif #ifndef XMLNS_AppleCalApp # define XMLNS_AppleCalApp @"com.apple.ical:" #endif /* Adobe */ #ifndef XMLNS_MXML_2006 # define XMLNS_MXML_2006 @"http://www.adobe.com/2006/mxml" #endif #endif /* __SaxObjC_XML_Namespaces_H__ */ SOPE/sope-xml/SaxObjC/SaxObjectModel.h0000644000000000000000000000473612242733417016412 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __SaxObjC_SaxObjectModel_H__ #define __SaxObjC_SaxObjectModel_H__ #import @class NSDictionary, NSString, NSArray; @class SaxTagModel; @interface SaxObjectModel : NSObject { NSDictionary *nsToModel; } + (id)modelWithName:(NSString *)_name; + (id)modelWithContentsOfFile:(NSString *)_path; + (NSString *)libraryDriversSubDir; - (id)initWithDictionary:(NSDictionary *)_dict; /* queries */ - (SaxTagModel *)modelForTag:(NSString *)_localName namespace:(NSString *)_ns; @end @interface SaxNamespaceModel : NSObject { NSDictionary *tagToModel; } /* queries */ - (SaxTagModel *)modelForTag:(NSString *)_localName; @end @interface SaxTagModel : NSObject { NSString *className; NSString *key; NSString *tagKey; /* the key to store the tag name under */ NSString *namespaceKey; /* the key to store the namespace uri under */ NSString *parentKey; /* the key to store the parent object under */ NSString *contentKey; /* the key to store the cdata content under */ NSArray *toManyRelationshipKeys; NSDictionary *defaultValues; NSDictionary *tagToKey; NSDictionary *attrToKey; } /* accessors */ - (NSString *)className; - (NSString *)key; - (NSString *)tagKey; - (NSString *)namespaceKey; - (NSString *)parentKey; - (NSString *)contentKey; - (NSDictionary *)defaultValues; - (NSString *)propertyKeyForChildTag:(NSString *)_tag; - (BOOL)isToManyKey:(NSString *)_key; - (NSArray *)toManyRelationshipKeys; - (NSArray *)attributeKeys; - (NSString *)propertyKeyForAttribute:(NSString *)_attr; /* object operations */ - (void)addValue:(id)_val toPropertyWithKey:(NSString *)_key ofObject:(id)_obj; @end #endif /* __SaxObjC_SaxObjectModel_H__ */ SOPE/sope-xml/SaxObjC/SxXML-SaxObjC.graffle0000644000000000000000000014253512242733417017170 0ustar rootroot CanvasColor w 1.000000e+00 ColumnAlign 0 ColumnSpacing 5.400000e+01 GraphDocumentVersion 2 GraphicsList Bounds {{12, 477}, {98, 18}} Class ShapedGraphic FitText YES ID 1101 Shape Rectangle Style fill Draws NO shadow Draws NO stroke Draws NO Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 libxmlSAXDriver} Bounds {{9, 10}, {112, 36}} Class ShapedGraphic FitText YES ID 1100 Shape Rectangle Style fill Draws NO shadow Draws NO stroke Draws NO Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica-BoldOblique;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\i\b\fs48 \cf0 SaxObjC} Bounds {{9, 459}, {702, 1}} Class ShapedGraphic ID 1099 Shape Rectangle Class Group Graphics Bounds {{27, 81}, {131, 18}} Class ShapedGraphic ID 1073 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/SaxObjC/SaxDocumentHandler.h Shape Rectangle Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica-Oblique;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\i\fs24 \cf0 SaxDocumentHandler} Bounds {{202, 81}, {104, 18}} Class ShapedGraphic ID 1074 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/SaxObjC/SaxHandlerBase.h Shape Rectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 SaxHandlerBase} Class Group Graphics Bounds {{189, 306}, {135, 18}} Class ShapedGraphic ID 1076 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/SaxObjC/SaxMethodCallHandler.h Shape Rectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 SaxMethodCallHandler} Bounds {{202, 270}, {113, 18}} Class ShapedGraphic ID 1077 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/SaxObjC/SaxDefaultHandler.h Shape Rectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 SaxDefaultHandler} ID 1075 Class Group Graphics Bounds {{315, 180}, {90, 18}} Class ShapedGraphic ID 1079 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/SaxObjC/SaxXMLFilter.h Shape Rectangle Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica-Oblique;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\i\fs24 \cf0 SaxXMLFilter} Bounds {{207, 180}, {90, 18}} Class ShapedGraphic ID 1080 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/SaxObjC/SaxXMLFilter.h Shape Rectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 SaxXMLFilter} ID 1078 Bounds {{27, 180}, {131, 18}} Class ShapedGraphic ID 1081 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/SaxObjC/SaxEntityResolver.h Shape Rectangle Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica-Oblique;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\i\fs24 \cf0 SaxEntityResolver} Bounds {{27, 135}, {131, 18}} Class ShapedGraphic ID 1082 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/SaxObjC/SaxDTDHandler.h Shape Rectangle Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica-Oblique;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\i\fs24 \cf0 SaxDTDHandler} Bounds {{27, 270}, {131, 18}} Class ShapedGraphic ID 1083 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/SaxObjC/SaxContentHandler.h Shape Rectangle Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica-Oblique;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\i\fs24 \cf0 SaxContentHandler} Bounds {{27, 225}, {131, 18}} Class ShapedGraphic ID 1084 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/SaxObjC/SaxErrorHandler.h Shape Rectangle Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica-Oblique;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\i\fs24 \cf0 SaxErrorHandler} Class LineGraphic Head ID 1074 ID 1085 Points {107.182, 180} {239.318, 99} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 1081 Class LineGraphic Head ID 1074 ID 1086 Points {119.417, 135} {227.083, 99} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 1082 Class LineGraphic Head ID 1074 ID 1087 Points {158, 90} {202, 90} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 1073 Class LineGraphic Head ID 1074 ID 1088 Points {102.594, 225} {243.906, 99} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 1084 Class LineGraphic Head ID 1076 ID 1089 Points {258, 288} {257, 306} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 1077 Class LineGraphic Head ID 1077 ID 1090 Points {109.1, 198} {241.9, 270} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 1081 Class LineGraphic Head ID 1077 ID 1091 Points {103.567, 153} {247.433, 270} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 1082 Class LineGraphic Head ID 1077 ID 1092 Points {158, 279} {202, 279} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 1083 Class LineGraphic Head ID 1077 ID 1093 Points {125.7, 243} {225.3, 270} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 1084 Class LineGraphic Head ID 1080 ID 1094 Points {315, 189} {297, 189} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 1079 Class LineGraphic Head ID 1080 ID 1095 Points {158, 189} {207, 189} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 1081 Class LineGraphic Head ID 1080 ID 1096 Points {124.4, 153} {220.1, 180} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 1082 Class LineGraphic Head ID 1080 ID 1097 Points {108.45, 270} {236.05, 198} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 1083 Class LineGraphic Head ID 1080 ID 1098 Points {124.4, 225} {220.1, 198} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 1084 ID 1072 Bounds {{333, 504}, {130, 18}} Class ShapedGraphic ID 1071 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/libxmlSAXDriver/libxmlSAXDriver.h Shape Rectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 libxmlSAXDriver} Class Group Graphics Bounds {{603, 81}, {90, 18}} Class ShapedGraphic ID 1068 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/SaxObjC/SaxAttributes.h Shape Rectangle Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica-Oblique;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\i\fs24 \cf0 SaxAttributes} Bounds {{495, 81}, {90, 18}} Class ShapedGraphic ID 1069 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/SaxObjC/SaxAttributes.h Shape Rectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 SaxAttributes} Class LineGraphic Head ID 1069 ID 1070 Points {603, 90} {585, 90} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 1068 ID 1067 Bounds {{495, 504}, {108, 18}} Class ShapedGraphic ID 1066 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/libxmlSAXDriver/libxmlSAXLocator.h Shape Rectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 libxmlSAXLocator} Bounds {{193, 504}, {131, 18}} Class ShapedGraphic ID 1065 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/libxmlSAXDriver/libxmlDocSAXDriver.h Shape Rectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 libxmlDocSAXDriver} Class Group Graphics Bounds {{490, 207}, {86, 18}} Class ShapedGraphic ID 1058 Shape Rectangle Style fill Color b 5.000000e-01 g 1.000000e+00 r 1.000000e+00 Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NSException} Bounds {{508, 333}, {167, 18}} Class ShapedGraphic ID 1059 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/SaxObjC/SaxException.h Shape Rectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 SaxNotSupportedException} Bounds {{508, 279}, {167, 18}} Class ShapedGraphic ID 1060 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/SaxObjC/SaxException.h Shape Rectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 SaxParseException} Bounds {{486, 243}, {91, 18}} Class ShapedGraphic ID 1061 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/SaxObjC/SaxException.h Shape Rectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 SaxException} Bounds {{418, 306}, {167, 18}} Class ShapedGraphic ID 1062 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/SaxObjC/SaxException.h Shape Rectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 SaxNotRecognizedException} Class LineGraphic Head ID 1059 ID 1063 Points {537.5, 261} {585.5, 333} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 1061 Class LineGraphic Head ID 1060 ID 1064 Points {546.5, 261} {576.5, 279} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 1061 ID 1057 Bounds {{207, 423}, {99, 18}} Class ShapedGraphic ID 1056 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/SaxObjC/SaxXMLReader.h Shape Rectangle Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica-Oblique;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\i\fs24 \cf0 SaxXMLReader} Bounds {{54, 504}, {130, 18}} Class ShapedGraphic ID 1055 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/libxmlSAXDriver/libxmlHTMLSAXDriver.h Shape Rectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 libxmlHTMLSAXDriver} Bounds {{527, 153}, {167, 18}} Class ShapedGraphic ID 1054 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/SaxObjC/SaxXMLReaderFactory.h Shape Rectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 SaxXMLReaderFactory} Class Group Graphics Bounds {{265, 360}, {95, 18}} Class ShapedGraphic ID 1051 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/SaxObjC/SaxAttributeList.h Shape Rectangle Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica-Oblique;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\i\fs24 \cf0 SaxAttributeList} Bounds {{144, 360}, {103, 18}} Class ShapedGraphic ID 1052 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/SaxObjC/SaxAttributeList.h Shape Rectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 SaxAttributeList} Class LineGraphic Head ID 1052 ID 1053 Points {265, 369} {247, 369} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 1051 ID 1050 Bounds {{527, 126}, {167, 18}} Class ShapedGraphic ID 1049 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/SaxObjC/SaxNamespaceSupport.h Shape Rectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 SaxNamespaceSupport} Bounds {{495, 423}, {108, 18}} Class ShapedGraphic ID 1048 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/SaxObjC/SaxLocator.h Shape Rectangle Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica-Oblique;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\i\fs24 \cf0 SaxLocator} Bounds {{396, 423}, {81, 18}} Class ShapedGraphic ID 1047 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/SaxObjC/SaxLocator.h Shape Rectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 SaxLocator} Class LineGraphic Head ID 1071 ID 1046 Points {272.222, 441} {382.278, 504} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 1056 Class LineGraphic Head ID 1066 ID 1045 Points {549, 441} {549, 504} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 1048 Class LineGraphic Head ID 1065 ID 1044 Points {256.722, 441} {258.278, 504} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 1056 Class LineGraphic Head ID 1061 ID 1043 Points {532.625, 225} {531.875, 243} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 1058 Class LineGraphic Head ID 1055 ID 1042 Points {241.222, 441} {134.278, 504} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 1056 Class LineGraphic Head ID 1062 ID 1041 Points {527.214, 261} {505.786, 306} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 1061 Class LineGraphic Head ID 1047 ID 1040 Points {495, 432} {477, 432} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 1048 GridInfo HPages 1 ImageCounter 1 IsPalette NO Layers Lock NO Name Layer 1 Print YES View YES LayoutInfo AutoAdjust YES HierarchicalOrientation 0 MagneticFieldCenter {0, 0} MagnetsEnabled YES PageBreakColor w 3.333333e-01 PageBreaks YES PageSetup BAt0eXBlZHN0cmVhbYED6IQBQISEhAtOU1ByaW50SW5mbwGEhAhOU09iamVjdACFkoSE hBNOU011dGFibGVEaWN0aW9uYXJ5AISEDE5TRGljdGlvbmFyeQCUhAFpEpKEhIQITlNT dHJpbmcBlIQBKxBOU0pvYkRpc3Bvc2l0aW9uhpKEmZkPTlNQcmludFNwb29sSm9ihpKE mZkOTlNCb3R0b21NYXJnaW6GkoSEhAhOU051bWJlcgCEhAdOU1ZhbHVlAJSEASqEhAFm nSSGkoSZmQtOU1BhcGVyTmFtZYaShJmZBkxldHRlcoaShJmZD05TUHJpbnRBbGxQYWdl c4aShJ2chIQBc54AhpKEmZkNTlNSaWdodE1hcmdpboaShJ2cn50khpKEmZkITlNDb3Bp ZXOGkoSdnISEAVOfAYaShJmZD05TU2NhbGluZ0ZhY3RvcoaShJ2chIQBZKABhpKEmZkL TlNGaXJzdFBhZ2WGkoSdnKmfAYaShJmZFE5TVmVydGljYWxQYWdpbmF0aW9uhpKEnZyk ngCGkoSZmRVOU0hvcml6b25hbFBhZ2luYXRpb26GkoSdnKSeAIaShJmZFk5TSG9yaXpv bnRhbGx5Q2VudGVyZWSGkoSdnKSeAYaShJmZDE5TTGVmdE1hcmdpboaShJ2cn50khpKE mZkNTlNPcmllbnRhdGlvboaShJ2cpJ4BhpKEmZkZTlNQcmludFJldmVyc2VPcmllbnRh dGlvboaSo5KEmZkKTlNMYXN0UGFnZYaShJ2chJeXgn////+GkoSZmQtOU1RvcE1hcmdp boaShJ2cn50khpKEmZkUTlNWZXJ0aWNhbGx5Q2VudGVyZWSGkrSShJmZC05TUGFwZXJT aXplhpKEnpyEhAx7X05TU2l6ZT1mZn2hgQMYgQJkhoaG RowAlign 0 RowSpacing 9.000000e+00 VPages 1 WindowInfo Frame {{109, 134}, {783, 743}} VisibleRegion {{-24, -63}, {768, 666}} Zoom 1 SOPE/sope-xml/SaxObjC/SaxObjC.h0000644000000000000000000000276312242733417015036 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __SaxObjC_H__ #define __SaxObjC_H__ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #endif /* __SaxObjC_H__ */ SOPE/sope-xml/SaxObjC/SaxDeclHandler.h0000644000000000000000000000700612242733417016361 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __SaxDeclHandler_H__ #define __SaxDeclHandler_H__ @class NSString; /* new in SAX 2.0beta In Java this class is in the ext-package, that is, implementation is optional. SAX2 extension handler for DTD declaration events. This is an optional extension handler for SAX2 to provide information about DTD declarations in an XML document. XML readers are not required to support this handler. Note that data-related DTD declarations (unparsed entities and notations) are already reported through the DTDHandler interface. If you are using the declaration handler together with a lexical handler, all of the events will occur between the startDTD and the endDTD events. To set the DeclHandler for an XML reader, use the setProperty method with the propertyId "http://xml.org/sax/handlers/DeclHandler". If the reader does not support declaration events, it will throw a SAXNotRecognizedException or a SAXNotSupportedException when you attempt to register the handler. */ @protocol SaxDeclHandler /* Report an attribute type declaration. Only the effective (first) declaration for an attribute will be reported. The type will be one of the strings "CDATA", "ID", "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY", "ENTITIES", or "NOTATION", or a parenthesized token group with the separator "|" and all whitespace removed. valueDefault - A string representing the attribute default ("#IMPLIED", "#REQUIRED", or "#FIXED") or nil if none of these applies */ - (void)attributeDeclaration:(NSString *)_attributeName elementName:(NSString *)_elementName type:(NSString *)_type defaultType:(NSString *)_defType defaultValue:(NSString *)_defValue; /* Report an attribute type declaration. Only the effective (first) declaration for an attribute will be reported. The type will be one of the strings "CDATA", "ID", "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY", "ENTITIES", or "NOTATION", or a parenthesized token group with the separator "|" and all whitespace removed. If it is a parameter entity, the name will begin with '%'. */ - (void)elementDeclaration:(NSString *)_name contentModel:(NSString *)_model; /* Report a parsed external entity declaration. Only the effective (first) declaration for each entity will be reported. If it is a parameter entity, the name will begin with '%'. */ - (void)externalEntityDeclaration:(NSString *)_name publicId:(NSString *)_pub systemId:(NSString *)_sys; /* Report an internal entity declaration. Only the effective (first) declaration for each entity will be reported. If it is a parameter entity, the name will begin with '%'. */ - (void)internalEntityDeclaration:(NSString *)_name value:(NSString *)_value; @end #endif /* __SaxDeclHandler_H__ */ SOPE/sope-xml/README0000644000000000000000000000050612242733417012754 0ustar rootrootSKYRiX Libraries for XML Processing =================================== This directory contains libraries for processing XML files and other tagged file formats like HTML, iCalendar, PYX or STX using Objective-C. For more information, please follow up on the webpage: http://www.opengroupware.org/en/devs/sope/skyrix_xml/ SOPE/sope-xml/GNUmakefile0000644000000000000000000000102312242733417014141 0ustar rootroot# GNUstep makefile include ../config.make include $(GNUSTEP_MAKEFILES)/common.make PACKAGE_NAME=sope-xml VERSION=4.5.0 SUBPROJECTS = \ SaxObjC \ DOM \ XmlRpc SUBPROJECTS += STXSaxDriver ifneq ($(HAS_LIBRARY_xml2),no) SUBPROJECTS += libxmlSAXDriver endif ifeq ($(frameworks),yes) include umbrella.make endif # project makefiles include $(GNUSTEP_MAKEFILES)/aggregate.make ifeq ($(frameworks),yes) include $(GNUSTEP_MAKEFILES)/framework.make endif # package macosx-pkg :: all ../maintenance/make-osxpkg.sh sope-xml SOPE/sope-xml/COPYING0000644000000000000000000006130312242733417013131 0ustar rootroot GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 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. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] 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 Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, 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 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 a program 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. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, 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 companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. 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, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library 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 compile 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) 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. c) 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. d) 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 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. 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 to 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 Library 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 Appendix: 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 Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library 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! SOPE/sope-xml/pyxSAXDriver/0000755000000000000000000000000012242733420014435 5ustar rootrootSOPE/sope-xml/pyxSAXDriver/fhs.make0000644000000000000000000000137412242733420016061 0ustar rootroot# postprocessing # FHS support (this is a hack and is going to be done by gstep-make!) ifneq ($(FHS_INSTALL_ROOT),) ifeq ($(findstring _64, $(GNUSTEP_TARGET_CPU)), _64) FHS_LIB_DIR=$(FHS_INSTALL_ROOT)/lib64/ else FHS_LIB_DIR=$(FHS_INSTALL_ROOT)/lib/ endif FHS_SAX_DIR=$(FHS_LIB_DIR)sope-$(SOPE_MAJOR_VERSION).$(SOPE_MINOR_VERSION)/saxdrivers/ fhs-sax-dirs :: $(MKDIRS) $(FHS_SAX_DIR) move-bundles-to-fhs :: fhs-sax-dirs @echo "moving bundles $(BUNDLE_INSTALL_DIR) to $(FHS_SAX_DIR) .." for i in $(BUNDLE_NAME); do \ j="$(FHS_SAX_DIR)/$${i}$(BUNDLE_EXTENSION)"; \ if test -d $$j; then rm -r $$j; fi; \ mv "$(BUNDLE_INSTALL_DIR)/$${i}$(BUNDLE_EXTENSION)" $$j; \ done move-to-fhs :: move-bundles-to-fhs after-install :: move-to-fhs endif SOPE/sope-xml/pyxSAXDriver/README0000644000000000000000000000052012242733420015312 0ustar rootrootpyxSAXDriver ============ This directory contains the sources for a SAX driver bundle which can read so called "pyx" files. PYX is a line based representation for XML useful for processing XML files using Unix cmdline tools (like grep or awk). The parser itself is written in Objective-C (and probably pretty slow for large files ;-) SOPE/sope-xml/pyxSAXDriver/GNUmakefile0000644000000000000000000000056312242733420016513 0ustar rootroot# GNUstep makefile include ../../config.make include $(GNUSTEP_MAKEFILES)/common.make include ../Version include ./Version BUNDLE_NAME = pyxSAXDriver BUNDLE_EXTENSION = .sax BUNDLE_INSTALL_DIR = ${SOPE_SAXDRIVERS}/ pyxSAXDriver_OBJC_FILES = pyxSAXDriver.m -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/bundle.make -include GNUmakefile.postamble SOPE/sope-xml/pyxSAXDriver/GNUmakefile.postamble0000644000000000000000000000036212242733420020475 0ustar rootroot# postprocessing ifneq ($(GNUSTEP_BUILD_DIR),) after-all :: @(cp bundle-info.plist \ $(GNUSTEP_BUILD_DIR)/$(BUNDLE_NAME)$(BUNDLE_EXTENSION)) else after-all :: @(cd $(BUNDLE_NAME)$(BUNDLE_EXTENSION);\ cp ../bundle-info.plist .) endif SOPE/sope-xml/pyxSAXDriver/COPYING0000644000000000000000000006130312242733420015473 0ustar rootroot GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 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. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] 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 Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, 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 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 a program 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. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, 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 companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. 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, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library 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 compile 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) 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. c) 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. d) 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 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. 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 to 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 Library 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 Appendix: 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 Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library 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! SOPE/sope-xml/pyxSAXDriver/ChangeLog0000644000000000000000000000171412242733420016212 0ustar rootroot2004-11-04 Helge Hess * use Version file for install directory location 2004-08-29 Helge Hess * added hack to install the project in FHS locations - the SAX driver will be installed in FHS_INSTALL_ROOT if specified (eg make FHS_INSTALL_ROOT=/usr/local) 2004-08-24 Helge Hess * GNUmakefile: install SAX driver in Library/SaxDrivers-4.3/ * GNUmakefile: install SAX driver in Library/SaxDrivers/4.3/ 2004-05-05 Marcus Mueller * GNUmakefile: added support for building with GNUSTEP_BUILD_DIR environment variable set for recent gnustep-make package. 2003-12-03 Helge Hess * GNUmakefile: include common.make from GNUSTEP_MAKEFILES 2003-01-07 Helge Hess * fixed a compilation bug, maybe the driver needs to be updated to the current SAX API * created ChangeLog SOPE/sope-xml/pyxSAXDriver/pyxSAXDriver-Info.plist0000644000000000000000000000151412242733420020754 0ustar rootroot CFBundleDevelopmentRegion English CFBundleExecutable pyxSAXDriver CFBundleGetInfoString CFBundleIconFile CFBundleIdentifier org.opengroupware.xml.pyxSAXDriver CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType APPL CFBundleShortVersionString CFBundleSignature ???? CFBundleVersion 4.2 CSResourcesFileMapped yes SOPE/sope-xml/pyxSAXDriver/pyxSAXDriver.h0000644000000000000000000000337312242733420017164 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __pyxSAXDriver_H__ #define __pyxSAXDriver_H__ #import #include #include #include #include #include #include #include #include @class NSMutableArray; @class SaxAttributes; @interface pyxSAXDriver : NSObject < SaxXMLReader > { @private id contentHandler; id dtdHandler; id errorHandler; id entityResolver; id lexicalHandler; id declHandler; int depth; NSMutableArray *nsStack; BOOL fNamespaces; BOOL fNamespacePrefixes; /* cache */ id locator; SaxAttributes *attrs; } @end #endif /* __pyxSAXDriver_H__ */ SOPE/sope-xml/pyxSAXDriver/pyxSAXDriver.m0000644000000000000000000002117312242733420017167 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "pyxSAXDriver.h" #include #include #include #import #if NeXT_Foundation_LIBRARY || APPLE_Foundation_LIBRARY # include # include #endif static NSString *SaxDeclHandlerProperty = @"http://xml.org/sax/properties/declaration-handler"; static NSString *SaxLexicalHandlerProperty = @"http://xml.org/sax/properties/lexical-handler"; #if 0 static NSString *SaxDOMNodeProperty = @"http://xml.org/sax/properties/dom-node"; static NSString *SaxXMLStringProperty = @"http://xml.org/sax/properties/xml-string"; #endif @implementation pyxSAXDriver - (id)init { self->nsStack = [[NSMutableArray alloc] init]; /* feature defaults */ self->fNamespaces = YES; self->fNamespacePrefixes = NO; return self; } - (void)dealloc { RELEASE(self->nsStack); RELEASE(self->attrs); RELEASE(self->declHandler); RELEASE(self->lexicalHandler); RELEASE(self->contentHandler); RELEASE(self->dtdHandler); RELEASE(self->errorHandler); RELEASE(self->entityResolver); [super dealloc]; } /* properties */ - (void)setProperty:(NSString *)_name to:(id)_value { if ([_name isEqualToString:SaxLexicalHandlerProperty]) { ASSIGN(self->lexicalHandler, _value); return; } if ([_name isEqualToString:SaxDeclHandlerProperty]) { ASSIGN(self->declHandler, _value); return; } [SaxNotRecognizedException raise:@"PropertyException" format:@"don't know property %@", _name]; } - (id)property:(NSString *)_name { if ([_name isEqualToString:SaxLexicalHandlerProperty]) return self->lexicalHandler; if ([_name isEqualToString:SaxDeclHandlerProperty]) return self->declHandler; [SaxNotRecognizedException raise:@"PropertyException" format:@"don't know property %@", _name]; return nil; } /* features */ - (void)setFeature:(NSString *)_name to:(BOOL)_value { if ([_name isEqualToString:@"http://xml.org/sax/features/namespaces"]) { self->fNamespaces = _value; return; } if ([_name isEqualToString: @"http://xml.org/sax/features/namespace-prefixes"]) { self->fNamespacePrefixes = _value; return; } [SaxNotRecognizedException raise:@"FeatureException" format:@"don't know feature %@", _name]; } - (BOOL)feature:(NSString *)_name { if ([_name isEqualToString:@"http://xml.org/sax/features/namespaces"]) return self->fNamespaces; if ([_name isEqualToString: @"http://xml.org/sax/features/namespace-prefixes"]) return self->fNamespacePrefixes; [SaxNotRecognizedException raise:@"FeatureException" format:@"don't know feature %@", _name]; return NO; } /* handlers */ #if 0 - (void)setDocumentHandler:(id)_handler { SaxDocumentHandlerAdaptor *a; a = [[SaxDocumentHandlerAdaptor alloc] initWithDocumentHandler:_handler]; [self setContentHandler:a]; RELEASE(a); } #endif - (void)setDTDHandler:(id)_handler { ASSIGN(self->dtdHandler, _handler); } - (id)dtdHandler { return self->dtdHandler; } - (void)setErrorHandler:(id)_handler { ASSIGN(self->errorHandler, _handler); } - (id)errorHandler { return self->errorHandler; } - (void)setEntityResolver:(id)_handler { ASSIGN(self->entityResolver, _handler); } - (id)entityResolver { return self->entityResolver; } - (void)setContentHandler:(id)_handler { ASSIGN(self->contentHandler, _handler); } - (id)contentHandler { return self->contentHandler; } /* parsing */ - (void)parseFromSource:(id)_source { NSAutoreleasePool *pool; NSArray *lines; if ([_source isKindOfClass:[NSString class]]) { lines = [_source componentsSeparatedByString:@"\n"]; } else if ([_source isKindOfClass:[NSData class]]) { _source = [[NSString alloc] initWithData:_source encoding:[NSString defaultCStringEncoding]]; lines = [_source componentsSeparatedByString:@"\n"]; RELEASE(_source); } else { SaxParseException *e; NSDictionary *ui; ui = [NSDictionary dictionaryWithObjectsAndKeys: _source ? _source : @"", @"source", self, @"parser", nil]; e = (id)[SaxParseException exceptionWithName:@"SaxIOException" reason:@"can't handle data-source" userInfo:ui]; [self->errorHandler fatalError:e]; return; } pool = [[NSAutoreleasePool alloc] init]; /* start parsing lines */ { NSEnumerator *e; NSString *line; e = [lines objectEnumerator]; while ((line = [e nextObject])) { recheck: if ([line hasPrefix:@"("]) { NSMutableDictionary *ns = nil; NSString *startTag; NSDictionary *nsDict = nil; /* not yet finished ! */ startTag = [line substringFromIndex:1]; line = [e nextObject]; while ([line hasPrefix:@"A"]) { /* attribute */ NSString *rawName, *value; unsigned idx; line = [line substringFromIndex:1]; if ((idx = [line indexOfString:@" "]) == NSNotFound) { value = @""; rawName = line; } else { rawName = [line substringToIndex:idx]; value = [line substringFromIndex:(idx + 1)]; } if ([rawName hasPrefix:@"xmlns"]) { /* a namespace declaration */ if (ns == nil) ns = [[NSMutableDictionary alloc] init]; if ([rawName hasPrefix:@"xmlns:"]) { /* eg */ NSString *prefix, *uri; prefix = [rawName substringFromIndex:6]; uri = value; [ns setObject:uri forKey:prefix]; if (self->fNamespaces) [self->contentHandler startPrefixMapping:prefix uri:uri]; } else { /* eg */ [ns setObject:value forKey:@":"]; } } } /* start tag finished */ nsDict = [ns copy]; RELEASE(ns); ns = nil; /* manage namespace stack */ if (nsDict == nil) nsDict = [NSDictionary dictionary]; [self->nsStack addObject:nsDict]; /* to be completed ! */ if (line != nil) goto recheck; } } } RELEASE(pool); } - (void)parseFromSystemId:(NSString *)_sysId { NSString *s; /* _sysId is a URI */ if (![_sysId hasPrefix:@"file://"]) { SaxParseException *e; NSDictionary *ui; ui = [NSDictionary dictionaryWithObjectsAndKeys: _sysId ? _sysId : @"", @"systemID", self, @"parser", nil]; e = (id)[SaxParseException exceptionWithName:@"SaxIOException" reason:@"can't handle system-id" userInfo:ui]; [self->errorHandler fatalError:e]; return; } /* cut off file:// */ _sysId = [_sysId substringFromIndex:7]; /* start parsing .. */ if ((s = [NSString stringWithContentsOfFile:_sysId])) [self parseFromSource:s]; } /* entities */ - (NSString *)replacementStringForEntityNamed:(NSString *)_entityName { //NSLog(@"get entity: %@", _entityName); return [[@"&" stringByAppendingString:_entityName] stringByAppendingString:@";"]; } /* namespace support */ - (NSString *)nsUriForPrefix:(NSString *)_prefix { NSEnumerator *e; NSDictionary *ns; e = [self->nsStack reverseObjectEnumerator]; while ((ns = [e nextObject])) { NSString *uri; if ((uri = [ns objectForKey:_prefix])) return uri; } return nil; } - (NSString *)defaultNamespace { return [self nsUriForPrefix:@":"]; } @end /* pyxSAXDriver */ SOPE/sope-xml/pyxSAXDriver/GNUmakefile.preamble0000644000000000000000000000056312242733420020301 0ustar rootroot# compilation settings ifeq ($(frameworks),yes) BUNDLE_INSTALL_DIR := $(FRAMEWORK_INSTALL_DIR)/SaxObjC.framework/Resources/SaxDrivers/ endif pyxSAXDriver_RESOURCE_FILES = bundle-info.plist pyxSAXDriver_LOCALIZED_RESOURCE_FILES = pyxSAXDriver_BUNDLE_LIBS += -lSaxObjC ADDITIONAL_INCLUDE_DIRS += -I.. -I../.. ADDITIONAL_LIB_DIRS += -L../SaxObjC/$(GNUSTEP_OBJ_DIR) SOPE/sope-xml/pyxSAXDriver/bundle-info.plist0000644000000000000000000000045012242733420017713 0ustar rootroot{ requires = { bundleManagerVersion = 1; classes = ( { name = NSObject; } ); }; provides = { SAXDrivers = ( { name = pyxSAXDriver; sourceTypes = ( "text/pyx" ); } ); classes = ( { name = pyxSAXDriver; } ); }; } SOPE/sope-xml/pyxSAXDriver/slashdot.pyx0000644000000000000000000000776612242733420017040 0ustar rootroot(ultramode -\n (story -\n (title -100 Mbit/s on Fibre to the home )title -\n (url -http://slashdot.org/articles/99/06/06/1440211.shtml )url -\n (time -1999-06-06 14:39:59 )time -\n (author -CmdrTaco )author -\n (department -wouldn't-it-be-nice )department -\n (topic -internet )topic -\n (comments -20 )comments -\n (section -articles )section -\n (image -topicinternet.jpg )image -\n )story -\n (story -\n (title -Gimp 1.2 Preview )title -\n (url -http://slashdot.org/articles/99/06/06/1438246.shtml )url -\n (time -1999-06-06 14:38:40 )time -\n (author -CmdrTaco )author -\n (department -stuff-to-read )department -\n (topic -gimp )topic -\n (comments -12 )comments -\n (section -articles )section -\n (image -topicgimp.gif )image -\n )story -\n (story -\n (title -Sony's AIBO robot Sold Out )title -\n (url -http://slashdot.org/articles/99/06/06/1432256.shtml )url -\n (time -1999-06-06 14:32:51 )time -\n (author -CmdrTaco )author -\n (department -stuff-to-see )department -\n (topic -tech )topic -\n (comments -10 )comments -\n (section -articles )section -\n (image -topictech2.jpg )image -\n )story -\n (story -\n (title -Ask Slashdot: Another Word for "Hacker"? )title -\n (url -http://slashdot.org/askslashdot/99/06/05/1815225.shtml )url -\n (time -1999-06-05 20:00:00 )time -\n (author -Cliff )author -\n (department -hacker-vs-cracker )department -\n (topic -news )topic -\n (comments -385 )comments -\n (section -askslashdot )section -\n (image -topicnews.gif )image -\n )story -\n (story -\n (title -Corel Linux FAQ )title -\n (url -http://slashdot.org/articles/99/06/05/1842218.shtml )url -\n (time -1999-06-05 18:42:06 )time -\n (author -CmdrTaco )author -\n (department -stuff-to-read )department -\n (topic -corel )topic -\n (comments -164 )comments -\n (section -articles )section -\n (image -topiccorel.gif )image -\n )story -\n (story -\n (title -Upside downsides MP3.COM. )title -\n (url -http://slashdot.org/articles/99/06/05/1558210.shtml )url -\n (time -1999-06-05 15:56:45 )time -\n (author -CmdrTaco )author -\n (department -stuff-to-think-about )department -\n (topic -music )topic -\n (comments -48 )comments -\n (section -articles )section -\n (image -topicmusic.gif )image -\n )story -\n (story -\n (title -2 Terabits of Bandwidth )title -\n (url -http://slashdot.org/articles/99/06/05/1554258.shtml )url -\n (time -1999-06-05 15:53:43 )time -\n (author -CmdrTaco )author -\n (department -faster-porn )department -\n (topic -internet )topic -\n (comments -66 )comments -\n (section -articles )section -\n (image -topicinternet.jpg )image -\n )story -\n (story -\n (title -Suppression of cold fusion research? )title -\n (url -http://slashdot.org/articles/99/06/04/2313200.shtml )url -\n (time -1999-06-04 23:12:29 )time -\n (author -Hemos )author -\n (department -possibly-probably )department -\n (topic -science )topic -\n (comments -217 )comments -\n (section -articles )section -\n (image -topicscience.gif )image -\n )story -\n (story -\n (title -California Gov. Halts Wage Info Sale )title -\n (url -http://slashdot.org/articles/99/06/04/235256.shtml )url -\n (time -1999-06-04 23:05:34 )time -\n (author -Hemos )author -\n (department -woo-hoo! )department -\n (topic -usa )topic -\n (comments -16 )comments -\n (section -articles )section -\n (image -topicus.gif )image -\n )story -\n (story -\n (title -Red Hat Announces IPO )title -\n (url -http://slashdot.org/articles/99/06/04/0849207.shtml )url -\n (time -1999-06-04 19:30:18 )time -\n (author -Justin )author -\n (department -details-sketchy )department -\n (topic -redhat )topic -\n (comments -155 )comments -\n (section -articles )section -\n (image -topicredhat.gif )image -\n )story -\n )ultramode SOPE/sope-xml/XmlRpc/0000755000000000000000000000000012242733420013272 5ustar rootrootSOPE/sope-xml/XmlRpc/XmlRpcValue.m0000644000000000000000000000440012242733420015650 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "XmlRpcValue.h" #include "common.h" @implementation XmlRpcValue /*" The XmlRpcValue class is used internally by the XML-RPC decoder to represent any valid XML-RPC value. You should never need to use this class. "*/ - (id)initWithValue:(id)_value className:(NSString *)_className { if ((self = [super init])) { NSString *cName; ASSIGN(self->value, _value); cName = (_className != nil) ? _className : NSStringFromClass([_value class]); ASSIGN(self->className, cName); } return self; } - (void)dealloc { [self->className release]; [self->value release]; [super dealloc]; } - (id)value { return self->value; } - (void)setClassName:(NSString *)_className { if (_className != self->className) { [self->className autorelease]; self->className = [_className copy]; } } - (NSString *)className { return self->className; } - (Class)class { return NSClassFromString([self className]); } - (BOOL)isException { return [(id)[self value] isKindOfClass:[NSException class]]; } - (BOOL)isDictionary { return [(id)[self value] isKindOfClass:[NSDictionary class]]; } /* description */ - (NSString *)description { return [NSString stringWithFormat:@"XmlRpcValue: %@->%@", self->className, self->value]; } /* NSCopying */ - (id)copyWithZone:(NSZone *)zone { return [[[self class] alloc] initWithValue:self->value className:self->className]; } @end /* XmlRpcValue */ SOPE/sope-xml/XmlRpc/fhs.make0000644000000000000000000000173312242733420014715 0ustar rootroot# postprocessing # FHS support (this is a hack and is going to be done by gstep-make!) ifneq ($(FHS_INSTALL_ROOT),) FHS_INCLUDE_DIR=$(FHS_INSTALL_ROOT)/include/ FHS_BIN_DIR=$(FHS_INSTALL_ROOT)/bin/ ifeq ($(findstring _64, $(GNUSTEP_TARGET_CPU)), _64) FHS_LIB_DIR=$(FHS_INSTALL_ROOT)/lib64/ else FHS_LIB_DIR=$(FHS_INSTALL_ROOT)/lib/ endif fhs-header-dirs :: $(MKDIRS) $(FHS_INCLUDE_DIR)$(libXmlRpc_HEADER_FILES_INSTALL_DIR) move-headers-to-fhs :: fhs-header-dirs @echo "moving headers to $(FHS_INCLUDE_DIR) .." mv $(GNUSTEP_HEADERS)$(libXmlRpc_HEADER_FILES_INSTALL_DIR)/*.h \ $(FHS_INCLUDE_DIR)$(libXmlRpc_HEADER_FILES_INSTALL_DIR)/ NONFHS_LIBDIR="$(GNUSTEP_LIBRARIES)/$(GNUSTEP_TARGET_LDIR)/" NONFHS_LIBNAME="$(LIBRARY_NAME)$(LIBRARY_NAME_SUFFIX)$(SHARED_LIBEXT)" move-libs-to-fhs :: @echo "moving libs to $(FHS_LIB_DIR) .." mv $(NONFHS_LIBDIR)/$(NONFHS_LIBNAME)* $(FHS_LIB_DIR)/ move-to-fhs :: move-headers-to-fhs move-libs-to-fhs after-install :: move-to-fhs endif SOPE/sope-xml/XmlRpc/XmlRpc.h0000644000000000000000000000177412242733420014661 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __XmlRpc_XmlRpc_H__ #define __XmlRpc_XmlRpc_H__ #include #include #include #include #endif /* __XmlRpc_XmlRpc_H__ */ SOPE/sope-xml/XmlRpc/XmlRpcRequestDecoder.m0000644000000000000000000000630612242733420017521 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include "common.h" @implementation XmlRpcRequestDecoder static id saxRequestHandler = nil; static id requestParser = nil; static BOOL doDebug = NO; - (void)_ensureSaxAndParser { if (saxRequestHandler == nil) { static Class clazz = Nil; if (clazz == Nil) clazz = NSClassFromString(@"XmlRpcSaxRequestHandler"); if ((saxRequestHandler = [[clazz alloc] init]) == nil) { NSLog(@"%s: did not find sax handler ...", __PRETTY_FUNCTION__); return; } } if (requestParser != nil) return; requestParser = [[SaxXMLReaderFactory standardXMLReaderFactory] createXMLReader]; if (requestParser == nil) { NSLog(@"%s: did not find an XML parser ...", __PRETTY_FUNCTION__); return; } [requestParser setContentHandler:saxRequestHandler]; [requestParser setDTDHandler:saxRequestHandler]; [requestParser setErrorHandler:saxRequestHandler]; [requestParser retain]; } - (XmlRpcMethodCall *)decodeRootObject { XmlRpcMethodCall *methodCall; NSEnumerator *paramEnum; NSMutableArray *params; XmlRpcValue *param; if (doDebug) NSLog(@"%s: begin", __PRETTY_FUNCTION__); [self _ensureSaxAndParser]; [saxRequestHandler reset]; [requestParser parseFromSource:self->string systemId:nil]; methodCall = [saxRequestHandler methodCall]; // the methodCall's parameters is an array of XmlRpcValues!!! paramEnum = [[methodCall parameters] objectEnumerator]; params = [[NSMutableArray alloc] initWithCapacity: [[methodCall parameters] count]]; while ((param = [paramEnum nextObject])) { Class objClass = Nil; id obj; [self->value autorelease]; self->value = [param retain]; if ((objClass = NSClassFromString([param className])) != Nil) { if ((obj = [objClass decodeObjectWithXmlRpcCoder:self])) { [params addObject:obj]; } else { NSLog(@"%s: Warning: try to add 'nil' object to params (class='%@')", __PRETTY_FUNCTION__, [param className]); } } } [methodCall setParameters:params]; [params release]; if (doDebug) NSLog(@"%s: done: %@", __PRETTY_FUNCTION__, methodCall); return methodCall; } @end /* XmlRpcRequestDecoder */ SOPE/sope-xml/XmlRpc/NSObject+XmlRpc.m0000644000000000000000000002237712242733420016333 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include "common.h" @interface NSObject(Misc) - (id)initWithString:(NSString *)_s; @end @interface NSString(XmlRpcParsing) - (id)initWithXmlRpcType:(NSString *)_type characters:(unichar *)_chars length:(NSUInteger)_len; @end @interface NSDate(XmlRpcParsing) - (id)initWithXmlRpcType:(NSString *)_type characters:(unichar *)_chars length:(NSUInteger)_len; @end @interface NSNumber(XmlRpcParsing) - (id)initWithXmlRpcType:(NSString *)_type characters:(unichar *)_chars length:(NSUInteger)_len; @end @interface NSData(XmlRpcParsing) - (id)initWithXmlRpcType:(NSString *)_type characters:(unichar *)_chars length:(NSUInteger)_len; @end @interface NSData(UsedNGExtensions) - (NSData *)dataByDecodingBase64; @end @implementation NSObject(XmlRpcParsing) - (id)initWithXmlRpcCoder:(XmlRpcDecoder *)_coder { NSClassDescription *cd; if ((cd = [self classDescription])) { NSEnumerator *e; NSString *k; if ((self = [self init])) { e = [[cd attributeKeys] objectEnumerator]; while ((k = [e nextObject])) [self takeValue:[_coder decodeObjectForKey:k] forKey:k]; e = [[cd toOneRelationshipKeys] objectEnumerator]; while ((k = [e nextObject])) [self takeValue:[_coder decodeObjectForKey:k] forKey:k]; e = [[cd toManyRelationshipKeys] objectEnumerator]; while ((k = [e nextObject])) [self takeValue:[_coder decodeArrayForKey:k] forKey:k]; } } else if ([self respondsToSelector:@selector(initWithString:)]) { self = [(id)self initWithString:[_coder decodeString]]; } else { [NSException raise:@"XmlRpcCodingException" format: @"in initWithXmlRpcCoder: cannot decode class '%@'", NSStringFromClass([self class])]; [self release]; return nil; } return self; } + (id)decodeObjectWithXmlRpcCoder:(XmlRpcDecoder *)_decoder { return [[[self alloc] initWithXmlRpcCoder:_decoder] autorelease]; } - (NSString *)xmlRpcType { return @"struct"; } - (void)encodeWithXmlRpcCoder:(XmlRpcEncoder *)_coder { NSClassDescription *cd; if ((cd = [self classDescription])) { NSEnumerator *e; NSString *k; e = [[cd attributeKeys] objectEnumerator]; while ((k = [e nextObject])) [_coder encodeObject:[self valueForKey:k] forKey:k]; e = [[cd toOneRelationshipKeys] objectEnumerator]; while ((k = [e nextObject])) [_coder encodeObject:[self valueForKey:k] forKey:k]; e = [[cd toManyRelationshipKeys] objectEnumerator]; while ((k = [e nextObject])) [_coder encodeArray:[self valueForKey:k] forKey:k]; } else if ([self respondsToSelector:@selector(initWithString:)]) { [_coder encodeString:[self description]]; } else { [NSException raise:@"XmlRpcCodingException" format: @"in encodeWithXmlRpcCoder: " @"cannot encode class '%@', object=%@B", NSStringFromClass([self class]), self]; } } + (id)objectWithXmlRpcType:(NSString *)_type characters:(unichar *)_chars length:(NSUInteger)_len { static NSDictionary *typeToClass = nil; Class ObjClass = Nil; id obj; if ([@"nil" isEqualToString:_type]) /* Python with allow_none */ return nil; if (typeToClass == nil) { typeToClass = [[NSDictionary alloc] initWithObjectsAndKeys: [NSNumber class], @"i4", [NSNumber class], @"int", [NSNumber class], @"double", [NSNumber class], @"boolean", [NSString class], @"string", [NSString class], @"value", [NSData class], @"base64", [NSCalendarDate class], @"dateTime.iso8601", nil]; } /* determine basetype class */ if ((ObjClass = [typeToClass objectForKey:_type]) == Nil) { NSLog(@"WARNING(%s): unknown XML-RPC type '%@', using String ...", __PRETTY_FUNCTION__, _type); ObjClass = [NSString class]; } /* construct object */ obj = [[ObjClass alloc] initWithXmlRpcType:_type characters:_chars length:_len]; return [obj autorelease]; } - (id)initWithXmlRpcType:(NSString *)_type characters:(unichar *)_chars length:(NSUInteger)_len { if ([self respondsToSelector:@selector(initWithString:)]) { NSString *s; s = [[NSString alloc] initWithCharacters:_chars length:_len]; self = [self initWithString:s]; [s release]; return self; } /* don't know how to init with given type ... */ [self release]; return nil; } @end /* NSObject(XmlRpc) */ @implementation NSData(XmlRpcParsing) /* NSData represents the xml-rpc base type 'base64' */ - (id)initWithXmlRpcType:(NSString *)_type characters:(unichar *)_chars length:(NSUInteger)_len { NSString *v; [self release]; self = nil; v = [NSString stringWithCharacters:_chars length:_len]; self = [v dataUsingEncoding:NSUTF8StringEncoding]; if ([_type isEqualToString:@"base64"]) self = [self dataByDecodingBase64]; return [self copy]; } @end /* NSData(XmlRpcParsing) */ @implementation NSDate(XmlRpcParsing) /* NSDate represents the xml-rpc type dateTime.iso8601: */ - (id)initWithXmlRpcType:(NSString *)_type characters:(unichar *)_chars length:(NSUInteger)_len { /* eg 19980717T14:08:55 */ if (_len < 17) { [self release]; return nil; } { unsigned char buf[8]; int year, month, day, hour, min, sec; buf[0] = _chars[0]; buf[1] = _chars[1]; buf[2] = _chars[2]; buf[3] = _chars[3]; buf[4] = '\0'; year = atoi((char *)buf); buf[0] = _chars[4]; buf[1] = _chars[5]; buf[2] = '\0'; month = atoi((char *)buf); buf[0] = _chars[6]; buf[1] = _chars[7]; buf[2] = '\0'; day = atoi((char *)buf); buf[0] = _chars[9]; buf[1] = _chars[10]; buf[2] = '\0'; hour = atoi((char *)buf); buf[0] = _chars[12]; buf[1] = _chars[13]; buf[2] = '\0'; min = atoi((char *)buf); buf[0] = _chars[15]; buf[1] = _chars[16]; buf[2] = '\0'; sec = atoi((char *)buf); if (year > 2033) { NSString *s; s = [[NSString alloc] initWithCharacters:_chars length:_len]; NSLog(@"WARNING: got a date value '%@' with year >2033, " @"which cannot be represented, silently using 2033 ...", s); [s release]; year = 2033; } else if (year < 1900) { NSString *s; s = [[NSString alloc] initWithCharacters:_chars length:_len]; NSLog(@"WARNING: got a date value '%@' with year < 1900, " @"which cannot be represented, silently using 1900 ...", s); [s release]; year = 1900; } if (![self isKindOfClass:[NSCalendarDate class]]) { [self release]; self = [NSCalendarDate alloc]; } return [(NSCalendarDate *)self initWithYear:year month:month day:day hour:hour minute:min second:sec timeZone:[NSTimeZone timeZoneWithName:@"GMT"]]; } } @end /* NSDate(XmlRpcParsing) */ @implementation NSNumber(XmlRpcParsing) /* NSNumber represents the xml-rpc base types: 'int', 'double', 'boolean': */ - (id)initWithXmlRpcType:(NSString *)_type characters:(unichar *)_chars length:(NSUInteger)_len { if ([_type isEqualToString:@"boolean"]) { BOOL v; v = (_len > 0) ? ((_chars[0] == '1') ? YES : NO) : NO; return [self initWithBool:v]; } else { NSString *v; BOOL isInt = NO; v = [NSString stringWithCharacters:_chars length:_len]; if ([_type isEqualToString:@"i4"] || [_type isEqualToString:@"int"]) isInt = YES; else if ([_type isEqualToString:@"double"]) isInt = NO; else isInt = ([v rangeOfString:@"."].length == 0) ? YES : NO; return isInt ? [self initWithInt:[v intValue]] : [self initWithDouble:[v doubleValue]]; } } @end /* NSNumber(XmlRpcParsing */ @implementation NSString(XmlRpcParsing) - (id)initWithXmlRpcType:(NSString *)_type characters:(unichar *)_chars length:(NSUInteger)_len { /* this is *never* called, since NSString+alloc returns a NSTemporaryString*/ return [self initWithCharacters:_chars length:_len]; } @end /* NSString(XmlRpcParsing) */ SOPE/sope-xml/XmlRpc/GNUmakefile0000644000000000000000000000220512242733420015343 0ustar rootroot# GNUstep makefile include ../../config.make include ../common.make ifneq ($(frameworks),yes) LIBRARY_NAME = libXmlRpc else FRAMEWORK_NAME = XmlRpc XmlRpc_RESOURCE_FILES += Version endif libXmlRpc_PCH_FILE = common.h XmlRpc_PCH_FILE = common.h libXmlRpc_HEADER_FILES = \ XmlRpc.h \ NSObject+XmlRpc.h \ XmlRpcCoder.h \ XmlRpcMethodCall.h \ XmlRpcMethodResponse.h \ libXmlRpc_OBJC_FILES = \ XmlRpcEncoder.m \ XmlRpcDecoder.m \ XmlRpcMethodCall.m \ XmlRpcMethodResponse.m \ XmlRpcSaxHandler.m \ XmlRpcValue.m \ NSMutableString+XmlRpcDecoder.m \ \ NSArray+XmlRpcCoding.m \ NSData+XmlRpcCoding.m \ NSDate+XmlRpcCoding.m \ NSDictionary+XmlRpcCoding.m \ NSException+XmlRpcCoding.m \ NSHost+XmlRpcCoding.m \ NSNotification+XmlRpcCoding.m \ NSNumber+XmlRpcCoding.m \ NSObject+XmlRpc.m \ NSString+XmlRpcCoding.m \ NSURL+XmlRpcCoding.m \ -include GNUmakefile.preamble ifneq ($(FHS_INSTALL_ROOT),) GNUSTEP_HEADERS=$(DESTDIR)$(FHS_INSTALL_ROOT)/include endif ifneq ($(frameworks),yes) include $(GNUSTEP_MAKEFILES)/library.make else include $(GNUSTEP_MAKEFILES)/framework.make endif -include GNUmakefile.postamble SOPE/sope-xml/XmlRpc/NSException+XmlRpcCoding.m0000644000000000000000000000520712242733420020200 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "XmlRpcMethodResponse.h" #include "common.h" #include "XmlRpcCoder.h" @implementation NSException(XmlRpcCoding) - (NSString *)xmlRpcType { return @"struct"; } - (NSNumber *)xmlRpcFaultCode { NSDictionary *ui; id code; ui = [self userInfo]; if ((code = [ui objectForKey:@"XmlRpcFaultCode"])) /* code is set */; else if ((code = [ui objectForKey:@"faultCode"])) /* code is set */; else code = [self name]; return [NSNumber numberWithInt:[code intValue]]; } - (void)encodeWithXmlRpcCoder:(XmlRpcEncoder *)_coder { int code; NSString *str, *n, *r; NSDictionary *ui; code = [[self xmlRpcFaultCode] intValue]; n = [self name]; r = [self reason]; if ([n length] == 0) str = r; else if ([r length] == 0) str = n; else str = [NSString stringWithFormat:@"%@: %@", n, r]; if ((ui = [self userInfo])) str = [NSString stringWithFormat:@"%@ %@", str, ui]; [_coder encodeInt:code forKey:@"faultCode"]; [_coder encodeString:str forKey:@"faultString"]; } + (NSString *)exceptionNameForXmlRpcFaultCode:(int)_code { return [NSString stringWithFormat:@"XmlRpcFault<%i>", _code]; } - (NSString *)exceptionNameForXmlRpcFaultCode:(int)_code { return [[self class] exceptionNameForXmlRpcFaultCode:_code]; } + (id)decodeObjectWithXmlRpcCoder:(XmlRpcDecoder *)_coder { int code; NSString *r; NSDictionary *ui; code = [_coder decodeIntForKey:@"faultCode"]; r = [_coder decodeStringForKey:@"faultString"]; ui = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:code], @"faultCode", r, @"faultString", nil]; return [self exceptionWithName: [self exceptionNameForXmlRpcFaultCode:code] reason:r userInfo:ui]; } @end /* NSException(XmlRpcCoding) */ SOPE/sope-xml/XmlRpc/XmlRpcMethodCall.m0000644000000000000000000000777112242733420016626 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include "common.h" @interface XmlRpcMethodCall(PrivateMethodes) - (NSString *)_encodeXmlRpcMethodCall; @end @implementation XmlRpcMethodCall - (id)initWithXmlRpcString:(NSString *)_string { XmlRpcDecoder *coder; XmlRpcMethodCall *baseCall; if ([_string length] == 0) { [self release]; return nil; } coder = [[XmlRpcDecoder alloc] initForReadingWithString:_string]; baseCall = [coder decodeMethodCall]; [coder release]; if (baseCall == nil) { [self release]; return nil; } self = [self initWithMethodName:[baseCall methodName] parameters:[baseCall parameters]]; return self; } - (id)initWithXmlRpcData:(NSData *)_xmlRpcData { XmlRpcDecoder *coder; XmlRpcMethodCall *baseCall; if ([_xmlRpcData length] == 0) { [self release]; return nil; } coder = [[XmlRpcDecoder alloc] initForReadingWithData:_xmlRpcData]; baseCall = [coder decodeMethodCall]; [coder release]; if (baseCall == nil) { [self release]; return nil; } self = [self initWithMethodName:[baseCall methodName] parameters:[baseCall parameters]]; return self; } - (id)initWithMethodName:(NSString *)_name parameters:(NSArray *)_params { if ((self = [super init])) { self->methodName = [_name copy]; [self setParameters:_params]; } return self; } - (void)dealloc { [self->methodName release]; [self->parameters release]; [super dealloc]; } /* accessors */ - (void)setMethodName:(NSString *)_name { [self->methodName autorelease]; self->methodName = [_name copy]; } - (NSString *)methodName { return self->methodName; } - (void)setParameters:(NSArray *)_params { if (self->parameters != _params) { unsigned i, cc; id *objects; [self->parameters autorelease]; /* shallow copy parameters, it is implemented here 'by-hand', since skyrix-xml is not dependend on EOControl */ cc = [_params count]; objects = calloc(cc + 1, sizeof(id)); for (i = 0; i < cc; i++) objects[i] = [_params objectAtIndex:i]; self->parameters = [[NSArray alloc] initWithObjects:objects count:cc]; if (objects) free(objects); } } - (NSArray *)parameters { return self->parameters; } - (NSString *)xmlRpcString { return [self _encodeXmlRpcMethodCall]; } /* description */ - (NSString *)description { NSMutableString *s; s = [NSMutableString stringWithFormat:@"<0x%p[%@]: ", self, NSStringFromClass([self class])]; [s appendFormat:@"method=%@", [self methodName]]; [s appendFormat:@" #paras=%d", [self->parameters count]]; [s appendString:@">"]; return s; } @end /* XmlRpcMethodCall */ @implementation XmlRpcMethodCall(PrivateMethodes) - (NSString *)_encodeXmlRpcMethodCall { NSMutableString *str; XmlRpcEncoder *coder; #if DEBUG NSAssert1(self->methodName, @"%s, methodName is not allowed to be nil!", __PRETTY_FUNCTION__); #endif str = [NSMutableString stringWithCapacity:512]; coder = [[XmlRpcEncoder alloc] initForWritingWithMutableString:str]; [coder encodeMethodCall:self]; [coder release]; coder = nil; return str; } @end /* XmlRpcMethodCall(PrivateMethodes) */ SOPE/sope-xml/XmlRpc/COPYING0000644000000000000000000006130312242733420014330 0ustar rootroot GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 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. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] 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 Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, 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 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 a program 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. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, 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 companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. 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, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library 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 compile 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) 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. c) 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. d) 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 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. 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 to 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 Library 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 Appendix: 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 Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library 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! SOPE/sope-xml/XmlRpc/NSObject+XmlRpc.h0000644000000000000000000000236412242733420016320 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NSObject_XMLRPC_H__ #define __NSObject_XMLRPC_H__ #import #import #import @interface NSObject(XmlRpcValues) + (id)objectWithXmlRpcType:(NSString *)_type characters:(unichar *)_chars length:(NSUInteger)_len; @end @interface NSObject(XmlRpcSignatures) - (NSString *)xmlRpcType; @end @interface NSArray(XmlRpcSignatures) - (NSArray *)xmlRpcElementSignature; @end #endif /* __NSObject_XMLRPC_H__ */ SOPE/sope-xml/XmlRpc/XmlRpcSaxHandler.h0000644000000000000000000000373212242733420016627 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __XmlRpcSaxHandler_H__ #define __XmlRpcSaxHandler_H__ #include /* Mappings: or -> NSNumber -> NSNumber -> NSNumber -> NSData -> NSString -> NSCalendarDate -> NSDictionary -> NSArray */ @class NSMutableArray, NSTimeZone, NSCalendarDate; @class XmlRpcMethodCall, XmlRpcMethodResponse; @interface XmlRpcSaxHandler : SaxDefaultHandler { XmlRpcMethodCall *call; XmlRpcMethodResponse *response; NSMutableArray *params; NSString *methodName; BOOL invalidCall; NSMutableArray *tagStack; NSMutableArray *valueStack; NSString *className; NSMutableArray *memberNameStack; NSMutableArray *memberValueStack; NSTimeZone *timeZone; NSCalendarDate *dateTime; NSMutableString *characters; unsigned valueNestingLevel; SEL nextCharactersProcessor; } /* reusing sax handler */ - (void)reset; /* result accessors */ - (XmlRpcMethodCall *)methodCall; - (XmlRpcMethodResponse *)methodResponse; @end #endif /* __XmlRpcSaxHandler_H__ */ SOPE/sope-xml/XmlRpc/NSData+XmlRpcCoding.m0000644000000000000000000000221712242733420017111 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "XmlRpcMethodResponse.h" #include "common.h" #include "XmlRpcCoder.h" @implementation NSData(XmlRpcCoding) - (NSString *)xmlRpcType { return @"base64"; } - (void)encodeWithXmlRpcCoder:(XmlRpcEncoder *)_coder { [_coder encodeBase64:self]; } + (id)decodeObjectWithXmlRpcCoder:(XmlRpcDecoder *)_coder { return [_coder decodeBase64]; } @end /* NSData(XmlRpcCoding) */ SOPE/sope-xml/XmlRpc/XmlRpcSaxHandler.m0000644000000000000000000004244312242733420016636 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "XmlRpcSaxHandler.h" #include "XmlRpcMethodCall.h" #include "XmlRpcMethodResponse.h" #include "NSObject+XmlRpc.h" #include "XmlRpcValue.h" #include "common.h" @implementation XmlRpcSaxHandler /*" The SAX handler used to decode XML-RPC responses and requests. If the parsing finishes successfully, either -methodCall or -methodResponse will return an properly initialized object representing the XML-RPC response. The SAX handler is used by the XmlRpcDecoder class internally, in most cases you shouldn't need to access it directly. "*/ static Class ArrayClass = Nil; static Class DictionaryClass = Nil; static BOOL doDebug = NO; + (void)initialize { if (ArrayClass == Nil) ArrayClass = [NSMutableArray class]; if (DictionaryClass == Nil) DictionaryClass = [NSMutableDictionary class]; } - (void)reset { if (doDebug) NSLog(@"%s: begin ...", __PRETTY_FUNCTION__); [self->response release]; self->response = nil; [self->call release]; self->call = nil; [self->methodName release]; self->methodName = nil; [self->params release]; self->params = nil; // for recursive structures (struct, array) [self->valueStack removeAllObjects]; [self->className release]; self->className = nil; [self->memberNameStack removeAllObjects]; [self->memberValueStack removeAllObjects]; [self->timeZone release]; self->timeZone = nil; [self->dateTime release]; self->dateTime = nil; [self->characters setString:@""]; self->valueNestingLevel = 0; self->nextCharactersProcessor = NULL; self->invalidCall = NO; [self->tagStack removeAllObjects]; } - (void)dealloc { [self reset]; [self->characters release]; [self->tagStack release]; [self->valueStack release]; [self->memberNameStack release]; [self->memberValueStack release]; [super dealloc]; } /* accessors */ - (XmlRpcMethodCall *)methodCall { return self->call; } - (XmlRpcMethodResponse *)methodResponse { return self->response; } - (id)result { return [self->params lastObject]; // => NSException || XmlRpcValue } /* *** */ - (void)_addValueToParas:(id)_value { id topValue = [(XmlRpcValue *)[self->valueStack lastObject] value]; if ([topValue isKindOfClass:ArrayClass]) [topValue addObject:_value]; else if ([topValue isKindOfClass:DictionaryClass]) [self->memberValueStack addObject:_value]; else [self->params addObject:_value]; } /* document */ - (void)startDocument { if (doDebug) NSLog(@"%s: begin ...", __PRETTY_FUNCTION__); [self reset]; if (self->tagStack == nil) self->tagStack = [[NSMutableArray alloc] initWithCapacity:8]; if (self->valueStack == nil) self->valueStack = [[NSMutableArray alloc] initWithCapacity:8]; if (self->characters == nil) self->characters = [[NSMutableString alloc] initWithCapacity:128]; if (doDebug) NSLog(@"%s: done ...", __PRETTY_FUNCTION__); } - (void)endDocument { if (doDebug) NSLog(@"%s: begin ...", __PRETTY_FUNCTION__); if ([self->tagStack count] > 0) { self->invalidCall = YES; NSLog(@"Warning(%s): tagStack is not empty (%@)", __PRETTY_FUNCTION__, self->tagStack); } if (self->call != nil && self->response != nil) { self->invalidCall = YES; NSLog(@"Warning(%s): got methodCall *AND* methodResponse!!! (%@<->%@)", __PRETTY_FUNCTION__, self->call, self->response); } if (self->invalidCall) { if (doDebug) NSLog(@"%s: marked as invalid call!", __PRETTY_FUNCTION__); [self->call release]; self->call = nil; [self->response release]; self->response = nil; } if (doDebug) NSLog(@"%s: done ...", __PRETTY_FUNCTION__); } /* elements */ - (void)start_name:(id)_attrs { self->nextCharactersProcessor = @selector(_name:length:); } - (void)end_name { self->nextCharactersProcessor = NULL; } - (void)_name:(unichar *)_chars length:(NSUInteger)_len { NSString *name; name = [NSString stringWithCharacters:_chars length:_len]; [self->memberNameStack addObject:name]; } - (void)start_params:(id)_attrs { if (self->params) { self->invalidCall = YES; return; } self->params = [[NSMutableArray alloc] initWithCapacity:8]; } - (void)end_params { if (self->params == nil) self->invalidCall =YES; } - (void)start_value:(id)_attrs { self->valueNestingLevel++; self->nextCharactersProcessor = @selector(_baseValue:length:); } - (void)end_value { self->valueNestingLevel--; } - (void)_dateValue:(unichar *)_chars length:(NSUInteger)_len { if (self->dateTime) return; self->dateTime = [[NSObject objectWithXmlRpcType:@"dateTime.iso8601" characters:_chars length:_len] retain]; } - (void)_baseValue:(unichar *)_chars length:(NSUInteger)_len { id value; if (self->valueNestingLevel == 0) { NSLog(@"%s: invalidCall......... self->valueNestingLevel = 0", __PRETTY_FUNCTION__); return; } value = [NSObject objectWithXmlRpcType:[self->tagStack lastObject] characters:_chars length:_len]; if (value == nil) value = [NSNull null]; value = [[XmlRpcValue alloc] initWithValue:value className:self->className]; if (self->params == nil) { NSLog(@"%s: invalidCall......... self->params = nil", __PRETTY_FUNCTION__); return; } [self _addValueToParas:value]; [value release]; } - (void)start_i4:(id)_attrs { self->nextCharactersProcessor = @selector(_baseValue:length:); } - (void)start_int:(id)_attrs { self->nextCharactersProcessor = @selector(_baseValue:length:); } - (void)start_double:(id)_attrs { self->nextCharactersProcessor = @selector(_baseValue:length:); } - (void)start_base64:(id)_attrs { self->nextCharactersProcessor = @selector(_baseValue:length:); } - (void)start_boolean:(id)_attrs { self->nextCharactersProcessor = @selector(_baseValue:length:); } - (void)start_string:(id)_attrs { self->nextCharactersProcessor = @selector(_baseValue:length:); } - (void)start_dateTime:(id)_attrs { NSString *tz; NSUInteger idx; [self->timeZone release]; self->timeZone = nil; [self->dateTime release]; self->dateTime = nil; tz = ((idx = [_attrs indexOfRawName:@"timeZone"]) != NSNotFound) ? (id)[_attrs valueAtIndex:idx] : nil; if (tz) { self->timeZone = [[NSTimeZone timeZoneWithAbbreviation:tz] retain]; } self->nextCharactersProcessor = @selector(_dateValue:length:); } - (void)end_dateTime { if (self->dateTime) { NSCalendarDate *date; XmlRpcValue *value; int secFromGMT; if ([self->dateTime respondsToSelector:@selector(setTimeZone:)]) { secFromGMT = [self->timeZone secondsFromGMT]; [self->dateTime setTimeZone:self->timeZone]; date = [self->dateTime dateByAddingYears:0 months:0 days:0 hours:0 minutes:0 seconds:-secFromGMT]; } else { NSLog(@"WARNING(%s): cannot set timezone on date: %@", __PRETTY_FUNCTION__, self->dateTime); date = self->dateTime; } value = [[XmlRpcValue alloc] initWithValue:date className:@"NSCalendarDate"]; [value autorelease]; [self _addValueToParas:value]; } [self->timeZone release]; self->timeZone = nil; [self->dateTime release]; self->dateTime = nil; self->nextCharactersProcessor = NULL; } - (void)start_array:(id)_attrs { id value = [NSMutableArray arrayWithCapacity:8]; value = [[XmlRpcValue alloc] initWithValue:value className:self->className]; [self _addValueToParas:value]; [self->valueStack addObject:value]; self->nextCharactersProcessor = NULL; [value release]; } - (void)end_array { if ([self->valueStack count] > 0) [self->valueStack removeLastObject]; else { NSLog(@"%s: valueStack should be empty: %@", __PRETTY_FUNCTION__, self->valueStack); } } - (void)start_struct:(id)_attrs { id value = [NSMutableDictionary dictionaryWithCapacity:8]; value = [[XmlRpcValue alloc] initWithValue:value className:self->className]; [self _addValueToParas:value]; [self->valueStack addObject:value]; self->nextCharactersProcessor = NULL; [value release]; } - (void)end_struct { if ([self->valueStack count] > 0) [self->valueStack removeLastObject]; else { NSLog(@"%s: valueStack should be empty: %@", __PRETTY_FUNCTION__, self->valueStack); } } - (void)start_member:(id)_attrs { if (![[(XmlRpcValue *)[self->valueStack lastObject] value] isKindOfClass:DictionaryClass]) { self->invalidCall = YES; } else { if (self->memberNameStack == nil) self->memberNameStack = [[NSMutableArray alloc] initWithCapacity:8]; if (self->memberValueStack == nil) self->memberValueStack = [[NSMutableArray alloc] initWithCapacity:8]; } self->nextCharactersProcessor = NULL; } - (void)end_member { id tmp; // TODO: can't we type the var? tmp = [(XmlRpcValue *)[self->valueStack lastObject] value]; if ([self->memberNameStack count] != [self->memberValueStack count]) { NSLog(@"Warning(%s): memberNameStack.count != memberValueStack.count" @" (%@ <--> %@)", __PRETTY_FUNCTION__, self->memberNameStack, self->memberValueStack, nil); [self->memberValueStack release]; self->memberValueStack = nil; [self->memberNameStack release]; self->memberNameStack = nil; self->invalidCall = YES; } else if ([self->memberNameStack count] == 0) { NSLog(@"Warning(%s): memberNameStack and memberValueStack are empty!", __PRETTY_FUNCTION__, nil); [self->memberValueStack release]; self->memberValueStack = nil; [self->memberNameStack release]; self->memberNameStack = nil; self->invalidCall = YES; } else if (![tmp isKindOfClass:DictionaryClass]) self->invalidCall = YES; else { [(NSMutableDictionary *)tmp setObject:[self->memberValueStack lastObject] forKey:[self->memberNameStack lastObject]]; [self->memberNameStack removeLastObject]; [self->memberValueStack removeLastObject]; } } - (void)start_methodCall:(id)_attrs { /* can't create call here, args unknown !!! */ if (self->call != nil) { if (doDebug) NSLog(@"%s: method-call already setup!", __PRETTY_FUNCTION__); self->invalidCall = YES; return; } if (doDebug) NSLog(@"%s: ...", __PRETTY_FUNCTION__); } - (void)end_methodCall { if (self->call != nil) { if (doDebug) NSLog(@"%s: method-call already setup!", __PRETTY_FUNCTION__); self->invalidCall = YES; return; } self->call = [[XmlRpcMethodCall alloc] initWithMethodName:self->methodName parameters:self->params]; /* reset args */ [self->methodName release]; self->methodName = nil; [self->params release]; self->params = nil; } - (void)start_methodResponse:(id)_attrs { if (self->response != nil) { if (doDebug) NSLog(@"%s: method-response already setup!", __PRETTY_FUNCTION__); self->invalidCall = YES; return; } } - (void)end_methodResponse { if (doDebug) NSLog(@"%s: begin ...", __PRETTY_FUNCTION__); if (self->response != nil) { if (doDebug) NSLog(@"%s: method-response already setup!", __PRETTY_FUNCTION__); self->invalidCall = YES; return; } if ([self->params count] > 1) { if (doDebug) { NSLog(@"%s: has more than one params (%i)!", __PRETTY_FUNCTION__, [self->params count]); } self->invalidCall = YES; } if (self->invalidCall) { NSException *error; if (doDebug) NSLog(@"%s: response marked as invalid!", __PRETTY_FUNCTION__); error = [NSException exceptionWithName:@"error while parsing response" reason:@"error while parsing response" userInfo:nil]; [self->params release]; self->params = [[NSMutableArray arrayWithObject:error] retain]; } self->response = [[XmlRpcMethodResponse alloc] initWithResult:[self->params lastObject]]; if (doDebug) NSLog(@"%s: response: %@", __PRETTY_FUNCTION__, self->response); /* reset args */ [self->params release]; self->params = nil; if (doDebug) NSLog(@"%s: done.", __PRETTY_FUNCTION__); } - (void)start_methodName:(id)_attrs { if (self->call != nil) { self->invalidCall = YES; return; } self->nextCharactersProcessor = @selector(_methodName:length:); } - (void)end_methodName { self->nextCharactersProcessor = NULL; } - (void)_methodName:(unichar *)_chars length:(NSUInteger)_len { [self->methodName release]; self->methodName = [[NSString alloc] initWithCharacters:_chars length:_len]; } - (void)start_fault:(id)_attrs { if (self->params) { self->invalidCall = YES; return; } else self->params = [[NSMutableArray alloc] initWithCapacity:2]; self->nextCharactersProcessor = NULL; } - (void)end_fault { if (self->params == nil) self->invalidCall = YES; self->nextCharactersProcessor = NULL; /* fixup result class */ if ([self->params count] != 1) { NSLog(@"XML-RPC: incorrect params count (should be 1 for faults) ?: %@", self->params); } else { XmlRpcValue *fault; fault = [self->params objectAtIndex:0]; if (![fault isException]) { if ([fault isDictionary]) { [fault setClassName:@"NSException"]; } else { NSException *e; NSString *name; NSString *reason; NSLog(@"XML-RPC: got incorrect fault object (class=%@) ?: %@", [fault className], fault); name = [NSString stringWithFormat:@"XmlRpcFault<%@>", [fault valueForKey:@"faultCode"]]; if (name == nil) name = @"GenericXmlRpcFault"; reason = [fault valueForKey:@"faultString"]; if (reason == nil) reason = name; e = [NSException exceptionWithName:name reason:reason userInfo:nil]; [self->params replaceObjectAtIndex:0 withObject:e]; } } } } /* generic dispatcher */ - (void)startElement:(NSString *)_localName namespace:(NSString *)_ns rawName:(NSString *)_rawName attributes:(id)_attrs { NSString *tmp = nil; SEL sel; NSUInteger idx; [self->tagStack addObject:_rawName]; tmp = ((idx = [_attrs indexOfRawName:@"NSObjectClass"]) != NSNotFound) ? (id)[_attrs valueAtIndex:idx] : nil; [self->className autorelease]; self->className = [tmp retain]; if (self->invalidCall) return; if ([_rawName isEqualToString:@"dateTime.iso8601"]) _rawName = @"dateTime"; [self->characters setString:@""]; tmp = [NSString stringWithFormat:@"start_%@:",_rawName]; if ((sel = NSSelectorFromString(tmp))) { if ([self respondsToSelector:sel]) [self performSelector:sel withObject:_attrs]; } } - (void)endElement:(NSString *)_localName namespace:(NSString *)_ns rawName:(NSString *)_rawName { NSUInteger stackDepth, lastIdx; NSString *tmp; SEL sel; if (self->nextCharactersProcessor != NULL) { void (*m)(id, SEL, unichar *, NSUInteger); unichar *chars; NSUInteger len; len = [self->characters length]; chars = malloc(sizeof(unichar)*len); [self->characters getCharacters:chars]; if ((m = (void*)[self methodForSelector:self->nextCharactersProcessor])) m(self, self->nextCharactersProcessor, chars, len); free(chars); } self->nextCharactersProcessor = NULL; if ((stackDepth = [self->tagStack count]) == 0) { self->invalidCall = YES; return; } lastIdx = stackDepth - 1; if (![[self->tagStack objectAtIndex:lastIdx] isEqualToString:_rawName]) { self->invalidCall = YES; return; } [self->tagStack removeObjectAtIndex:lastIdx]; stackDepth--; if (self->invalidCall) { return; } if ([_rawName isEqualToString:@"dateTime.iso8601"]) _rawName = @"dateTime"; tmp = [NSString stringWithFormat:@"end_%@", _rawName]; if ((sel = NSSelectorFromString(tmp))) { if ([self respondsToSelector:sel]) [self performSelector:sel]; } } - (void)characters:(unichar *)_chars length:(NSUInteger)_len { if (_len > 0) { [self->characters appendString: [NSString stringWithCharacters:_chars length:_len]]; } } /* errors */ - (void)warning:(SaxParseException *)_exception { NSLog(@"XML-RPC warning: %@", _exception); } - (void)error:(SaxParseException *)_exception { NSLog(@"XML-RPC error: %@", _exception); } @end /* XmlRpcSaxHandler */ SOPE/sope-xml/XmlRpc/COPYRIGHT0000644000000000000000000000010612242733420014562 0ustar rootrootCopyright (C) 2000-2005 SKYRIX Software AG Contact: info@skyrix.com SOPE/sope-xml/XmlRpc/XmlRpcMethodCall.h0000644000000000000000000000257712242733420016620 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __XmlRpcMethodCall_H__ #define __XmlRpcMethodCall_H__ #import @class NSString, NSArray, NSData; @interface XmlRpcMethodCall : NSObject { NSString *methodName; NSArray *parameters; } - (id)initWithXmlRpcString:(NSString *)_xmlRpcString; - (id)initWithXmlRpcData:(NSData *)_xmlRpcData; - (id)initWithMethodName:(NSString *)_name parameters:(NSArray *)_params; /* accessors */ - (void)setMethodName:(NSString *)_name; - (NSString *)methodName; - (void)setParameters:(NSArray *)_params; - (NSArray *)parameters; - (NSString *)xmlRpcString; @end #endif /* __XmlRpcMethodCall_H__ */ SOPE/sope-xml/XmlRpc/XmlRpcRequestEncoder.m0000644000000000000000000000420012242733420017522 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "XmlRpcCoder.h" #include "XmlRpcMethodCall.h" #include "common.h" @interface XmlRpcEncoder(PrivateMethodes) - (void)_encodeObject:(id)_object; - (void)_reset; @end @implementation XmlRpcRequestEncoder - (void)encodeRootObject:(XmlRpcMethodCall *)_methodCall { NSEnumerator *paramEnum; id param; if (_methodCall == nil) return; if (![_methodCall isKindOfClass:[XmlRpcMethodCall class]]) { NSLog(@"%s: Warning: rootObject MUST be a XmlRpcMethodCall\n " @"(rootObject=%@)", __PRETTY_FUNCTION__, _methodCall); return; } [self _reset]; paramEnum = [[_methodCall parameters] objectEnumerator]; [self->string appendString:@"\n"]; [self->string appendString:@"\n"]; [self->string appendString:@""]; [self->string appendString:[_methodCall methodName]]; [self->string appendString:@"\n"]; [self->string appendString:@"\n"]; while ((param = [paramEnum nextObject])) { [self->string appendString:@"\n"]; [self->string appendString:@"\n"]; [self _encodeObject:param]; [self->string appendString:@"\n"]; [self->string appendString:@"\n"]; } [self->string appendString:@"\n"]; [self->string appendString:@"\n"]; } @end /* XmlRpcRequestEncoder */ SOPE/sope-xml/XmlRpc/NSDictionary+XmlRpcCoding.m0000644000000000000000000000227012242733420020344 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "XmlRpcMethodResponse.h" #include "NSObject+XmlRpc.h" #include "common.h" #include "XmlRpcCoder.h" @implementation NSDictionary(XmlRpcCoding) - (NSString *)xmlRpcType { return @"struct"; } - (void)encodeWithXmlRpcCoder:(XmlRpcEncoder *)_coder { [_coder encodeStruct:self]; } + (id)decodeObjectWithXmlRpcCoder:(XmlRpcDecoder *)_coder { return [_coder decodeStruct]; } @end /* NSDictionary(XmlRpcCoding) */ SOPE/sope-xml/XmlRpc/ChangeLog0000644000000000000000000002550612242733420015054 0ustar rootroot2007-02-12 Helge Hess * XmlRpcSaxHandler.m, XmlRpcDecoder.m: fixed a few gnustep-base compilation warnings (v4.7.31) 2006-09-20 Helge Hess * GNUmakefile.preamble: filter out -O% flags for files using exception handlers, enable -O2 per default (v4.5.30) 2006-08-24 Helge Hess * NSObject+XmlRpc.m: added support for 'nil' type as submitted by xmlrpclib with the 'allow_none' option set (v4.5.29) 2006-07-03 Helge Hess * fixed gcc 4.1 warnings, use %p for pointer formats (v4.5.28) 2006-02-26 Marcus Mueller * XmlRpcValue.m: fixed stupid bugs in -isException and -isDictionary, which formerly lead to unreadable exception garbage whenever a remote exception occured. NOTE: have we had proper unit tests, this probably wouldn't have splipped through so easily. :-) (v4.5.27) 2005-11-17 Helge Hess * NSMutableString+XmlRpcDecoder.m: properly include string.h to fix a memcpy warning (v4.5.26) 2005-05-03 Helge Hess * NSObject+XmlRpc.m, XmlRpcSaxHandler.m: fixed gcc 4.0 warnings (v4.5.25) 2005-04-26 Helge Hess * XmlRpcDecoder.m: fixed duplicate decoding of base64 values in XML-RPC results (v4.5.24) 2004-12-14 Marcus Mueller * XmlRpc.xcode: minor cleanup 2004-09-22 Marcus Mueller * XmlRpc.xcode: minor fixes 2004-09-21 Marcus Mueller * XmlRpc.xcode: Fixed dependencies to resemble the make process more closely. Our aim should be to stick to the make process as closely as possible, so we shouldn't introduce dependencies in non-toplevel projects. 2004-08-29 Helge Hess * added hack to install the project in FHS locations - the library, its headers, the tools and the resources will be installed in FHS_INSTALL_ROOT if specified (eg make FHS_INSTALL_ROOT=/usr/local) (v4.3.23) 2004-08-29 Marcus Mueller * XmlRpc.xcode: moved unused source into Unused group. Fixed file encodings. 2004-08-27 Helge Hess * XmlRpc.xcode: fixed Xcode project 2004-08-26 Marcus Mueller * XmlRpc.xcode: new Xcode project 2004-08-20 Helge Hess * moved to SOPE 4.3 (v4.3.22) 2004-06-09 Helge Hess * v4.2.21 * GNUmakefile.preamble: added prebinding info * GNUmakefile: moved preamble stuff to GNUmakefile.preamble, also build XmlRpc.framework on non-libFoundation systems 2004-05-09 Helge Hess * XmlRpcDecoder.m: do not print a compile warning if NSXMLParser is used (on MacOSX) (v4.2.20) 2004-05-05 Marcus Mueller * GNUmakefile.preamble: added support for building with GNUSTEP_BUILD_DIR environment variable set for recent gnustep-make package. (v4.2.19) 2003-11-19 Helge Hess * GNUmakefile: removed autodoc target 2003-11-09 Helge Hess * v4.2.18 * XmlRpcDecoder.m: can use NSXMLParser for parsing, if available * XmlRpcMethodResponse: now accepts an NSData object for parsing, this avoids costly conversions between NSString and NSData for parsing ... * XmlRpcRequestDecoder.m, XmlRpcSaxHandler.m: added debug logging facilities 2003-10-30 Helge Hess * XmlRpcDecoder.m: fixed some Xcode warnings (v4.2.17) 2003-08-29 Helge Hess * fixed an MacOSX warning in XmlRpcEncoder (v4.2.16) 2003-08-28 Helge Hess * v4.2.15 * NSObject+XmlRpc.m: catch year-values bigger than 2033 or smaller than 1900 and transform them into something usable by libFoundation (problem exposed by JOGI) * XmlRpcEncoder.m: moved string category to separate file * XmlRpcDecoder.m: smaller cleanups 2003-08-11 Helge Hess * v4.2.14 * NSObject+XmlRpc.m: map XML-RPC "value" type to "NSString". This happens if the XML-RPC client does not send the "string" tag (abc instead of abc) 2003-07-18 Helge Hess * NSNotification+XmlRpcCoding.m: use -name instead of -notificationName to get the name of the notification for encoding (required for gstep-base, Cocoa, also works on lF) (v4.2.13) 2003-04-28 Helge Hess * XmlRpcEncoder.m: fixed a bug in encode-datetime (wrong timezone was used due to a bug in libFoundation), smaller speed optimizations (v4.2.12) 2003-02-04 Helge Hess * v4.2.11 * XmlRpcSaxHandler.m: if an incorrect fault object is returned, try to transform it to a exception * XmlRpcEncoder.m: renamed -appendHTMLString: to -appendXmlRpcString:, added specialized methods for adding int and double members (since performSelector:withObject: doesn't coerce arguments on Cocoa) 2003-01-30 Helge Hess * XmlRpcMethodCall.m: removed dependency on -shallowCopy (dependency to EOControl being linked in ...) (v4.2.10) 2003-01-07 Helge Hess * v4.2.9 * NSDate+XmlRpcCoding.m: fixed a warning on MacOSX * common.h: removed dependency on FoundationExt on MacOSX Thu Jan 2 10:52:41 2003 Helge Hess * v4.2.8 * common.h: defined ASSIGN macro if missing * XmlRpcValue.m, XmlRpcDecoder.m: do not use AUTORELEASE macros Fri Dec 27 10:56:51 2002 Helge Hess * XmlRpcEncoder.m: added a new escaping function which works with unicode strings (v4.2.7) 2002-09-28 Helge Hess * removed some compilation warnings (v4.2.6) 2002-09-03 Helge Hess * made docs AutoDoc compliant 2002-08-08 Helge Hess * XmlRpcDecoder.m: fixed major bugs in the XML-RPC decoding code, when contained in structures, base types like int,bool resulted in a core dump (basetypes were handled like objects) 2002-07-03 Helge Hess * NSException+XmlRpcCoding.m: improved mapping of NSException's to XML-RPC faults * XmlRpcMethodResponse.m: added better -description Tue Jul 2 16:09:45 2002 Bjoern Stierand * fixed a bug with exception encoding/decoding 2002-07-01 Helge Hess * replaced -initWithXmlRpcDecoder: with -decodeObjectWithXmlRpcCoder: due to a problem with releasing newly allocated objects in MacOSX Fri May 17 11:03:12 2002 Helge Hess * XmlRpcValue.m: added some stuff for the fix below * XmlRpcSaxHandler.m: added a fixup to end_fault that turns NSDictionary XmlRpcValues into NSExceptions * XmlRpcResponseDecoder.m: pass string directly to the parser, not an NSData generated using NSASCIIStringEncoding ... Thu May 2 12:58:59 2002 Helge Hess * changed to use -rangeOfString: instead of -indexOfString: Thu Feb 28 15:16:21 2002 Jan41 Reichmann * NSException+XmlRpcCoding.m: fixed encode bug Wed Feb 27 11:51:17 2002 Helge Hess * added -xmlRpcType method to determine the "default" type which will result in encoding the object as XML-RPC Tue Feb 26 10:18:50 2002 Bjoern Stierand * XmlRpcEncoder.m: removed newlines created during en-/decoding Mon Feb 25 17:41:03 2002 Martin Spindler * XmlRpcSaxHandler.m: decode test as string Wed Feb 13 13:52:09 2002 Helge Hess * moved generic stuff to XML/XmlRpc Sat Feb 9 13:00:11 2002 Helge Hess * XmlRpcSaxHandler.m: added warning and error handlers ... * XmlRpcDecoder.m: improved error output Fri Feb 8 17:35:05 2002 Helge Hess * XmlRpcDecoder.m: fixed charset problems Fri Feb 8 12:29:28 2002 Helge Hess * WODirectAction+XmlRpcIntrospection.m: changed to return "string" signature for object types Thu Feb 7 20:19:55 2002 Helge Hess * WODirectAction+XmlRpc.m: autogenerate SandStorm component name Wed Jan 30 18:16:31 2002 Helge Hess * WODirectAction+XmlRpcIntrospection.m: fixed bug with method names * NGXmlRpcInvocation.m: convert types prior to call, if signature is available Tue Jan 29 18:30:56 2002 Helge Hess * added NGXmlRpcInvocation, NGXmlRpcMethodSignature Mon Jan 28 18:46:34 2002 Helge Hess * WODirectAction+XmlRpc.m: improved reflection capabilities * WODirectAction+XmlRpc.m: support a GET action for dynamic reflection * WODirectAction+XmlRpc.m: added method to define component prefix Fri Jan 25 18:36:58 2002 Helge Hess * WODirectAction+XmlRpc.m: use RPC2 as action name ... * added NGXmlRpcClient class Thu Jan 17 17:23:09 2002 Martin Spindler * NSObject+XmlRpc.m: raise exception if coding methods arn't supported Tue Nov 13 09:34:54 2001 Helge Hess * EOKeyGlobalID+XmlRpcCoding.m: removed unnecessary retain/autorelease Tue Nov 13 01:06:50 2001 Jan41 Reichmann * EOKeyGlobalID+XmlRpcCoding.m: fixed decoding bug Wed Oct 24 13:23:54 2001 Martin Spindler * XmlRpcSaxHandler.m: fixed multiple call of -characters:length: Mon Oct 22 20:53:33 2001 Helge Hess * XmlRpcEncoder.m: normalize NSString subclasses Mon Oct 22 18:20:54 2001 Helge Hess * XmlRpcMethodResponse+WO.m: enabled UTF-8 for result encoding Wed Oct 10 19:42:17 2001 Martin Spindler * XmlRpcEncoder.m: use -classForCoder instead of -class Tue Aug 28 15:38:05 2001 Martin Spindler * changed 'timeZone' - tag into 'timeZone' - attribute Tue Aug 28 14:21:54 2001 Martin Spindler * support of 'timeZone' - tag (not xmlprc compatible!) * XmlRpcCoder: added accessors for defaultTimeZone Mon Aug 27 10:47:03 2001 Helge Hess * moved SKYRiX Logic categories back to skyxmlrpcd Wed Aug 22 15:41:39 2001 Helge Hess * XmlRpcDecoder.m: decode dates as calendar-dates Wed Aug 22 14:56:22 2001 Helge Hess * use ObjC base-types for decoding/encoding numbers Wed Aug 22 11:36:02 2001 Helge Hess * NSDate+XmlRpcCoding.m: fixed NSTimeZone decoding * NSArray+XmlRpcCoding.m: fixed NSEnumerator coding, fixed RC bugs Mon Aug 20 21:55:41 2001 Helge Hess * created ChangeLog SOPE/sope-xml/XmlRpc/NSArray+XmlRpcCoding.m0000644000000000000000000000455612242733420017326 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "XmlRpcMethodResponse.h" #include "XmlRpcCoder.h" #include "NSObject+XmlRpc.h" #include "common.h" @implementation NSEnumerator(XmlRpcCoding) - (NSString *)xmlRpcType { return @"array"; } - (void)encodeWithXmlRpcCoder:(XmlRpcEncoder *)_coder { NSMutableArray *objs; id obj; /* make a copy to keep the enum state */ self = [self copy]; objs = [[NSMutableArray alloc] initWithCapacity:16]; while ((obj = [self nextObject])) [objs addObject:obj]; [_coder encodeArray:objs]; [objs release]; [self release]; } + (id)decodeObjectWithXmlRpcCoder:(XmlRpcDecoder *)_coder { return [[_coder decodeArray] objectEnumerator]; } @end /* NSEnumerator(XmlRpc) */ @implementation NSArray(XmlRpcCoding) - (NSString *)xmlRpcType { return @"array"; } - (NSArray *)xmlRpcElementSignature { unsigned i, count; NSMutableArray *ma; if ((count = [self count]) == 0) return [NSArray array]; ma = [NSMutableArray arrayWithCapacity:count]; for (i = 0; i < count; i++) [ma addObject:[[self objectAtIndex:i] xmlRpcType]]; return ma; } - (void)encodeWithXmlRpcCoder:(XmlRpcEncoder *)_coder { [_coder encodeArray:self]; } + (id)decodeObjectWithXmlRpcCoder:(XmlRpcDecoder *)_coder { return [_coder decodeArray]; } @end /* NSArray(XmlRpc) */ @implementation NSSet(XmlRpcCoding) - (NSString *)xmlRpcType { return @"array"; } - (void)encodeWithXmlRpcCoder:(XmlRpcEncoder *)_coder { [_coder encodeArray:[self allObjects]]; } + (id)decodeObjectWithXmlRpcCoder:(XmlRpcDecoder *)_coder { return [NSSet setWithArray:[_coder decodeArray]]; } @end /* NSSet(XmlRpcCoding) */ SOPE/sope-xml/XmlRpc/NSMutableString+XmlRpcDecoder.m0000644000000000000000000001015512242733420021162 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "common.h" #include @implementation NSMutableString(XmlRpcDecoder) - (void)appendXmlRpcString:(NSString *)_value { #if 1 // TODO: to be tested ! unsigned i, j, len; unichar *buf, *escbuf = NULL; if ((len = [_value length]) == 0) /* nothing to add ... */ return; if (len == 1) { /* a single char */ unichar c; switch ((c = [_value characterAtIndex:0])) { case '&': [self appendString:@"&"]; break; case '<': [self appendString:@"<"]; break; case '>': [self appendString:@">"]; break; case '"': [self appendString:@"""]; break; default: [self appendString:_value]; break; } return; } buf = calloc(len + 2, sizeof(unichar)); [_value getCharacters:buf]; for (i = 0, j = 0; i < len; i++) { switch (buf[i]) { case '&': case '<': case '>': case '"': { if (escbuf == NULL) { /* worst case: string consists of quotes */ escbuf = calloc(len * 6 + 2, sizeof(unichar)); memcpy(escbuf, buf, i * sizeof(unichar)); j = i; } escbuf[j++] = '&'; switch (buf[i]) { case '&': escbuf[j++] = 'a'; escbuf[j++] = 'm'; escbuf[j++] = 'p'; break; case '<': escbuf[j++] = 'l'; escbuf[j++] = 't'; break; case '>': escbuf[j++] = 'g'; escbuf[j++] = 't'; break; case '"': escbuf[j++] = 'q'; escbuf[j++] = 'u'; escbuf[j++] = 'o'; escbuf[j++] = 't'; break; } escbuf[j++] = ';'; break; } default: if (escbuf) escbuf[j++] = buf[i]; break; } } if (escbuf) { NSString *s; s = [[NSString alloc] initWithCharacters:escbuf length:j]; [self appendString:s]; [s release]; free(escbuf); } else [self appendString:_value]; if (buf) free(buf); #else #warning UNICODE !!! void (*addBytes)(id,SEL,const char *,unsigned); id dummy = nil; unsigned clen; unsigned char *cbuf; unsigned char *cstr; if ([_value length] == 0) return; clen = [_value cStringLength]; if (clen == 0) return; /* nothing to add .. */ cbuf = cstr = malloc(clen + 1); [_value getCString:cbuf]; cbuf[clen] = '\0'; dummy = [[NSMutableData alloc] initWithCapacity:2*clen]; addBytes = (void*)[dummy methodForSelector:@selector(appendBytes:length:)]; NSAssert(addBytes != NULL, @"could not get appendBytes:length: .."); while (*cstr) { switch (*cstr) { case '&': addBytes(dummy, @selector(appendBytes:length:), "&", 5); break; case '<': addBytes(dummy, @selector(appendBytes:length:), "<", 4); break; case '>': addBytes(dummy, @selector(appendBytes:length:), ">", 4); break; case '"': addBytes(dummy, @selector(appendBytes:length:), """, 6); break; default: addBytes(dummy, @selector(appendBytes:length:), cstr, 1); break; } cstr++; } free(cbuf); { NSString *tmp = nil; tmp = [[NSString alloc] initWithData:dummy encoding:[NSString defaultCStringEncoding]]; [self appendString:tmp]; [tmp release]; } #endif } @end /* NSMutableString(XmlRpcDecoder) */ SOPE/sope-xml/XmlRpc/XmlRpcCoder.h0000644000000000000000000001216012242733420015625 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __XmlRpc_XmlRpcCoder_H__ #define __XmlRpc_XmlRpcCoder_H__ #import @class NSDictionary, NSArray, NSNumber, NSString, NSCalendarDate, NSData; @class NSMutableArray, NSMutableString, NSTimeZone, NSDate; @class XmlRpcValue, XmlRpcMethodCall, XmlRpcMethodResponse; /*" The XmlRpcEncoder is used to encode XML-RPC objects. It's pretty much like NSArchiver, only for XML-RPC. Encoder example: NSMutableString *str; // asume that exists XmlRpcMethodResponse *methodResponse; // asume that exists XmlRpcMethodCall *methodCall; // asume that exists coder = [[XmlRpcEncoder alloc] initForWritingWithMutableString:str]; [coder encodeMethodCall:methodCall]; // or [coder encodeMethodResponse:methodResponse]; "*/ @interface XmlRpcEncoder : NSObject { NSMutableString *string; NSMutableArray *objectStack; NSMutableArray *objectHasStructStack; NSTimeZone *timeZone; } - (id)initForWritingWithMutableString:(NSMutableString *)_string; - (void)encodeMethodCall:(XmlRpcMethodCall *)_methodCall; - (void)encodeMethodResponse:(XmlRpcMethodResponse *)_methodResponse; - (void)encodeStruct:(NSDictionary *)_struct; - (void)encodeArray:(NSArray *)_array; - (void)encodeBase64:(NSData *)_data; - (void)encodeBoolean:(BOOL)_number; - (void)encodeInt:(int)_number; - (void)encodeDouble:(double)_number; - (void)encodeString:(NSString *)_string; - (void)encodeDateTime:(NSDate *)_date; - (void)encodeObject:(id)_object; - (void)encodeStruct:(NSDictionary *)_struct forKey:(NSString *)_key; - (void)encodeArray:(NSArray *)_array forKey:(NSString *)_key; - (void)encodeBase64:(NSData *)_data forKey:(NSString *)_key; - (void)encodeBoolean:(BOOL)_number forKey:(NSString *)_key; - (void)encodeInt:(int)_number forKey:(NSString *)_key; - (void)encodeDouble:(double)_number forKey:(NSString *)_key; - (void)encodeString:(NSString *)_string forKey:(NSString *)_key; - (void)encodeDateTime:(NSDate *)_date forKey:(NSString *)_key; - (void)encodeObject:(id)_object forKey:(NSString *)_key; - (void)setDefaultTimeZone:(NSTimeZone *)_timeZone; - (NSTimeZone *)defaultTimeZone; @end @class NSMutableSet; /*" The XmlRpcDecoder is used to decode XML-RPC objects. It's pretty much like NSUnarchiver, only for XML-RPC. Decoder example: NSString *xmlRpcString; // asume that exists XmlRpcMethodCall *methodCall = nil; XmlRpcMethodResponse *methodResponse = nil; coder = [[XmlRpcDecoder alloc] initForReadingWithString:xmlRpcString]; methodCall = [coder decodeMethodCall]; // or methodResponse = [coder decodeMethodResponse]; "*/ @interface XmlRpcDecoder : NSObject { NSData *data; NSMutableArray *valueStack; unsigned nesting; NSMutableArray *unarchivedObjects; NSMutableSet *awakeObjects; NSTimeZone *timeZone; } - (id)initForReadingWithString:(NSString *)_string; - (id)initForReadingWithData:(NSData *)_data; - (XmlRpcMethodCall *)decodeMethodCall; - (XmlRpcMethodResponse *)decodeMethodResponse; /* decoding */ - (NSDictionary *)decodeStruct; - (NSArray *)decodeArray; - (NSData *)decodeBase64; - (BOOL)decodeBoolean; - (int)decodeInt; - (double)decodeDouble; - (NSString *)decodeString; - (NSCalendarDate *)decodeDateTime; - (id)decodeObject; - (NSDictionary *)decodeStructForKey:(NSString *)_key; - (NSArray *)decodeArrayForKey:(NSString *)_key; - (NSData *)decodeBase64ForKey:(NSString *)_key; - (BOOL)decodeBooleanForKey:(NSString *)_key; - (int)decodeIntForKey:(NSString *)_key; - (double)decodeDoubleForKey:(NSString *)_key; - (NSString *)decodeStringForKey:(NSString *)_key; - (NSCalendarDate *)decodeDateTimeForKey:(NSString *)_key; - (id)decodeObjectForKey:(NSString *)_key; - (void)setDefaultTimeZone:(NSTimeZone *)_timeZone; - (NSTimeZone *)defaultTimeZone; /* operations */ - (void)ensureObjectAwake:(id)_object; - (void)finishInitializationOfObjects; - (void)awakeObjects; @end @interface NSObject(XmlRpcCoder) + (id)decodeObjectWithXmlRpcCoder:(XmlRpcDecoder *)_decoder; - (void)encodeWithXmlRpcCoder:(XmlRpcEncoder *)_coder; @end @interface NSObject(XmlRpcDecoderAwakeMethods) - (void)finishInitializationWithXmlRpcDecoder:(XmlRpcDecoder *)_decoder; - (void)awakeFromXmlRpcDecoder:(XmlRpcDecoder *)_decoder; @end #endif /* __XmlRpc_XmlRpcCoder_H__ */ SOPE/sope-xml/XmlRpc/NSString+XmlRpcCoding.m0000644000000000000000000000226012242733420017504 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "XmlRpcMethodResponse.h" #include "NSObject+XmlRpc.h" #include "XmlRpcCoder.h" #include "common.h" @implementation NSString(XmlRpcCoding) + (id)decodeObjectWithXmlRpcCoder:(XmlRpcDecoder *)_coder { return [_coder decodeString]; } - (NSString *)xmlRpcType { return @"string"; } - (void)encodeWithXmlRpcCoder:(XmlRpcEncoder *)_coder { [_coder encodeString:self]; } @end /* NSString(XmlRpcCoding) */ SOPE/sope-xml/XmlRpc/XmlRpcEncoder.m0000644000000000000000000003354312242733420016165 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "XmlRpcCoder.h" #include "XmlRpcMethodCall.h" #include "XmlRpcMethodResponse.h" #include "common.h" @interface NSMutableString(XmlRpcDecoder) - (void)appendXmlRpcString:(NSString *)_value; @end @interface NSData(UsedNGExtensions) - (NSData *)dataByEncodingBase64; @end @implementation XmlRpcEncoder static NSTimeZone *gmt = nil; static BOOL profileOn = NO; static Class NSNumberClass = Nil; + (void)initialize { NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; profileOn = [ud boolForKey:@"ProfileXmlRpcCoding"]; gmt = [[NSTimeZone timeZoneWithAbbreviation:@"GMT"] retain]; NSNumberClass = [NSNumber class]; } - (id)initForWritingWithMutableString:(NSMutableString *)_string { if ((self = [super init])) { self->string = [_string retain]; self->timeZone = [gmt retain]; } return self; } - (void)dealloc { [self->string release]; [self->objectStack release]; [self->objectHasStructStack release]; [self->timeZone release]; [super dealloc]; } - (BOOL)profileXmlRpcCoding { return profileOn; } /* accessors */ - (void)setDefaultTimeZone:(NSTimeZone *)_timeZone { [self->timeZone autorelease]; self->timeZone = [_timeZone retain]; } /*" This returns the timezone which will be associated with XML-RPC datetime objects. Note: XML-RPC datetime values have no! associated timezone, it's recommended that you always use UTC though. "*/ - (NSTimeZone *)defaultTimeZone { return self->timeZone; } /* *** */ - (void)encodeMethodCall:(XmlRpcMethodCall *)_methodCall { NSEnumerator *paramEnum = [[_methodCall parameters] objectEnumerator]; id param; NSTimeInterval st = 0.0; if ([self profileXmlRpcCoding]) st = [[NSDate date] timeIntervalSince1970]; [self->string appendString:@""]; [self->string appendString:@""]; [self->string appendString:@""]; [self->string appendString:[_methodCall methodName]]; [self->string appendString:@""]; [self->string appendString:@""]; while ((param = [paramEnum nextObject])) { [self->string appendString:@""]; [self->string appendString:@""]; [self encodeObject:param]; [self->string appendString:@""]; [self->string appendString:@""]; } [self->string appendString:@""]; [self->string appendString:@""]; if ([self profileXmlRpcCoding]) { NSTimeInterval diff; diff = [[NSDate date] timeIntervalSince1970] - st; printf("+++ encodeMethodCall: %0.5fs\n", diff); } } - (void)encodeMethodResponse:(XmlRpcMethodResponse *)_methodResponse { id result = [_methodResponse result]; static Class ExceptionClass = Nil; NSTimeInterval st = 0.0; if ([self profileXmlRpcCoding]) st = [[NSDate date] timeIntervalSince1970]; if (ExceptionClass == Nil) ExceptionClass = [NSException class]; [self->string appendString:@""]; [self->string appendString:@""]; if ([result isKindOfClass:ExceptionClass]) { [self->string appendString:@""]; [self->string appendString:@""]; [self encodeObject:result]; [self->string appendString:@""]; [self->string appendString:@""]; } else { [self->string appendString:@""]; [self->string appendString:@""]; [self->string appendString:@""]; [self encodeObject:result]; [self->string appendString:@""]; [self->string appendString:@""]; [self->string appendString:@""]; } [self->string appendString:@""]; if ([self profileXmlRpcCoding]) { NSTimeInterval diff; diff = [[NSDate date] timeIntervalSince1970] - st; printf("+++ enocdeMethodResponse: %0.5fs\n", diff); } } - (void)_reset { [self->objectStack release]; self->objectStack = nil; [self->objectHasStructStack release]; self->objectHasStructStack = nil; } - (void)_ensureStacks { if (self->objectStack == nil) self->objectStack = [[NSMutableArray alloc] initWithCapacity:8]; if (self->objectHasStructStack == nil) self->objectHasStructStack = [[NSMutableArray alloc] initWithCapacity:8]; } - (void)_encodeObject:(id)_object { if (_object) { [self _ensureStacks]; [self->objectStack addObject:_object]; [self->objectHasStructStack addObject:@"NO"]; [_object encodeWithXmlRpcCoder:self]; if ([[self->objectHasStructStack lastObject] boolValue]) { [self->string appendString:@""]; } [self->objectHasStructStack removeLastObject]; [self->objectStack removeLastObject]; } } - (NSString *)_className { id obj; if ((obj = [self->objectStack lastObject]) == nil) return nil; if ([obj isKindOfClass:[NSString class]]) return @"NSString"; return NSStringFromClass([obj classForCoder]); } - (void)encodeObject:(id)_obj { [self _encodeObject:_obj]; } - (BOOL)isObjectClassAttributeEnabled { // adding of NSObjectClass removed due to compatibility issues ! return NO; } - (void)_appendTagName:(NSString *)_tagName attributes:(NSDictionary *)_attrs { NSEnumerator *keyEnum = [_attrs keyEnumerator]; NSString *key = nil; [self->string appendString:@"<"]; [self->string appendString:_tagName]; if ([self isObjectClassAttributeEnabled]) { NSString *className = [self _className]; if ([className length] > 0) { [self->string appendString:@" NSObjectClass=\""]; [self->string appendXmlRpcString:className]; [self->string appendString:@"\""]; } } while ((key = [keyEnum nextObject])) { [self->string appendString:@" "]; [self->string appendString:key]; [self->string appendString:@"=\""]; [self->string appendXmlRpcString:[_attrs objectForKey:key]]; [self->string appendString:@"\""]; } [self->string appendString:@">"]; } - (void)_appendTagName:(NSString *)_tagName { [self _appendTagName:_tagName attributes:nil]; } - (void)_encodeNumber:(NSNumber *)_number tagName:(NSString *)_tagName { [self _appendTagName:_tagName]; if ([_tagName isEqualToString:@"boolean"]) [self->string appendString:[_number boolValue] ? @"1" : @"0"]; else if ([_tagName isEqualToString:@"int"]) [self->string appendFormat:@"%i", [_number intValue]]; else [self->string appendXmlRpcString:[_number stringValue]]; [self->string appendString:@"string appendString:_tagName]; [self->string appendString:@">"]; } - (void)encodeStruct:(NSDictionary *)_struct { NSEnumerator *keys = nil; id key = nil; [self _appendTagName:@"struct"]; keys = [_struct keyEnumerator]; while ((key = [keys nextObject])) { [self->string appendString:@""]; [self->string appendString:@""]; [self->string appendXmlRpcString:key]; [self->string appendString:@""]; [self->string appendString:@""]; [self _encodeObject:[_struct objectForKey:key]]; [self->string appendString:@""]; [self->string appendString:@""]; } [self->string appendString:@""]; } - (void)encodeArray:(NSArray *)_array { NSEnumerator *valueEnum = [_array objectEnumerator]; id value; [self _appendTagName:@"array"]; [self->string appendString:@""]; while ((value = [valueEnum nextObject])) { [self->string appendString:@""]; [self _encodeObject:value]; [self->string appendString:@""]; } [self->string appendString:@""]; [self->string appendString:@""]; } - (void)encodeBase64:(NSData *)_data { NSString *base64; base64 = [[NSString alloc] initWithData:[_data dataByEncodingBase64] encoding:NSASCIIStringEncoding]; [self _appendTagName:@"base64"]; [self->string appendString:base64]; [self->string appendString:@""]; [base64 release]; base64 = nil; } - (void)encodeBoolean:(BOOL)_number { [self _encodeNumber:[NSNumberClass numberWithBool:_number] tagName:@"boolean"]; } - (void)encodeInt:(int)_number { [self _encodeNumber:[NSNumberClass numberWithInt:_number] tagName:@"int"]; } - (void)encodeDouble:(double)_number { [self _encodeNumber:[NSNumberClass numberWithDouble:_number] tagName:@"double"]; } - (void)encodeString:(NSString *)_string { [self _appendTagName:@"string"]; [self->string appendXmlRpcString:_string]; [self->string appendString:@""]; } - (void)encodeDateTime:(NSDate *)_date { static NSDictionary *attrs = nil; NSCalendarDate *date; NSString *s; if (attrs == nil) { attrs = [[NSDictionary alloc] initWithObjectsAndKeys:@"GMT",@"timeZone",nil]; } /* convert parameter to GMT */ #if LIB_FOUNDATION_LIBRARY /* TODO: not sure whether lF handles reference-date correctly ... */ date = [[NSCalendarDate alloc] initWithTimeIntervalSince1970: [_date timeIntervalSince1970]]; #else date = [[NSCalendarDate alloc] initWithTimeIntervalSinceReferenceDate: [_date timeIntervalSinceReferenceDate]]; #endif [date setTimeZone:gmt]; /* format in XML-RPC date format */ s = [[NSString alloc] initWithFormat:@"%04i%02i%02iT%02i:%02i:%02i", [date yearOfCommonEra], [date monthOfYear], [date dayOfMonth], [date hourOfDay], [date minuteOfHour], [date secondOfMinute]]; [date release]; date = nil; [self _appendTagName:@"dateTime.iso8601" attributes:attrs]; [self->string appendString:s]; [self->string appendString:@""]; [s release]; } - (void)_appendMember:(id)_obj forKey:(NSString *)_key selector:(SEL)_sel { [self _ensureStacks]; if (![[self->objectHasStructStack lastObject] boolValue]) { [self->objectHasStructStack removeLastObject]; [self->objectHasStructStack addObject:@"YES"]; [self _appendTagName:@"struct"]; } if (_obj != nil) { [self->objectStack addObject:_obj]; [self->string appendString:@""]; [self->string appendString:_key]; [self->string appendString:@""]; /* this does not work for int/double on OSX, since OSX doesn't coerce the argument to the receivers parameter type */ [self performSelector:_sel withObject:_obj]; [self->string appendString:@""]; [self->objectStack removeLastObject]; } } - (void)_appendInt:(int)_i forKey:(NSString *)_key selector:(SEL)_sel { /* special methods required for OSX */ void (*m)(id,SEL,int); [self _ensureStacks]; if (![[self->objectHasStructStack lastObject] boolValue]) { [self->objectHasStructStack removeLastObject]; [self->objectHasStructStack addObject:@"YES"]; [self _appendTagName:@"struct"]; } [self->objectStack addObject:[NSNumberClass numberWithInt:_i]]; [self->string appendString:@""]; [self->string appendString:_key]; [self->string appendString:@""]; m = (void *)[self methodForSelector:_sel]; m(self, _sel, _i); [self->string appendString:@""]; [self->objectStack removeLastObject]; } - (void)_appendDouble:(double)_d forKey:(NSString *)_key selector:(SEL)_sel { /* special methods required for OSX */ void (*m)(id,SEL,double); [self _ensureStacks]; if (![[self->objectHasStructStack lastObject] boolValue]) { [self->objectHasStructStack removeLastObject]; [self->objectHasStructStack addObject:@"YES"]; [self _appendTagName:@"struct"]; } [self->objectStack addObject:[NSNumberClass numberWithDouble:_d]]; [self->string appendString:@""]; [self->string appendString:_key]; [self->string appendString:@""]; m = (void *)[self methodForSelector:_sel]; m(self, _sel, _d); [self->string appendString:@""]; [self->objectStack removeLastObject]; } - (void)encodeStruct:(NSDictionary *)_struct forKey:(NSString *)_key { [self _appendMember:_struct forKey:_key selector:@selector(encodeStruct:)]; } - (void)encodeArray:(NSArray *)_array forKey:(NSString *)_key { [self _appendMember:_array forKey:_key selector:@selector(encodeArray:)]; } - (void)encodeBase64:(NSData *)_data forKey:(NSString *)_key { [self _appendMember:_data forKey:_key selector:@selector(encodeBase64:)]; } - (void)encodeBoolean:(BOOL)_number forKey:(NSString *)_key { [self _appendInt:(int)_number forKey:_key selector:@selector(encodeBoolean:)]; } - (void)encodeInt:(int)_number forKey:(NSString *)_key { [self _appendInt:_number forKey:_key selector:@selector(encodeInt:)]; } - (void)encodeDouble:(double)_number forKey:(NSString *)_key { [self _appendDouble:_number forKey:_key selector:@selector(encodeDouble:)]; } - (void)encodeString:(NSString *)_string forKey:(NSString *)_key { [self _appendMember:_string forKey:_key selector:@selector(encodeString:)]; } - (void)encodeDateTime:(NSDate *)_date forKey:(NSString *)_key { [self _appendMember:_date forKey:_key selector:@selector(encodeDateTime:)]; } - (void)encodeObject:(id)_object forKey:(NSString *)_key { [self _appendMember:_object forKey:_key selector:@selector(encodeObject:)]; } @end /* XmlRpcEncoder */ SOPE/sope-xml/XmlRpc/XmlRpcResponseEncoder.m0000644000000000000000000000363712242733420017705 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "XmlRpcCoder.h" #include "common.h" @interface XmlRpcEncoder(PrivateMethodes) - (void)_encodeObject:(id)_object; - (void)_reset; @end @implementation XmlRpcResponseEncoder - (void)encodeRootObject:(id)_object { static Class ExceptionClass = Nil; if (ExceptionClass == Nil) ExceptionClass = [NSException class]; [self _reset]; [self->string appendString:@"\n"]; [self->string appendString:@"\n"]; if ([_object isKindOfClass:ExceptionClass]) { [self->string appendString:@"\n"]; [self->string appendString:@"\n"]; [self _encodeObject:_object]; [self->string appendString:@"\n"]; [self->string appendString:@"\n"]; } else { [self->string appendString:@"\n"]; [self->string appendString:@"\n"]; [self->string appendString:@"\n"]; [self _encodeObject:_object]; [self->string appendString:@"\n"]; [self->string appendString:@"\n"]; [self->string appendString:@"\n"]; } [self->string appendString:@"\n"]; } @end /* XmlRpcResponseEncoder */ SOPE/sope-xml/XmlRpc/NSDate+XmlRpcCoding.m0000644000000000000000000000326012242733420017114 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "XmlRpcMethodResponse.h" #include "NSObject+XmlRpc.h" #include "XmlRpcCoder.h" #import #include "common.h" @implementation NSDate(XmlRpcCoding) - (NSString *)xmlRpcType { return @"dateTime.iso8601"; } - (void)encodeWithXmlRpcCoder:(XmlRpcEncoder *)_coder { [_coder encodeDateTime:self]; } + (id)decodeObjectWithXmlRpcCoder:(XmlRpcDecoder *)_coder { return [_coder decodeDateTime]; } @end /* NSDate(XmlRpcCoding) */ @implementation NSTimeZone(XmlRpcCoding) - (NSString *)xmlRpcType { return @"string"; } - (void)encodeWithXmlRpcCoder:(XmlRpcEncoder *)_coder { #if NeXT_Foundation_LIBRARY || APPLE_Foundation_LIBRARY [_coder encodeString:[self name]]; #else [_coder encodeString:[self timeZoneName]]; #endif } + (id)decodeObjectWithXmlRpcCoder:(XmlRpcDecoder *)_coder { return [NSTimeZone timeZoneWithName:[_coder decodeString]]; } @end /* NSTimeZone(XmlRpcCoding) */ SOPE/sope-xml/XmlRpc/GNUmakefile.preamble0000644000000000000000000000272612242733420017141 0ustar rootroot# compilation settings include ./Version libXmlRpc_HEADER_FILES_DIR = . libXmlRpc_HEADER_FILES_INSTALL_DIR = /XmlRpc libXmlRpc_INTERFACE_VERSION=$(MAJOR_VERSION).$(MINOR_VERSION) libXmlRpc_INSTALL_DIR=$(SOPE_SYSLIBDIR) libXmlRpc_VERSION=$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBMINOR_VERSION) XmlRpc_INTERFACE_VERSION=$(MAJOR_VERSION).$(MINOR_VERSION) XmlRpc_VERSION=$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBMINOR_VERSION) ADDITIONAL_CPPFLAGS += \ -O2 \ -Wall -DCOMPILE_FOR_GSTEP_MAKE=1 \ -DSOPE_MAJOR_VERSION=$(MAJOR_VERSION) \ -DSOPE_MINOR_VERSION=$(MINOR_VERSION) \ -DSOPE_SUBMINOR_VERSION=$(SUBMINOR_VERSION) # framework support XmlRpc_HEADER_FILES = $(libXmlRpc_HEADER_FILES) XmlRpc_OBJC_FILES = $(libXmlRpc_OBJC_FILES) libXmlRpc_LIBRARIES_DEPEND_UPON += -lSaxObjC $(BASE_LIBS) ifneq ($(GNUSTEP_BUILD_DIR),) libXmlRpc_LIB_DIRS += \ -L$(GNUSTEP_BUILD_DIR)/../SaxObjC/$(GNUSTEP_OBJ_DIR_NAME) \ -L$(GNUSTEP_BUILD_DIR)/../DOM/$(GNUSTEP_OBJ_DIR_NAME) XmlRpc_LIB_DIRS += -F$(GNUSTEP_BUILD_DIR)/../SaxObjC/ else libXmlRpc_LIB_DIRS += \ -L../SaxObjC/$(GNUSTEP_OBJ_DIR) \ -L../DOM/$(GNUSTEP_OBJ_DIR) XmlRpc_LIB_DIRS += -F../SaxObjC/ endif # Apple ifeq ($(FOUNDATION_LIB),apple) libXmlRpc_PREBIND_ADDR="0xC0400000" libXmlRpc_LDFLAGS += -seg1addr $(libXmlRpc_PREBIND_ADDR) #ADDITIONAL_INCLUDE_DIRS += -framework SaxObjC XmlRpc_FRAMEWORK_LIBS += -framework SaxObjC XmlRpc_LIBRARIES_DEPEND_UPON += -framework SaxObjC endif SOPE/sope-xml/XmlRpc/XmlRpcMethodResponse.m0000644000000000000000000000614212242733420017540 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "XmlRpcMethodResponse.h" #include "XmlRpcCoder.h" #include "common.h" @interface XmlRpcMethodResponse(PrivateMethodes) - (NSString *)_encodeXmlRpcMethodResponse; @end @implementation XmlRpcMethodResponse - (id)initWithXmlRpcString:(NSString *)_string { XmlRpcDecoder *coder; XmlRpcMethodResponse *baseResponse; if ([_string length] == 0) { [self release]; return nil; } coder = [[XmlRpcDecoder alloc] initForReadingWithString:_string]; baseResponse = [coder decodeMethodResponse]; [coder release]; if (baseResponse == nil) { [self release]; return nil; } self = [self initWithResult:[baseResponse result]]; return self; } - (id)initWithXmlRpcData:(NSData *)_data { XmlRpcDecoder *coder; XmlRpcMethodResponse *baseResponse; if ([_data length] == 0) { [self release]; return nil; } coder = [[XmlRpcDecoder alloc] initForReadingWithData:_data]; baseResponse = [coder decodeMethodResponse]; [coder release]; if (baseResponse == nil) { [self release]; return nil; } self = [self initWithResult:[baseResponse result]]; return self; } - (id)initWithResult:(id)_result { if ((self = [super init])) { self->result = [_result retain]; } return self; } - (void)dealloc { [self->result release]; [super dealloc]; } /* accessors */ - (void)setResult:(id)_result { [self->result autorelease]; self->result = [_result retain]; } - (id)result { return self->result; } - (NSString *)xmlRpcString { return [self _encodeXmlRpcMethodResponse]; } /* description */ - (NSString *)description { NSMutableString *ms; ms = [NSMutableString stringWithCapacity:64]; [ms appendFormat:@"<0x%p[%@]:", self, NSStringFromClass([self class])]; if (result) [ms appendFormat:@" %@", self->result]; else [ms appendString:@" no result"]; [ms appendString:@">"]; return ms; } @end /* XmlRpcMethodResponse */ @implementation XmlRpcMethodResponse(PrivateMethodes) - (NSString *)_encodeXmlRpcMethodResponse { XmlRpcEncoder *encoder = nil; NSMutableString *str = nil; str = [NSMutableString stringWithCapacity:512]; encoder = [[XmlRpcEncoder alloc] initForWritingWithMutableString:str]; [encoder encodeMethodResponse:self]; [encoder release]; return str; } @end /* XmlRpcMethodResponse(PrivateMethodes) */ SOPE/sope-xml/XmlRpc/XmlRpc-Info.plist0000644000000000000000000000133512242733420016447 0ustar rootroot CFBundleDevelopmentRegion English CFBundleExecutable XmlRpc CFBundleGetInfoString CFBundleIdentifier org.OpenGroupware.SOPE.xml.XmlRpc CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType FMWK CFBundleShortVersionString CFBundleSignature ???? CFBundleVersion 4.5 SOPE/sope-xml/XmlRpc/SxXML-XmlRpc.graffle0000644000000000000000000003516512242733420017012 0ustar rootroot CanvasColor w 1.000000e+00 ColumnAlign 0 ColumnSpacing 5.400000e+01 GraphDocumentVersion 2 GraphicsList Bounds {{15, 13}, {101, 36}} Class ShapedGraphic FitText YES ID 1012 Shape Rectangle Style fill Draws NO shadow Draws NO stroke Draws NO Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica-BoldOblique;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\i\b\fs48 \cf0 XmlRpc} Bounds {{284, 207}, {167, 18}} Class ShapedGraphic ID 1011 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/XmlRpc/XmlRpcMethodResponse.h Magnets {0.5, 0} {-0.5, 0} Shape Rectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 XmlRpcMethodResponse} Bounds {{284, 180}, {167, 18}} Class ShapedGraphic ID 1010 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/XmlRpc/XmlRpcValue.h Magnets {0.5, 0} {-0.5, 0} Shape Rectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 XmlRpcValue} Bounds {{284, 261}, {167, 18}} Class ShapedGraphic ID 1009 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/SaxObjC/SaxDefaultHandler.h Magnets {0.5, 0} {-0.5, 0} Shape Rectangle Style fill Color b 5.000000e-01 g 1.000000e+00 r 1.000000e+00 Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 SaxDefaultHandler} Bounds {{477, 261}, {167, 18}} Class ShapedGraphic ID 1008 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/XmlRpc/XmlRpcSaxHandler.h Magnets {0.5, 0} {-0.5, 0} Shape Rectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 XmlRpcSaxHandler} Bounds {{284, 153}, {167, 18}} Class ShapedGraphic ID 1007 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/XmlRpc/XmlRpcMethodCall.h Magnets {0.5, 0} {-0.5, 0} Shape Rectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 XmlRpcMethodCall} Bounds {{284, 126}, {167, 18}} Class ShapedGraphic ID 1006 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/XmlRpc/XmlRpcCoder.h Magnets {0.5, 0} {-0.5, 0} Shape Rectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 XmlRpcEncoder} Bounds {{284, 99}, {167, 18}} Class ShapedGraphic ID 1005 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/XmlRpc/XmlRpcCoder.h Magnets {0.5, 0} {-0.5, 0} Shape Rectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 XmlRpcDecoder} Bounds {{63, 153}, {167, 18}} Class ShapedGraphic ID 1004 Magnets {0.5, 0} {-0.5, 0} Shape Rectangle Style fill Color b 5.000000e-01 g 1.000000e+00 r 1.000000e+00 Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 NSObject} Class LineGraphic Head ID 1011 ID 1003 Points {230, 162} {284, 216} Style stroke HeadArrow 0 LineType 2 TailArrow 0 Tail ID 1004 Class LineGraphic Head ID 1010 ID 1002 Points {230, 162} {284, 189} Style stroke HeadArrow 0 LineType 2 TailArrow 0 Tail ID 1004 Class LineGraphic Head ID 1009 ID 1001 Points {230, 162} {284, 270} Style stroke HeadArrow 0 LineType 2 TailArrow 0 Tail ID 1004 Class LineGraphic Head ID 1008 ID 1000 Points {451, 270} {477, 270} Style stroke HeadArrow 0 LineType 2 TailArrow 0 Tail ID 1009 Class LineGraphic Head ID 1007 ID 999 Points {230, 162} {284, 162} Style stroke HeadArrow 0 LineType 2 TailArrow 0 Tail ID 1004 Class LineGraphic Head ID 1006 ID 998 Points {230, 162} {284, 135} Style stroke HeadArrow 0 LineType 2 TailArrow 0 Tail ID 1004 Class LineGraphic Head ID 1005 ID 997 Points {230, 162} {284, 108} Style stroke HeadArrow 0 LineType 2 TailArrow 0 Tail ID 1004 GridInfo HPages 1 ImageCounter 1 IsPalette NO Layers Lock NO Name Layer 1 Print YES View YES LayoutInfo AutoAdjust YES HierarchicalOrientation 0 MagneticFieldCenter {0, 0} MagnetsEnabled YES PageBreakColor w 3.333333e-01 PageBreaks YES PageSetup BAt0eXBlZHN0cmVhbYED6IQBQISEhAtOU1ByaW50SW5mbwGEhAhOU09iamVjdACFkoSE hBNOU011dGFibGVEaWN0aW9uYXJ5AISEDE5TRGljdGlvbmFyeQCUhAFpEpKEhIQITlNT dHJpbmcBlIQBKxBOU0pvYkRpc3Bvc2l0aW9uhpKEmZkPTlNQcmludFNwb29sSm9ihpKE mZkOTlNCb3R0b21NYXJnaW6GkoSEhAhOU051bWJlcgCEhAdOU1ZhbHVlAJSEASqEhAFm nSSGkoSZmQtOU1BhcGVyTmFtZYaShJmZBkxldHRlcoaShJmZD05TUHJpbnRBbGxQYWdl c4aShJ2chIQBY54AhpKEmZkNTlNSaWdodE1hcmdpboaShJ2cn50khpKEmZkITlNDb3Bp ZXOGkoSdnISEAVOfAYaShJmZD05TU2NhbGluZ0ZhY3RvcoaShJ2chIQBZKABhpKEmZkL TlNGaXJzdFBhZ2WGkoSdnKmfAYaShJmZFE5TVmVydGljYWxQYWdpbmF0aW9uhpKEnZyE hAFzoQCGkoSZmRVOU0hvcml6b25hbFBhZ2luYXRpb26GkoSdnLGhAIaShJmZFk5TSG9y aXpvbnRhbGx5Q2VudGVyZWSGkoSdnKSeAYaShJmZDE5TTGVmdE1hcmdpboaShJ2cn50k hpKEmZkNTlNPcmllbnRhdGlvboaShJ2csaEBhpKEmZkZTlNQcmludFJldmVyc2VPcmll bnRhdGlvboaSo5KEmZkKTlNMYXN0UGFnZYaShJ2chJeXgn////+GkoSZmQtOU1RvcE1h cmdpboaShJ2cn50khpKEmZkUTlNWZXJ0aWNhbGx5Q2VudGVyZWSGkrWShJmZC05TUGFw ZXJTaXplhpKEnpyEhAx7X05TU2l6ZT1mZn2igQMYgQJkhoaG RowAlign 0 RowSpacing 9.000000e+00 VPages 1 WindowInfo Frame {{67, 90}, {826, 833}} VisibleRegion {{-44.5, -108}, {811, 756}} Zoom 1 SOPE/sope-xml/XmlRpc/XmlRpcResponseDecoder.m0000644000000000000000000000476012242733420017671 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "XmlRpcCoder.h" #include "XmlRpcSaxHandler.h" #include #include "common.h" @implementation XmlRpcResponseDecoder static id saxResponseHandler = nil; static id responseParser = nil; - (void)_ensureSaxAndParser { if (saxResponseHandler == nil) { if ((saxResponseHandler = [[XmlRpcSaxResponseHandler alloc] init])==nil) { NSLog(@"%s: did not find sax handler ...", __PRETTY_FUNCTION__); return; } } if (responseParser != nil) return; responseParser = [[SaxXMLReaderFactory standardXMLReaderFactory] createXMLReaderForMimeType:@"text/xml"]; if (responseParser == nil) { NSLog(@"%s: did not find an XML parser ...", __PRETTY_FUNCTION__); return; } responseParser = [responseParser retain]; [responseParser setContentHandler:saxResponseHandler]; [responseParser setDTDHandler:saxResponseHandler]; [responseParser setErrorHandler:saxResponseHandler]; } - (id)decodeRootObject { static Class ExceptionClass = Nil; id result; [self _ensureSaxAndParser]; if (ExceptionClass == Nil) ExceptionClass = [NSException class]; [saxResponseHandler reset]; [responseParser parseFromSource:self->string systemId:nil]; result = [saxResponseHandler result]; if ([result isKindOfClass:ExceptionClass]) { return result; } else { // => XmlRpcValue XmlRpcValue *val = result; Class objClass = Nil; id obj; [self->value autorelease]; self->value = [val retain]; if ((objClass = NSClassFromString([val className])) != Nil) { obj = [objClass decodeObjectWithXmlRpcCoder:self]; return obj; } } return nil; } @end /* XmlRpcResponseDecoder */ SOPE/sope-xml/XmlRpc/NSURL+XmlRpcCoding.m0000644000000000000000000000232012242733420016675 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "XmlRpcMethodResponse.h" #include "NSObject+XmlRpc.h" #include "XmlRpcCoder.h" #include "common.h" @implementation NSURL(XmlRpcCoding) - (NSString *)xmlRpcType { return @"string"; } - (void)encodeWithXmlRpcCoder:(XmlRpcEncoder *)_coder { [_coder encodeString:[self absoluteString]]; } + (id)decodeObjectWithXmlRpcCoder:(XmlRpcDecoder *)_coder { return [self URLWithString:[_coder decodeString]]; } @end /* NSURL(XmlRpcCoding) */ SOPE/sope-xml/XmlRpc/common.h0000644000000000000000000000224712242733420014740 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __XmlRpc_common_h__ #define __XmlRpc_common_h__ #import #ifndef ASSIGN # define ASSIGN(object, value) \ ({id __object = (id)object; \ id __value = (id)value; \ if (__value != __object) { if (__value) [__value retain]; \ if (__object) [__object release]; \ object = __value;}}) #endif #endif /* __XmlRpc_common_h__ */ SOPE/sope-xml/XmlRpc/NSHost+XmlRpcCoding.m0000644000000000000000000000231112242733420017150 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "XmlRpcMethodResponse.h" #include "NSObject+XmlRpc.h" #include "common.h" #include "XmlRpcCoder.h" @implementation NSHost(XmlRpcCoding) - (NSString *)xmlRpcType { return @"string"; } - (void)encodeWithXmlRpcCoder:(XmlRpcEncoder *)_coder { [_coder encodeString:[self name]]; } + (id)decodeObjectWithXmlRpcCoder:(XmlRpcDecoder *)_coder { return [NSHost hostWithName:[_coder decodeString]]; } @end /* NSHost(XmlRpcCoding) */ SOPE/sope-xml/XmlRpc/Version0000644000000000000000000000004512242733420014641 0ustar rootroot# version file SUBMINOR_VERSION:=31 SOPE/sope-xml/XmlRpc/XmlRpcDecoder.m0000644000000000000000000004275312242733420016156 0ustar rootroot/* Copyright (C) 2000-2007 SKYRIX Software AG Copyright (C) 2007 Helge Hess This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "XmlRpcCoder.h" #include "XmlRpcValue.h" #include "XmlRpcSaxHandler.h" #include #include "XmlRpcMethodCall.h" #include "XmlRpcMethodResponse.h" #include "common.h" /* self->unarchivedObjects does *not* store objects with xmlrpc base type! */ @interface XmlRpcDecoder(PrivateMethodes) - (id)_decodeObject:(XmlRpcValue *)_value; @end @interface NSData(NGExtensions) - (NSData *)dataByDecodingBase64; @end @implementation XmlRpcDecoder - (BOOL)profileXmlRpcCoding { return [[NSUserDefaults standardUserDefaults] boolForKey:@"ProfileXmlRpcCoding"]; } #if HAVE_NSXMLPARSER && 0 #warning using NSXMLParser! static BOOL useNSXMLParser = YES; #else static BOOL useNSXMLParser = NO; #endif static id saxHandler = nil; static id xmlRpcParser = nil; static Class ArrayClass = Nil; static Class DictionaryClass = Nil; static Class DataClass = Nil; static Class NumberClass = Nil; static Class StringClass = Nil; static Class DateClass = Nil; static BOOL doDebug = NO; + (void)initialize { if (ArrayClass == Nil) ArrayClass = [NSArray class]; if (DictionaryClass == Nil) DictionaryClass = [NSDictionary class]; if (DataClass == Nil) DataClass = [NSData class]; if (NumberClass == Nil) NumberClass = [NSNumber class]; if (StringClass == Nil) StringClass = [NSString class]; if (DateClass == Nil) DateClass = [NSCalendarDate class]; } - (id)init { if ((self = [super init])) { self->unarchivedObjects = [[NSMutableArray alloc] init]; self->awakeObjects = [[NSMutableSet alloc] init]; self->valueStack = [[NSMutableArray alloc] initWithCapacity:4]; self->timeZone = [[NSTimeZone timeZoneWithAbbreviation:@"GMT"] retain]; } return self; } - (NSStringEncoding)encodingForXMLEncodingString:(NSString *)_enc { _enc = [_enc lowercaseString]; if ([_enc isEqualToString:@"utf-8"]) return NSUTF8StringEncoding; else if ([_enc isEqualToString:@"iso-8859-1"]) return NSISOLatin1StringEncoding; #if !(NeXT_Foundation_LIBRARY || APPLE_Foundation_LIBRARY) else if ([_enc isEqualToString:@"iso-8859-9"]) return NSISOLatin9StringEncoding; #endif else if ([_enc isEqualToString:@"ascii"]) return NSASCIIStringEncoding; else NSLog(@"%s: UNKNOWN XML ENCODING '%@'", __PRETTY_FUNCTION__, _enc); return 0; } - (id)initForReadingWithString:(NSString *)_string { if ((self = [self init])) { NSRange r; r = [_string rangeOfString:@"?>"]; if ([_string hasPrefix:@" 0) { NSStringEncoding enc; if ((enc = [self encodingForXMLEncodingString:xmlDecl]) != 0) { self->data = [[_string dataUsingEncoding:enc] retain]; if (self->data == nil) { NSLog(@"WARNING(%s): couldn't get data for string '%@', " @"encoding %i !", __PRETTY_FUNCTION__, _string, enc); [self release]; return nil; } } } } if (self->data == nil) self->data = [[_string dataUsingEncoding:NSUTF8StringEncoding] retain]; } return self; } - (id)initForReadingWithData:(NSData *)_data { if ((self = [self init])) { self->data = [_data retain]; } return self; } - (void)dealloc { [self->data release]; [self->valueStack release]; [self->unarchivedObjects release]; [self->awakeObjects release]; [self->timeZone release]; [super dealloc]; } /* accessors */ - (void)setDefaultTimeZone:(NSTimeZone *)_timeZone { [self->timeZone autorelease]; self->timeZone = [_timeZone retain]; } - (NSTimeZone *)defaultTimeZone { return self->timeZone; } /* *** */ - (void)_ensureSaxAndParser { if (saxHandler == nil) { if ((saxHandler = [[XmlRpcSaxHandler alloc] init]) == nil) { NSLog(@"%s: did not find sax handler ...", __PRETTY_FUNCTION__); return; } } if (useNSXMLParser) return; if (xmlRpcParser != nil) return; xmlRpcParser = [[SaxXMLReaderFactory standardXMLReaderFactory] createXMLReaderForMimeType:@"text/xml"]; if (xmlRpcParser == nil) { NSLog(@"%s: did not find an XML parser ...", __PRETTY_FUNCTION__); return; } [xmlRpcParser setContentHandler:saxHandler]; [xmlRpcParser setDTDHandler:saxHandler]; [xmlRpcParser setErrorHandler:saxHandler]; [xmlRpcParser retain]; } - (id)_decodeValueOfClass:(Class)_class { id obj; obj = [(XmlRpcValue *)[self->valueStack lastObject] value]; if ([obj isKindOfClass:_class]) return obj; NSLog(@"WARNING(%s): obj (%@) is not of proper class ('%@'<-->'%@'", __PRETTY_FUNCTION__, obj, NSStringFromClass(_class), NSStringFromClass([obj class]), nil); return nil; } - (XmlRpcMethodCall *)_decodeMethodCall:(XmlRpcMethodCall *)_baseCall { NSArray *params; NSEnumerator *paramEnum; XmlRpcMethodCall *result = nil; XmlRpcValue *param = nil; NSMutableArray *decParams = nil; // decoded parameters params = [_baseCall parameters]; // XmlRpcValues!! decParams = [[NSMutableArray alloc] initWithCapacity:[params count]]; paramEnum = [params objectEnumerator]; while ((param = [paramEnum nextObject])) { id obj; if ((obj = [self _decodeObject:param]) != nil) [decParams addObject:obj]; } result = [[XmlRpcMethodCall alloc] initWithMethodName:[_baseCall methodName] parameters:decParams]; [decParams release]; return [result autorelease]; } - (XmlRpcMethodResponse *)_decodeMethodResponse:(XmlRpcMethodResponse *)_resp { static Class ExceptionClass = Nil; XmlRpcMethodResponse *response = nil; id result = [_resp result]; if (ExceptionClass == Nil) ExceptionClass = [NSException class]; if (![result isKindOfClass:ExceptionClass]) { result = [self _decodeObject:result]; // => XmlRpcValue } response = [[XmlRpcMethodResponse alloc] initWithResult:result]; return [response autorelease]; } - (NSStringEncoding)logEncoding { return NSUTF8StringEncoding; } - (id)decodeRootObject { id tmp = nil; if (doDebug) { NSLog(@"%s: begin (data: %i bytes, nesting: %i)", __PRETTY_FUNCTION__, [self->data length], self->nesting); } if ([self->data length] == 0) return nil; self->nesting++; [self _ensureSaxAndParser]; NSAssert(saxHandler, @"missing sax handler ..."); NSAssert(xmlRpcParser || useNSXMLParser, @"missing parser handler ..."); [saxHandler reset]; if (doDebug) NSLog(@"%s: SAX handler: %@", __PRETTY_FUNCTION__, saxHandler); #if HAVE_NSXMLPARSER if (useNSXMLParser) { NSXMLParser *parser; parser = [[NSXMLParser alloc] initWithData:self->data]; if (doDebug) NSLog(@"%s: using NSXMLParser: %@", __PRETTY_FUNCTION__, parser); [parser setDelegate:saxHandler]; [parser setShouldProcessNamespaces:NO]; [parser setShouldReportNamespacePrefixes:NO]; [parser setShouldResolveExternalEntities:NO]; [parser parse]; [parser release]; } else #endif [xmlRpcParser parseFromSource:self->data systemId:@""]; if ((tmp = [saxHandler methodCall]) != nil) { tmp = [self _decodeMethodCall:tmp]; } else if ((tmp = [saxHandler methodResponse]) != nil) { tmp = [self _decodeMethodResponse:tmp]; } else if (tmp == nil) { NSString *s; s = [[NSString alloc] initWithData:self->data encoding:[self logEncoding]]; NSLog(@"%s: couldn't parse source\n" @" parser: %@\n" @" handler: %@\n" @" data: %@" @" string: '%@'", __PRETTY_FUNCTION__, xmlRpcParser, saxHandler, self->data, s); [s release]; } else { NSLog(@"%s: neither call nor response (handler=%@): %@ ..", __PRETTY_FUNCTION__, saxHandler, tmp); } self->nesting--; // [saxHandler reset]; // hh asks: why is that commented out? if (doDebug) NSLog(@"%s: end: %@", __PRETTY_FUNCTION__, tmp); return tmp; } - (XmlRpcMethodCall *)decodeMethodCall { XmlRpcMethodCall *result; NSTimeInterval st = 0.0; if ([self profileXmlRpcCoding]) st = [[NSDate date] timeIntervalSince1970]; result = [self decodeRootObject]; if ([self profileXmlRpcCoding]) { NSTimeInterval diff; diff = [[NSDate date] timeIntervalSince1970] - st; printf("+++ decodeMethodCall: %0.5fs\n", diff); } return ([result isKindOfClass:[XmlRpcMethodCall class]]) ? result : (XmlRpcMethodCall *)nil; } - (XmlRpcMethodResponse *)decodeMethodResponse { XmlRpcMethodResponse *result; NSTimeInterval st = 0.0; if ([self profileXmlRpcCoding]) st = [[NSDate date] timeIntervalSince1970]; result = [self decodeRootObject]; if ([self profileXmlRpcCoding]) { NSTimeInterval diff; diff = [[NSDate date] timeIntervalSince1970] - st; printf("+++ decodeMethodResponse: %0.5fs\n", diff); } return [result isKindOfClass:[XmlRpcMethodResponse class]] ? result : (XmlRpcMethodResponse *)nil; } - (id)_decodeObject:(XmlRpcValue *)_value { id result; if (_value == nil) return nil; [self->valueStack addObject:_value]; result = [self decodeObject]; [self->valueStack removeLastObject]; return result; } - (id)decodeObject { Class objClass = Nil; id object = nil; self->nesting++; if ((self->nesting == 1) && ([self->valueStack count] == 0)) { object = [self decodeRootObject]; } else { NSString *className; id value = [self->valueStack lastObject]; className = [value className]; if ([className length] == 0) { object = [(XmlRpcValue *)value value]; } else if ((objClass = NSClassFromString(className)) != Nil) { object = [objClass decodeObjectWithXmlRpcCoder:self]; } else { NSLog(@"%s: class (%@) specified by value (%@) wasn't found.", __PRETTY_FUNCTION__, className, value); object = [(XmlRpcValue *)value value]; } if (object) [self->unarchivedObjects addObject:object]; } self->nesting--; return object; } - (NSDictionary *)decodeStruct { NSDictionary *dict; id result = nil; NSMutableDictionary *tmp; NSEnumerator *keyEnum; NSString *key; dict = (NSDictionary *)[(XmlRpcValue *)[self->valueStack lastObject] value]; if (!([dict respondsToSelector:@selector(keyEnumerator)] && [dict respondsToSelector:@selector(objectForKey:)])) return nil; keyEnum = [dict keyEnumerator]; tmp = [[NSMutableDictionary alloc] initWithCapacity:8]; while ((key = [keyEnum nextObject])) { XmlRpcValue *v; id obj; v = [dict objectForKey:key]; if ((obj = [self _decodeObject:v]) != nil) [tmp setObject:obj forKey:key]; } result = [NSDictionary dictionaryWithDictionary:tmp]; [tmp release]; return result; } - (NSArray *)decodeArray { NSArray *array; id result = nil; NSMutableArray *tmp = nil; NSEnumerator *valEnum; XmlRpcValue *val = nil; array = (NSArray *)[(XmlRpcValue *)[self->valueStack lastObject] value]; if (![array respondsToSelector:@selector(objectEnumerator)]) return nil; valEnum = [array objectEnumerator]; tmp = [[NSMutableArray alloc] initWithCapacity:8]; while ((val = [valEnum nextObject])) { id obj; if ((obj = [self _decodeObject:val]) != nil) [tmp addObject:obj]; } result = [NSArray arrayWithArray:tmp]; [tmp release]; return result; } - (NSData *)decodeBase64 { #if 0 /* data is already decoded in the XmlRpcValue */ tmp = [tmp dataByDecodingBase64]; #endif return [self _decodeValueOfClass:DataClass]; } - (BOOL)decodeBoolean { return [[self _decodeValueOfClass:NumberClass] boolValue]; } - (int)decodeInt { return [[self _decodeValueOfClass:NumberClass] intValue]; } - (double)decodeDouble { return [[self _decodeValueOfClass:NumberClass] doubleValue]; } - (NSString *)decodeString { return [self _decodeValueOfClass:StringClass]; } - (NSCalendarDate *)decodeDateTime { NSCalendarDate *date; NSTimeZone *tz; int secFromGMT; if ((date = [self _decodeValueOfClass:DateClass]) == nil) return nil; if ((tz = [date timeZone])) return date; if (![date respondsToSelector:@selector(setTimeZone:)]) { /* a plain date ... */ NSLog(@"cannot set timezone on date: %@", date); return date; } /* apply timezone correction */ secFromGMT = [self->timeZone secondsFromGMT]; [date setTimeZone:self->timeZone]; date = [date dateByAddingYears:0 months:0 days:0 hours:0 minutes:0 seconds:-secFromGMT]; return date; } - (XmlRpcValue *)beginDecodingKey:(NSString *)_key { XmlRpcValue *newValue; NSDictionary *obj; obj = (NSDictionary *)[(XmlRpcValue *)[self->valueStack lastObject] value]; NSAssert(_key != nil, @"_key is not allowed to be nil"); if (![obj isKindOfClass:DictionaryClass]) { NSLog(@"WARNING(%s): obj (%@) is not kind of class NSDictionary !!", __PRETTY_FUNCTION__, obj, nil); return nil; } if ((newValue = [obj objectForKey:_key]) == nil) /* got no value for key ... */ return nil; [self->valueStack addObject:newValue]; return newValue; } - (void)finishedDecodingKey { [self->valueStack removeLastObject]; } - (id)_decodeValueForKey:(NSString *)_key selector:(SEL)_selector { XmlRpcValue *newValue; id result; if ((newValue = [self beginDecodingKey:_key]) == nil) return nil; result = [[self performSelector:_selector] retain]; [self finishedDecodingKey]; return [result autorelease]; } - (NSDictionary *)decodeStructForKey:(NSString *)_key { return [self _decodeValueForKey:_key selector:@selector(decodeStruct)]; } - (NSArray *)decodeArrayForKey:(NSString *)_key { return [self _decodeValueForKey:_key selector:@selector(decodeArray)]; } - (NSData *)decodeBase64ForKey:(NSString *)_key { return [self _decodeValueForKey:_key selector:@selector(decodeBase64)]; } - (BOOL)decodeBooleanForKey:(NSString *)_key { XmlRpcValue *newValue; BOOL result; if ((newValue = [self beginDecodingKey:_key]) == nil) /* any useful alternatives ? */ return NO; result = [self decodeBoolean]; [self finishedDecodingKey]; return result; } - (int)decodeIntForKey:(NSString *)_key { XmlRpcValue *newValue; int result; if ((newValue = [self beginDecodingKey:_key]) == nil) /* NSKeyedArchiver returns 0, we too */ return 0; result = [self decodeInt]; [self finishedDecodingKey]; return result; } - (double)decodeDoubleForKey:(NSString *)_key { XmlRpcValue *newValue; double result; if ((newValue = [self beginDecodingKey:_key]) == nil) /* any useful alternatives ? */ return 0.0; result = [self decodeDouble]; [self finishedDecodingKey]; return result; } - (NSString *)decodeStringForKey:(NSString *)_key { return [self _decodeValueForKey:_key selector:@selector(decodeString)]; } - (NSCalendarDate *)decodeDateTimeForKey:(NSString *)_key { return [self _decodeValueForKey:_key selector:@selector(decodeDateTime)]; } - (id)decodeObjectForKey:(NSString *)_key { return [self _decodeValueForKey:_key selector:@selector(decodeObject)]; } /* operations */ - (void)ensureObjectAwake:(id)_object { if ([self->awakeObjects containsObject:_object]) return; if ([_object respondsToSelector:@selector(awakeFromXmlRpcDecoder:)]) [_object awakeFromXmlRpcDecoder:self]; [self->awakeObjects addObject:_object]; } - (void)awakeObjects { NSEnumerator *e; id obj; e = [self->unarchivedObjects objectEnumerator]; while ((obj = [e nextObject])) [self ensureObjectAwake:obj]; } - (void)finishInitializationOfObjects { NSEnumerator *e; id obj; e = [self->unarchivedObjects objectEnumerator]; while ((obj = [e nextObject])) { if ([obj respondsToSelector: @selector(finishInitializationWithXmlRpcDecoder:)]) [obj finishInitializationWithXmlRpcDecoder:self]; } } @end /* XmlRpcDecoder */ SOPE/sope-xml/XmlRpc/XmlRpcMethodResponse.h0000644000000000000000000000233312242733420017531 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __XmlRpcMethodResponse_H__ #define __XmlRpcMethodResponse_H__ #import @class NSString, NSData; @interface XmlRpcMethodResponse : NSObject { id result; } - (id)initWithXmlRpcString:(NSString *)_xmlRpcString; - (id)initWithXmlRpcData:(NSData *)_data; - (id)initWithResult:(id)_result; /* accessors */ - (void)setResult:(id)_result; - (id)result; - (NSString *)xmlRpcString; @end #endif /* __XmlRpcMethodResponse_H__ */ SOPE/sope-xml/XmlRpc/XmlRpcValue.h0000644000000000000000000000232512242733420015647 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __XML_RPC_XmlRpcValue_H__ #define __XML_RPC_XmlRpcValue_H__ #import @interface XmlRpcValue : NSObject { NSString *className; id value; } - (id)initWithValue:(id)_value className:(NSString *)_className; /* accessors */ - (void)setClassName:(NSString *)_className; - (NSString *)className; - (id)value; - (Class)class; - (BOOL)isException; - (BOOL)isDictionary; @end #endif /* __XML_RPC_XmlRpcValue_H__ */ SOPE/sope-xml/XmlRpc/NSNotification+XmlRpcCoding.m0000644000000000000000000000310312242733420020661 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "XmlRpcMethodResponse.h" #include "common.h" #include "XmlRpcCoder.h" @implementation NSNotification(XmlRpcCoding) - (NSString *)xmlRpcType { return @"struct"; } + (id)decodeObjectWithXmlRpcCoder:(XmlRpcDecoder *)_coder { self = [NSNotification notificationWithName: [_coder decodeStringForKey:@"name"] object:[_coder decodeObjectForKey:@"object"] userInfo:[_coder decodeStructForKey:@"userInfo"]]; return self; } - (void)encodeWithXmlRpcCoder:(XmlRpcEncoder *)_coder { NSString *n; n = [self name]; [_coder encodeString:n forKey:@"name"]; [_coder encodeObject:[self object] forKey:@"object"]; [_coder encodeStruct:[self userInfo] forKey:@"userInfo"]; } @end /* NSNotification(XmlRpcCoding) */ SOPE/sope-xml/XmlRpc/NSNumber+XmlRpcCoding.m0000644000000000000000000000616312242733420017474 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "XmlRpcMethodResponse.h" #include "NSObject+XmlRpc.h" #include "XmlRpcCoder.h" #include "common.h" #if LIB_FOUNDATION_LIBRARY # include #endif #define BOOLEAN_TYPE 0 #define INTEGER_TYPE 1 #define DOUBLE_TYPE 2 @implementation NSNumber(XmlRpcCoding) - (unsigned int)_xmlRpcNumberType { static Class BoolClass = Nil; if (BoolClass == Nil) BoolClass = NSClassFromString(@"NSBoolNumber"); if ([self isKindOfClass:BoolClass]) return BOOLEAN_TYPE; switch (*[self objCType]) { case 'i': case 'I': case 'c': case 'C': case 's': case 'S': case 'l': case 'L': return INTEGER_TYPE; case 'f': case 'd': default: return DOUBLE_TYPE; } } - (NSString *)xmlRpcType { switch ([self _xmlRpcNumberType]) { case BOOLEAN_TYPE: return @"boolean"; case DOUBLE_TYPE: return @"double"; default: /* INTEGER_TYPE */ return @"i4"; } } - (void)encodeWithXmlRpcCoder:(XmlRpcEncoder *)_coder { switch ([self _xmlRpcNumberType]) { case BOOLEAN_TYPE: [_coder encodeBoolean:[self boolValue]]; break; case DOUBLE_TYPE: [_coder encodeDouble:[self doubleValue]]; break; default: /* INTEGER_TYPE */ [_coder encodeInt:[self intValue]]; } } + (id)decodeObjectWithXmlRpcCoder:(XmlRpcDecoder *)_coder { return [NSNumber numberWithInt:[_coder decodeInt]]; } @end /* NSNumber(XmlRpcCoding) */ #if LIB_FOUNDATION_LIBRARY @implementation NSBoolNumber(XmlRpcCoding) + (id)decodeObjectWithXmlRpcCoder:(XmlRpcDecoder *)_coder { return [[[NSNumber alloc] initWithBool:[_coder decodeBoolean]] autorelease]; } - (NSString *)xmlRpcType { return @"boolean"; } @end /* NSBoolNumber(XmlRpcCoding) */ // nicht notwendig, nur BOOL muss speziell abgefangen werden ??? : @implementation NSFloatNumber(XmlRpcCoding) + (id)decodeObjectWithXmlRpcCoder:(XmlRpcDecoder *)_coder { return [[[NSNumber alloc] initWithDouble:[_coder decodeDouble]] autorelease]; } - (NSString *)xmlRpcType { return @"double"; } @end /* NSFloatNumber(XmlRpcCoding) */ @implementation NSDoubleNumber(XmlRpcCoding) + (id)decodeObjectWithXmlRpcCoder:(XmlRpcDecoder *)_coder { return [[[NSNumber alloc] initWithDouble:[_coder decodeDouble]] autorelease]; } - (NSString *)xmlRpcType { return @"double"; } @end /* NSDoubleNumber(XmlRpcCoding) */ #endif SOPE/sope-xml/ChangeLogSaxDriver/0000755000000000000000000000000012242733417015552 5ustar rootrootSOPE/sope-xml/ChangeLogSaxDriver/fhs.make0000644000000000000000000000121212242733417017165 0ustar rootroot# postprocessing # FHS support (this is a hack and is going to be done by gstep-make!) ifneq ($(FHS_INSTALL_ROOT),) FHS_LIB_DIR=$(FHS_INSTALL_ROOT)/lib/ FHS_SAX_DIR=$(FHS_LIB_DIR)sope-$(MAJOR_VERSION).$(MINOR_VERSION)/saxdrivers/ fhs-sax-dirs :: $(MKDIRS) $(FHS_SAX_DIR) move-bundles-to-fhs :: fhs-sax-dirs @echo "moving bundles $(BUNDLE_INSTALL_DIR) to $(FHS_SAX_DIR) .." for i in $(BUNDLE_NAME); do \ j="$(FHS_SAX_DIR)/$${i}$(BUNDLE_EXTENSION)"; \ if test -d $$j; then rm -r $$j; fi; \ mv "$(BUNDLE_INSTALL_DIR)/$${i}$(BUNDLE_EXTENSION)" $$j; \ done move-to-fhs :: move-bundles-to-fhs after-install :: move-to-fhs endif SOPE/sope-xml/ChangeLogSaxDriver/README0000644000000000000000000000337512242733417016442 0ustar rootrootOverview ======== ChangeLogSaxDriver is a SAX driver for reading, well, ChangeLogs. Generated XML ============= A ChangeLog like this: --- snip --- 2004-11-22 Helge Hess * v4.5.97 * WOContext.m: move some categories into main class implementation * WORequestHandler.m: bind default logger to WODebuggingEnabled 2004-11-21 Helge Hess * WODirectActionRequestHandler.m: minor code cleanups (v4.5.96) --- snap --- gets tranformed into this: --- snip --- Helge Hess v4.5.97 WOContext.m: move some categories into main class implementation WORequestHandler.m: bind default logger to WODebuggingEnabled "Helge Hess" WODirectActionRequestHandler.m: minor code cleanups (v4.5.96) --- snap --- Notes ===== The generated date stamps follow the w3.org recommendation at http://www.w3.org/TR/NOTE-datetime. Specifically, this is the format described as "complete date plus hours, minutes and seconds", with timezone set to 'Zulu' (GMT). If the original format didn't contain timezone information, the resulting timezone is set to GMT. If the original format didn't contain time information, the resulting time information is set to 12:00:00. SOPE/sope-xml/ChangeLogSaxDriver/AUTHORS0000644000000000000000000000005312242733417016620 0ustar rootrootMarcus Mueller SOPE/sope-xml/ChangeLogSaxDriver/GNUmakefile0000644000000000000000000000101712242733417017623 0ustar rootroot# GNUstep makefile include ../../config.make include $(GNUSTEP_MAKEFILES)/common.make -include ../../Version -include ./Version BUNDLE_NAME = ChangeLogSaxDriver BUNDLE_EXTENSION = .sax BUNDLE_INSTALL_DIR = ${SOPE_SAXDRIVERS}/ ChangeLogSaxDriver_OBJC_FILES = \ ChangeLogSaxDriver.m \ NSString+Extensions.m \ NSCalendarDate+Extensions.m ChangeLogSaxDriver_RESOURCE_FILES = bundle-info.plist default.locale -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/bundle.make -include GNUmakefile.postamble SOPE/sope-xml/ChangeLogSaxDriver/GNUmakefile.postamble0000644000000000000000000000015712242733417021614 0ustar rootroot# aftermath after-all :: @(cp bundle-info.plist \ $(GNUSTEP_BUILD_DIR)/$(BUNDLE_NAME)$(BUNDLE_EXTENSION)) SOPE/sope-xml/ChangeLogSaxDriver/COPYING0000644000000000000000000005530312242733417016613 0ustar rootroot GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 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. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] 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 Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, 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 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 a program 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. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, 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 companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. 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, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library 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 compile 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) 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. c) 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. d) 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 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. 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 to 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 Library 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 SOPE/sope-xml/ChangeLogSaxDriver/NSString+Extensions.h0000644000000000000000000000226612242733417021573 0ustar rootroot/* Copyright (C) 2004 Marcus Mueller This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __ChangeLogSaxDriver_NSString_Extensions_H_ #define __ChangeLogSaxDriver_NSString_Extensions_H_ #import @interface NSString (ChangeLogSaxDriverExtensions) - (BOOL)parseDate:(NSCalendarDate **)_date andAuthor:(NSString **)_author; - (void)getRealName:(NSString **)_realName andEmail:(NSString **)_email; @end #endif /* __ChangeLogSaxDriver_NSString_Extensions_H_ */ SOPE/sope-xml/ChangeLogSaxDriver/ChangeLogSaxDriver.m0000644000000000000000000002646312242733417021422 0ustar rootroot/* Copyright (C) 2004 Marcus Mueller This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "ChangeLogSaxDriver.h" #include "NSString+Extensions.h" #include "NSCalendarDate+Extensions.h" #include "common.h" @interface ChangeLogSaxDriver(PrivateAPI) - (NSString *)_namespace; - (void)_writeString:(NSString *)_s; - (void)_processLine:(NSString *)_line; - (void)_parseFromString:(NSString *)_str systemId:(NSString *)_sysId; - (void)_beginEntryWithDate:(NSCalendarDate *)_date; - (void)_endEntry; - (void)_beginLogs; - (void)_endLogs; - (void)_beginLog; - (void)_appendLog:(NSString *)_s; - (void)_endLog; @end @implementation ChangeLogSaxDriver static NSCharacterSet *wsSet = nil; static NSCharacterSet *wsnlSet = nil; + (void)initialize { static BOOL didInit = NO; if(didInit) return; didInit = YES; wsSet = [[NSCharacterSet whitespaceCharacterSet] retain]; wsnlSet = [[NSCharacterSet whitespaceAndNewlineCharacterSet] retain]; } - (void)dealloc { [self->contentHandler release]; [self->errorHandler release]; [self->namespace release]; [super dealloc]; } /* properties */ - (void)setProperty:(NSString *)_name to:(id)_value { return; [SaxNotRecognizedException raise:@"PropertyException" format:@"don't know property %@", _name]; } - (id)property:(NSString *)_name { return nil; [SaxNotRecognizedException raise:@"PropertyException" format:@"don't know property %@", _name]; return nil; } /* features */ - (void)setFeature:(NSString *)_name to:(BOOL)_value { if ([_name isEqualToString:@"http://xml.org/sax/features/namespaces"]) { self->fNamespaces = _value; return; } if ([_name isEqualToString: @"http://xml.org/sax/features/namespace-prefixes"]) { self->fNamespacePrefixes = _value; return; } [SaxNotRecognizedException raise:@"FeatureException" format:@"don't know feature %@", _name]; } - (BOOL)feature:(NSString *)_name { if ([_name isEqualToString:@"http://xml.org/sax/features/namespaces"]) return self->fNamespaces; if ([_name isEqualToString: @"http://xml.org/sax/features/namespace-prefixes"]) return self->fNamespacePrefixes; if ([_name isEqualToString: @"http://www.skyrix.com/sax/features/predefined-namespaces"]) return NO; [SaxNotRecognizedException raise:@"FeatureException" format:@"don't know feature %@", _name]; return NO; } /* handlers */ /* - (void)setDocumentHandler:(id)_handler { SaxDocumentHandlerAdaptor *a; a = [[SaxDocumentHandlerAdaptor alloc] initWithDocumentHandler:_handler]; [self setContentHandler:a]; [a release]; } */ - (void)setDTDHandler:(id)_handler { } - (id)dtdHandler { return nil; } - (void)setErrorHandler:(id)_handler { ASSIGN(self->errorHandler, _handler); } - (id)errorHandler { return self->errorHandler; } - (void)setEntityResolver:(id)_handler { } - (id)entityResolver { return nil; } - (void)setContentHandler:(id)_handler { ASSIGN(self->contentHandler, _handler); } - (id)contentHandler { return self->contentHandler; } /* parsing ... */ - (void)parseFromSource:(id)_source systemId:(NSString *)_sysId { NSAutoreleasePool *pool; pool = [[NSAutoreleasePool alloc] init]; if ([_source isKindOfClass:[NSData class]]) { NSString *s; s = [[NSString alloc] initWithData:_source encoding:[NSString defaultCStringEncoding]]; [self _parseFromString:s systemId:_sysId]; [s release]; } else if ([_source isKindOfClass:[NSURL class]]) { [self parseFromSystemId:_source]; } else if ([_source isKindOfClass:[NSString class]]) { if (_sysId == nil) _sysId = @""; [self _parseFromString:_source systemId:_sysId]; } else { SaxParseException *e; NSDictionary *ui; ui = [NSDictionary dictionaryWithObjectsAndKeys: _source ? _source : @"", @"source", self, @"parser", nil]; e = (id)[SaxParseException exceptionWithName:@"SaxIOException" reason:@"can't handle data-source" userInfo:ui]; [self->errorHandler fatalError:e]; } [pool release]; } - (void)parseFromSource:(id)_source { [self parseFromSource:_source systemId:@""]; } - (void)parseFromSystemId:(NSString *)_sysId { NSAutoreleasePool *pool; NSString *str; NSURL *url; pool = [[NSAutoreleasePool alloc] init]; url = [NSURL URLWithString:_sysId]; str = [NSString stringWithContentsOfURL:url]; [self _parseFromString:str systemId:_sysId]; [pool release]; } /* Private API */ - (void)_parseFromString:(NSString *)_s systemId:(NSString *)_sysId { static SaxAttributes *versionAttr = nil; NSArray *lines; unsigned i, count; self->currentLog = [[NSMutableString alloc] initWithCapacity:200]; self->flags.hasLog = NO; self->flags.hasEntry = NO; if (versionAttr == nil) { versionAttr = [[SaxAttributes alloc] init]; [versionAttr addAttribute:@"version" uri:[self _namespace] rawName:@"version" type:@"CDATA" value:@"1.0"]; } lines = [_s componentsSeparatedByString:@"\n"]; count = [lines count]; [self->contentHandler startDocument]; [self->contentHandler startElement:@"changelog" namespace:[self _namespace] rawName:@"changelog" attributes:versionAttr]; for(i = 0; i < count; i++) { [self _processLine:[lines objectAtIndex:i]]; } [self _endEntry]; [self->contentHandler endElement:@"changelog" namespace:[self _namespace] rawName:@"changelog"]; [self->contentHandler endDocument]; [self->currentLog release]; } - (void)_processLine:(NSString *)_line { if([_line length] > 0) { unichar first; NSCalendarDate *date; NSString *author; first = [_line characterAtIndex:0]; if(!(first == '*' || first == '-' || [wsSet characterIsMember:first]) && [_line parseDate:&date andAuthor:&author]) { SaxAttributes *authorAttrs; NSString *realName, *email; /* entry start */ [self _beginEntryWithDate:date]; /* author */ [author getRealName:&realName andEmail:&email]; if(!email) email = @""; authorAttrs = [[SaxAttributes alloc] init]; [authorAttrs addAttribute:@"email" uri:[self _namespace] rawName:@"email" type:@"CDATA" value:email]; [self->contentHandler startElement:@"author" namespace:[self _namespace] rawName:@"author" attributes:authorAttrs]; [authorAttrs release]; [self _writeString:realName]; [self->contentHandler endElement:@"author" namespace:[self _namespace] rawName:@"author"]; } else { /* strip leading whitespace and "*" from line */ _line = [_line stringByTrimmingLeadSpaces]; if([_line length] > 0) { first = [_line characterAtIndex:0]; if(first == '*') { /* new log line */ [self _beginLog]; _line = [_line substringFromIndex:1]; _line = [_line stringByTrimmingLeadSpaces]; } [self _appendLog:_line]; } } } } - (void)_beginEntryWithDate:(NSCalendarDate *)_date { SaxAttributes *entryAttrs; [self _endEntry]; /* date */ entryAttrs = [[SaxAttributes alloc] init]; [entryAttrs addAttribute:@"date" uri:[self _namespace] rawName:@"date" type:@"CDATA" value:[_date w3OrgDateTimeRepresentation]]; [self->contentHandler startElement:@"entry" namespace:[self _namespace] rawName:@"entry" attributes:entryAttrs]; [entryAttrs release]; self->flags.hasEntry = YES; } - (void)_endEntry { if(self->flags.hasEntry) { [self _endLogs]; [self->contentHandler endElement:@"entry" namespace:[self _namespace] rawName:@"entry"]; self->flags.hasEntry = NO; } } - (void)_beginLogs { if(!self->flags.hasLog) { [self->contentHandler startElement:@"logs" namespace:[self _namespace] rawName:@"logs" attributes:nil]; self->flags.hasLog = YES; } } - (void)_endLogs { if(self->flags.hasLog) { [self _endLog]; [self->contentHandler endElement:@"logs" namespace:[self _namespace] rawName:@"logs"]; self->flags.hasLog = NO; } } - (void)_beginLog { [self _beginLogs]; [self _endLog]; } - (void)_appendLog:(NSString *)_s { unsigned loc; if([_s length] == 0) return; loc = [self->currentLog length]; if(loc > 0) { unichar last; last = [self->currentLog characterAtIndex:loc - 1]; if(![wsnlSet characterIsMember:last]) { [self->currentLog appendString:@" "]; } } [self->currentLog appendString:_s]; } - (void)_endLog { NSRange r; r = NSMakeRange(0, [self->currentLog length]); if(r.length == 0) return; [self _beginLogs]; [self->contentHandler startElement:@"log" namespace:[self _namespace] rawName:@"log" attributes:nil]; [self _writeString:self->currentLog]; [self->contentHandler endElement:@"log" namespace:[self _namespace] rawName:@"log"]; [self->currentLog deleteCharactersInRange:r]; } - (NSString *)_namespace { if(!self->namespace) return @""; return self->namespace; } - (void)_writeString:(NSString *)_s { unsigned len; if ((len = [_s length]) == 0) return; if (len == 1) { unichar c[2]; [_s getCharacters:&(c[0])]; c[1] = '\0'; [self->contentHandler characters:&(c[0]) length:1]; } else { unichar *ca; ca = calloc(len + 1, sizeof(unichar)); [_s getCharacters:ca]; ca[len] = 0; [self->contentHandler characters:ca length:len]; if (ca) free(ca); } } @end /* ChangeLogSaxDriver */ SOPE/sope-xml/ChangeLogSaxDriver/COPYRIGHT0000644000000000000000000000010612242733417017042 0ustar rootrootCopyright (C) 2004 Marcus Mueller Contact: znek@mulle-kybernetik.com SOPE/sope-xml/ChangeLogSaxDriver/ChangeLog0000644000000000000000000000056712242733417017334 0ustar rootroot2005-08-16 Helge Hess * v4.5.1 * install into SaxObjC framework Resources when being used with OSX * ChangeLogSaxDriver.m: fixed a gcc 4.0 warning 2004-12-14 Marcus Mueller * ChangeLogSaxDriver.xcode: minor fixes 2004-12-07 Marcus Mueller * ChangeLog: created (v4.5.0) SOPE/sope-xml/ChangeLogSaxDriver/NSString+Extensions.m0000644000000000000000000001305112242733417021572 0ustar rootroot/* Copyright (C) 2004 Marcus Mueller This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NSString+Extensions.h" #include "common.h" @implementation NSString (ChangeLogSaxDriverExtensions) typedef struct { unsigned minLength; unsigned offset; BOOL hasTime; BOOL hasTimeZone; NSString *format; } dateFormatTest; static dateFormatTest formats[] = { { 24, 4, YES, NO, @"%b %d %H:%M:%S %Y" }, { 10, 0, NO, NO, @"%Y-%m-%d" }, { 12, 0, NO, NO, @"%b %d, %Y" }, { 13, 0, NO, NO, @"%b %d, %Y" }, { 15, 5, NO, NO, @"%b %d %Y" }, { 16, 0, NO, NO, @"%a %b %d %Y" }, { 23, 3, YES, NO, @"%b %d %H:%M:%S %Y" }, { 24, 4, YES, NO, @"%d %b %Y %H:%M:%S" }, { 25, 4, YES, NO, @"%b %d %H:%M:%S %Y" }, { 25, 4, YES, NO, @"%B %d %H:%M:%S %Y" }, { 28, 4, YES, YES, @"%b %d %H:%M:%S %Z %Y" }, { 30, 0, YES, YES, @"%a %b %d %H:%M:%S %Z %Y" }, { 0, 0, NO, NO, nil } /* end marker */ }; typedef struct { unsigned minLength; unsigned start; unsigned stop; unsigned contAt; BOOL hasTime; BOOL hasTimeZone; NSString *format; } complexDateFormatTest; static complexDateFormatTest complexFormats[] = { { 28, 4, 20, 24, YES, NO, @"%b %d %H:%M:%S %Y" }, { 29, 4, 20, 25, YES, NO, @"%b %d %H:%M:%S %Y" }, { 29, 4, 20, 24, YES, NO, @"%b %d %H:%M:%S %Y" }, { 0, 0, 0, 0, NO, NO, nil } /* end marker */ }; - (BOOL)parseDate:(NSCalendarDate **)_date andAuthor:(NSString **)_author { static NSTimeZone *gmt = nil; static NSDictionary *locale = nil; NSString *s, *format; NSCalendarDate *date; NSRange r; unsigned i, endLoc, len; BOOL hasTime, hasTimeZone; if(!gmt) { NSBundle *bundle; NSString *path; gmt = [[NSTimeZone timeZoneForSecondsFromGMT:0] retain]; bundle = [NSBundle bundleForClass:[self class]]; path = [bundle pathForResource:@"default" ofType:@"locale"]; if(path != nil) { locale = [[NSDictionary dictionaryWithContentsOfFile:path] retain]; } } date = nil; endLoc = 0, i = 0; len = [self length]; /* perform basic tests */ while((endLoc = formats[i].minLength) != 0 && endLoc < len) { r = NSMakeRange(formats[i].offset, endLoc - formats[i].offset); s = [self substringWithRange:r]; format = formats[i].format; date = [NSCalendarDate dateWithString:s calendarFormat:format locale:locale]; if(date) { hasTime = formats[i].hasTime; hasTimeZone = formats[i].hasTimeZone; break; } i++; } if(!date) { /* perform complex tests */ i = 0; while((endLoc = complexFormats[i].minLength) != 0 && endLoc < len) { r = NSMakeRange(complexFormats[i].start, complexFormats[i].stop - complexFormats[i].start); s = [self substringWithRange:r]; r = NSMakeRange(complexFormats[i].contAt, endLoc - complexFormats[i].contAt); s = [NSString stringWithFormat:@"%@%@", s, [self substringWithRange:r]]; format = complexFormats[i].format; date = [NSCalendarDate dateWithString:s calendarFormat:format locale:locale]; if(date) { hasTime = complexFormats[i].hasTime; hasTimeZone = complexFormats[i].hasTimeZone; break; } i++; } } if(date) { if(!hasTimeZone && !hasTime) date = [NSCalendarDate dateWithYear:[date yearOfCommonEra] month:[date monthOfYear] day:[date dayOfMonth] hour:12 minute:0 second:0 timeZone:gmt]; else if(!hasTimeZone) [date setTimeZone:gmt]; else if(!hasTime) date = [date hour:12 minute:0]; *_author = [self substringFromIndex:endLoc]; } else { *_author = nil; } *_date = date; return (date != nil) ? YES : NO; } - (void)getRealName:(NSString **)_realName andEmail:(NSString **)_email { NSRange r; NSString *s; s = [self stringByTrimmingSpaces]; r = [s rangeOfString:@"<"]; if(r.length == 0) { *_realName = s; *_email = nil; return; } if(r.location != 0) { NSString *rn; rn = [s substringToIndex:r.location]; *_realName = [rn stringByTrimmingTailSpaces]; } else { *_realName = @""; } s = [s substringFromIndex:NSMaxRange(r)]; s = [s stringByTrimmingTailSpaces]; s = [s substringToIndex:[s length] - 1]; *_email = s; } @end SOPE/sope-xml/ChangeLogSaxDriver/ChangeLogSaxDriver.h0000644000000000000000000000265112242733417021406 0ustar rootroot/* Copyright (C) 2004 Marcus Mueller This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __ChangeLogSaxDriver_ChangeLogSaxDriver_H_ #define __ChangeLogSaxDriver_ChangeLogSaxDriver_H_ #import #include @interface ChangeLogSaxDriver : NSObject < SaxXMLReader > { @private id contentHandler; id errorHandler; /* features */ BOOL fNamespaces; BOOL fNamespacePrefixes; NSString *namespace; /* internal */ NSMutableString *currentLog; struct { unsigned hasLog : 1; unsigned hasEntry : 1; } flags; } @end #endif /* __ChangeLogSaxDriver_ChangeLogSaxDriver_H_ */ SOPE/sope-xml/ChangeLogSaxDriver/GNUmakefile.preamble0000644000000000000000000000153712242733417021420 0ustar rootroot# compilation settings ifeq ($(frameworks),yes) BUNDLE_INSTALL_DIR := $(FRAMEWORK_INSTALL_DIR)/SaxObjC.framework/Resources/SaxDrivers/ endif SOPE_ROOT=../.. SOPE_OBJ_ROOT=$(GNUSTEP_BUILD_DIR)/$(SOPE_ROOT) ADDITIONAL_INCLUDE_DIRS += \ -I$(SOPE_ROOT)/sope-xml \ -I$(SOPE_ROOT)/sope-core/NGExtensions # dependencies ifneq ($(frameworks),yes) BUNDLE_LIBS += -lSaxObjC $(libxml_LIBS) else BUNDLE_LIBS += -framework SaxObjC $(libxml_LIBS) endif ADDITIONAL_BUNDLE_LIBS += $(BUNDLE_LIBS) # library/framework search pathes DEP_DIRS = ../SaxObjC ../../sope-core/NGExtensions ifneq ($(frameworks),yes) ADDITIONAL_LIB_DIRS += \ $(foreach dir,$(DEP_DIRS),\ -L$(GNUSTEP_BUILD_DIR)/$(dir)/$(GNUSTEP_OBJ_DIR_NAME)) else ADDITIONAL_LIB_DIRS += \ $(foreach dir,$(DEP_DIRS),-F$(GNUSTEP_BUILD_DIR)/$(dir)) endif SYSTEM_LIB_DIR += -L/usr/local/lib -L/usr/lib SOPE/sope-xml/ChangeLogSaxDriver/bundle-info.plist0000644000000000000000000000067112242733417021035 0ustar rootroot{ CVS = "$Id: bundle-info.plist 429 2004-12-08 22:36:03Z znek $"; //bundleHandler = NSObject; requires = { bundleManagerVersion = 1; classes = ( { name = NSObject; } ); }; provides = { SAXDrivers = ( { name = ChangeLogSaxDriver; sourceTypes = ( "application/x-changelog" ); }, ); classes = ( { name = ChangeLogSaxDriver; }, ); }; } SOPE/sope-xml/ChangeLogSaxDriver/default.locale0000644000000000000000000000072212242733417020360 0ustar rootroot{ NSLocaleCode = "en"; /* ISO 639-1 */ NSLanguageCode = "eng"; /* ISO 639-2 */ NSParentContext = ""; NSMonthNameArray = (January, February, March, April, May, June, July, August, September, October, November, December); NSShortMonthNameArray = (Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec); NSShortWeekDayNameArray = (Sun, Mon, Tue, Wed, Thu, Fri, Sat); NSWeekDayNameArray = (Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday); } SOPE/sope-xml/ChangeLogSaxDriver/NSCalendarDate+Extensions.h0000644000000000000000000000241112242733417022624 0ustar rootroot/* Copyright (C) 2004 Marcus Mueller This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __ChangeLogSaxDriver_NSCalendarDate_Extensions_H_ #define __ChangeLogSaxDriver_NSCalendarDate_Extensions_H_ #import @interface NSCalendarDate (ChangeLogSaxDriverExtensions) /* see http://www.w3.org/TR/NOTE-datetime */ /* this is Complete date plus hours, minutes and seconds, with timezone set to 'Zulu', i.e. 1994-11-05T13:15:30Z */ - (NSString *)w3OrgDateTimeRepresentation; @end #endif /* __ChangeLogSaxDriver_NSCalendarDate_Extensions_H_ */ SOPE/sope-xml/ChangeLogSaxDriver/common.h0000644000000000000000000000205412242733417017214 0ustar rootroot/* Copyright (C) 2004 Marcus Mueller This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __ChangeLogSaxDriver_common_H_ #define __ChangeLogSaxDriver_common_H_ #import #include #include #include #endif /* __ChangeLogSaxDriver_common_H_ */ SOPE/sope-xml/ChangeLogSaxDriver/version.plist0000644000000000000000000000072312242733417020316 0ustar rootroot BuildVersion 12 CFBundleVersion 1.0 ProductBuildVersion 7K571 ProjectName DevToolsWizardTemplates SourceVersion 3870000 SOPE/sope-xml/ChangeLogSaxDriver/Version0000644000000000000000000000004412242733417017120 0ustar rootroot# Version file SUBMINOR_VERSION:=1 SOPE/sope-xml/ChangeLogSaxDriver/NSCalendarDate+Extensions.m0000644000000000000000000000265012242733417022636 0ustar rootroot/* Copyright (C) 2004 Marcus Mueller This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NSCalendarDate+Extensions.h" @implementation NSCalendarDate (ChangeLogSaxDriverExtensions) /* set to 'Zulu', i.e. 1994-11-05T13:15:30Z */ - (NSString *)w3OrgDateTimeRepresentation { static NSTimeZone *zulu = nil; NSCalendarDate *date; NSString *desc; if(!zulu) zulu = [[NSTimeZone timeZoneForSecondsFromGMT:0] retain]; date = [self copy]; [date setTimeZone:zulu]; desc = [NSString stringWithFormat:@"%04d-%02d-%02dT%02d:%02d:%02dZ", [date yearOfCommonEra], [date monthOfYear], [date dayOfMonth], [date hourOfDay], [date minuteOfHour], [date secondOfMinute]]; [date release]; return desc; } @end SOPE/sope-xml/ChangeLogSaxDriver/Info.plist0000644000000000000000000000134512242733417017525 0ustar rootroot CFBundleDevelopmentRegion English CFBundleExecutable ChangeLogSaxDriver CFBundleIconFile CFBundleIdentifier com.mulle-kybernetik.znek.ChangeLogSaxDriver CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType BNDL CFBundleSignature ???? CFBundleVersion 4.5 NSPrincipalClass SOPE/sope-xml/COPYRIGHT0000644000000000000000000000010512242733417013362 0ustar rootrootCopyright (C) 2000-2005 SKYRIX Software AG Contact: info@skyrix.com SOPE/sope-xml/STXSaxDriver/0000755000000000000000000000000012242733417014401 5ustar rootrootSOPE/sope-xml/STXSaxDriver/fhs.make0000644000000000000000000000137412242733417016025 0ustar rootroot# postprocessing # FHS support (this is a hack and is going to be done by gstep-make!) ifneq ($(FHS_INSTALL_ROOT),) ifeq ($(findstring _64, $(GNUSTEP_TARGET_CPU)), _64) FHS_LIB_DIR=$(FHS_INSTALL_ROOT)/lib64/ else FHS_LIB_DIR=$(FHS_INSTALL_ROOT)/lib/ endif FHS_SAX_DIR=$(FHS_LIB_DIR)sope-$(SOPE_MAJOR_VERSION).$(SOPE_MINOR_VERSION)/saxdrivers/ fhs-sax-dirs :: $(MKDIRS) $(FHS_SAX_DIR) move-bundles-to-fhs :: fhs-sax-dirs @echo "moving bundles $(BUNDLE_INSTALL_DIR) to $(FHS_SAX_DIR) .." for i in $(BUNDLE_NAME); do \ j="$(FHS_SAX_DIR)/$${i}$(BUNDLE_EXTENSION)"; \ if test -d $$j; then rm -r $$j; fi; \ mv "$(BUNDLE_INSTALL_DIR)/$${i}$(BUNDLE_EXTENSION)" $$j; \ done move-to-fhs :: move-bundles-to-fhs after-install :: move-to-fhs endif SOPE/sope-xml/STXSaxDriver/README0000644000000000000000000000561112242733417015264 0ustar rootrootNote: this is the initial release, it should contain some bugs ;-) STXSaxDriver ============ This project contains a skyrix-xml/SaxObjC SAX driver bundle which can process so called "structured text" files, or in short "STX". The parsing events are reported as XHTML tags. Example: ---snip--- * item A * item B ---snap--- will be reported as SAX events similiar to such an HTML file: ---snip---
  • item A
  • item B
---snap--- The basis for this driver bundle, the StructuredText framework, was initially written by Mirko Viviani and Giulio Cesare Solaroli and sponsored by eXtrapola Srl. Note that the "original" StructuredText framework is much more capable and generic than what this SAX driver provides. On the pro side, your applications do not need to care about the actual tag format if you use SaxObjC. Your applications can use either, XHTML, HTML, PYX or STX files using the available SaxObjC drivers without any additional work. Supported MIME Types ==================== Not sure what the correct MIME type for structured text is supposed to be, for now we register this driver for the "text/structured" MIME type. How to try ========== Just use the saxxml or domxml tools which are part of skyrix-xml, eg: saxxml -XMLReader STXSaxDriver data/hhtest1.stx This will print the XHTML representation of the STX file on stdout. STX Functionality which is implemented ====================================== Guilio writes: ---snip--- Anyway, we used this document as "reference": http://plone.org/documentation/howto/FrontPage/UsingStructuredText of the construct defined there, we have skipped just the table construct. But we have added a few thinks: - it is possible to use quotes in link url (es: if you have "Link":http://www.url.com, the comma will end up into the link; to avoid this, we can parse a string like that: "Link":'http://www.url.com', and the comma will be left out of the link). - link target: they are not a first class citizen (specially in XHTML), but sometime they are very usefull. To define a target, you can add it after a link: "Link":'http://www.url.com'::'target'. Also the target can be quoted in order to avoid problems with punctuation. - Image link: in order to create a link around an image, we have defined the following sintax: ["Alt text":http://www.url.com/image.gif]:'http://www.url.com'. Here too, quoting and target are supported. ---snap--- Defaults ======== STXDebugEnabled YES|NO STXSaxDriverDebugEnabled YES|NO Structured Text Links ===================== http://www.zope.org/Members/millejoh/structuredText http://plone.org/documentation/howto/FrontPage/UsingStructuredText Classes ======= NSObject STXSaxDriver < SaxXMLReader > NSObject StructuredLine StructuredStack StructuredText StructuredTextRenderingDelegate StructuredTextRenderingDelegate_XHTML NSString(STX) SOPE/sope-xml/STXSaxDriver/GNUmakefile0000644000000000000000000000102512242733417016451 0ustar rootroot# GNUstep makefile include ../../config.make include $(GNUSTEP_MAKEFILES)/common.make include ../Version include ./Version BUNDLE_NAME = STXSaxDriver BUNDLE_EXTENSION = .sax BUNDLE_INSTALL_DIR = $(SOPE_SAXDRIVERS) STXSaxDriver_PCH_FILE = common.h STXSaxDriver_OBJC_FILES += \ STXSaxDriver.m \ StructuredTextBodyElement+SAX.m STXSaxDriver_SUBPROJECTS += \ ExtraSTX \ Model STXSaxDriver_RESOURCE_FILES += Version -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/bundle.make -include GNUmakefile.postamble SOPE/sope-xml/STXSaxDriver/GNUmakefile.postamble0000644000000000000000000000037012242733417020440 0ustar rootroot# compilation settings ifneq ($(GNUSTEP_BUILD_DIR),) after-all :: @(cp bundle-info.plist \ $(GNUSTEP_BUILD_DIR)/$(BUNDLE_NAME)$(BUNDLE_EXTENSION)) else after-all :: @(cd $(BUNDLE_NAME)$(BUNDLE_EXTENSION);\ cp ../bundle-info.plist .) endif SOPE/sope-xml/STXSaxDriver/Model/0000755000000000000000000000000012242733417015441 5ustar rootrootSOPE/sope-xml/STXSaxDriver/Model/README0000644000000000000000000000051212242733417016317 0ustar rootroot Notes ===== The central class containing the parsing code seems to be: StructuredTextBodyElement Classes ======= NSObject StructuredTextBodyElement StructuredTextHeader StructuredTextList StructuredTextListItem StructuredTextParagraph StructuredTextDocument StructuredTextLiteralBlock SOPE/sope-xml/STXSaxDriver/Model/StructuredTextListItem.h0000644000000000000000000000310112242733417022271 0ustar rootroot/* Copyright (C) 2004 eXtrapola Srl This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __StructuredTextListItem_H__ #define __StructuredTextListItem_H__ #include "StructuredTextBodyElement.h" @class NSString, NSDictionary; @class StructuredTextList; @interface StructuredTextListItem : StructuredTextBodyElement { StructuredTextList *_list; // not retained NSString *_title; NSString *_text; } - (id)initWithTitle:(NSString *)aTitle text:(NSString *)aString; /* accessors */ - (NSString *)title; - (NSString *)text; - (void)setList:(StructuredTextList *)aList; - (StructuredTextList *)list; /* parsing */ - (NSString *)titleParsedWithDelegate:(id)_del inContext:(NSDictionary *)_ctx; - (NSString *)textParsedWithDelegate:(id)_del inContext:(NSDictionary *)_ctx; @end #endif /* __StructuredTextListItem_H__ */ SOPE/sope-xml/STXSaxDriver/Model/StructuredTextHeader.m0000644000000000000000000000422412242733417021743 0ustar rootroot/* Copyright (C) 2004 eXtrapola Srl This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "StructuredTextHeader.h" #include "common.h" @implementation StructuredTextHeader - (id)initWithString:(NSString *)_str level:(int)_level { if ((self = [super init])) { self->_text = [_str copy]; self->level = _level; } return self; } - (void)dealloc { [self->_text release]; [super dealloc]; } /* accessors */ - (NSString *)text { return self->_text; } - (int)level { return self->level; } /* operations */ - (NSString *)textParsedWithDelegate:(id)_del inContext:(NSDictionary *)_ctx { self->_delegate = _del; return [self parseText:[self text] inContext:_ctx]; } /* description */ - (NSString *)description { NSMutableString *ms; ms = [NSMutableString stringWithCapacity:128]; [ms appendFormat:@"<0x%p[%@]:", self, NSStringFromClass([self class])]; /* header specific */ if (self->_text) [ms appendFormat:@" text-len=%d", [self->_text length]]; if (self->level) [ms appendFormat:@" level=%i", self->level]; /* common stuff */ if (self->_elements) [ms appendFormat:@" #elements=%d", [self->_elements count]]; if (self->_delegate) { [ms appendFormat:@" delegate=0x%p<%@>", self->_delegate, NSStringFromClass([(id)self->_delegate class])]; } if (self->runPreprocessor) [ms appendFormat:@" run-preprocessor"]; [ms appendString:@">"]; return ms; } @end /* StructuredTextHeader */ SOPE/sope-xml/STXSaxDriver/Model/StructuredTextParagraph.h0000644000000000000000000000213712242733417022454 0ustar rootroot/* Copyright (C) 2004 eXtrapola Srl This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "StructuredTextBodyElement.h" @interface StructuredTextParagraph : StructuredTextBodyElement { NSString *_text; } - (id)initWithString:(NSString *)aString; /* accessors */ - (NSString *)text; /* parsing */ - (NSString *)textParsedWithDelegate:(id)_del inContext:(NSDictionary *)aContext; @end SOPE/sope-xml/STXSaxDriver/Model/GNUmakefile0000644000000000000000000000120112242733417017505 0ustar rootroot# # StructuredText.subproj makefile for StructuredText. # # Author: Mirko Viviani # # Date: 24 November 2003 # include ../../../config.make include $(GNUSTEP_MAKEFILES)/common.make SUBPROJECT_NAME = Model Model_PCH_FILE = common.h Model_OBJC_FILES = \ StructuredTextDocument.m \ StructuredTextBodyElement.m \ StructuredTextParagraph.m \ StructuredTextListItem.m \ StructuredTextList.m \ StructuredTextLiteralBlock.m \ StructuredTextHeader.m ADDITIONAL_INCLUDE_DIRS += \ -I. -I.. -I../ExtraSTX -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/subproject.make -include GNUmakefile.postamble SOPE/sope-xml/STXSaxDriver/Model/StructuredTextBodyElement.m0000644000000000000000000005630612242733417022772 0ustar rootroot/* Copyright (C) 2004 eXtrapola Srl This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "StructuredTextBodyElement.h" #include "NSString+STX.h" #include "common.h" #define ST_ESCAPE_CHAR '\\' #define ST_UNDERLINE_CHAR '_' #define ST_DYNAMICKEY_CHAR '@' #define ST_ITALICS_CHAR '*' #define ST_LINK_CHAR '"' #define ST_LINKIMAGE_CHAR '[' static NSString *preprocessorTag = @"##"; @implementation StructuredTextBodyElement static BOOL debugOn = NO; + (void)initialize { NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; debugOn = [ud boolForKey:@"STXDebugEnabled"]; } - (id)init { if ((self = [super init])) { self->runPreprocessor = YES; } return self; } - (void)dealloc { [self->_elements release]; [super dealloc]; } /* accessors */ - (NSMutableArray *)elements { if (_elements == nil) _elements = [[NSMutableArray alloc] init]; return _elements; } - (void)addElement:(StructuredTextBodyElement *)anElement { if (anElement == nil) return; [[self elements] addObject:anElement]; } /* operations */ - (NSString *)parseText:(NSString *)_str inContext:(NSDictionary *)_ctx { // TODO: too big a method NSMutableString *result; NSString *text; NSRange range, rangeOut; int i, length, start; if (debugOn) NSLog(@"PARSE TEXT: '%@' (delegate=0x%p)", _str, self->_delegate); _str = [self preprocessText:_str inContext:_ctx]; if (debugOn) NSLog(@" preprocessed: '%@'", _str); result = [NSMutableString stringWithCapacity:[_str length]]; text = _str; for (i = start = 0, length = [text length]; i < length; i++) { unichar c; c = [text characterAtIndex:i]; switch (c) { case ST_ESCAPE_CHAR: if (i - start > 0) { range.location = start; range.length = (i - start); [self appendText:[text substringWithRange:range] inContext:_ctx]; } start = ++i; break; case '\'': if (i - start > 0) { range.location = start; range.length = i - start; [self appendText:[text substringWithRange:range] inContext:_ctx]; } if (i + 1 < length) { c = [_str characterAtIndex:i + 1]; if (c == '\'') { start = ++i; break; } } range.location = i + 1; range.length = length - range.location; rangeOut = [text rangeOfString:@"'" options:0 range:range]; if (rangeOut.length > 0) { NSString *s; range.location = i + 1; range.length = rangeOut.location - range.location; start = i = rangeOut.location + 1; s = [[text substringWithRange:range] unescapedString]; [self beginPreformattedInContext:_ctx]; [self appendText:s inContext:_ctx]; [self endPreformattedInContext:_ctx]; } else { start = i; } break; case ST_UNDERLINE_CHAR: if (i - start > 0) { range.location = start; range.length = i - start; start = i; [self appendText:[text substringWithRange:range] inContext:_ctx]; } range = [self findUnderlineSubstring:[text substringFromIndex:i + 1]]; if (range.length > 0) { NSString *s; range.location = i + 1; i += range.length + 1; start = i + 1; s = [[text substringWithRange:range] unescapedString]; [self beginUnderlineInContext:_ctx]; s = [self parseText:s inContext:_ctx]; [self appendText:s inContext:_ctx]; [self endUnderlineInContext:_ctx]; } break; case ST_DYNAMICKEY_CHAR: if (i - start > 0) { range.location = start; range.length = i - start; start = i; [self appendText:[text substringWithRange:range] inContext:_ctx]; } range = [self findDynamicKeySubstring:[text substringFromIndex:i + 1]]; if (range.length > 0) { NSString *s; range.location = i + 1; i += range.length + 1; start = i + 1; s = [self parseText:[text substringWithRange:range] inContext:_ctx]; [self appendText:[self dynamicKeyText:s inContext:_ctx] inContext:_ctx]; } break; case ST_ITALICS_CHAR: { // italics and bold if (i - start > 0) { range.location = start; range.length = i - start; start = i; [self appendText:[text substringWithRange:range] inContext:_ctx]; } if (i + 1 < length) { c = [text characterAtIndex:i + 1]; if (c == ST_ITALICS_CHAR) { range = [self findBoldSubstring:[text substringFromIndex:i + 2]]; if (range.length > 0) { NSString *s; range.location = i + 2; i += range.length + 3; start = i + 1; s = [[text substringWithRange:range] unescapedString]; [self beginBoldInContext:_ctx]; s = [self parseText:s inContext:_ctx]; [self appendText:s inContext:_ctx]; [self endBoldInContext:_ctx]; } } else { range = [self findItalicsSubstring:[text substringFromIndex:i + 1]]; if (range.length > 0) { NSString *s; range.location = i + 1; i += range.length + 1; start = i + 1; s = [[text substringWithRange:range] unescapedString]; [self beginItalicsInContext:_ctx]; s = [self parseText:s inContext:_ctx]; [self appendText:s inContext:_ctx]; [self endItalicsInContext:_ctx]; } } } break; } case ST_LINKIMAGE_CHAR: // links if (i - start > 0) { range.location = start; range.length = i - start; start = i; [self appendText:[text substringWithRange:range] inContext:_ctx]; } range = [self findLinkImageSubstring:[text substringFromIndex:i + 1]]; if (range.length > 0) { NSString *s; range.location = i + 1; i += range.length; start = i + 1; s = [self linkImage:[text substringWithRange:range] inContext:_ctx]; [self appendText:s inContext:_ctx]; } break; case ST_LINK_CHAR: // links if (i - start > 0) { range.location = start; range.length = i - start; start = i; [self appendText:[text substringWithRange:range] inContext:_ctx]; } range = [self findLinkSubstring:[text substringFromIndex:(i + 1)]]; if (range.length > 0) { NSString *s; range.location = i + 1; i += range.length; start = i + 1; s = [self linkText:[text substringWithRange:range] inContext:_ctx]; [self appendText:s inContext:_ctx]; if (debugOn) NSLog(@"found link substring: '%@'", s); } break; } } if (i - start > 0) { range.location = start; range.length = i - start; [self appendText:[text substringWithRange:range] inContext:_ctx]; } if (debugOn) NSLog(@" result: '%@'", result); return result; } - (void)appendText:(NSString *)_txt inContext:(NSDictionary *)_ctx { [self->_delegate appendText:_txt inContext:_ctx]; } - (void)beginItalicsInContext:(NSDictionary *)_ctx { [self->_delegate beginItalicsInContext:_ctx]; } - (void)endItalicsInContext:(NSDictionary *)_ctx { [self->_delegate endItalicsInContext:_ctx]; } - (void)beginUnderlineInContext:(NSDictionary *)_ctx { [self->_delegate beginUnderlineInContext:_ctx]; } - (void)endUnderlineInContext:(NSDictionary *)_ctx { [self->_delegate endUnderlineInContext:_ctx]; } - (void)beginBoldInContext:(NSDictionary *)_ctx { [self->_delegate beginBoldInContext:_ctx]; } - (void)endBoldInContext:(NSDictionary *)_ctx { [self->_delegate endBoldInContext:_ctx]; } - (void)beginPreformattedInContext:(NSDictionary *)_ctx { [self->_delegate beginPreformattedInContext:_ctx]; } - (void)endPreformattedInContext:(NSDictionary *)_ctx { [self->_delegate endPreformattedInContext:_ctx]; } - (void)beginParagraphInContext:(NSDictionary *)_ctx { [self->_delegate beginParagraphInContext:_ctx]; } - (void)endParagraphInContext:(NSDictionary *)_ctx { [self->_delegate endParagraphInContext:_ctx]; } - (NSRange)findMarkerSubstring:(NSString *)_str withMarker:(unichar)aMarker markerLength:(int)markLength { NSRange range; int i, h, length; length = [_str length]; markLength--; for (i = 0; i < length; i++) { unichar c; c = [_str characterAtIndex:i]; if (c == aMarker && i + markLength < length) { BOOL foundMarker = YES; for (h = i + 1; h <= i + markLength; h++) { c = [_str characterAtIndex:h]; if (c != aMarker) { foundMarker = NO; break; } } if (foundMarker) { range.location = 0; range.length = i; return range; } } else if (c == ST_ESCAPE_CHAR) { i++; } } range.location = NSNotFound; range.length = 0; return range; } /* find markers */ - (NSRange)findBoldSubstring:(NSString *)_str { return [self findMarkerSubstring:_str withMarker:ST_ITALICS_CHAR markerLength:2]; } - (NSRange)findItalicsSubstring:(NSString *)_str { return [self findMarkerSubstring:_str withMarker:ST_ITALICS_CHAR markerLength:1]; } - (NSRange)findUnderlineSubstring:(NSString *)_str { return [self findMarkerSubstring:_str withMarker:ST_UNDERLINE_CHAR markerLength:1]; } /* operations */ - (NSRange)_findLinkBlockTargetSubstring:(NSString *)_str { NSRange range, rangeTarget; int length; unichar c; length = [_str length]; if (debugOn) NSLog(@" find link block target: '%s'", _str); c = [_str characterAtIndex:0]; if (c == ':' && 1 < length) { c = [_str characterAtIndex:1]; range.location = 2; range.length = length - range.location; if (c == '\'') { range = [_str rangeOfString:@"'" options:0 range:range]; if (range.length == 0) return range; range.length = range.location + 1; if (range.length < length) { rangeTarget = [self findLinkTargetFromString: [_str substringFromIndex:range.length]]; if (rangeTarget.length > 0) range.length += rangeTarget.length; } } else if (c == '{') { range = [_str rangeOfString:@"}" options:0 range:range]; if (range.length == 0) return range; range.length = range.location + 1; if (range.length < length) { rangeTarget = [self findLinkTargetFromString: [_str substringFromIndex:range.length]]; if (rangeTarget.length > 0) range.length += rangeTarget.length; } } else { range = [_str rangeOfString:@" " options:0 range:range]; range.length = (range.length == 0) ? length : range.location; } range.location = 0; if (debugOn) NSLog(@" range(0,%d)", range.length); return range; } range.location = NSNotFound; range.length = 0; if (debugOn) NSLog(@" not found."); return range; } - (NSRange)findLinkImageSubstring:(NSString *)_str { NSRange range; int i, length; for (i = 0, length = [_str length]; i < length; i++) { unichar c; c = [_str characterAtIndex:i]; if (!(c == ']' && i + 1 < length)) continue; range = [self _findLinkBlockTargetSubstring: [_str substringFromIndex:i + 1]]; if (range.length > 0) { range.length += (range.location + i + 1); range.location = 0; } return range; } range.location = NSNotFound; range.length = 0; return range; } - (NSRange)findLinkSubstring:(NSString *)_str { NSRange range; int i, length; length = [_str length]; if (debugOn) NSLog(@"find link substring: '%@'(%d)", _str, length); for (i = 0; i < length; i++) { unichar c; c = [_str characterAtIndex:i]; if (!(c == ST_LINK_CHAR && ((i + 1) < length))) continue; range = [self _findLinkBlockTargetSubstring: [_str substringFromIndex:i + 1]]; if (range.length > 0) { range.length += (range.location + i + 1); range.location = 0; } return range; } range.location = NSNotFound; range.length = 0; return range; } - (NSRange)findLinkTargetFromString:(NSString *)_str { int i, length; BOOL tag = NO; NSRange range; for (i = 0, length = [_str length]; i < length; i++) { unichar c; c = [_str characterAtIndex:i]; if (!tag && c == ':' && i + 1 < length) { c = [_str characterAtIndex:i + 1]; if (c == ':') { i++; tag = YES; } } else if (tag) { if (c == '\'') { range.location = i + 1; range.length = length - range.location; range = [_str rangeOfString:@"'" options:0 range:range]; if (range.length == 0) return range; length = range.location + 1; break; } else { range.location = i; range.length = length - i; range = [_str rangeOfString:@" " options:0 range:range]; if (range.length == 0) break; length = range.location; break; } } else { range.location = NSNotFound; range.length = 0; return range; } } range.location = 0; range.length = length; return range; } - (NSRange)findDynamicKeySubstring:(NSString *)_str { NSRange range; int i, length; for (i = 0, length = [_str length]; i < length; i++) { unichar c; c = [_str characterAtIndex:i]; if (c == ST_DYNAMICKEY_CHAR) { range.location = 0; range.length = i; return range; } } range.location = NSNotFound; range.length = 0; return range; } /* links */ - (NSString *)_linkBlockTarget:(NSString *)_str withName:(NSString *)aName isImage:(BOOL)isImage inContext:(NSDictionary *)_ctx { NSString *linkName = aName; NSRange range; int length; unichar c; NSArray *components; NSString *link, *linkType = nil, *target = nil; NSRange rangeOut; if (_delegate == nil) return _str; length = [_str length]; if (length < 2) return nil; c = [_str characterAtIndex:0]; if (c != ':') { if (debugOn) NSLog(@"no link in: '%@'", _str); return nil; } c = [_str characterAtIndex:1]; range.location = 2; range.length = length - range.location; if (c == '\'') { rangeOut = [_str rangeOfString:@"'" options:0 range:range]; if (rangeOut.length == 0) return nil; range.length = rangeOut.location - range.location; target = [self linkTargetFromString: [_str substringFromIndex:rangeOut.location + 1]]; } else if (c == '{') { rangeOut = [_str rangeOfString:@"}" options:0 range:range]; if (rangeOut.length == 0) return nil; range.location--; range.length = rangeOut.location - range.location + 1; linkType = @"ibn"; target = [self linkTargetFromString: [_str substringFromIndex:rangeOut.location + 1]]; } else { rangeOut = [_str rangeOfString:@"::" options:0 range:range]; range.location--; if (rangeOut.length == 0) { rangeOut = [_str rangeOfString:@" " options:0 range:range]; range.length = (rangeOut.length == 0) ? length - range.location : rangeOut.location - range.location; } else { range.length = rangeOut.location - range.location; target = [self linkTargetFromString: [_str substringFromIndex:rangeOut.location]]; } } link = [_str substringWithRange:range]; components = [link componentsSeparatedByString:@":"]; if (!linkType) linkType = [components objectAtIndex:0]; if (!isImage) { if ([linkType isEqualToString:@"mailto"]) { return [_delegate insertEmail:linkName withAddress:link inContext:_ctx]; } if ([linkType isEqualToString:@"img"]) { NSString *url; url = [link substringFromIndex:[linkType length] + 1]; return [_delegate insertImage:linkName withUrl:url inContext:_ctx]; } if ([linkType isEqualToString:@"ibn"]) { if (debugOn) NSLog(@"IBN link %@", linkName); return [_delegate insertExtrapolaLink:linkName parameters:[link propertyList] withTarget:target inContext:_ctx]; } if (debugOn) NSLog(@"link %@: %@", linkName, link); return [_delegate insertLink:linkName withUrl:link target:target inContext:_ctx]; } if (debugOn) NSLog(@"img %@: %@", linkName, link); return [_delegate insertImage:linkName withUrl:link inContext:_ctx]; } - (NSString *)linkImage:(NSString *)_str inContext:(NSDictionary *)_ctx { NSString *linkName = nil; NSRange range; int i, length, startOfTarget; if (_delegate == nil) return _str; length = [_str length]; if (length > 1) { unichar c; range.location = 0; range.length = length; range = [_str rangeOfString:@"]" options:0 range:range]; if (range.length == 0) return _str; startOfTarget = range.location + 1; for (i = 1; i < range.location; i++) { c = [_str characterAtIndex:i]; if (c == ST_LINK_CHAR && i + 1 < length) { range.location = 1; range.length = i - 1; linkName = [_str substringWithRange:range]; range.length = startOfTarget - (i + 2); range.location = i + 1; linkName = [self _linkBlockTarget:[_str substringWithRange:range] withName:linkName isImage:YES inContext:_ctx]; break; } } if (linkName) { NSString *result; result = [self _linkBlockTarget: [_str substringFromIndex:startOfTarget] withName:linkName isImage:NO inContext:_ctx]; if (result == nil) result = _str; return result; } } return _str; } - (NSString *)linkText:(NSString *)_str inContext:(NSDictionary *)_ctx { NSString *linkName; int i, length; if (_delegate == nil) return _str; for (i = 0, length = [_str length]; i < length; i++) { NSString *result; unichar c; c = [_str characterAtIndex:i]; if (!(c == ST_LINK_CHAR && (i + 1 < length))) continue; linkName = [_str substringToIndex:i]; result = [self _linkBlockTarget:[_str substringFromIndex:i + 1] withName:linkName isImage:NO inContext:_ctx]; return result ? result : _str; } return _str; } - (NSString *)linkTargetFromString:(NSString *)_str { int i, length, start; BOOL tag = NO; NSRange range; length = [_str length]; for (start = i = 0; i < length; i++) { unichar c; c = [_str characterAtIndex:i]; if (!tag && c == ':' && i + 1 < length) { c = [_str characterAtIndex:i + 1]; if (c == ':') { start = i + 2; i++; tag = YES; } } else if (c == '\'') { range.location = i + 1; range.length = length - range.location; range = [_str rangeOfString:@"'" options:0 range:range]; if (range.length == 0) break; length = range.location; start++; break; } else { break; } } range.location = start; range.length = length - range.location; if (range.length <= 0) { return nil; } return [_str substringWithRange:range]; } - (NSString *)dynamicKeyText:(NSString *)_str inContext:(NSDictionary *)_ctx { if (_delegate) return [_delegate insertDynamicKey:_str inContext:_ctx]; return _str; } - (NSString *)preprocessText:(NSString *)_str inContext:(NSDictionary *)_ctx { // TODO: breaks on libFoundation // TODO: need to find out what this is exactly supposed to do NSMutableString *result; NSRange rangeToCopy, range, rangeEnd; int length; if (debugOn) NSLog(@"preprocess: '%@'", _str); if (!self->runPreprocessor) return _str; self->runPreprocessor = NO; length = [_str length]; result = [NSMutableString stringWithCapacity:length]; range.location = 0; range.length = length; rangeEnd.location = 0; rangeEnd.length = length; rangeToCopy.location = 0; rangeToCopy.length = length; // TODO: the NSNotFound check might make trouble on libFoundation for (; range.location != NSNotFound && range.location < length;) { range = [_str rangeOfString:preprocessorTag options:0 range:range]; if (range.length == 0) { if (rangeEnd.location == 0) return _str; rangeToCopy.location = rangeEnd.location + 2; rangeToCopy.length = (length - rangeToCopy.location); [result appendString:[_str substringWithRange:rangeToCopy]]; continue; } rangeToCopy.location = rangeEnd.location; if (rangeEnd.location > 0) rangeToCopy.location += 2; rangeEnd.location = range.location + 2; rangeEnd.length = length - rangeEnd.location; rangeEnd = [_str rangeOfString:preprocessorTag options:0 range:rangeEnd]; if (rangeEnd.length > 0) { NSRange keyRange; NSString *text; rangeToCopy.length = (range.location - rangeToCopy.location); if (rangeToCopy.length > 0) { NSString *s; s = [_str substringWithRange:rangeToCopy]; [result appendString:s]; } keyRange.location = range.location + 2; keyRange.length = rangeEnd.location - keyRange.location; text = [_delegate insertPreprocessedTextForKey: [_str substringWithRange:keyRange] inContext:_ctx]; if (text) [result appendString:text]; range.location = rangeEnd.location + 2; range.length = length - range.location; self->runPreprocessor = YES; } else { range.location = NSNotFound; rangeToCopy.length = length - rangeToCopy.location; [result appendString:[_str substringWithRange:rangeToCopy]]; } } return result; } /* description */ - (NSString *)description { NSMutableString *ms; ms = [NSMutableString stringWithCapacity:128]; [ms appendFormat:@"<0x%p[%@]:", self, NSStringFromClass([self class])]; if (self->_elements) [ms appendFormat:@" #elements=%d", [self->_elements count]]; if (self->_delegate) { [ms appendFormat:@" delegate=0x%p<%@>", self->_delegate, NSStringFromClass([(id)self->_delegate class])]; } if (self->runPreprocessor) [ms appendFormat:@" run-preprocessor"]; [ms appendString:@">"]; return ms; } @end /* StructuredTextBodyElement */ SOPE/sope-xml/STXSaxDriver/Model/StructuredTextList.h0000644000000000000000000000242012242733417021455 0ustar rootroot/* Copyright (C) 2004 eXtrapola Srl This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __StructuredTextList_H__ #define __StructuredTextList_H__ #include "StructuredTextBodyElement.h" #define StructuredTextList_BULLET 0 #define StructuredTextList_ENUMERATED 1 #define StructuredTextList_DEFINITION 2 @class StructuredTextListItem; @interface StructuredTextList : StructuredTextBodyElement { int typology; } - (id)initWithTypology:(int)aValue; /* accessors */ - (int)typology; /* operations */ - (void)addElement:(StructuredTextListItem *)anItem; @end #endif /* __StructuredTextList_H__ */ SOPE/sope-xml/STXSaxDriver/Model/COPYRIGHT0000644000000000000000000000203412242733417016733 0ustar rootroot Structured Text Code Copyright (C) 2004 eXtrapola Srl Contact: marco.barulli@extrapola.com Statement by Extrapola SRL (Marco Barulli) ========================================== I'm glad to confirm that eXtrapola Srl, as the copyright holder on the StructuredText code sent to the OpenGroupware.org project and initially written by Mirko Viviani and Giulio Cesare Solaroli, hereby states that the code is licensed and can be used under the terms of the Lesser General Public License. Statement by Mirko Viviani ========================== Mirko Viviani, as the original author of the StructuredText framework sent to the OpenGroupware.org project, hereby states that the code is licensed and can be used under the terms of the Lesser General Public License. Statement by Giulio Cesare Solaroli =================================== I, as one of the original author on the StructuredText code sent to the OpenGroupware.org project, hereby states that the code is licensed and can be used under the terms of the Lesser General Public License. SOPE/sope-xml/STXSaxDriver/Model/StructuredTextParagraph.m0000644000000000000000000000266012242733417022462 0ustar rootroot/* Copyright (C) 2004 eXtrapola Srl This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "StructuredTextParagraph.h" #include "common.h" @implementation StructuredTextParagraph - (id)initWithString:(NSString *)_s { if ((self = [super init])) { self->_text = [_s retain]; } return self; } - (void)dealloc { [self->_text release]; [super dealloc]; } /* accessors */ - (NSString *)text { return self->_text; } /* processing */ - (NSString *)textParsedWithDelegate:(id)_del inContext:(NSDictionary *)_ctx { self->_delegate = _del; [self beginParagraphInContext:_ctx]; [self parseText:[self text] inContext:_ctx]; [self endParagraphInContext:_ctx]; return nil; } @end /* StructuredTextParagraph */ SOPE/sope-xml/STXSaxDriver/Model/StructuredTextLiteralBlock.h0000644000000000000000000000172712242733417023122 0ustar rootroot/* Copyright (C) 2004 eXtrapola Srl This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import @class NSString; @interface StructuredTextLiteralBlock : NSObject { NSString *_text; } - (id)initWithString:(NSString *)aString; /* accessors */ - (NSString *)text; @end SOPE/sope-xml/STXSaxDriver/Model/StructuredTextListItem.m0000644000000000000000000000416712242733417022313 0ustar rootroot/* Copyright (C) 2004 eXtrapola Srl This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "StructuredTextListItem.h" #include "StructuredTextList.h" #include "common.h" @interface NSObject(SetListPrivate) - (void)setList:(id)_list; @end @implementation StructuredTextListItem - (id)initWithTitle:(NSString *)_aTitle text:(NSString *)_aString { if ((self = [super init])) { self->_title = [_aTitle copy]; self->_text = [_aString copy]; } return self; } - (void)dealloc { [self->_title release]; [self->_text release]; [super dealloc]; } /* accessors */ - (NSString *)title { return self->_title; } - (NSString *)text { return self->_text; } - (void)setList:(StructuredTextList *)aList { self->_list = aList; } - (StructuredTextList *)list { return self->_list; } /* operations */ - (void)addElement:(StructuredTextBodyElement *)_item { if (_item == nil) return; [super addElement:_item]; if ([_item respondsToSelector:@selector(setList:)]) [_item setList:_list]; } /* parsing parts */ - (NSString *)titleParsedWithDelegate:(id)_d inContext:(NSDictionary *)_ctx { self->_delegate = _d; return [self parseText:[self title] inContext:_ctx]; } - (NSString *)textParsedWithDelegate:(id)_del inContext:(NSDictionary *)_ctx { self->_delegate = _del; return [self parseText:[self text] inContext:_ctx]; } @end /* StructuredTextListItem */ SOPE/sope-xml/STXSaxDriver/Model/StructuredTextLiteralBlock.m0000644000000000000000000000222012242733417023114 0ustar rootroot/* Copyright (C) 2004 eXtrapola Srl This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "StructuredTextLiteralBlock.h" #include "common.h" @implementation StructuredTextLiteralBlock - (id)initWithString:(NSString *)_str { if ((self = [super init])) { self->_text = [_str copy]; } return self; } - (void)dealloc { [self->_text release]; [super dealloc]; } /* accessors */ - (NSString *)text { return self->_text; } @end /* StructuredTextLiteralBlock */ SOPE/sope-xml/STXSaxDriver/Model/common.h0000644000000000000000000000002712242733417017101 0ustar rootroot#include "../common.h" SOPE/sope-xml/STXSaxDriver/Model/StructuredTextDocument.h0000644000000000000000000000202612242733417022322 0ustar rootroot/* Copyright (C) 2004 eXtrapola Srl This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import @class NSMutableArray; @class StructuredTextBodyElement; @interface StructuredTextDocument : NSObject { NSMutableArray *_bodyElements; } - (NSMutableArray *)bodyElements; - (void)addBodyElement:(StructuredTextBodyElement *)aBody; @end SOPE/sope-xml/STXSaxDriver/Model/StructuredTextDocument.m0000644000000000000000000000250612242733417022332 0ustar rootroot/* Copyright (C) 2004 eXtrapola Srl This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "StructuredTextDocument.h" #include "StructuredTextBodyElement.h" #include "common.h" @implementation StructuredTextDocument - (void)dealloc { [self->_bodyElements release]; [super dealloc]; } /* accessors */ - (NSMutableArray *)bodyElements { if (self->_bodyElements == nil) self->_bodyElements = [[NSMutableArray alloc] init]; return self->_bodyElements; } /* operations */ - (void)addBodyElement:(StructuredTextBodyElement *)_body { if (_body == nil) return; [[self bodyElements] addObject:_body]; } @end /* StructuredTextDocument */ SOPE/sope-xml/STXSaxDriver/Model/StructuredTextList.m0000644000000000000000000000236512242733417021472 0ustar rootroot/* Copyright (C) 2004 eXtrapola Srl This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "StructuredTextList.h" #include "StructuredTextListItem.h" #include "common.h" @implementation StructuredTextList - (id)initWithTypology:(int)aValue { if ((self = [super init])) { self->typology = aValue; } return self; } /* accessors */ - (int)typology { return self->typology; } /* operations */ - (void)addElement:(StructuredTextListItem *)_item { if (_item == nil) return; [super addElement:_item]; [_item setList:self]; } @end /* StructuredTextList */ SOPE/sope-xml/STXSaxDriver/Model/StructuredTextBodyElement.h0000644000000000000000000000522012242733417022752 0ustar rootroot/* Copyright (C) 2004 eXtrapola Srl This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __StructuredTextBodyElement_H__ #define __StructuredTextBodyElement_H__ #import #import #include "StructuredTextRenderingDelegate.h" @class NSMutableArray; @interface StructuredTextBodyElement : NSObject { NSMutableArray *_elements; id _delegate; /* non-retained */ BOOL runPreprocessor; } - (NSMutableArray *)elements; - (void)addElement:(StructuredTextBodyElement *)_element; - (NSString *)parseText:(NSString *)_str inContext:(NSDictionary *)_ctx; - (NSRange)findBoldSubstring:(NSString *)_str; - (NSRange)findItalicsSubstring:(NSString *)_str; - (NSRange)findUnderlineSubstring:(NSString *)_str; - (NSRange)findLinkImageSubstring:(NSString *)_str; - (NSRange)findLinkSubstring:(NSString *)_str; - (NSRange)findLinkTargetFromString:(NSString *)_str; - (NSRange)findDynamicKeySubstring:(NSString *)_str; - (void)appendText:(NSString *)_txt inContext:(NSDictionary *)_ctx; - (void)beginItalicsInContext:(NSDictionary *)_ctx; - (void)endItalicsInContext:(NSDictionary *)_ctx; - (void)beginUnderlineInContext:(NSDictionary *)_ctx; - (void)endUnderlineInContext:(NSDictionary *)_ctx; - (void)beginBoldInContext:(NSDictionary *)_ctx; - (void)endBoldInContext:(NSDictionary *)_ctx; - (void)beginPreformattedInContext:(NSDictionary *)_ctx; - (void)endPreformattedInContext:(NSDictionary *)_ctx; - (void)beginParagraphInContext:(NSDictionary *)_ctx; - (void)endParagraphInContext:(NSDictionary *)_ctx; - (NSString *)linkImage:(NSString *)_str inContext:(NSDictionary *)_ctx; - (NSString *)linkText:(NSString *)_str inContext:(NSDictionary *)_ctx; - (NSString *)linkTargetFromString:(NSString *)_str; - (NSString *)dynamicKeyText:(NSString *)aKey inContext:(NSDictionary *)_ctx; - (NSString *)preprocessText:(NSString *)_str inContext:(NSDictionary *)_ctx; @end #endif /* __StructuredTextBodyElement_H__ */ SOPE/sope-xml/STXSaxDriver/Model/StructuredTextHeader.h0000644000000000000000000000226012242733417021734 0ustar rootroot/* Copyright (C) 2004 eXtrapola Srl This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "StructuredTextBodyElement.h" @class NSString, NSDictionary; @interface StructuredTextHeader : StructuredTextBodyElement { NSString *_text; int level; } - (id)initWithString:(NSString *)aString level:(int)aLevel; /* accessors */ - (NSString *)text; - (int)level; /* operations */ - (NSString *)textParsedWithDelegate:(id)_dele inContext:(NSDictionary *)aContext; @end SOPE/sope-xml/STXSaxDriver/COPYRIGHT0000644000000000000000000000216312242733417015676 0ustar rootrootStructured Text Code Copyright (C) 2004 eXtrapola Srl Contact: marco.barulli@extrapola.com SAX Driver Classes Copyright (C) 2004 Helge Hess Contact: helge.hess@opengroupware.org Statement by Extrapola SRL (Marco Barulli) ========================================== I'm glad to confirm that eXtrapola Srl, as the copyright holder on the StructuredText code sent to the OpenGroupware.org project and initially written by Mirko Viviani and Giulio Cesare Solaroli, hereby states that the code is licensed and can be used under the terms of the Lesser General Public License. Statement by Mirko Viviani ========================== Mirko Viviani, as the original author of the StructuredText framework sent to the OpenGroupware.org project, hereby states that the code is licensed and can be used under the terms of the Lesser General Public License. Statement by Giulio Cesare Solaroli =================================== I, as one of the original author on the StructuredText code sent to the OpenGroupware.org project, hereby states that the code is licensed and can be used under the terms of the Lesser General Public License. SOPE/sope-xml/STXSaxDriver/ChangeLog0000644000000000000000000002157212242733417016162 0ustar rootroot2007-02-21 Marcus Mueller * v4.7.15 * STXSaxDriver.m, ExtraSTX/StructuredTextRenderingDelegate.h: changed the API, which was broken by design, to properly deal with block elements (which can be nested). * Model/{StructuredTextBodyElement.[hm], StructuredTextParagraph.m}: changed API and implementation to properly deal with block elements. * data/znektest1.stx: trimmed testcase 2007-02-19 Marcus Mueller * data/znektest1.stx: added testcase demonstrating a bug in conjunction with lists and hyperlinks 2007-02-12 Marcus Mueller * STXSaxDriver.xcodeproj: added Xcode 2.4 project file 2006-07-03 Helge Hess * fixed gcc 4.1 warnings, use %p for pointers formats (v4.5.14) 2005-08-27 Helge Hess * added common.h in project subdirs for PCH support (v4.5.13) 2005-08-16 Helge Hess * v4.5.12 * install into SaxObjC framework Resources when being used with OSX * bumped version to 4.5 to be consistent with the remaining SOPE versioning 2005-05-03 Helge Hess * Model/StructuredTextBodyElement.m: fixed a gcc 4.0 warning (v1.0.11) 2004-11-04 Helge Hess * use Version file for install directory location 2004-10-21 Helge Hess * ExtraSTX/GNUmakefile, Model/GNUmakefile: fixed for config.make compilation (v1.0.10) 2004-08-29 Helge Hess * added hack to install the project in FHS locations - the SAX driver will be installed in FHS_INSTALL_ROOT if specified (eg make FHS_INSTALL_ROOT=/usr/local) (v1.0.9) 2004-08-24 Helge Hess * GNUmakefile: install SAX driver in Library/SaxDrivers-4.3/ (v1.0.8) * GNUmakefile: install SAX driver in Library/SaxDrivers/4.3/ (v1.0.7) 2004-05-05 Marcus Mueller * GNUmakefile.preamble, GNUmakefile.postamble: added support for building with GNUSTEP_BUILD_DIR environment variable set for recent gnustep-make package. (v1.0.6) 2004-03-16 Helge Hess * bundle-info.plist: fixed a type in the bundle-info.plist (v1.0.5) 2004-03-04 Helge Hess * STXSaxDriver.m: fixed a bug with header generation (header subelements did not properly generate) (v1.0.4) * STXSaxDriver.m: added proper error handling for missing files (v1.0.3) 2004-03-04 Helge Hess * ExtraSTX/StructuredText.m: applied a bugfix on the header processing by Mirko (v1.0.2) 2004-02-29 Helge Hess * v1.0.1 * initial import of the SAX driver into OpenGroupware.org - many thanks go to extrapola for contributing the STX framework to OGo * removed things unnecessary for the SAX driver * replace some -rangeOfString: NSNotFound checks which do not work with libFoundation (need to check for range.length==0 instead!) * added the STXSaxDriver, an application of the StructuredText code * reformatted code according to OGo styleguides 2004-02-15 Mirko Viviani * StructuredTextBodyElement.m: implementato link image ed escaping stile C. * NSString_StructuredText_Extra.m: implementato escaping di stringhe. 2004-02-10 Giulio Cesare Solaroli * Aggiunti alcuni test per la verifica della gestione dei link attorno alle immagini. 2004-01-16 Giulio Cesare Solaroli * Aggiunto un test (test__characterEscaping) che fallisce, mostrando un problema nella gestione nell'escape dei caratteri. 2004-01-13 Mirko Viviani * StructuredText.m ([-separateIntoBlocks]): ignora linee contenente solo spazi o tab. 2004-01-12 Mirko Viviani * StructuredText.m ([-separateIntoBlocks]): rimuove \r dal testo. 2004-01-08 Mirko Viviani * StructuredText.subproj/StructuredTextBodyElement.m: fix del link target. 2003-12-19 Mirko Viviani * StructuredText.subproj/StructuredTextBodyElement.m: aggiunto riconoscimento chiavi dinamiche. * StructuredTextRenderingDelegate.h: aggiunto metodo chiamato per chiavi dinamiche. 2003-12-18 Mirko Viviani * StructuredTextRenderingDelegate.m ([-insertPreprocessedTextForKey: inContext:]): metodo chiamato dal preprocessore per sostituire le chiavi. * StructuredText.subproj/StructuredTextBodyElement.m: implementato preprocessore. 2003-12-16 Mirko Viviani * Test.subproj/Test_StructuredText.m: aggiunto test per link Extrapola. * StructuredTextRenderingDelegate.h: corretto metodo per link Extrapola e aggiunto parametro target al link. * StructuredText.subproj/StructuredTextBodyElement.m: implementato link Extrapola. 2003-12-11 Mirko Viviani * StructuredText.subproj/StructuredTextHeader.m: implementato rendering con delegate. * StructuredText.subproj/StructuredTextListItem.m: come sopra. * StructuredText.subproj/StructuredTextBodyElement.m: Spostato il parser da StructuredTextParagraph. 2003-12-08 Mirko Viviani * StructuredText.subproj/StructuredTextParagraph.m: implementati link. * Test.subproj/StructuredText_TEST.m ([StructuredTextListItem -toTestInContext:]): fix per liste nidificate. * StructuredText_XHTML.m ([StructuredTextListItem -toXhtmlInContext:]): come sopra. * Test.subproj/Test_StructuredText.m: corretti vari tests. * StructuredLine.m ([-setText:]): setta correttamente il numero di spazi iniziali. * StructuredText.m ([-buildList], [-checkForListItem:]): implementata lista numerata. ([-adjustLineLevels]): setta i livelli correttamente anche per liste. ([-lineType]): fix per liste. ([-checkForListItem]): spostato codice in listItemTypology: ([-buildList]): fix per liste nidificate. * StructuredStack.m ([-pop]): posiziona correttamente il cursore. 2003-12-08 Mirko Viviani * StructuredText.subproj/StructuredTextParagraph.m ([-parseText:inContext:]): modificato in metodo ricorsivo. Implementato bold, underline e italico. ([-findBoldSubstring:]: Ricerca terminatore stringa in grassetto. ([-findItalicsSubstring:]: Ricerca terminatore stringa in italico. ([-findUnderlineSubstring:]: Ricerca terminatore stringa in sottolineato. ([-boldText:inContext]): formatta il testo con il delegato. ([-italicsText:inContext]): come sopra. ([-underlineText:inContext]): come sopra. 2003-12-05 Mirko Viviani * StructuredText_XHTML.m ([StructuredTextListItem -toXhtmlInContext]): fix per list item. * StructuredText.m ([-buildLiteralBlock]): aggiunto newline a fine riga. 2003-12-04 Mirko Viviani * StructuredText.subproj/StructuredTextHeader.m: modificato inizializzatore per settare il livello dell'header. Vari fix. * StructuredText.m: implementate le liste di tipo DEFINITION, i blocchi preformattati e gli header. * StructuredLine.m ([-setText:]: setta il testo originale. ([-text]): ritorna il testo privo di spazi iniziali/finali e newline. ([-originalText]): ritorna il testo originale. * StructuredText.subproj/StructuredTextLiteralBlock.m ([-initWithString:]: inizializza il blocco. * StructuredText.subproj/StructuredTextListItem.m: aggiunto testo del list item per i tipi DEFINITION. * StructuredStack.m ([-objectRelativeToCursorAtIndex:]: ritorna l'oggetto con un indice relativo alla posizione corrente del cursore. 2003-12-01 Mirko Viviani * StructuredText.subproj/StructuredTextBodyElement.m: metodi per la gestione degli elementi figli. * StructuredText.m: fix delle strutture di stack, una (paragraphs) per la gestione delle linee di testo da processare, l'altra (stack) per la posizione nell'albero del documento. * StructuredStack.m ([StructuredStack -currentObject], [StructuredStack -nextObject]): fix per fine array. * StructuredText.subproj/StructuredTextList.h: fix typo. * StructuredText.subproj/StructuredTextListItem.m.|.h: inizializzazione e settaggio lista di appartenenza. _list non deve essere rilasciato. 2003-11-27 Mirko Viviani * StructuredTextRenderingDelegate.m ([StructuredTextRenderingDelegate -insertExtrapolaLink:withAction:parameters:inContext:]): uso di NSStringFromClass() per ottenere nome di classe. * StructuredText.subproj/StructuredTextParagraph.m: inizializzazione e minimo uso del delegate per il test. * StructuredText.subproj/StructuredTextDocument.m|.h ([-addBodyElement]): aggiunge un elemento al documento. * PB.project, GSmakefile, Makefile: Aggiunto framework IBNExtensions SOPE/sope-xml/STXSaxDriver/data/0000755000000000000000000000000012242733417015312 5ustar rootrootSOPE/sope-xml/STXSaxDriver/data/hhtest1-expect.pyx0000644000000000000000000000050212242733417020717 0ustar rootroot(p -jasdhf sdajfh asdfh asdfh ajasdhfj hasdjkfh jkasdf asdf jasd fhjasdhf jkasdhf )p (em -asdklf )em (strong -klasdf )strong (u -asf )u (p -asdkfj kl;asdfk asdjfjasdhf asdfkj daskjf asdkj flkasdf asdfkj )p (ul (li (a Ahref http://www.skyrix.de/ -SKYRiX )a )li (li (a Ahref http://www.opengroupware.org/ -OGo )a )li )ul SOPE/sope-xml/STXSaxDriver/data/hhtest1.stx0000644000000000000000000000036312242733417017434 0ustar rootrootjasdhf sdajfh asdfh asdfh ajasdhfj hasdjkfh jkasdf asdf jasd fhjasdhf jkasdhf asdkfj kl;asdfk asdjfjasdhf asdfkj daskjf asdkj flkasdf asdfkj *asdklf* **klasdf** _asf_ * "SKYRiX":http://www.skyrix.de/ * "OGo":http://www.opengroupware.org/ SOPE/sope-xml/STXSaxDriver/data/znektest1.stx0000644000000000000000000000014112242733417017776 0ustar rootrootThe *test 3* URL should appear here "test 3":http://www.example.org/test3 and not anywhere else. SOPE/sope-xml/STXSaxDriver/data/extra_test1-expect.pyx0000644000000000000000000000004012242733417021577 0ustar rootroot(ul (li - a )li (li - b )li )ul SOPE/sope-xml/STXSaxDriver/data/extra_test2-expect.pyx0000644000000000000000000000270712242733417021614 0ustar rootroot(p -Municipia aggrega 12099 lettori in diverse comunita che accedono alla versione completa del magazine e ad utili servizi di personalizzazione. )p -Leggi le Faq! (p -Vuoi saperne di piu? Leggi le Faq!":{url = article; action= ciao;} )p (p -Richiedi l'accesso a una comunita di Municipia )p (ul (li -COM-P.A. -COM-P.A.":{url = article; action= ciao;} )li (li -Comune di Senigallia -Comune di Senigallia":{url = article; action= ciao;} )li (li -Comuneinlinea -Comuneinlinea":{url = article; action= ciao;} )li (li -Comunicatori Pubblici -Comunicatori Pubblici":{url = article; action= ciao;} )li (li -Findonline -Findonline":{url = article; action= ciao;} )li (li -Provincia Regionale di Messina -Provincia Regionale di Messina":{url = article; action= ciao;} )li (li -Provincia di Brescia -Provincia di Brescia":{url = article; action= ciao;} )li (li -Provincia di Milano -Provincia di Milano":{url = article; action= ciao;} )li (li -Provincia di Modena -Provincia di Modena":{url = article; action= ciao;} )li (li -Provincia di Napoli -Provincia di Napoli":{url = article; action= ciao;} )li (li -Provincia di Padova -Provincia di Padova":{url = article; action= ciao;} )li (li -Provincia di Pesaro-Urbino -Provincia di Pesaro-Urbino":{url = article; action= ciao;} )li (li -Provincia Autonoma di Trento -Provincia Autonoma di Trento":{url = article; action= ciao;} )li )ul -segnala una nuova comunita! (p -Oppure segnala una nuova comunita!":{url = article; action= ciao;} )p SOPE/sope-xml/STXSaxDriver/data/extra_test1.stx0000644000000000000000000000001412242733417020310 0ustar rootroot* a * bSOPE/sope-xml/STXSaxDriver/data/hhtest2.stx0000644000000000000000000000041212242733417017430 0ustar rootrootjasdhf sdajfh asdfh asdfh ajasdhfj hasdjkfh jkasdf asdf jasd fhjasdhf jkasdhf asdkfj asdf asdf asdkfj kl;asdfk asdjfjasdhf asdfkj daskjf asdkj flkasdf asdfkj *asdklf* **klasdf** _asf_ * "SKYRiX":http://www.skyrix.de/ * "OGo":http://www.opengroupware.org/ SOPE/sope-xml/STXSaxDriver/data/extra_test2.stx0000644000000000000000000000211112242733417020311 0ustar rootrootMunicipia aggrega 12099 lettori in diverse comunita che accedono alla versione completa del magazine e ad utili servizi di personalizzazione. Vuoi saperne di piu? "Leggi le Faq!":{url = article; action= ciao;} Richiedi l'accesso a una comunita di Municipia * "COM-P.A.":{url = article; action= ciao;} * "Comune di Senigallia":{url = article; action= ciao;} * "Comuneinlinea":{url = article; action= ciao;} * "Comunicatori Pubblici":{url = article; action= ciao;} * "Findonline":{url = article; action= ciao;} * "Provincia Regionale di Messina":{url = article; action= ciao;} * "Provincia di Brescia":{url = article; action= ciao;} * "Provincia di Milano":{url = article; action= ciao;} * "Provincia di Modena":{url = article; action= ciao;} * "Provincia di Napoli":{url = article; action= ciao;} * "Provincia di Padova":{url = article; action= ciao;} * "Provincia di Pesaro-Urbino":{url = article; action= ciao;} * "Provincia Autonoma di Trento":{url = article; action= ciao;} Oppure "segnala una nuova comunita!":{url = article; action= ciao;}SOPE/sope-xml/STXSaxDriver/data/hhtest3.stx0000644000000000000000000000003412242733417017431 0ustar rootroot1 sdkfj 2 ksdafj 3 asldfk SOPE/sope-xml/STXSaxDriver/data/hhtest3-expect.pyx0000644000000000000000000000006712242733417020727 0ustar rootroot(ol (li -sdkfj )li (li -ksdafj )li (li -asldfk )li )ol SOPE/sope-xml/STXSaxDriver/GNUmakefile.preamble0000644000000000000000000000145512242733417020246 0ustar rootroot# compilation settings ifeq ($(frameworks),yes) BUNDLE_INSTALL_DIR := $(FRAMEWORK_INSTALL_DIR)/SaxObjC.framework/Resources/SaxDrivers/ endif STXSaxDriver_INCLUDE_DIRS += \ -I. \ -I./Model/ \ -I./ExtraSTX/ \ -I.. # dependencies ifneq ($(frameworks),yes) STXSaxDriver_BUNDLE_LIBS += -lSaxObjC else STXSaxDriver_BUNDLE_LIBS += -framework SaxObjC endif # library/framework search pathes DEP_DIRS = ../SaxObjC ifneq ($(frameworks),yes) ADDITIONAL_LIB_DIRS += \ $(foreach dir,$(DEP_DIRS),\ -L$(GNUSTEP_BUILD_DIR)/$(dir)/$(GNUSTEP_OBJ_DIR_NAME)) else ADDITIONAL_LIB_DIRS += \ $(foreach dir,$(DEP_DIRS),-F$(GNUSTEP_BUILD_DIR)/$(dir)) endif ifeq ($(findstring _64, $(GNUSTEP_TARGET_CPU)), _64) SYSTEM_LIB_DIR += -L/usr/local/lib64 -L/usr/lib64 else SYSTEM_LIB_DIR += -L/usr/local/lib -L/usr/lib endif SOPE/sope-xml/STXSaxDriver/bundle-info.plist0000644000000000000000000000064312242733417017663 0ustar rootroot{ requires = { bundleManagerVersion = 1; classes = ( { name = NSObject; } ); }; provides = { SAXDrivers = ( { name = STXSaxDriver; sourceTypes = ( "text/structured" ); }, { name = STXSaxDriver; sourceTypes = ( "text/restructured" ); } ); classes = ( { name = STXSaxDriver; } ); }; } SOPE/sope-xml/STXSaxDriver/TODO0000644000000000000000000000053412242733417015073 0ustar rootrootTODO ==== - find out proper MIME types for STX - check why data/hhtest2.stx fails - further cleanup of the sources to OGo styleguides - remove unused classes - complete support for missing STX model classes in the SAX driver? - document the exact set of STX grammar which is supported - check for memory leaks (see TODO comments in sources) SOPE/sope-xml/STXSaxDriver/ExtraSTX/0000755000000000000000000000000012242733417016063 5ustar rootrootSOPE/sope-xml/STXSaxDriver/ExtraSTX/NSString+STX.h0000644000000000000000000000177612242733417020430 0ustar rootroot/* Copyright (C) 2004 eXtrapola Srl This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NSString_STX_H__ #define __NSString_STX_H__ #import #import "StructuredText.h" @interface NSString(STX) - (StructuredText *)structuredText; - (NSString *)unescapedString; @end #endif /* __NSString_STX_H__ */ SOPE/sope-xml/STXSaxDriver/ExtraSTX/StructuredText.h0000644000000000000000000000454112242733417021251 0ustar rootroot/* Copyright (C) 2004 eXtrapola Srl This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __StructuredText_H__ #define __StructuredText_H__ #import #include "StructuredTextDocument.h" @class NSString, NSMutableString; @class StructuredLine, StructuredStack; @class StructuredTextHeader, StructuredTextParagraph, StructuredTextList; @class StructuredTextListItem, StructuredTextLiteralBlock; #define StructuredTextParserLine_Header 0 #define StructuredTextParserLine_Paragraph 1 #define StructuredTextParserLine_List 2 #define StructuredTextParserLine_LiteralBlock 3 @interface StructuredText : NSObject { NSString *_text; StructuredTextDocument *_document; StructuredStack *_stack; StructuredStack *_paragraphs; #if DISABLE_BUG_FIX int currentHeaderLevel; #endif } + (StructuredTextDocument *)parseText:(NSString *)_txt; - (id)initWithString:(NSString *)_str; /* accessors */ - (NSString *)text; - (StructuredTextDocument *)document; - (StructuredStack *)stack; - (StructuredStack *)paragraphs; /* parsing */ - (void)parse; - (NSUInteger)lineType:(StructuredLine *)_line; - (void)separateIntoBlocks; - (void)adjustLineLevels; - (void)buildDocument; - (BOOL)checkForHeader:(StructuredLine *)_line; - (BOOL)checkForListItem:(StructuredLine *)_line; - (BOOL)checkForPreformattedStatement:(StructuredLine *)_line; - (BOOL)checkForPreformattedBlock:(StructuredLine *)_line; - (StructuredTextHeader *)buildHeader; - (StructuredTextParagraph *)buildParagraph; - (StructuredTextLiteralBlock *)buildLiteralBlock; - (StructuredTextList *)buildList; - (NSUInteger)listItemTypology:(StructuredLine *)_line; @end #endif /* __StructuredText_H__ */ SOPE/sope-xml/STXSaxDriver/ExtraSTX/README0000644000000000000000000000211512242733417016742 0ustar rootroot How to use ========== 1. get a string in structured text format: NSString *s = "a\nb\nc" 2. parse it into "StructuredText" object: StructuredText *stx = [s structuredText]; or: StructuredText *stx = [[StructuredText alloc] initWithString:s]; 3. render the object, eg using -toXhtmlInContext: Defaults ======== STXDebugEnabled YES|NO Links ===== http://www.zope.org/Members/millejoh/structuredText http://plone.org/documentation/howto/FrontPage/UsingStructuredText Classes ======= NSObject StructuredLine StructuredStack StructuredText StructuredTextRenderingDelegate StructuredTextRenderingDelegate_XHTML NSString(NSString_StructuredText_Extra) NSArray(StructuredText_XHTML) StructuredText(StructuredText_XHTML) StructuredTextDocument(StructuredText_XHTML) StructuredTextBodyElement(StructuredText_XHTML) StructuredTextHeader(StructuredText_XHTML) StructuredTextParagraph(StructuredText_XHTML) StructuredTextList(StructuredText_XHTML) StructuredTextListItem(StructuredText_XHTML) StructuredTextLiteralBlock(StructuredText_XHTML) SOPE/sope-xml/STXSaxDriver/ExtraSTX/StructuredStack.m0000644000000000000000000000603512242733417021377 0ustar rootroot/* Copyright (C) 2004 eXtrapola Srl This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import "StructuredStack.h" #include "common.h" @implementation StructuredStack - (void)dealloc { [self->_stack release]; [super dealloc]; } /* accessors */ - (NSMutableArray *)stack { if (self->_stack == nil) // TODO: find a proper capacity self->_stack = [[NSMutableArray alloc] initWithCapacity:16]; return _stack; } /* operations */ - (void)removeAllObjects { [[self stack] removeAllObjects]; [self first]; } - (void)push:(id)anObject { NSMutableArray *stack; if (anObject == nil) return; stack = [self stack]; [stack addObject:anObject]; if (![self cursorFollowsFIFO]) return; self->start = NO; self->pos = ([stack count] - 1); } - (id)pop { NSMutableArray *stack; int count; id object; object = nil; stack = [self stack]; count = [stack count]; if (count > 0) { object = [stack objectAtIndex:--count]; [stack removeLastObject]; } if ([self cursorFollowsFIFO]) { start = NO; pos = count - 1; } return object; } - (void)first { pos = 0; start = YES; } - (void)last { pos = [[self stack] count]; start = NO; } /* enumerator */ - (id)nextObject { NSMutableArray *stack; int count; stack = [self stack]; count = [stack count]; if (count == 0 || pos >= count) { return nil; } if (self->start) { self->start = NO; } else { pos++; if (pos >= count) return nil; } return [stack objectAtIndex:pos]; } - (id)currentObject { NSMutableArray *stack; int count; stack = [self stack]; count = [stack count]; if (count == 0 || pos >= count) return nil; self->start = NO; return [[self stack] objectAtIndex:pos]; } - (id)prevObject { NSMutableArray *stack; id result; stack = [self stack]; result = ((start || pos == 0) && [stack count]) ? nil : [stack objectAtIndex:--pos]; return result; } - (void)setCursorFollowsFIFO:(BOOL)aValue { self->cursorFIFO = aValue; } - (BOOL)cursorFollowsFIFO { return self->cursorFIFO; } - (id)objectRelativeToCursorAtIndex:(int)anIndex { NSMutableArray *stack; int i, count; stack = [self stack]; count = [stack count]; i = pos + anIndex; if (count == 0 || i < 0 || i >= count) return nil; return [[self stack] objectAtIndex:i]; } @end /* StructuredStack */ SOPE/sope-xml/STXSaxDriver/ExtraSTX/GNUmakefile0000644000000000000000000000063012242733417020134 0ustar rootroot# GNUstep makefile include ../../../config.make include $(GNUSTEP_MAKEFILES)/common.make SUBPROJECT_NAME = ExtraSTX ExtraSTX_PCH_FILE = common.h ExtraSTX_OBJC_FILES = \ NSString+STX.m \ StructuredLine.m \ StructuredStack.m \ StructuredText.m \ ADDITIONAL_INCLUDE_DIRS += -I. -I../Model -I.. -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/subproject.make -include GNUmakefile.postamble SOPE/sope-xml/STXSaxDriver/ExtraSTX/StructuredText_XHTML.h0000644000000000000000000000365612242733417022233 0ustar rootroot/* Copyright (C) 2004 eXtrapola Srl This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #error does not compile, just for reference! @interface StructuredTextRenderingDelegate_XHTML : StructuredTextRenderingDelegate @end @interface NSArray (StructuredText_XHTML) - (NSString *)toXhtmlInContext:(NSDictionary *)aContext; @end @interface StructuredText (StructuredText_XHTML) - (NSString *)toXhtmlInContext:(NSDictionary *)aContext; @end @interface StructuredTextDocument (StructuredText_XHTML) - (NSString *)toXhtmlInContext:(NSDictionary *)aContext; @end @interface StructuredTextBodyElement (StructuredText_XHTML) - (NSString *)toXhtmlInContext:(NSDictionary *)aContext; @end @interface StructuredTextHeader (StructuredText_XHTML) - (NSString *)toXhtmlInContext:(NSDictionary *)aContext; @end @interface StructuredTextParagraph (StructuredText_XHTML) - (NSString *)toXhtmlInContext:(NSDictionary *)aContext; @end @interface StructuredTextList (StructuredText_XHTML) - (NSString *)toXhtmlInContext:(NSDictionary *)aContext; @end @interface StructuredTextListItem (StructuredText_XHTML) - (NSString *)toXhtmlInContext:(NSDictionary *)aContext; @end @interface StructuredTextLiteralBlock (StructuredText_XHTML) - (NSString *)toXhtmlInContext:(NSDictionary *)aContext; @end SOPE/sope-xml/STXSaxDriver/ExtraSTX/StructuredLine.m0000644000000000000000000000477212242733417021227 0ustar rootroot/* Copyright (C) 2004 eXtrapola Srl This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import "StructuredLine.h" #include "common.h" @implementation StructuredLine - (id)initWithString:(NSString *)aString level:(int)aLevel { if ((self = [super init])) { [self setText:aString]; level = aLevel; } return self; } - (void)dealloc { [self->_text release]; [self->_originalText release]; [super dealloc]; } /* accessors */ - (NSString *)text { NSMutableString *result; NSArray *components; int i, count; if (self->_text) return self->_text; result = [NSMutableString stringWithCapacity:16]; components = [_originalText componentsSeparatedByString:@"\n"]; count = [components count]; for (i = 0; i < count; i++) { NSString *s; if (i > 0) [result appendString:@" "]; s = [components objectAtIndex:i]; s = [s stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceCharacterSet]]; [result appendString:s]; } self->_text = [result copy]; return self->_text; } - (NSString *)originalText { return self->_originalText; } - (void)setText:(NSString *)aString { BOOL running = YES; int i, length; NSString *ptr; numberOfSpaces = 0; length = [aString length]; for (i = 0; i < length; i++) { switch (([aString characterAtIndex:i])) { case ' ': case 0x09: break; default: running = NO; break; } if (!running) break; } if (running) return; numberOfSpaces = i; ptr = _originalText; self->_originalText = [aString retain]; [ptr release]; [self->_text release]; self->_text = nil; } - (void)setLevel:(int)aLevel { level = aLevel; } - (int)level { return level; } - (int)numberOfSpacesAtBeginning { return numberOfSpaces; } @end /* StructuredLine */ SOPE/sope-xml/STXSaxDriver/ExtraSTX/StructuredText.m0000644000000000000000000003053212242733417021255 0ustar rootroot/* Copyright (C) 2004 eXtrapola Srl This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "StructuredText.h" #include "StructuredLine.h" #include "StructuredStack.h" #include "StructuredTextHeader.h" #include "StructuredTextParagraph.h" #include "StructuredTextList.h" #include "StructuredTextListItem.h" #include "StructuredTextLiteralBlock.h" #include "common.h" #include @implementation StructuredText - (id)initWithString:(NSString *)_str { if ((self = [super init])) { self->_text = [_str copy]; } return self; } - (void)dealloc { [self->_text release]; [self->_document release]; [self->_stack release]; [self->_paragraphs release]; [super dealloc]; } /* factory */ + (StructuredTextDocument *)parseText:(NSString *)aText { StructuredText *text; // TODO: shouldn't we release the object? text = [[StructuredText alloc] initWithString:aText]; return [text document]; } /* accessors */ - (NSString *)text { return _text; } - (StructuredTextDocument *)document { if (self->_document) return self->_document; self->_document = [[StructuredTextDocument alloc] init]; [self parse]; return _document; } - (StructuredStack *)stack { if (self->_stack == nil) self->_stack = [[StructuredStack alloc] init]; return self->_stack; } - (StructuredStack *)paragraphs { if (self->_paragraphs == nil) self->_paragraphs = [[StructuredStack alloc] init]; return self->_paragraphs; } - (void)parse { #if DISABLE_BUG_FIX currentHeaderLevel = 1; #endif [self separateIntoBlocks]; [self adjustLineLevels]; [self buildDocument]; } - (void)separateIntoBlocks { NSArray *lines; StructuredStack *pars; NSString *text, *currentLine, *trimmedLine; NSMutableString *buf; NSCharacterSet *set; NSUInteger i, count; set = [NSCharacterSet characterSetWithCharactersInString:@"\r"]; buf = [NSMutableString stringWithCapacity:256]; text = [self text]; pars = [self paragraphs]; lines = [text componentsSeparatedByString:@"\n"]; count = [lines count]; for (i = 0; i < count; i++) { currentLine = [lines objectAtIndex:i]; currentLine = [currentLine stringByTrimmingCharactersInSet:set]; trimmedLine = [currentLine stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceCharacterSet]]; if ([trimmedLine length] > 0) { if ([buf length] > 0) [buf appendString:@"\n"]; [buf appendString:currentLine]; } else { if ([buf length] > 0) { StructuredLine *sl; sl = [[StructuredLine alloc] initWithString:[NSString stringWithString:buf] level:0];; [pars push:sl]; // TODO: shouldn't we release the object? } [buf setString:@""]; } } if ([buf length] > 0) { StructuredLine *sl; sl = [[StructuredLine alloc] initWithString:[NSString stringWithString:buf] level:0]; [pars push:sl]; // TODO: shouldn't we release the object? } } - (void)adjustLineLevels { StructuredStack *paragraphs; StructuredStack *stack; StructuredLine *line; int level = 0; stack = [self stack]; [stack setCursorFollowsFIFO:YES]; paragraphs = [self paragraphs]; [paragraphs first]; while ((line = [paragraphs nextObject])) { StructuredLine *tmpLine; while ((tmpLine = [stack currentObject])) { if ([line numberOfSpacesAtBeginning]>[tmpLine numberOfSpacesAtBeginning]) break; [stack pop]; level--; } if (!tmpLine) level = 0; switch ([self lineType:line]) { case StructuredTextParserLine_Header: [line setLevel:level++]; [stack push:line]; break; case StructuredTextParserLine_Paragraph: case StructuredTextParserLine_LiteralBlock: [line setLevel:level]; break; case StructuredTextParserLine_List: { [line setLevel:level++]; [stack push:line]; break; } } } [stack removeAllObjects]; } - (void)buildDocument { StructuredTextDocument *document; StructuredStack *paragraphs; StructuredStack *stack, *objectStack; StructuredLine *line; document = [self document]; stack = [self stack]; [stack setCursorFollowsFIFO:YES]; paragraphs = [self paragraphs]; [paragraphs first]; objectStack = [[StructuredStack alloc] init]; [objectStack setCursorFollowsFIFO:YES]; while ((line = [paragraphs currentObject])) { StructuredLine *tmpLine; id object = nil; switch ([self lineType:line]) { case StructuredTextParserLine_Header: object = [self buildHeader]; #if DISABLE_BUG_FIX currentHeaderLevel++; #endif break; case StructuredTextParserLine_Paragraph: object = [self buildParagraph]; //NSLog(@"par %@", [object text]); break; case StructuredTextParserLine_LiteralBlock: object = [self buildLiteralBlock]; break; case StructuredTextParserLine_List: object = [self buildList]; break; } if (object != nil) { StructuredTextBodyElement *body; body = [objectStack currentObject]; if (body && [body respondsToSelector:@selector(addElement:)]) [body addElement:object]; else [document addBodyElement:object]; if ([object isKindOfClass:[StructuredTextHeader class]] /* || [object isKindOfClass:[StructuredTextList class]] */) { while ((tmpLine = [stack currentObject])) { if ([line level] > [tmpLine level]) break; [stack pop]; [objectStack pop]; #if DISABLE_BUG_FIX { id currentObject = [objectStack pop]; if ([currentObject isKindOfClass:[StructuredTextHeader class]]) currentHeaderLevel--; } #endif } [objectStack push:object]; [stack push:line]; } } [paragraphs nextObject]; } [objectStack release]; } - (NSUInteger)lineType:(StructuredLine *)aLine { if ([self checkForListItem:aLine]) return StructuredTextParserLine_List; if ([self checkForHeader:aLine]) { return [self checkForPreformattedStatement:aLine] ? StructuredTextParserLine_Paragraph : StructuredTextParserLine_Header; } if ([self checkForPreformattedBlock:aLine]) return StructuredTextParserLine_LiteralBlock; return StructuredTextParserLine_Paragraph; } - (BOOL)checkForHeader:(StructuredLine *)aLine { StructuredLine *nextLine; nextLine = [[self paragraphs] objectRelativeToCursorAtIndex:1]; if (nextLine == nil) return NO; if ([nextLine numberOfSpacesAtBeginning]>[aLine numberOfSpacesAtBeginning]) return YES; return NO; } - (BOOL)checkForListItem:(StructuredLine *)aLine { return ([self listItemTypology:aLine] == NSNotFound) ? NO : YES; } - (BOOL)checkForPreformattedStatement:(StructuredLine *)aLine { NSString *s; if (aLine == nil) return NO; s = [aLine text]; s = [s stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceCharacterSet]]; return [s hasSuffix:@"::"]; } - (BOOL)checkForPreformattedBlock:(StructuredLine *)aLine { id stmt; stmt = [[self paragraphs] objectRelativeToCursorAtIndex:-1]; return [self checkForPreformattedStatement:stmt] ? YES : NO; } - (StructuredTextHeader *)buildHeader { StructuredTextHeader *result; StructuredLine *line; line = [[self paragraphs] currentObject]; #if DISABLE_BUG_FIX result = [[StructuredTextHeader alloc] initWithString:[line text] level:currentHeaderLevel]; #else result = [[StructuredTextHeader alloc] initWithString:[line text] level:([line level] + 1)]; #endif return [result autorelease]; } - (StructuredTextParagraph *)buildParagraph { StructuredTextParagraph *result; StructuredLine *line; NSString *text; line = [[self paragraphs] currentObject]; text = [line text]; if ([[text stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceCharacterSet]] hasSuffix:@"::"]) { NSUInteger length; length = [text length]; text = [text substringToIndex:length - 2]; } result = [[StructuredTextParagraph alloc] initWithString:text]; return [result autorelease]; } - (StructuredTextLiteralBlock *)buildLiteralBlock { StructuredTextLiteralBlock *result; StructuredLine *line; NSString *s; line = [[self paragraphs] currentObject]; s = [[line originalText] stringByAppendingString:@"\n"]; result = [[StructuredTextLiteralBlock alloc] initWithString:s]; return [result autorelease]; } - (StructuredTextList *)buildList { StructuredTextList *result; StructuredLine *line, *prevLine = nil; StructuredTextListItem *item = nil; StructuredStack *paragraphs; NSUInteger type; result = nil; paragraphs = [self paragraphs]; line = [paragraphs currentObject]; while (line != nil) { NSString *text, *title; text = [line text]; title = nil; type = [self listItemTypology:line]; if (type == NSNotFound) { [paragraphs prevObject]; break; } if (!result) result = [[StructuredTextList alloc] initWithTypology:type]; else if ([result typology] != type) break; if (prevLine) { if ([line level] > [prevLine level]) { if (item) { [item addElement:[self buildList]]; line = [paragraphs currentObject]; continue; } } else if ([line level] < [prevLine level]) { return result; } } switch (type) { case StructuredTextList_BULLET: text = [text substringFromIndex:2]; break; case StructuredTextList_DEFINITION: { NSArray *components; NSUInteger i, count; components = [text componentsSeparatedByString:@" -- "]; count = [components count]; title = [components objectAtIndex:0]; if (count > 2) { NSMutableString *buffer; buffer = [NSMutableString stringWithCapacity:(count * 8)]; for (i = 1; i < count; i++) { if (i > 1) { [buffer appendString:@" -- "]; } [buffer appendString:[components objectAtIndex:i]]; } text = buffer; } else text = [components objectAtIndex:1]; break; } case StructuredTextList_ENUMERATED: { NSRange range; range = [text rangeOfString:@" "]; if (range.length > 0) text = [text substringFromIndex:range.location + 1]; break; } } item = [[StructuredTextListItem alloc] initWithTitle:title text:text]; [result addElement:item]; [item release]; prevLine = line; line = [paragraphs nextObject]; } return [result autorelease]; } - (NSUInteger)listItemTypology:(StructuredLine *)aLine { NSString *text; NSUInteger type = NSNotFound; NSUInteger i, h, length; NSRange range; text = [aLine text]; if ([text hasPrefix:@"* "]) return StructuredTextList_BULLET; range = [text rangeOfString:@" -- "]; if (range.length > 0 && range.length == 4) return StructuredTextList_DEFINITION; for (i = h = 0, length = [text length]; i < length; i++) { if (!isdigit([text characterAtIndex:i])) break; h++; } if (h > 0) type = StructuredTextList_ENUMERATED; return type; } /* description */ - (NSString *)description { NSMutableString *ms; ms = [NSMutableString stringWithCapacity:128]; [ms appendFormat:@"<0x%p[%@]:", self, NSStringFromClass([self class])]; if (self->_text) [ms appendFormat:@" text-len=%d", [self->_text length]]; if (self->_document) [ms appendFormat:@" document=%@", self->_document]; #if DISABLE_BUG_FIX [ms appendFormat:@" headerlevel=%i", self->currentHeaderLevel]; #endif [ms appendString:@">"]; return ms; } @end /* StructuredText */ SOPE/sope-xml/STXSaxDriver/ExtraSTX/NSString+STX.m0000644000000000000000000000337112242733417020426 0ustar rootroot/* Copyright (C) 2004 eXtrapola Srl This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NSString+STX.h" #include "common.h" @implementation NSString(STX) - (StructuredText *)structuredText { return [[[StructuredText alloc] initWithString:self] autorelease]; } - (NSString *)unescapedString { NSMutableString *result; NSString *text; int i, start, length; NSRange range; result = [NSMutableString stringWithCapacity:[self length]]; text = self; length = [text length]; for (i = start = 0; i < length; i++) { unichar c; c = [text characterAtIndex:i]; if (c == '\\') { if (i - start > 0) { range.location = start; range.length = i - start; [result appendString:[text substringWithRange:range]]; } if (i + 1 < length) { c = [text characterAtIndex:i + 1]; if (c == '\\') { start = ++i; } } } } if (i - start > 0) { range.location = start; range.length = i - start; [result appendString:[text substringWithRange:range]]; } return result; } @end /* NSString(STX) */ SOPE/sope-xml/STXSaxDriver/ExtraSTX/StructuredText_XHTML.m0000644000000000000000000001667512242733417022245 0ustar rootroot/* Copyright (C) 2004 eXtrapola Srl This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #error does not compile, just for reference! #include "StructuredText_XHTML.h" #include "common.h" @implementation StructuredTextRenderingDelegate_XHTML - (NSString *)insertText:(NSString *)_txt inContext:(NSDictionary *)_ctx { return [NSString stringWithFormat:@"

%@

", _txt]; } - (NSString *)insertItalics:(NSString *)_txt inContext:(NSDictionary *)_ctx { return [NSString stringWithFormat: @"%@", _txt]; } - (NSString *)insertUnderline:(NSString *)_txt inContext:(NSDictionary *)_ctx { return [NSString stringWithFormat: @"%@", _txt]; } - (NSString *)insertBold:(NSString *)_txt inContext:(NSDictionary *)_ctx { return [NSString stringWithFormat:@"%@", _txt]; } - (NSString *)insertPreformatted:(NSString *)_txt inContext:(NSDictionary *)_ctx { return [NSString stringWithFormat: @"%@", _txt]; } - (NSString *)insertLink:(NSString *)_txt withUrl:(NSString *)anUrl target:(NSString *)aTarget inContext:(NSDictionary *)_ctx { NSString *result; if ([aTarget length] > 0) { result = [NSString stringWithFormat: @"%@", anUrl, aTarget, _txt]; } else { result = [NSString stringWithFormat:@"%@", anUrl, _txt]; } return result; } - (NSString *)insertEmail:(NSString *)_txt withAddress:(NSString *)anAddress inContext:(NSDictionary *)_ctx { return [NSString stringWithFormat:@"%@", anAddress, _txt]; } - (NSString *)insertImage:(NSString *)_txt withUrl:(NSString *)anUrl inContext:(NSDictionary *)_ctx { return [NSString stringWithFormat:@"", anUrl, _txt]; } - (NSString *)insertExtrapolaLink:(NSString *)_txt parameters:(NSDictionary *)someParameters withTarget:(NSString *)aTarget inContext:(NSDictionary *)_ctx { NSString *result; NSString *targetString; if ([aTarget length] > 0) targetString = [NSString stringWithFormat:@" target = \"%@\"", aTarget]; else targetString = @""; result = [NSString stringWithFormat: @"%@", [someParameters objectForKey:@"page"], targetString, _txt]; return result; } - (NSString *)insertPreprocessedTextForKey:(NSString *)aKey inContext:(NSDictionary *)_ctx { return [_ctx objectForKey:aKey]; } @end /* StructuredTextRenderingDelegate_XHTML */ @implementation NSArray (StructuredText_XHTML) - (NSString *)toXhtmlInContext:(NSDictionary *)_ctx { NSMutableString *result; int i,c; c = [self count]; result = [NSMutableString stringWithCapacity:(c * 16)]; for (i = 0; i < c; i++) { id currentObject; currentObject = [self objectAtIndex:i]; [result appendString:[currentObject toXhtmlInContext:_ctx]]; } return result; } @end @implementation StructuredText(StructuredText_XHTML) - (NSString *)toXhtmlInContext:(NSDictionary *)_ctx { return [[self document] toXhtmlInContext:_ctx]; } @end /* StructuredText(StructuredText_XHTML) */ @implementation StructuredTextDocument(StructuredText_XHTML) - (NSString *)toXhtmlInContext:(NSDictionary *)_ctx { return [[self bodyElements] toXhtmlInContext:_ctx]; } @end /* StructuredTextDocument(StructuredText_XHTML) */ @implementation StructuredTextBodyElement(StructuredText_XHTML) - (NSString *)toXhtmlInContext:(NSDictionary *)_ctx { return [[self elements] toXhtmlInContext:_ctx]; } @end /* StructuredTextBodyElement(StructuredText_XHTML) */ @implementation StructuredTextHeader(StructuredText_XHTML) - (NSString *)toXhtmlInContext:(NSDictionary *)_ctx { NSMutableString *ms; id delegate; delegate = [StructuredTextRenderingDelegate_XHTML delegate] ; ms = [NSMutableString stringWithCapacity:64]; [ms appendFormat:@"", [self level]]; [ms appendString:[self textParsedWithDelegate:delegate inContext:_ctx]]; [ms appendFormat:@"", [self level]]; [ms appendString:[super toXhtmlInContext:_ctx]]; return ms; } @end /* StructuredTextHeader(StructuredText_XHTML) */ @implementation StructuredTextParagraph(StructuredText_XHTML) - (NSString *)toXhtmlInContext:(NSDictionary *)_ctx { id delegate; delegate = [StructuredTextRenderingDelegate_XHTML delegate]; return [self textParsedWithDelegate:delegate inContext:_ctx]; } @end /* StructuredTextParagraph (StructuredText_XHTML) */ @implementation StructuredTextList(StructuredText_XHTML) - (NSString *)toXhtmlInContext:(NSDictionary *)_ctx { NSString *result; NSString *elemText; elemText = [[self elements] toXhtmlInContext:_ctx]; switch ([self typology]) { case StructuredTextList_BULLET: { result = [NSString stringWithFormat:@"
    %@
", elemText]; break; } case StructuredTextList_ENUMERATED: { result = [NSString stringWithFormat:@"
    %@
", elemText]; break; } case StructuredTextList_DEFINITION: { result = [NSString stringWithFormat:@"
%@
", elemText]; break; } default: { result = @""; break; } } return result; } @end /* StructuredTextList(StructuredText_XHTML) */ @implementation StructuredTextListItem(StructuredText_XHTML) - (NSString *)toXhtmlInContext:(NSDictionary *)_ctx { NSString *result; NSString *textParsed; NSString *elemText; elemText = [[self elements] toXhtmlInContext:_ctx]; textParsed = [self textParsedWithDelegate: [StructuredTextRenderingDelegate_XHTML delegate] inContext:_ctx]; switch ([[self list] typology]) { case StructuredTextList_BULLET: { result = [NSString stringWithFormat:@"
  • %@%@
  • ", textParsed, elemText]; break; } case StructuredTextList_ENUMERATED: { result = [NSString stringWithFormat:@"
  • %@%@
  • ", textParsed, elemText]; break; } case StructuredTextList_DEFINITION: { result = [NSString stringWithFormat:@"
    %@
    %@
    ", [self titleParsedWithDelegate: [StructuredTextRenderingDelegate_XHTML delegate] inContext:_ctx], textParsed]; break; } default: { result = @""; break; } } return result; } @end /* StructuredTextListItem(StructuredText_XHTML) */ @implementation StructuredTextLiteralBlock(StructuredText_XHTML) - (NSString *)toXhtmlInContext:(NSDictionary *)_ctx { return [NSString stringWithFormat: @"
    %@
    ", [self text]]; } @end /* StructuredTextLiteralBlock(StructuredText_XHTML) */ SOPE/sope-xml/STXSaxDriver/ExtraSTX/COPYRIGHT0000644000000000000000000000203512242733417017356 0ustar rootroot Structured Text Code Copyright (C) 2004 eXtrapola Srl Contact: marco.barulli@extrapola.com Statement by Extrapola SRL (Marco Barulli) ========================================== I'm glad to confirm that eXtrapola Srl, as the copyright holder on the StructuredText code sent to the OpenGroupware.org project and initially written by Mirko Viviani and Giulio Cesare Solaroli, hereby states that the code is licensed and can be used under the terms of the Lesser General Public License. Statement by Mirko Viviani ========================== Mirko Viviani, as the original author of the StructuredText framework sent to the OpenGroupware.org project, hereby states that the code is licensed and can be used under the terms of the Lesser General Public License. Statement by Giulio Cesare Solaroli =================================== I, as one of the original author on the StructuredText code sent to the OpenGroupware.org project, hereby states that the code is licensed and can be used under the terms of the Lesser General Public License. SOPE/sope-xml/STXSaxDriver/ExtraSTX/StructuredLine.h0000644000000000000000000000226512242733417021215 0ustar rootroot/* Copyright (C) 2004 eXtrapola Srl This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import @class NSString; @interface StructuredLine : NSObject { NSString *_text; NSString *_originalText; int numberOfSpaces; int level; } - (id)initWithString:(NSString *)aString level:(int)level; /* accessors */ - (NSString *)text; - (NSString *)originalText; - (void)setText:(NSString *)aString; - (int)level; - (void)setLevel:(int)aLevel; - (int)numberOfSpacesAtBeginning; @end SOPE/sope-xml/STXSaxDriver/ExtraSTX/StructuredTextRenderingDelegate.h0000644000000000000000000000442312242733417024541 0ustar rootroot/* Copyright (C) 2004 eXtrapola Srl This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __StructuredTextRenderingDelegate_H__ #define __StructuredTextRenderingDelegate_H__ #import @class NSString, NSDictionary; @protocol StructuredTextRenderingDelegate - (void)appendText:(NSString *)_txt inContext:(NSDictionary *)_ctx; - (void)beginItalicsInContext:(NSDictionary *)_ctx; - (void)endItalicsInContext:(NSDictionary *)_ctx; - (void)beginUnderlineInContext:(NSDictionary *)_ctx; - (void)endUnderlineInContext:(NSDictionary *)_ctx; - (void)beginBoldInContext:(NSDictionary *)_ctx; - (void)endBoldInContext:(NSDictionary *)_ctx; - (void)beginPreformattedInContext:(NSDictionary *)_ctx; - (void)endPreformattedInContext:(NSDictionary *)_ctx; - (void)beginParagraphInContext:(NSDictionary *)_ctx; - (void)endParagraphInContext:(NSDictionary *)_ctx; - (NSString *)insertLink:(NSString *)_txt withUrl:(NSString *)anUrl target:(NSString *)aTarget inContext:(NSDictionary *)_ctx; - (NSString *)insertEmail:(NSString *)_txt withAddress:(NSString *)anAddress inContext:(NSDictionary *)_ctx; - (NSString *)insertImage:(NSString *)_txt withUrl:(NSString *)anUrl inContext:(NSDictionary *)_ctx; - (NSString *)insertExtrapolaLink:(NSString *)_txt parameters:(NSDictionary *)someParameters withTarget:(NSString *)aTarget inContext:(NSDictionary *)_ctx; - (NSString *)insertDynamicKey:(NSString *)_txt inContext:(NSDictionary *)_ctx; - (NSString *)insertPreprocessedTextForKey:(NSString *)aKey inContext:(NSDictionary *)_ctx; @end #endif /* __StructuredTextRenderingDelegate_H__ */ SOPE/sope-xml/STXSaxDriver/ExtraSTX/common.h0000644000000000000000000000002712242733417017523 0ustar rootroot#include "../common.h" SOPE/sope-xml/STXSaxDriver/ExtraSTX/StructuredStack.h0000644000000000000000000000232512242733417021370 0ustar rootroot/* Copyright (C) 2004 eXtrapola Srl This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import @interface StructuredStack : NSObject { NSMutableArray *_stack; int start; int pos; BOOL cursorFIFO; } - (NSMutableArray *)stack; - (void)removeAllObjects; - (void)push:(id)anObject; - (id)pop; - (void)first; - (void)last; - (id)nextObject; - (id)currentObject; - (id)prevObject; - (BOOL)cursorFollowsFIFO; - (void)setCursorFollowsFIFO:(BOOL)aValue; - (id)objectRelativeToCursorAtIndex:(int)anIndex; @end SOPE/sope-xml/STXSaxDriver/STXSaxDriver.h0000644000000000000000000000465112242733417017066 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __ExtraSTX_STXSaxDriver_H__ #define __ExtraSTX_STXSaxDriver_H__ #import #include @class NSArray, NSDictionary; @class SaxAttributes; @class StructuredTextParagraph, StructuredTextList, StructuredTextListItem; @class StructuredTextLiteralBlock, StructuredTextHeader; @interface STXSaxDriver : NSObject < SaxXMLReader > { id contentHandler; id errorHandler; id lexicalHandler; id entityResolver; NSDictionary *context; SaxAttributes *attrs; } /* handlers */ - (void)setContentHandler:(id)_handler; - (void)setDTDHandler:(id)_handler; - (void)setErrorHandler:(id)_handler; - (void)setEntityResolver:(id)_handler; - (id)contentHandler; - (id)dtdHandler; - (id)errorHandler; - (id)entityResolver; /* parsing */ - (void)parseFromSource:(id)_source systemId:(NSString *)_sysId; /* generating events */ - (void)produceSaxEventsForParagraph:(StructuredTextParagraph *)_p; - (void)produceSaxEventsForList:(StructuredTextList *)_list; - (void)produceSaxEventsForListItem:(StructuredTextListItem *)_item; - (void)produceSaxEventsForLiteralBlock:(StructuredTextLiteralBlock *)_block; - (void)produceSaxEventsForHeader:(StructuredTextHeader *)_header; - (void)produceSaxEventsForElement:(id)_element; - (void)produceSaxEventsForElements:(NSArray *)_elems; @end #endif /* __ExtraSTX_STXSaxDriver_H__ */ SOPE/sope-xml/STXSaxDriver/common.h0000644000000000000000000000146112242733417016044 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import SOPE/sope-xml/STXSaxDriver/Version0000644000000000000000000000004512242733417015750 0ustar rootroot# Version file SUBMINOR_VERSION:=15 SOPE/sope-xml/STXSaxDriver/STXSaxDriver-Info.plist0000644000000000000000000000153512242733417020661 0ustar rootroot CFBundleDevelopmentRegion English CFBundleExecutable STXSaxDriver CFBundleGetInfoString CFBundleIconFile CFBundleIdentifier org.opengroupware.SOPE.sope-xml.STXSaxDriver CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType APPL CFBundleShortVersionString CFBundleSignature ???? CFBundleVersion 4.5.14 NSPrincipalClass STXSaxDriver SOPE/sope-xml/STXSaxDriver/STXSaxDriver.m0000644000000000000000000003712712242733417017077 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "STXSaxDriver.h" #include "StructuredText.h" #include "StructuredTextList.h" #include "StructuredTextListItem.h" #include "StructuredTextLiteralBlock.h" #include "StructuredTextHeader.h" #include "StructuredTextParagraph.h" #include #include "common.h" static NSString *SaxDeclHandlerProperty = @"http://xml.org/sax/properties/declaration-handler"; static NSString *SaxLexicalHandlerProperty = @"http://xml.org/sax/properties/lexical-handler"; @interface NSObject(SAX) - (void)produceSaxEventsOnSTXSaxDriver:(STXSaxDriver *)_sax; @end @implementation STXSaxDriver static BOOL debugOn = NO; + (void)initialize { NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; debugOn = [ud boolForKey:@"STXSaxDriverDebugEnabled"]; } - (id)init { if ((self = [super init])) { self->attrs = [[SaxAttributes alloc] init]; } return self; } - (void)dealloc { [self->context release]; [self->attrs release]; [self->lexicalHandler release]; [self->contentHandler release]; [self->errorHandler release]; [self->entityResolver release]; [super dealloc]; } /* properties */ - (void)setProperty:(NSString *)_name to:(id)_value { if ([_name isEqualToString:SaxLexicalHandlerProperty]) { [self->lexicalHandler autorelease]; self->lexicalHandler = [_value retain]; return; } if ([_name isEqualToString:SaxDeclHandlerProperty]) { return; } [SaxNotRecognizedException raise:@"PropertyException" format:@"don't know property %@", _name]; } - (id)property:(NSString *)_name { if ([_name isEqualToString:SaxLexicalHandlerProperty]) return self->lexicalHandler; if ([_name isEqualToString:SaxDeclHandlerProperty]) return nil; [SaxNotRecognizedException raise:@"PropertyException" format:@"don't know property %@", _name]; return nil; } /* features */ - (void)setFeature:(NSString *)_name to:(BOOL)_value { return; #if 0 // be tolerant [SaxNotRecognizedException raise:@"FeatureException" format:@"don't know feature %@", _name]; #endif } - (BOOL)feature:(NSString *)_name { return NO; } /* handlers */ - (void)setContentHandler:(id)_handler { [self->contentHandler autorelease]; self->contentHandler = [_handler retain]; } - (id)contentHandler { return self->contentHandler; } - (void)setLexicalHandler:(id)_handler { [self->lexicalHandler autorelease]; self->lexicalHandler = [_handler retain]; } - (id)lexicalHandler { return self->lexicalHandler; } - (void)setDTDHandler:(id)_handler { } - (id)dtdHandler { return nil; } - (void)setErrorHandler:(id)_handler { [self->errorHandler autorelease]; self->errorHandler = [_handler retain]; } - (id)errorHandler { return self->errorHandler; } - (void)setEntityResolver:(id)_handler { [self->entityResolver autorelease]; self->entityResolver = [_handler retain]; } - (id)entityResolver { return self->entityResolver; } /* support */ - (void)_beginTag:(NSString *)_tag { [self->contentHandler startElement:_tag namespace:XMLNS_XHTML rawName:_tag attributes:nil /* id */]; } - (void)_endTag:(NSString *)_tag { [self->contentHandler endElement:_tag namespace:XMLNS_XHTML rawName:_tag]; } - (void)_characters:(NSString *)_chars { unichar *buf; unsigned int len; if ((len = [_chars length]) == 0) // TODO: may or may not be correct return; buf = calloc(len + 4, sizeof(unichar)); // TODO: cache/reuse buffer [_chars getCharacters:buf]; [self->contentHandler characters:buf length:len]; if (buf) free(buf); } /* STX delegate */ - (void)appendText:(NSString *)_txt inContext:(NSDictionary *)_ctx { [self _characters:_txt]; } - (void)beginItalicsInContext:(NSDictionary *)_ctx { [self _beginTag:@"em"]; } - (void)endItalicsInContext:(NSDictionary *)_ctx { [self _endTag:@"em"]; } - (void)beginUnderlineInContext:(NSDictionary *)_ctx { [self _beginTag:@"u"]; } - (void)endUnderlineInContext:(NSDictionary *)_ctx { [self _endTag:@"u"]; } - (void)beginBoldInContext:(NSDictionary *)_ctx { [self _beginTag:@"strong"]; } - (void)endBoldInContext:(NSDictionary *)_ctx { [self _endTag:@"strong"]; } - (void)beginPreformattedInContext:(NSDictionary *)_ctx { [self _beginTag:@"pre"]; } - (void)endPreformattedInContext:(NSDictionary *)_ctx { [self _endTag:@"pre"]; } - (void)beginParagraphInContext:(NSDictionary *)_ctx { [self _beginTag:@"p"]; } - (void)endParagraphInContext:(NSDictionary *)_ctx { [self _endTag:@"p"]; } - (NSString *)insertLink:(NSString *)_txt withUrl:(NSString *)_url target:(NSString *)_target inContext:(NSDictionary *)_ctx { // TODO: need to generate SaxAttributes here [self->attrs clear]; [self->attrs addAttribute:@"href" uri:XMLNS_XHTML rawName:@"href" type:@"CDATA" value:_url]; if ([_target length] > 0) { [self->attrs addAttribute:@"target" uri:XMLNS_XHTML rawName:@"target" type:@"CDATA" value:_target]; } [self->contentHandler startElement:@"a" namespace:XMLNS_XHTML rawName:@"a" attributes:self->attrs]; [self _characters:_txt]; [self _endTag:@"a"]; // if we return nil, the content will be generated as if it didn't match // if we return an empty string, a zero-length string is reported return @""; } - (NSString *)insertEmail:(NSString *)_txt withAddress:(NSString *)_link inContext:(NSDictionary *)_ctx { // TODO: check&implement #if 0 [NSString stringWithFormat:@"%@", anAddress, _txt]; #endif return _txt; } - (NSString *)insertImage:(NSString *)_title withUrl:(NSString *)_src inContext:(NSDictionary *)_ctx { // TODO: check&implement #if 0 [NSString stringWithFormat:@"", anUrl, _txt]; #endif return _title; } - (NSString *)insertExtrapolaLink:(NSString *)_txt parameters:(NSDictionary *)_paras withTarget:(NSString *)_target inContext:(NSDictionary *)_ctx { // TODO: do we want to support that? if (debugOn) NSLog(@"insert extrapola link: %@", _txt); [self _characters:_txt]; return nil; } - (NSString *)insertDynamicKey:(NSString *)_k inContext:(NSDictionary *)_ctx { // TODO: what to do here? return [_ctx objectForKey:_k]; } - (NSString *)insertPreprocessedTextForKey:(NSString *)_k inContext:(NSDictionary *)_ctx { // TODO: what to do here? return [_ctx objectForKey:_k]; } /* generating element events */ - (void)produceSaxEventsForParagraph:(StructuredTextParagraph *)_p { NSString *s; if (debugOn) NSLog(@" produce SAX events for paragraph: %@", _p); s = [_p textParsedWithDelegate:(id)self inContext:self->context]; if ([s length] > 0) [self _characters:s]; } - (void)produceSaxEventsForHeader:(StructuredTextHeader *)_h { NSString *tagName, *s; if (debugOn) NSLog(@" produce SAX events for header: %@", _h); switch ([_h level]) { case 1: tagName = @"h1"; break; case 2: tagName = @"h2"; break; case 3: tagName = @"h3"; break; case 4: tagName = @"h4"; break; case 5: tagName = @"h5"; break; case 6: tagName = @"h6"; break; default: tagName = [@"h" stringByAppendingFormat:@"%d", [_h level]]; break; } [self _beginTag:tagName]; if ((s = [_h textParsedWithDelegate:(id)self inContext:self->context])) [self _characters:s]; [self _endTag:tagName]; [self produceSaxEventsForElements:[_h elements]]; } - (void)produceSaxEventsForList:(StructuredTextList *)_list { NSString *tagName; if (debugOn) NSLog(@" produce SAX events for list: %@", _list); switch ([_list typology]) { case StructuredTextList_BULLET: tagName = @"ul"; break; case StructuredTextList_ENUMERATED: tagName = @"ol"; break; case StructuredTextList_DEFINITION: tagName = @"dl"; break; default: tagName = nil; } [self _beginTag:tagName]; [self produceSaxEventsForElements:[_list elements]]; [self _endTag:tagName]; } - (void)produceSaxEventsForListItem:(StructuredTextListItem *)_item { NSString *s; int typology; if (debugOn) NSLog(@" produce SAX events for item: %@", _item); typology = [[_item list] typology]; if (typology == StructuredTextList_DEFINITION) { [self _beginTag:@"dt"]; if ((s = [_item titleParsedWithDelegate:(id)self inContext:self->context])) [self _characters:s]; [self _endTag:@"dt"]; } switch (typology) { case StructuredTextList_BULLET: [self _beginTag:@"li"]; break; case StructuredTextList_ENUMERATED: [self _beginTag:@"li"]; break; case StructuredTextList_DEFINITION: [self _beginTag:@"dd"]; break; } if ((s = [_item textParsedWithDelegate:(id)self inContext:self->context])) { if (debugOn) NSLog(@" chars: %d", [s length]); [self _characters:s]; } if (debugOn) NSLog(@" elems: %d", [[_item elements] count]); [self produceSaxEventsForElements:[_item elements]]; switch (typology) { case StructuredTextList_BULLET: [self _endTag:@"li"]; break; case StructuredTextList_ENUMERATED: [self _endTag:@"li"]; break; case StructuredTextList_DEFINITION: [self _endTag:@"dd"]; break; } } - (void)produceSaxEventsForLiteralBlock:(StructuredTextLiteralBlock *)_block { [self _beginTag:@"pre"]; [self _characters:[_block text]]; [self _endTag:@"pre"]; } /* generating events */ - (void)produceSaxEventsForElement:(id)_element { if (debugOn) NSLog(@" produce SAX events for element: %@", _element); if (_element == nil) return; if ([_element respondsToSelector:@selector(produceSaxEventsOnSTXSaxDriver:)]) [_element produceSaxEventsOnSTXSaxDriver:self]; else { NSLog(@"Note: cannot handle STX element: %@", _element); } } - (void)produceSaxEventsForElements:(NSArray *)_elems { unsigned int i, c; if (debugOn) NSLog(@" produce SAX events for elements: %d", [_elems count]); for (i = 0, c = [_elems count]; i < c; i++) { id currentObject; currentObject = [_elems objectAtIndex:i]; if (debugOn) NSLog(@" element[%d]/%d: %@", i, c, currentObject); [self produceSaxEventsForElement:currentObject]; } } - (void)produceSaxEventsForStructuredTextDocument:(StructuredTextDocument *)_d{ if (debugOn) NSLog(@" produce SAX events for document: %@", _d); [self produceSaxEventsForElements:[_d bodyElements]]; } - (void)produceSaxEventsForStructuredText:(StructuredText *)_stx systemId:(NSString *)_sysId { if (debugOn) NSLog(@"produce SAX events for: %@", _stx); [self->contentHandler startDocument]; [self produceSaxEventsForStructuredTextDocument:[_stx document]]; [self->contentHandler endDocument]; } /* parsing */ - (void)parseFromString:(NSString *)_str systemId:(NSString *)_sysId { StructuredText *stx; if (_sysId == nil) _sysId = @""; stx = [[[StructuredText alloc] initWithString:_str] autorelease]; if (debugOn) NSLog(@"%s: %@: %@", __PRETTY_FUNCTION__, _sysId, stx); [self produceSaxEventsForStructuredText:stx systemId:_sysId]; } - (void)parseFromData:(NSData *)_data systemId:(NSString *)_sysId { NSString *s; if (_sysId == nil) _sysId = @""; s = [[NSString alloc] initWithData:_data encoding:NSISOLatin1StringEncoding]; s = [s autorelease]; [self parseFromString:s systemId:_sysId]; } - (void)parseFromNSURL:(NSURL *)_url systemId:(NSString *)_sysId { NSData *data; if (_sysId == nil) _sysId = [_url absoluteString]; if ((data = [_url resourceDataUsingCache:NO]) == nil) { SaxParseException *e; NSDictionary *ui; ui = [[NSDictionary alloc] initWithObjectsAndKeys: _url ? _url : (NSURL *)@"", @"url", _sysId ? _sysId : (NSString *)@"", @"publicId", self, @"parser", nil]; e = (id)[SaxParseException exceptionWithName:@"SaxIOException" reason:@"could not retrieve URL content" userInfo:ui]; [ui release]; ui = nil; [self->errorHandler fatalError:e]; return; } [self parseFromData:data systemId:_sysId]; } - (void)parseFromSource:(id)_source systemId:(NSString *)_sysId { if (_source == nil) { /* no source ??? */ SaxParseException *e; NSDictionary *ui; ui = [[NSDictionary alloc] initWithObjectsAndKeys: _sysId ? _sysId : (NSString *)@"", @"publicId", self, @"parser", nil]; e = (id)[SaxParseException exceptionWithName:@"SaxIOException" reason:@"missing source for parsing!" userInfo:ui]; [ui release]; ui = nil; [self->errorHandler fatalError:e]; return; } if ([_source isKindOfClass:[NSString class]]) { [self parseFromString:_source systemId:_sysId]; return; } if ([_source isKindOfClass:[NSURL class]]) { [self parseFromNSURL:_source systemId:_sysId]; return; } if ([_source isKindOfClass:[NSData class]]) { [self parseFromData:_source systemId:_sysId]; return; } { SaxParseException *e; NSDictionary *ui; ui = [[NSDictionary alloc] initWithObjectsAndKeys: _source ? _source : (id)@"", @"source", _sysId ? _sysId : (NSString *)@"", @"publicId", self, @"parser", nil]; e = (id)[SaxParseException exceptionWithName:@"SaxIOException" reason:@"can not handle data-source" userInfo:ui]; [ui release]; ui = nil; [self->errorHandler fatalError:e]; return; } } - (void)parseFromSource:(id)_source { [self parseFromSource:_source systemId:nil]; } - (void)parseFromSystemId:(NSString *)_sysId { NSURL *url; if ([_sysId length] == 0) { SaxParseException *e; NSDictionary *ui; ui = [NSDictionary dictionaryWithObjectsAndKeys:self, @"parser", nil]; e = (id)[SaxParseException exceptionWithName:@"SaxIOException" reason:@"missing system-id for parsing!" userInfo:ui]; [self->errorHandler fatalError:e]; return; } if ([_sysId rangeOfString:@"://"].length == 0) { /* not a URL */ if (![_sysId isAbsolutePath]) _sysId = [[NSFileManager defaultManager] currentDirectoryPath]; url = [[[NSURL alloc] initFileURLWithPath:_sysId] autorelease]; } else url = [NSURL URLWithString:_sysId]; [self parseFromSource:url systemId:_sysId]; } @end /* STXSaxDriver */ SOPE/sope-xml/STXSaxDriver/COPYING.LIB0000644000000000000000000006130312242733417016044 0ustar rootroot GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 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. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] 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 Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, 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 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 a program 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. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, 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 companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. 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, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library 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 compile 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) 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. c) 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. d) 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 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. 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 to 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 Library 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 Appendix: 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 Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library 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! SOPE/sope-xml/STXSaxDriver/StructuredTextBodyElement+SAX.m0000644000000000000000000000406412242733417022353 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "StructuredTextBodyElement.h" #include "StructuredTextParagraph.h" #include "StructuredTextList.h" #include "StructuredTextListItem.h" #include "StructuredTextLiteralBlock.h" #include "StructuredTextHeader.h" #include "STXSaxDriver.h" #include "common.h" @implementation StructuredTextBodyElement(SAX) @end /* StructuredTextBodyElement(SAX) */ @implementation StructuredTextParagraph(SAX) - (void)produceSaxEventsOnSTXSaxDriver:(STXSaxDriver *)_sax { [_sax produceSaxEventsForParagraph:self]; } @end /* StructuredTextParagraph(SAX) */ @implementation StructuredTextList(SAX) - (void)produceSaxEventsOnSTXSaxDriver:(STXSaxDriver *)_sax { [_sax produceSaxEventsForList:self]; } @end /* StructuredTextList(SAX) */ @implementation StructuredTextListItem(SAX) - (void)produceSaxEventsOnSTXSaxDriver:(STXSaxDriver *)_sax { [_sax produceSaxEventsForListItem:self]; } @end /* StructuredTextListItem(SAX) */ @implementation StructuredTextLiteralBlock(SAX) - (void)produceSaxEventsOnSTXSaxDriver:(STXSaxDriver *)_sax { [_sax produceSaxEventsForLiteralBlock:self]; } @end /* StructuredTextLiteralBlock(SAX) */ @implementation StructuredTextHeader(SAX) - (void)produceSaxEventsOnSTXSaxDriver:(STXSaxDriver *)_sax { [_sax produceSaxEventsForHeader:self]; } @end /* StructuredTextHeader(SAX) */ SOPE/sope-xml/common.make0000644000000000000000000000050012242733420014207 0ustar rootroot# GNUstep makefile include $(GNUSTEP_MAKEFILES)/common.make ADDITIONAL_CPPFLAGS += -pipe -Wall -Wno-protocol ADDITIONAL_INCLUDE_DIRS += -I.. ADDITIONAL_LIB_DIRS += \ -L./$(GNUSTEP_OBJ_DIR) \ -L../SaxObjC/$(GNUSTEP_OBJ_DIR) \ ifeq ($(FOUNDATION_LIB),nx) ADDITIONAL_LDFLAGS += -framework Foundation endif SOPE/sope-xml/ChangeLog0000644000000000000000000000551212242733417013650 0ustar rootroot2008-03-03 Marcus Mueller * README-OSX.txt: Updated 2006-04-21 Marcus Mueller * GNUmakefile: reverse test for libxml2 existence flag - this allows for building libxml2 even if we didn't run configure :-) 2005-08-26 Helge Hess * all makefiles: add common.h as the precompiled header file 2005-08-09 Helge Hess * all makefiles: added flags to build only frameworks on MacOSX 2004-10-17 Helge Hess * all makefiles: include config.make if available 2004-09-21 Marcus Mueller * sope-xml.xcode: Fixed dependencies to resemble the make process more closely. Our aim should be to stick to the make process as closely as possible, so we shouldn't introduce dependencies in non-toplevel projects. 2004-08-29 Marcus Mueller * sope-xml.xcode: new Xcode aggregate project * SxXML*: removed old Xcode projects 2004-08-20 Helge Hess * moved iCalSaxDriver to sope-ical * moved ExpatSaxDriver, CFXMLSaxDriver to Recycler * moved PlistSaxDriver to samples 2004-08-03 Marcus Mueller * SxXML.xcode: fixed missing SaxObjC build dependency. libxmlSAXDriver is now built before SaxObjC, so copying it in the framework's wrapper will succeed. 2004-07-21 Marcus Mueller * README-OSX.txt: Major overhaul for build description, especially the Xcode section. 2004-07-16 Marcus Mueller * SxXML.xcode: added 'Wrapper' build style and 'Wrapper Contents' target. Use these to build the frameworks in an appropriate form to have them embedded in an applications app wrapper's 'Frameworks' folder. 2004-05-05 Marcus Mueller * ExpatSaxDriver/GNUmakefile, PlistSaxDriver/GNUmakefile: added support for building with GNUSTEP_BUILD_DIR environment variable set for recent gnustep-make package. 2004-03-24 Marcus Mueller * SxXML.xcode: added -headerpad_max_install_names to linker flags where appropriate. 2004-03-08 Helge Hess * SxXML.xcode: added a README file * README-OSX.txt: added some build notes 2004-02-29 Helge Hess * GNUmakefile: compile STXSaxDriver per default * SxXML.xcode: added new STXSaxDriver for parsing structured text files 2004-02-10 Marcus Mueller * SxXML.xcode: Updated prebinding information according to README-OSX.txt. Also, added Foundation.framework explicitly to all subprojects. * README-OSX.txt: New README currently describing prebinding information for Mac OS X. * ChangeLog: created. SOPE/sope-xml/DOM/0000755000000000000000000000000012242733417012512 5ustar rootrootSOPE/sope-xml/DOM/DOMXMLOutputter.m0000644000000000000000000002710412242733417015630 0ustar rootroot/* Copyright (C) 2000-2009 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "DOMXMLOutputter.h" #include "DOMDocument.h" #include "DOMElement.h" #include "common.h" @interface DOMXMLOutputter(Privates) - (void)outputNode:(id)_node to:(id)_target; - (void)outputNodeList:(id)_nodeList to:(id)_target; @end @interface DOMXMLOutputter(PrefixStack) - (NSString *)topPrefix; - (NSString *)topNamespace; - (void)pushPrefix:(NSString *)_prefix namespace:(NSString *)_namespace; - (void)popPrefixAndNamespace; - (BOOL)isTagValidInStack:(id)_node; - (NSArray *)newAttributePrefixesAndNamespaces:(NSArray *)_attrs; @end /* DOMXMLOutputter(PrefixStack) */ @implementation DOMXMLOutputter - (id)init { if ((self = [super init])) { self->stack = [[NSMutableArray alloc] initWithCapacity:32]; } return self; } - (void)dealloc { [self->stack release]; [super dealloc]; } - (void)indentOn:(id)_target { int i; for (i = 0; i < (self->indent * 4); i++) { if (_target) [_target appendString:@" "]; else fputc(' ', stdout); } } - (void)write:(NSString *)s to:(id)_target { if (_target) [_target appendString:s]; else #ifndef __APPLE__ printf("%s", [s cString]); #else printf("%s", [s UTF8String]); #endif } - (BOOL)currentElementPreservesWhitespace { return NO; } - (void)outputAttributeNode:(id)_attrNode ofNode:(id)_node to:(id)_target { if ([[_attrNode prefix] length] > 0) { [self write:[_attrNode prefix] to:_target]; [self write:@":" to:_target]; } [self write:[_attrNode name] to:_target]; if ([_attrNode hasChildNodes]) { id children; unsigned i, count; [self write:@"=\"" to:_target]; children = [_attrNode childNodes]; for (i = 0, count = [children count]; i < count; i++) { id child; child = [children objectAtIndex:i]; if ([child nodeType] == DOM_TEXT_NODE) [self write:[(id)child data] to:_target]; else NSLog(@"WARNING: unsupported attribute value node %@", child); } [self write:@"\"" to:_target]; } else NSLog(@"WARNING: attribute %@ has no content !", _attrNode); } - (void)outputAttributeNodes:(id)_nodes list:(NSArray *)_list to:(id)_target { unsigned i, count, count2; if ((count = [_nodes length]) == 0) return; // append required prefix and namespaces for (i = 0, count2 = [_list count]; i < count2; i = i + 2) { [self write:@" xmlns:" to:_target]; [self write:[_list objectAtIndex:i] to:_target]; [self write:@"=\"" to:_target]; [self write:[_list objectAtIndex:i+1] to:_target]; [self write:@"\"" to:_target]; } for (i = 0; i < count; i++) { id attrNode; attrNode = [_nodes objectAtIndex:i]; [self write:@" " to:_target]; [self outputAttributeNode:attrNode ofNode:nil to:_target]; } } - (void)outputTextNode:(id)_node to:(id)_target { NSString *s; unsigned len; s = [_node data]; if ((len = [s length]) == 0) return; if (![self currentElementPreservesWhitespace]) { unsigned i; for (i = 0; i < len; i++) { if (!isspace([s characterAtIndex:i])) break; } if (i == len) /* only whitespace */ return; [self indentOn:_target]; } [self write:[_node data] to:_target]; if (![self currentElementPreservesWhitespace]) [self write:@"\n" to:_target]; } - (void)outputCommentNode:(id)_node to:(id)_target { [self write:@"" to:_target]; if (![self currentElementPreservesWhitespace]) [self write:@"\n" to:_target]; } - (void)outputElementNode:(id)_node to:(id)_target { NSArray *list; // new attribute prefixes and namespaces NSString *tagName; NSString *ns = nil; NSString *tagURI; NSString *tagPrefix; BOOL isNodeValid; unsigned i, count; // getting new attributes prefixes and namespaces list = (NSArray *)[_node attributes]; list = [self newAttributePrefixesAndNamespaces:list]; // push new attribute prefixes and namespaces to stack for (i = 0, count = [list count]; i < count; i = i + 2) { [self pushPrefix:[list objectAtIndex:i] namespace:[list objectAtIndex:i+1]]; } tagURI = [_node namespaceURI]; tagPrefix = [_node prefix]; isNodeValid = [self isTagValidInStack:_node]; if (!isNodeValid) [self pushPrefix:tagPrefix namespace:tagURI]; /* needs to declare namespaces !!! */ tagName = [_node tagName]; if ([[_node prefix] length] > 0) { NSString *p; if (!isNodeValid) { ns = [NSString stringWithFormat:@" xmlns:%@=\"%@\"", tagPrefix, tagURI]; } p = [_node prefix]; p = [p stringByAppendingString:@":"]; tagName = [p stringByAppendingString:tagName]; } else if ([tagURI length] > 0) { id parent; BOOL addNS; addNS = YES; if ((parent = [_node parentNode])) { if ([parent nodeType] == DOM_ELEMENT_NODE) { if ([[parent namespaceURI] isEqualToString:tagURI]) { if ([[parent prefix] length] == 0) addNS = NO; } } } else addNS = YES; if (addNS) ns = [NSString stringWithFormat:@" xmlns=\"%@\"", [_node namespaceURI]]; else ns = nil; } else ns = nil; if ([_node hasChildNodes]) { [self indentOn:_target]; [self write:@"<" to:_target]; [self write:tagName to:_target]; if (ns) [self write:ns to:_target]; [self outputAttributeNodes:[_node attributes] list:list to:_target]; [self write:@">\n" to:_target]; self->indent++; [self outputNodeList:[_node childNodes] to:_target]; self->indent--; [self indentOn:_target]; [self write:@"\n" to:_target]; } else { [self indentOn:_target]; [self write:@"<" to:_target]; [self write:tagName to:_target]; [self outputAttributeNodes:[_node attributes] list:list to:_target]; [self write:@"/>\n" to:_target]; } // pop attributes prefixes and namespaces from stack for (i = 0; i < count; i = i + 2) { [self popPrefixAndNamespace]; } if (!isNodeValid) [self popPrefixAndNamespace]; } - (void)outputCDATA:(id)_node to:(id)_target { [self write:@"" to:_target]; } - (void)outputPI:(id)_node to:(id)_target { [self indentOn:_target]; [self write:@"\n" to:_target]; } - (void)outputNode:(id)_node to:(id)_target { switch ([_node nodeType]) { case DOM_ELEMENT_NODE: [self outputElementNode:(id)_node to:_target]; break; case DOM_CDATA_SECTION_NODE: [self outputCDATA:(id)_node to:_target]; break; case DOM_PROCESSING_INSTRUCTION_NODE: [self outputPI:(id)_node to:_target]; break; case DOM_TEXT_NODE: [self outputTextNode:(id)_node to:_target]; break; case DOM_COMMENT_NODE: [self outputCommentNode:(id)_node to:_target]; break; default: NSLog(@"cannot output node '%@'", _node); break; } } - (void)outputNodeList:(id)_nodeList to:(id)_target { id children; unsigned i, count; children = _nodeList; for (i = 0, count = [children count]; i < count; i++) [self outputNode:[children objectAtIndex:i] to:_target]; } - (void)outputDocument:(id)_document to:(id)_target { if (![_document hasChildNodes]) { NSLog(@"ERROR: document has no childnodes !"); return; } [self write:@"\n" to:_target]; [self->stack removeAllObjects]; [self outputNodeList:[_document childNodes] to:_target]; #if 0 NS_DURING { } NS_HANDLER abort(); NS_ENDHANDLER; #endif } @end /* DOMXMLOutputter */ @implementation DOMXMLOutputter(PrefixStack) - (void)_checkPrefixStack { NSAssert2(([self->stack count] % 2 == 0), @"%s: prefixStack is not valid (%@)!!!", __PRETTY_FUNCTION__, self->stack); } - (NSString *)topPrefix { [self _checkPrefixStack]; if ([self->stack count] == 0) return nil; return [self->stack objectAtIndex:[self->stack count] -2]; } - (NSString *)topNamespace { [self _checkPrefixStack]; if ([self->stack count] == 0) return nil; return [self->stack lastObject]; } - (void)pushPrefix:(NSString *)_prefix namespace:(NSString *)_namespace { [self _checkPrefixStack]; [self->stack addObject:(_prefix) ? _prefix : (NSString *)@""]; [self->stack addObject:(_namespace) ? _namespace : (NSString *)@""]; } - (void)popPrefixAndNamespace { [self _checkPrefixStack]; NSAssert1(([self->stack count] > 0), @"%s: prefixStack.count == 0", __PRETTY_FUNCTION__); [self->stack removeLastObject]; // namespace [self->stack removeLastObject]; // prefix } - (BOOL)isTagValidInStack:(id)_node { NSString *nodeNamespace; NSString *nodePrefix; int i; nodePrefix = [_node prefix]; nodeNamespace = [_node namespaceURI]; for (i = [self->stack count]; i >= 2; i = i - 2) { NSString *namespace; NSString *prefix; prefix = [self->stack objectAtIndex:i-2]; namespace = [self->stack objectAtIndex:i-1]; if ([nodePrefix isEqualToString:prefix] && [nodeNamespace isEqualToString:namespace]) return YES; } return NO; } - (NSArray *)newAttributePrefixesAndNamespaces:(NSArray *)_attrs { NSMutableArray *result; int i, j, count; count = [_attrs count]; if (count == 0) return [NSArray array]; result = [[NSMutableArray alloc] initWithCapacity:count]; for (j = 0; j < count; j++) { id attr; NSString *attrNamespace; NSString *attrPrefix; BOOL didMatch = NO; attr = [_attrs objectAtIndex:j]; attrNamespace = [attr namespaceURI]; attrPrefix = [attr prefix]; attrNamespace = (attrNamespace) ? attrNamespace : (NSString *)@""; attrPrefix = (attrPrefix) ? attrPrefix : (NSString *)@""; if (([attrNamespace length] == 0 && [attrPrefix length] == 0)) continue; for (i = [self->stack count]; i >= 2; i = i - 2) { NSString *namespace; NSString *prefix; prefix = [self->stack objectAtIndex:i-2]; namespace = [self->stack objectAtIndex:i-1]; if ([attrPrefix isEqualToString:prefix] && [attrNamespace isEqualToString:namespace]) { didMatch = YES; break; } } if (didMatch == NO) { [result addObject:attrPrefix]; [result addObject:attrNamespace]; } } return [result autorelease]; } @end /* DOMXMLOutputter(PrefixStack) */ SOPE/sope-xml/DOM/DOMNotation.h0000644000000000000000000000206012242733417015014 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DOMNotation_H__ #define __DOMNotation_H__ #include @interface NGDOMNotation : NGDOMNode { } /* attributes */ /* node */ @end @interface NGDOMNotation(PrivateCtors) /* use DOMDocument for constructing DOMNotation's ! */ @end #endif /* __DOMNotation_H__ */ SOPE/sope-xml/DOM/DOMImplementation.h0000644000000000000000000000313212242733417016207 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DOMImplementation_H__ #define __DOMImplementation_H__ #import @class NSString; @interface NGDOMImplementation : NSObject { Class elementClass; Class textNodeClass; Class attrClass; } - (id)createDocumentWithName:(NSString *)_qname namespaceURI:(NSString *)_uri documentType:(id)_doctype; - (id)createDocumentType:(NSString *)_qname publicId:(NSString *)_pubId systemId:(NSString *)_sysId; @end @interface NGDOMImplementation(PrivateClassRegistry) - (Class)domElementClass; - (Class)domElementNSClass; - (Class)domDocumentFragmentClass; - (Class)domTextNodeClass; - (Class)domCommentClass; - (Class)domCDATAClass; - (Class)domProcessingInstructionClass; - (Class)domAttributeClass; - (Class)domAttributeNSClass; - (Class)domEntityReferenceClass; @end #endif /* __DOMImplementation_H__ */ SOPE/sope-xml/DOM/fhs.make0000644000000000000000000000172212242733417014133 0ustar rootroot# postprocessing # FHS support (this is a hack and is going to be done by gstep-make!) ifneq ($(FHS_INSTALL_ROOT),) FHS_INCLUDE_DIR=$(FHS_INSTALL_ROOT)/include/ FHS_BIN_DIR=$(FHS_INSTALL_ROOT)/bin/ ifeq ($(findstring _64, $(GNUSTEP_TARGET_CPU)), _64) FHS_LIB_DIR=$(FHS_INSTALL_ROOT)/lib64/ else FHS_LIB_DIR=$(FHS_INSTALL_ROOT)/lib/ endif fhs-header-dirs :: $(MKDIRS) $(FHS_INCLUDE_DIR)$(libDOM_HEADER_FILES_INSTALL_DIR) move-headers-to-fhs :: fhs-header-dirs @echo "moving headers to $(FHS_INCLUDE_DIR) .." mv $(GNUSTEP_HEADERS)$(libDOM_HEADER_FILES_INSTALL_DIR)/*.h \ $(FHS_INCLUDE_DIR)$(libDOM_HEADER_FILES_INSTALL_DIR)/ NONFHS_LIBDIR="$(GNUSTEP_LIBRARIES)/$(GNUSTEP_TARGET_LDIR)/" NONFHS_LIBNAME="$(LIBRARY_NAME)$(LIBRARY_NAME_SUFFIX)$(SHARED_LIBEXT)" move-libs-to-fhs :: @echo "moving libs to $(FHS_LIB_DIR) .." mv $(NONFHS_LIBDIR)/$(NONFHS_LIBNAME)* $(FHS_LIB_DIR)/ move-to-fhs :: move-headers-to-fhs move-libs-to-fhs after-install :: move-to-fhs endif SOPE/sope-xml/DOM/README0000644000000000000000000000264012242733417013374 0ustar rootrootHow to build a DOM tree ? ========================= 1. get a factory DOMBuilderFactory *factory = [DOMBuilderFactory standardDOMBuilderFactory]; 2. get a builder for your resource type id builder = [factory createDOMBuilderForMimeType:@"text/xml"]; 3. parse what you have: id document = [builder buildFromSource:@"myfile.xml"]; KVC === You can navigate the DOM tree with standard key/value coding. The NGDOMDocument will treat all KVC keys starting with a "/" as query path expressions. Samples: document.documentElement => root DOMElement document.documentElement.childNodes => NSArray containing the root children document./uid => DOMElement or array! matching 'uid' document./uid.textValue => text-value of 'uid' element element.@value.textValue => text-value of 'value' attribute of element element./subnode.textValue => lookup subnode (strips of the /) using QP Some info on classes ... ======================== Nodes with children Document DocumentFragment EntityReference Element Attr Entity Nodes without children DocumentType ProcessingInstruction Comment Text CDATASection Notation Nodes with parent DocumentType EntityReference Element ProcessingInstruction Comment Text CDATASection Nodes without parent Document DocumentFragment Attr Entity Notation SOPE/sope-xml/DOM/DOMDocument+factory.m0000644000000000000000000000356112242733417016456 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include "common.h" #include @implementation NGDOMDocument(DocumentTraversal) - (Class)domTreeWalkerClass { return NSClassFromString(@"DOMTreeWalker"); } - (id)createNodeIterator:(id)_node whatToShow:(unsigned long)_whatToShow filter:(id)_filter { [self doesNotRecognizeSelector:_cmd]; return nil; } - (id)createTreeWalker:(id)_rootNode whatToShow:(unsigned long)_whatToShow filter:(id)_filter expandEntityReferences:(BOOL)_expandEntityReferences { id walker; // should throw DOMException with NOT_SUPPORTED_ERR NSAssert(_rootNode, @"invalid root node !"); walker = [[[self domTreeWalkerClass] alloc] initWithRootNode:_rootNode whatToShow:_whatToShow filter:_filter expandEntityReferences:_expandEntityReferences]; return [walker autorelease]; } @end /* NGDOMDocument(DocumentTraversal) */ SOPE/sope-xml/DOM/DOMDocumentBuilder.h0000644000000000000000000000170112242733417016307 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DOMDocumentBuilder_H__ #define __DOMDocumentBuilder_H__ #include @protocol DOMDocumentBuilder @end #endif /* __DOMDocumentBuilder_H__ */ SOPE/sope-xml/DOM/DOMText.h0000644000000000000000000000344212242733417014152 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DOMText_H__ #define __DOMText_H__ #include /* Why do I get adjacent Text nodes? The DOM structure model that is created by whatever it is that creates it has one Text node per block of text when it starts. The only way you can have adjacent Text nodes is as a result of user operations; it is not an option for the DOM implementation when it first presents its structure model to the user. The normalize method (on the Element interface in level 1, but moved to Node for Level 2) will merge all the adjacent Text nodes into one again, so they will have the same form as if you wrote out the XML or HTML and then read it in again. Note that this will have no effect on CDATA Sections. A filtered view of a document, such as that obtained through use of TreeWalker, may have adjacent Text nodes because the intervening Nodes are not seen in that view. */ @interface NGDOMText : NGDOMCharacterData < DOMText > { } @end #endif /* __DOMTextNode_H__ */ SOPE/sope-xml/DOM/DOMQueryPathExpression.m0000644000000000000000000005327612242733417017247 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include "DOMDocument.h" #include "DOMAttribute.h" #include "DOMNamedNodeMap.h" #include "common.h" @interface NSString(QP) - (NSArray *)queryPathComponents; @end #define QUERY_CURRENT 1 #define QUERY_PARENT 2 #define QUERY_ROOT 3 /* QueryPathExpression classes: NSObject _DOMQPPredicateExpression _DOMQPPredicateQPExpression DOMQueryPathExpression _DOMQueryPathSequence _DOMQueryPathPredicates _DOMQueryPathAttribute _DOMQueryPathNodeQuery _DOMQueryPathChildNodes _DOMQueryPathKeyPath */ @interface DOMQueryPathExpression(Privates) + (id)makeQueryPathExpression:(NSString *)_expr; - (id)_deepChildNodesWithName:(id)_name type:(int)_type node:(id)_domNode; - (id)_flatChildNodesWithName:(id)_name type:(int)_type node:(id)_domNode; - (id)_rootSearchNodeForNode:(id)_domNode; - (id)evaluateWithNode:(id)_node inContext:(id)_ctx; - (id)evaluateWithNodeList:(id)_nodes inContext:(id)_ctx; @end @interface _DOMQPPredicateExpression : NSObject - (BOOL)matchesNode:(id)_node inContext:(id)_ctx; @end @interface _DOMQPPredicateQPExpression : NSObject { DOMQueryPathExpression *qpexpr; } - (id)initWithQueryPathExpression:(DOMQueryPathExpression *)_expr; @end @interface _DOMQueryPathSequence : DOMQueryPathExpression { NSArray *queryPaths; } + (id)sequenceWithArray:(NSArray *)_array; @end @interface _DOMQueryPathPredicates : DOMQueryPathExpression { DOMQueryPathExpression *expr; NSArray *predicates; } - (id)initWithQueryPathExpression:(DOMQueryPathExpression *)_expr predicates:(NSArray *)_predicates; @end @interface _DOMQueryPathAttribute : DOMQueryPathExpression { NSString *attrSpec; NSString *uri; struct { int getAll:1; int hasColon:1; } aflags; } - (id)initWithString:(NSString *)_spec; @end @interface _DOMQueryPathNodeQuery : DOMQueryPathExpression { int queryOp; } - (id)initWithQueryOp:(int)_op; @end @interface _DOMQueryPathChildNodes : DOMQueryPathExpression { NSString *elementName; BOOL deep; int nodeType; } - (id)initWithName:(NSString *)_name deep:(BOOL)_flag type:(int)_type; @end @interface _DOMQueryPathKeyPath : DOMQueryPathExpression { NSString *keyPath; } - (id)initWithKeyPath:(NSString *)_path; @end @implementation DOMQueryPathExpression - (id)_deepChildNodesWithName:(id)_name type:(int)_type node:(id)_domNode { NSMutableArray *array; id children; unsigned i, count; NSString *fname, *furi; if (![_domNode hasChildNodes]) return [NSArray array]; children = [_domNode childNodes]; if ((count = [children count]) == 0) return [NSArray array]; if (_name) { NSRange r; r = [_name rangeOfString:@"}"]; if (r.length != 0) { fname = [_name substringFromIndex:(r.location + r.length)]; furi = [[_name substringToIndex:r.location] substringFromIndex:1]; } else { fname = _name; furi = nil; } } else { fname = nil; furi = nil; } array = [NSMutableArray arrayWithCapacity:count]; for (i = 0; i < count; i++) { id child; if ((child = [children objectAtIndex:i]) == nil) continue; if (([child nodeType] == _type) || (_type == -1)) { if (_name == nil) { /* wildcard query */ [array addObject:child]; } else { NSString *nname; nname = [child nodeName]; if ([nname isEqualToString:_name]) { /* FQ name matches */ [array addObject:child]; } else if ([nname isEqualToString:fname]) { /* name matches */ if (furi) { /* check URI */ if ([[child namespaceURI] isEqualToString:furi]) [array addObject:child]; } else { [array addObject:child]; } } } } [array addObjectsFromArray: [self _deepChildNodesWithName:_name type:_type node:child]]; } return array; } - (id)_flatChildNodesWithName:(id)_name type:(int)_type node:(id)_domNode { NSMutableArray *array; id children; unsigned i, count; if (![_domNode hasChildNodes]) return [NSArray array]; children = [_domNode childNodes]; if ((count = [children count]) == 0) return [NSArray array]; array = [NSMutableArray arrayWithCapacity:count]; for (i = 0; i < count; i++) { id child; child = [children objectAtIndex:i]; if (([child nodeType] != _type) && (_type != -1)) continue; if (_name) { if (![[child nodeName] isEqualToString:_name]) continue; } if (child) [array addObject:child]; } return [[array copy] autorelease]; } - (id)_rootSearchNodeForNode:(id)_domNode { id root; switch ([_domNode nodeType]) { case DOM_DOCUMENT_NODE: case DOM_DOCUMENT_FRAGMENT_NODE: root = [(id)_domNode documentElement]; if (root == nil) { NSLog(@"WARNING(%s): document node %@ has no root element !", __PRETTY_FUNCTION__, _domNode); } break; case DOM_COMMENT_NODE: case DOM_PROCESSING_INSTRUCTION_NODE: case DOM_ELEMENT_NODE: root = [_domNode ownerDocument]; if (root == nil) { NSLog(@"WARNING(%s): node %@ has no owner document !", __PRETTY_FUNCTION__, _domNode); } root = [self _rootSearchNodeForNode:root]; break; case DOM_ATTRIBUTE_NODE: root = [(id)_domNode ownerElement]; if (root == nil) { NSLog(@"WARNING(%s): attribute node %@ has no owner element !", __PRETTY_FUNCTION__, _domNode); } root = [self _rootSearchNodeForNode:root]; break; default: root = [self _rootSearchNodeForNode:[_domNode parentNode]]; break; } return root; } + (id)queryPathWithComponents:(NSArray *)_array { NSMutableArray *a; unsigned i, count; if ((count = [_array count]) == 0) return nil; if (count == 1) return [[self makeQueryPathExpression:[_array objectAtIndex:0]] autorelease]; a = [NSMutableArray arrayWithCapacity:count]; for (i = 0; i < count; i++) { DOMQueryPathExpression *c; if ((c = [self makeQueryPathExpression:[_array objectAtIndex:i]])) { [a addObject:c]; [c release]; c = nil; } else { NSLog(@"%s: couldn't make query-path expression ..", __PRETTY_FUNCTION__); } } return [_DOMQueryPathSequence sequenceWithArray:a]; } + (NSArray *)queryPathComponentsOfString:(NSString *)_path { return [_path queryPathComponents]; } + (id)queryPathWithString:(NSString *)_string { return [self queryPathWithComponents:[_string queryPathComponents]]; } + (_DOMQPPredicateExpression *)parsePredicateExpression:(NSString *)_expr { DOMQueryPathExpression *qpexpr; _DOMQPPredicateExpression *pred; #if 0 NSLog(@"%s: can't parse predicates yet '%@'", __PRETTY_FUNCTION__, _expr); #endif _expr = [@"-" stringByAppendingString:_expr]; qpexpr = [DOMQueryPathExpression queryPathWithString:_expr]; //NSLog(@"Expr: %@", qpexpr); pred = [[_DOMQPPredicateQPExpression alloc] initWithQueryPathExpression:qpexpr]; return [pred autorelease]; } + (NSArray *)parseNodeQueryDetailExpressions:(NSString *)_path { unsigned i, len, s; NSMutableArray *predicates; if ([_path length] == 0) return nil; predicates = nil; for (i = 0, s = 0, len = [_path length]; i < len; i++) { unichar c; c = [_path characterAtIndex:i]; if ((c == ']') && (s != 0)) { /* finished a predicate */ NSString *ps; id predicate; ps = ((i - s) > 0) ? [_path substringWithRange:NSMakeRange(s, (i - s))] : (NSString *)@""; if ((predicate = [self parsePredicateExpression:ps])) { if (predicates == nil) predicates = [NSMutableArray arrayWithCapacity:4]; [predicates addObject:predicate]; } s = 0; } else if (c == '[') { /* start a predicate */ if (s != 0) { NSLog(@"%s: syntax error, predicate not properly closed ('%@') !", __PRETTY_FUNCTION__, _path); } s = (i + 1); } } return predicates; } + (id)makeQueryPathExpression:(NSString *)_path { DOMQueryPathExpression *result; BOOL isDeep = NO; NSString *predicateString; NSRange r; if (([_path rangeOfString:@")"].length) != 0) { //[self doesNotRecognizeSelector:_cmd]; NSLog(@"%s: unsupported querypath '%@'", __PRETTY_FUNCTION__, _path); } if ([_path hasPrefix:@"-"]) { isDeep = NO; _path = [_path substringFromIndex:1]; } else isDeep = YES; r = [_path rangeOfString:@"["]; if (r.length != 0) { predicateString = [_path substringFromIndex:r.location]; _path = [_path substringToIndex:r.location]; } else predicateString = nil; if ([_path length] == 0) { /* empty path, returns current node */ result = [[_DOMQueryPathNodeQuery alloc] initWithQueryOp:QUERY_CURRENT]; } else if ([_path isEqualToString:@"/"]) { /* lookup root element */ result = [[_DOMQueryPathNodeQuery alloc] initWithQueryOp:QUERY_ROOT]; } else if ([_path isEqualToString:@"."]) { /* lookup current element */ result = [[_DOMQueryPathNodeQuery alloc] initWithQueryOp:QUERY_CURRENT]; } else if ([_path isEqualToString:@".."]) { /* lookup parent element */ result = [[_DOMQueryPathNodeQuery alloc] initWithQueryOp:QUERY_PARENT]; } else if ([_path isEqualToString:@"*"]) { result = [[_DOMQueryPathChildNodes alloc] initWithName:nil deep:isDeep type:DOM_ELEMENT_NODE]; } else if ([_path isEqualToString:@"#"]) { result = [[_DOMQueryPathChildNodes alloc] initWithName:nil deep:isDeep type:-1]; } else if ([_path hasPrefix:@"!"]) { /* perform key-value call */ _path = [_path substringFromIndex:1]; result = [[_DOMQueryPathKeyPath alloc] initWithKeyPath:_path]; } else if ([_path hasPrefix:@"?"]) { /* lookup processing instruction */ _path = [_path substringFromIndex:1]; // target of PI result = [[_DOMQueryPathChildNodes alloc] initWithName:_path deep:isDeep type:DOM_PROCESSING_INSTRUCTION_NODE]; } else if ([_path hasPrefix:@"@"]) { /* lookup attribute */ _path = [_path substringFromIndex:1]; result = [[_DOMQueryPathAttribute alloc] initWithString:_path]; } else { /* deep lookup child element */ result = [[_DOMQueryPathChildNodes alloc] initWithName:_path deep:isDeep type:DOM_ELEMENT_NODE]; } /* attach predicates ... */ if (([predicateString length] > 0) && (result != nil)) { NSArray *predicates; if ((predicates = [self parseNodeQueryDetailExpressions:predicateString])){ #if 0 NSLog(@"%s: can't yet handle predicates %@", __PRETTY_FUNCTION__, predicates); #endif result = [result autorelease]; result = [[_DOMQueryPathPredicates alloc] initWithQueryPathExpression:result predicates:predicates]; } } return result; } - (id)evaluateWithNode:(id)_node inContext:(id)_ctx { /* override in subclasses ! */ [self doesNotRecognizeSelector:_cmd]; return nil; } - (id)evaluateWithNodeList:(id)_nodes inContext:(id)_ctx { unsigned i, count; NSMutableArray *ma; NSArray *results; if ((count = [_nodes count]) == 0) return _nodes; ma = [[NSMutableArray alloc] init]; for (i = 0; i < count; i++) { id node; node = [_nodes objectAtIndex:i]; node = [self evaluateWithNode:node inContext:_ctx]; if (node) [ma addObject:node]; } results = [ma copy]; [ma release]; return [results autorelease]; } - (id)evaluateWithNode:(id)_node { return [self evaluateWithNode:_node inContext:nil]; } - (id)evaluateWithNodeList:(id)_nodes { return [self evaluateWithNodeList:_nodes inContext:nil]; } @end /* DOMQueryPathExpression */ @implementation _DOMQueryPathChildNodes - (id)initWithName:(NSString *)_name deep:(BOOL)_flag type:(int)_type { self->elementName = [_name copy]; self->deep = _flag; self->nodeType = _type; return self; } - (void)dealloc { [self->elementName release]; [super dealloc]; } - (id)evaluateWithNode:(id)_node inContext:(id)_ctx { id result; BOOL _forceList = NO; result = self->deep ? [self _deepChildNodesWithName:self->elementName type:self->nodeType node:_node] : [self _flatChildNodesWithName:self->elementName type:self->nodeType node:_node]; if (!_forceList) { if ([result count] == 0) result = nil; else if ([result count] == 1) result = [result objectAtIndex:0]; } return result; } - (id)evaluateWithNodeList:(id)_nodes inContext:(id)_ctx { unsigned i, count; NSMutableArray *ma; NSArray *results; if ((count = [_nodes count]) == 0) return _nodes; ma = [[NSMutableArray alloc] init]; for (i = 0; i < count; i++) { id node; node = [_nodes objectAtIndex:i]; node = self->deep ? [self _deepChildNodesWithName:self->elementName type:self->nodeType node:node] : [self _flatChildNodesWithName:self->elementName type:self->nodeType node:node]; [ma addObjectsFromArray:node]; } results = [ma copy]; [ma release]; return [results autorelease]; } - (NSString *)description { NSMutableString *ms; ms = [NSMutableString stringWithCapacity:128]; [ms appendFormat:@"<%@[0x%p]:", NSStringFromClass([self class]), self]; [ms appendFormat:@" element='%@'", self->elementName]; [ms appendString:self->deep ? @" deep" : @" shallow"]; [ms appendFormat:@" nodeType=%i", self->nodeType]; [ms appendString:@">"]; return ms; } @end /* _DOMQueryPathChildNodes */ @implementation _DOMQueryPathKeyPath - (id)initWithKeyPath:(NSString *)_path { self->keyPath = [_path copy]; return self; } - (void)dealloc { [self->keyPath release]; [super dealloc]; } - (id)evaluateWithNode:(id)_node inContext:(id)_ctx { return [_node valueForKeyPath:self->keyPath]; } - (NSString *)description { return [NSString stringWithFormat:@"<0x%p[%@]: keypath='%@'>", self, NSStringFromClass([self class]), self->keyPath]; } @end /* _DOMQueryPathKeyPath */ @implementation _DOMQueryPathNodeQuery - (id)initWithQueryOp:(int)_op { self->queryOp = _op; return self; } - (id)evaluateWithNode:(id)_node inContext:(id)_ctx { switch (self->queryOp) { case QUERY_ROOT: return [self _rootSearchNodeForNode:_node]; case QUERY_PARENT: return [_node parentNode]; case QUERY_CURRENT: return _node; default: [NSException raise:@"DOMQueryPathException" format:@"unknown node operation %i on node %@", self->queryOp, _node]; return nil; } } - (NSString *)description { return [NSString stringWithFormat:@"<0x%p[%@]: op=%i>", self, NSStringFromClass([self class]), self->queryOp]; } @end /* _DOMQueryPathNodeQuery */ @implementation _DOMQueryPathPredicates - (id)initWithQueryPathExpression:(DOMQueryPathExpression *)_expr predicates:(NSArray *)_predicates { self->expr = [_expr retain]; self->predicates = [_predicates copy]; return self; } - (void)dealloc { [self->expr release]; [self->predicates release]; [super dealloc]; } - (id)evaluateWithNodeList:(id)_nodes inContext:(id)_ctx { NSArray *list; if ((list = [self->expr evaluateWithNodeList:_nodes inContext:_ctx]) && [self->predicates count] > 0) { NSMutableArray *result; unsigned i, count; result = [NSMutableArray arrayWithCapacity:16]; for (i = 0, count = [list count]; i < count; i++) { NSEnumerator *e; _DOMQPPredicateExpression *pred; id node; if ((node = [list objectAtIndex:i]) == nil) continue; e = [self->predicates objectEnumerator]; while ((pred = [e nextObject])) { if (![pred matchesNode:node inContext:nil]) { node = nil; break; } } if (node) [result addObject:node]; } list = [[result copy] autorelease]; } return list; } - (id)evaluateWithNode:(id)_node inContext:(id)_ctx { NSLog(@"WARNING(%s): called -evaluateWithNode: ...", __PRETTY_FUNCTION__); return [self evaluateWithNodeList:[NSArray arrayWithObject:_node] inContext:_ctx]; } @end /* _DOMQueryPathPredicates */ @implementation _DOMQueryPathSequence - (id)initWithArray:(NSArray *)_array { self->queryPaths = [_array retain]; return self; } + (id)sequenceWithArray:(NSArray *)_array { return [[[self alloc] initWithArray:_array] autorelease]; } - (void)dealloc { [self->queryPaths release]; [super dealloc]; } - (id)evaluateWithNode:(id)_node inContext:(id)_ctx { NSEnumerator *e; DOMQueryPathExpression *queryPathComponent; id activeNode; activeNode = _node; e = [self->queryPaths objectEnumerator]; while ((queryPathComponent = [e nextObject]) && (activeNode != nil)) { activeNode = [queryPathComponent evaluateWithNode:activeNode inContext:_ctx]; } return activeNode; } - (NSString *)description { NSMutableString *ms; ms = [NSMutableString stringWithCapacity:128]; [ms appendFormat:@"<%@[0x%p]: ", NSStringFromClass([self class]), self]; [ms appendString:@"sequence="]; [ms appendString:[self->queryPaths description]]; [ms appendString:@">"]; return ms; } @end /* _DOMQueryPathSequence */ @implementation _DOMQueryPathAttribute - (id)initWithString:(NSString *)_spec { if ([_spec isEqualToString:@"*"]) { /* select all attributes */ self->aflags.getAll = 1; } else if ([_spec hasPrefix:@"{"]) { /* fully qualified name */ NSRange r; r = [_spec rangeOfString:@"}"]; if (r.length == 0) { /* syntax error, missing closing '}' */ self->attrSpec = [_spec copy]; } else { self->attrSpec = [[_spec substringFromIndex:(r.location + r.length)] copy]; self->uri = [[[_spec substringToIndex:r.location] substringFromIndex:1] copy]; } } else { NSRange r; r = [_spec rangeOfString:@":"]; if (r.length != 0) { /* found colon (namespaces), eg 'html:blah' */ self->aflags.hasColon = 1; self->attrSpec = [[_spec substringFromIndex:(r.location + r.length)] copy]; self->uri = [_spec substringToIndex:r.location]; self->uri = ([self->uri length] > 1) ? [self->uri copy] : (id)@"*"; } else { /* usual 'blah' */ self->attrSpec = [_spec copy]; } } return self; } - (void)dealloc { [self->uri release]; [self->attrSpec release]; [super dealloc]; } - (id)evaluateWithNode:(id)_node inContext:(id)_ctx { /* lookup attribute element */ id attributes; id result; BOOL _forceList = NO; attributes = [(id)_node attributes]; #if DEBUG if (attributes == nil) NSLog(@"%s: node %@ has no attributes ..", __PRETTY_FUNCTION__, _node); #endif if (self->aflags.getAll) { /* all attribute elements */ result = attributes; _forceList = NO; // attributes behave already like a list .. } else if (self->uri) { result = [attributes namedItem:self->attrSpec namespaceURI:self->uri]; } else if (self->aflags.hasColon) { result = [attributes namedItem:self->attrSpec namespaceURI:self->uri]; //result = [result value]; } else { result = [attributes namedItem:self->attrSpec]; } if (_forceList) result = [NSArray arrayWithObject:result]; return result; } - (NSString *)description { NSMutableString *ms; ms = [NSMutableString stringWithCapacity:64]; [ms appendFormat:@"<%@[0x%p]:", NSStringFromClass([self class]), self]; [ms appendFormat:@" attrSpec='%@'", self->attrSpec]; if (self->uri) [ms appendFormat:@" uri='%@'", self->uri]; if (self->aflags.getAll) [ms appendString:@" getall"]; if (self->aflags.hasColon) [ms appendString:@" colon"]; [ms appendString:@">"]; return ms; } @end /* _DOMQueryPathAttribute */ @implementation _DOMQPPredicateExpression - (BOOL)matchesNode:(id)_node inContext:(id)_ctx { /* override in subclasses ! */ [self doesNotRecognizeSelector:_cmd]; return NO; } @end /* _DOMQPPredicateExpression */ @implementation _DOMQPPredicateQPExpression - (id)initWithQueryPathExpression:(DOMQueryPathExpression *)_expr { self->qpexpr = [_expr retain]; return self; } - (id)init { return [self initWithQueryPathExpression:nil]; } - (void)dealloc { [self->qpexpr release]; [super dealloc]; } - (BOOL)matchesNode:(id)_node inContext:(id)_ctx { id nodeList; //NSLog(@"check match of node %@, qpexpr %@ ...", _node, qpexpr); nodeList = [NSArray arrayWithObject:_node]; nodeList = [self->qpexpr evaluateWithNodeList:nodeList inContext:_ctx]; return ([nodeList count] > 0) ? YES : NO; } @end /* _DOMQPPredicateQPExpression */ SOPE/sope-xml/DOM/DOMEntity.m0000644000000000000000000000336412242733417014512 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "DOMEntity.h" #include "common.h" @implementation NGDOMEntity /* attributes */ - (NSString *)publicId { [self doesNotRecognizeSelector:_cmd]; return nil; } - (NSString *)systemId { [self doesNotRecognizeSelector:_cmd]; return nil; } - (NSString *)notationName { [self doesNotRecognizeSelector:_cmd]; return nil; } /* node */ - (DOMNodeType)nodeType { return DOM_ENTITY_NODE; } - (BOOL)_isValidChildNode:(id)_node { switch ([_node nodeType]) { case DOM_ELEMENT_NODE: case DOM_PROCESSING_INSTRUCTION_NODE: case DOM_COMMENT_NODE: case DOM_TEXT_NODE: case DOM_CDATA_SECTION_NODE: case DOM_ENTITY_REFERENCE_NODE: return YES; default: return NO; } } - (id)attributes { return nil; } /* parent node */ - (id)parentNode { return nil; } - (id)nextSibling { return nil; } - (id)previousSibling { return nil; } @end /* NGDOMEntity */ SOPE/sope-xml/DOM/DOM+JS.m0000644000000000000000000003170612242733417013626 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include "NSObject+StringValue.h" #include "common.h" /* Differences to DOM JavaScript Differences are due to JavaScript bridge retain-cycle issues with parent properties (properties are cached by the JS engine, while function return values are not) ... Node: original property | SKYRiX function parentNode | getParentNode() childNodes | getChildNodes() firstChild | getFirstChild() lastChild | getLastChild() previousSibling | getPreviousSibling() nextSibling | getNextSibling() attributes | getAttributes() ownerDocument | getOwnerDocument() Attr: ownerElement | getOwnerElement() Document: original property | SKYRiX function documentElement | getDocumentElement() */ @implementation NGDOMImplementation(JSSupport) - (id)_jsfunc_createDocument:(NSArray *)_args { NSString *nsuri = nil, *qname = nil, *doctype = nil; unsigned count; count = [_args count]; if (count > 0) nsuri = [[_args objectAtIndex:0] stringValue]; if (count > 1) qname = [[_args objectAtIndex:1] stringValue]; if (count > 2) doctype = [[_args objectAtIndex:2] stringValue]; return [self createDocumentWithName:qname namespaceURI:nsuri documentType:doctype]; } - (id)_jsfunc_createDocumentType:(NSArray *)_args { NSString *qname = nil, *pubId = nil, *sysId = nil; unsigned count; count = [_args count]; if (count > 0) qname = [[_args objectAtIndex:0] stringValue]; if (count > 1) pubId = [[_args objectAtIndex:1] stringValue]; if (count > 2) sysId = [[_args objectAtIndex:2] stringValue]; return [self createDocumentType:qname publicId:pubId systemId:sysId]; } @end /* NGDOMImplementation(JSSupport) */ @implementation NGDOMDocument(JSSupport) - (id)_jsprop_doctype { return [self doctype]; } - (id)_jsprop_implementation { return [self implementation]; } - (id)_jsfunc_getDocumentElement:(NSArray *)_args { return [self documentElement]; } /* lookup */ - (id)_jsfunc_getElementsByTagName:(NSArray *)_args { unsigned count; if ((count = [_args count]) == 0) return nil; if (count == 1) return [self getElementsByTagName:[[_args objectAtIndex:0] stringValue]]; else { return [self getElementsByTagName:[[_args objectAtIndex:1] stringValue] namespaceURI:[[_args objectAtIndex:0] stringValue]]; } } - (id)_jsfunc_getElementsByTagNameNS:(NSArray *)_args { return [self _jsfunc_getElementsByTagName:_args]; } - (id)_jsfunc_getElementById:(NSArray *)_args { unsigned count; if ((count = [_args count]) == 0) return nil; return [self getElementById:[[_args objectAtIndex:0] stringValue]]; } /* factory */ - (id)_jsfunc_createElement:(NSArray *)_args { unsigned count; if ((count = [_args count]) == 0) return nil; if (count == 1) return [self createElement:[[_args objectAtIndex:0] stringValue]]; else { return [self createElement:[[_args objectAtIndex:1] stringValue] namespaceURI:[[_args objectAtIndex:0] stringValue]]; } } - (id)_jsfunc_createElementNS:(NSArray *)_args { return [self _jsfunc_createElement:_args]; } - (id)_jsfunc_createDocumentFragment:(NSArray *)_args { return [self createDocumentFragment]; } - (id)_jsfunc_createTextNode:(NSArray *)_args { unsigned count; if ((count = [_args count]) == 0) return nil; return [self createTextNode:[[_args objectAtIndex:0] stringValue]]; } - (id)_jsfunc_createComment:(NSArray *)_args { unsigned count; if ((count = [_args count]) == 0) return nil; return [self createComment:[[_args objectAtIndex:0] stringValue]]; } - (id)_jsfunc_createCDATASection:(NSArray *)_args { unsigned count; if ((count = [_args count]) == 0) return nil; return [self createCDATASection:[[_args objectAtIndex:0] stringValue]]; } - (id)_jsfunc_createProcessingInstruction:(NSArray *)_args { unsigned count; if ((count = [_args count]) < 2) return nil; return [self createProcessingInstruction: [[_args objectAtIndex:0] stringValue] data:[[_args objectAtIndex:1] stringValue]]; } - (id)_jsfunc_createAttribute:(NSArray *)_args { unsigned count; if ((count = [_args count]) == 0) return nil; if (count == 1) return [self createAttribute:[[_args objectAtIndex:0] stringValue]]; else { return [self createAttribute:[[_args objectAtIndex:1] stringValue] namespaceURI:[[_args objectAtIndex:0] stringValue]]; } } - (id)_jsfunc_createAttributeNS:(NSArray *)_args { return [self _jsfunc_createAttribute:_args]; } - (id)_jsfunc_createEntityReference:(NSArray *)_args { unsigned count; if ((count = [_args count]) == 0) return nil; return [self createEntityReference:[[_args objectAtIndex:0] stringValue]]; } @end /* NGDOMDocument(JSSupport) */ @implementation NGDOMNode(JSSupport) - (NSString *)_jsprop_nodeName { return [self nodeName]; } - (NSString *)_jsprop_nodeValue { return [self nodeValue]; } - (NSNumber *)_jsprop_nodeType { return [NSNumber numberWithShort:[self nodeType]]; } - (NSString *)_jsprop_namespaceURI { return [self namespaceURI]; } - (NSString *)_jsprop_prefix { return [self prefix]; } - (NSString *)_jsprop_localName { return [self localName]; } - (id)_jsfunc_getParentNode:(NSArray *)_args { return [self parentNode]; } - (id)_jsfunc_getChildNodes:(NSArray *)_args { return [self childNodes]; } - (id)_jsfunc_getFirstChild:(NSArray *)_args { return [self firstChild]; } - (id)_jsfunc_getLastChild:(NSArray *)_args { return [self lastChild]; } - (id)_jsfunc_getPreviousSibling:(NSArray *)_args { return [self previousSibling]; } - (id)_jsfunc_getNextSibling:(NSArray *)_args { return [self nextSibling]; } - (id)_jsfunc_getAttributes:(NSArray *)_args { return [self attributes]; } - (id)_jsfunc_getOwnerDocument:(NSArray *)_args { return [self ownerDocument]; } - (NSNumber *)_jsfunc_hasChildNodes:(NSArray *)_args { return [NSNumber numberWithBool:[self hasChildNodes]]; } - (id)_jsfunc_normalize:(NSArray *)_args { return nil; } - (id)_jsfunc_appendChild:(NSArray *)_args { unsigned i, count; id last = nil; for (i = 0, count = [_args count]; i < count; i++) last = [self appendChild:[_args objectAtIndex:i]]; return last; } - (id)_jsfunc_removeChild:(NSArray *)_args { unsigned i, count; id last = nil; for (i = 0, count = [_args count]; i < count; i++) last = [self removeChild:[_args objectAtIndex:i]]; return last; } // #warning some JS DOMNode API missing @end /* NGDOMNode(JSSupport) */ @implementation NGDOMCharacterData(JSSupport) - (void)_jsprop_data:(NSString *)_data { _data = [_data stringValue]; [self setData:_data]; } - (NSString *)_jsprop_data { return [self data]; } - (NSNumber *)_jsprop_length { return [NSNumber numberWithInt:[self length]]; } - (NSString *)_jsfunc_substringData:(NSArray *)_args { unsigned count; if ((count = [_args count]) < 2) return nil; return [self substringData:[[_args objectAtIndex:0] intValue] count:[[_args objectAtIndex:1] intValue]]; } - (id)_jsfunc_appendData:(NSArray *)_args { unsigned i, count; for (i = 0, count = [_args count]; i < count; i++) [self appendData:[[_args objectAtIndex:i] stringValue]]; return self; } - (id)_jsfunc_insertData:(NSArray *)_args { unsigned count; if ((count = [_args count]) == 0) return nil; if (count == 1) [self insertData:[[_args objectAtIndex:0] stringValue] offset:0]; else { [self insertData:[[_args objectAtIndex:0] stringValue] offset:[[_args objectAtIndex:1] intValue]]; } return self; } - (id)_jsfunc_deleteData:(NSArray *)_args { unsigned count; if ((count = [_args count]) < 2) return nil; [self deleteData:[[_args objectAtIndex:0] intValue] count:[[_args objectAtIndex:1] intValue]]; return self; } - (id)_jsfunc_replaceData:(NSArray *)_args { unsigned count; if ((count = [_args count]) < 3) return nil; [self replaceData:[[_args objectAtIndex:0] intValue] count:[[_args objectAtIndex:1] intValue] with:[[_args objectAtIndex:2] stringValue]]; return self; } @end /* NGDOMCharacterData(JSSupport) */ @implementation NGDOMAttribute(JSSupport) - (NSString *)_jsprop_name { return [self name]; } - (NSNumber *)_jsprop_specified { return [NSNumber numberWithBool:[self specified]]; } - (void)_jsprop_value:(NSString *)_value { [self setValue:[_value stringValue]]; } - (NSString *)_jsprop_value { return [self value]; } - (id)_jsfunc_getOwnerElement:(NSArray *)_args { return [self ownerElement]; } @end /* NGDOMAttribute(JSSupport) */ @implementation NGDOMElement(JSSupport) - (NSString *)_jsprop_tagName { return [self tagName]; } /* attributes */ - (NSString *)_jsfunc_getAttribute:(NSArray *)_args { unsigned count; if ((count = [_args count]) == 0) return nil; return [self attribute:[[_args objectAtIndex:0] stringValue]]; } - (NSString *)_jsfunc_getAttributeNS:(NSArray *)_args { unsigned count; if ((count = [_args count]) == 0) return nil; return [self attribute:[[_args objectAtIndex:1] stringValue] namespaceURI:[[_args objectAtIndex:0] stringValue]]; } - (id)_jsfunc_setAttribute:(NSArray *)_args { unsigned count; if ((count = [_args count]) < 2) return nil; [self setAttribute:[[_args objectAtIndex:0] stringValue] value:[[_args objectAtIndex:1] stringValue]]; return self; } - (id)_jsfunc_setAttributeNS:(NSArray *)_args { unsigned count; if ((count = [_args count]) < 3) return nil; [self setAttribute:[[_args objectAtIndex:1] stringValue] namespaceURI:[[_args objectAtIndex:0] stringValue] value:[[_args objectAtIndex:2] stringValue]]; return self; } - (id)_jsfunc_removeAttribute:(NSArray *)_args { unsigned i, count; for (i = 0, count = [_args count]; i < count; i++) [self removeAttribute:[[_args objectAtIndex:i] stringValue]]; return self; } - (id)_jsfunc_removeAttributeNS:(NSArray *)_args { unsigned count; if ((count = [_args count]) < 2) return nil; [self removeAttribute:[[_args objectAtIndex:1] stringValue] namespaceURI:[[_args objectAtIndex:0] stringValue]]; return self; } - (id)_jsfunc_getAttributeNode:(NSArray *)_args { unsigned count; if ((count = [_args count]) == 0) return nil; return [[self attributes] namedItem:[[_args objectAtIndex:0] stringValue]]; } - (id)_jsfunc_setAttributeNode:(NSArray *)_args { unsigned i, count; id last = nil; for (i = 0, count = [_args count]; i < count; i++) last = [self setAttributeNode:[_args objectAtIndex:i]]; return last; } - (id)_jsfunc_removeAttributeNode:(NSArray *)_args { unsigned i, count; id last = nil; for (i = 0, count = [_args count]; i < count; i++) last = [self removeAttributeNode:[_args objectAtIndex:i]]; return last; } /* lookup */ - (id)_jsfunc_getElementsByTagName:(NSArray *)_args { unsigned count; if ((count = [_args count]) < 1) return nil; if (count == 1) return [self getElementsByTagName:[[_args objectAtIndex:0] stringValue]]; else { return [self getElementsByTagName:[[_args objectAtIndex:1] stringValue] namespaceURI:[[_args objectAtIndex:0] stringValue]]; } } - (id)_jsfunc_getElementsByTagNameNS:(NSArray *)_args { unsigned count; if ((count = [_args count]) < 2) return nil; return [self getElementsByTagName:[[_args objectAtIndex:1] stringValue] namespaceURI:[[_args objectAtIndex:0] stringValue]]; } @end /* NGDOMElement(JSSupport) */ @implementation NGDOMDocumentType(JSSupport) - (NSString *)_jsprop_name { return [self name]; } - (NSString *)_jsprop_publicId { return [self publicId]; } - (NSString *)_jsprop_systemId { return [self systemId]; } - (NSString *)_jsprop_internalSubset { return [self internalSubset]; } @end /* NGDOMDocumentType(JSSupport) */ @implementation NGDOMProcessingInstruction(JSSupport) - (NSString *)_jsprop_target { return [self target]; } - (void)_jsprop_data:(NSString *)_data { [self setData:[_data stringValue]]; } - (NSString *)_jsprop_data { return [self data]; } @end /* NGDOMProcessingInstruction(JSSupport) */ SOPE/sope-xml/DOM/GNUmakefile0000644000000000000000000000412712242733417014570 0ustar rootroot# GNUstep makefile include ../../config.make include ../common.make ifneq ($(frameworks),yes) LIBRARY_NAME = libDOM else FRAMEWORK_NAME = DOM DOM_RESOURCE_FILES += Version endif libDOM_PCH_FILE = common.h DOM_PCH_FILE = common.h LDOM_HEADER_FILES += \ DOM.h \ DOMProtocols.h \ DOMAttribute.h \ DOMCDATASection.h \ DOMCharacterData.h \ DOMComment.h \ DOMDocument.h \ DOMDocumentFragment.h \ DOMDocumentType.h \ DOMElement.h \ DOMEntity.h \ DOMEntityReference.h \ DOMImplementation.h \ DOMNode.h \ DOMNotation.h \ DOMProcessingInstruction.h \ DOMBuilder.h \ DOMBuilderFactory.h \ EDOM_HEADER_FILES += \ EDOM.h \ DOMNode+Enum.h \ DOMNode+QueryPath.h \ DOMQueryPathExpression.h \ libDOM_HEADER_FILES = \ $(LDOM_HEADER_FILES) \ $(EDOM_HEADER_FILES) \ DOMSaxBuilder.h \ DOMSaxHandler.h \ DOMText.h \ DOMXMLOutputter.h \ DOMPYXOutputter.h \ DOMNodeWalker.h \ DOMNamedNodeMap.h \ DOM_CORE_OBJC_FILES = \ NSObject+StringValue.m \ DOMAttribute.m \ DOMCDATASection.m \ DOMCharacterData.m \ DOMComment.m \ DOMDocument.m \ DOMElement.m \ DOMEntity.m \ DOMEntityReference.m \ DOMImplementation.m \ DOMNode.m \ DOMNodeWithChildren.m \ DOMNotation.m \ DOMProcessingInstruction.m \ DOMText.m \ DOMDocument+factory.m \ DOMDocumentType.m \ DOM+JS.m \ DOMBuilderFactory.m \ EDOM_OBJC_FILES = \ DOMNode+Enum.m \ DOMNode+QueryPath.m \ DOMQueryPathExpression.m \ NSObject+QPEval.m \ DOMNode+QPEval.m \ DOM_TRAVERSAL_OBJC_FILES = \ DOMTreeWalker.m \ DOMNodeFilter.m \ DOMNodeIterator.m \ libDOM_OBJC_FILES = \ DOMSaxBuilder.m \ DOMSaxHandler.m \ DOMXMLOutputter.m \ DOMPYXOutputter.m \ DOMNodeWalker.m \ NSObject+DOM.m \ $(EDOM_OBJC_FILES) \ $(DOM_CORE_OBJC_FILES) \ $(DOM_TRAVERSAL_OBJC_FILES) \ # building -include GNUmakefile.preamble ifneq ($(FHS_INSTALL_ROOT),) GNUSTEP_HEADERS=$(DESTDIR)$(FHS_INSTALL_ROOT)/include endif ifneq ($(frameworks),yes) include $(GNUSTEP_MAKEFILES)/library.make else include $(GNUSTEP_MAKEFILES)/framework.make endif -include GNUmakefile.postamble SOPE/sope-xml/DOM/NSObject+QPEval.h0000644000000000000000000000212712242733417015460 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NSObject_QPEval_H__ #define __NSObject_QPEval_H__ #import #import @class NSArray; @interface NSObject(QPEval) - (NSArray *)evaluateQueryPath:(NSString *)_pc; @end @interface NSString(QP) - (NSArray *)queryPathComponents; @end #endif /* __NSObject_QPEval_H__ */ SOPE/sope-xml/DOM/DOMCDATASection.m0000644000000000000000000000233512242733417015374 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "DOMCDATASection.h" @implementation NGDOMCDATASection /* node */ - (DOMNodeType)nodeType { return DOM_CDATA_SECTION_NODE; } - (BOOL)_isValidChildNode:(id)_node { return NO; } - (BOOL)hasChildNodes { return NO; } - (id)childNodes { return nil; } - (id)appendChild:(id)_node { return nil; } - (id)attributes { return nil; } @end /* NGDOMCDATASection */ SOPE/sope-xml/DOM/DOMEntityReference.h0000644000000000000000000000227612242733417016325 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DOMEntityReference_H__ #define __DOMEntityReference_H__ #include @class NSString; @interface NGDOMEntityReference : NGDOMNodeWithChildren { id parent; NSString *name; } /* attributes */ /* node */ @end @interface NGDOMEntityReference(PrivateCtors) /* use DOMDocument for constructing DOMEntityReference's ! */ - (id)initWithName:(NSString *)_name; @end #endif /* __DOMEntityReference_H__ */ SOPE/sope-xml/DOM/NSObject+QPEval.m0000644000000000000000000001352012242733417015464 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NSObject+QPEval.h" #include "common.h" @interface NSObject(QPEvalPrivates) - (NSArray *)evaluateQueryPathComponent:(NSString *)_pc inContext:(id)_ctx; - (NSArray *)evaluateQueryPathComponents:(NSArray *)_pcs; - (void)takeValue:(id)_value forQueryPath:(NSString *)_qp; - (id)valueForQueryPath:(NSString *)_qp; - (NSException *)setQueryPathValue:(id)_value; - (id)queryPathValue; @end /* NSObject(QPEval) */ @implementation NSString(QP) - (NSArray *)queryPathComponents { NSMutableArray *pc; unsigned i, len, s; if ([self rangeOfString:@"/"].length == 0) return [NSArray arrayWithObject:self]; if ([self isEqualToString:@"/"]) return [NSArray arrayWithObject:self]; pc = [NSMutableArray arrayWithCapacity:8]; len = [self length]; i = 0; /* add root, if absolute path */ if ([self characterAtIndex:0] == '/') { i++; [pc addObject:@"/"]; } for (s = i; i < len; i++) { if ([self characterAtIndex:i] == '/') { unsigned plen; NSString *p; plen = (i - s); p = [self substringWithRange:NSMakeRange(s, plen)]; [pc addObject:p]; s = (i + 1); /* next component begins at idx right after '/' .. */ } else if ([self characterAtIndex:i] == '{') { unsigned j; for (j = (i + 1); j < len; j++) { if ([self characterAtIndex:j] == '}') { /* continue after closing brace .. */ i = j; break; } } } } if (s < i) { NSString *p; p = [self substringWithRange:NSMakeRange(s, (i - s))]; [pc addObject:p]; } return pc; } @end /* NSString(QP) */ @implementation NSObject(QPEval) /* special expressions */ - (id)queryPathRootObjectInContext:(id)_ctx { return self; } /* query path evaluation */ - (NSArray *)evaluateQueryPathComponent:(NSString *)_pc inContext:(id)_ctx { unsigned len; NSArray *result; result = nil; if ((len = [_pc length]) == 0) return nil; else if (len == 1) { unichar c; c = [_pc characterAtIndex:0]; if (c == '/') { id root = [self queryPathRootObjectInContext:_ctx]; result = root ? [NSArray arrayWithObject:root] : nil; } else if (c == '.') result = [NSArray arrayWithObject:self]; } else { } NSLog(@"0x%p<%@> eval QP '%@': %@", self, NSStringFromClass([self class]), _pc, result); return result; } - (NSArray *)queryPathCursorArray { return [NSArray arrayWithObject:self]; } - (NSArray *)evaluateQueryPathComponents:(NSArray *)_pcs { NSEnumerator *pcs; NSString *pc; NSAutoreleasePool *pool; NSArray *array; NSMutableDictionary *ctx; pool = [[NSAutoreleasePool alloc] init]; ctx = [NSMutableDictionary dictionaryWithCapacity:16]; NSLog(@"eval PCs: %@", _pcs); array = [self queryPathCursorArray]; pcs = [_pcs objectEnumerator]; while ((array != nil) && (pc = [pcs nextObject])) { if ((array = [array evaluateQueryPathComponent:pc inContext:ctx]) == nil) break; } array = [array retain]; [pool release]; return [array autorelease]; } - (NSArray *)evaluateQueryPath:(NSString *)_path { if ([_path rangeOfString:@"/"].length == 0) return [self evaluateQueryPathComponents:[NSArray arrayWithObject:_path]]; if ([_path isEqualToString:@"/"]) { static NSArray *rootElem = nil; if (rootElem == nil) rootElem = [NSArray arrayWithObject:@"/"]; return [self evaluateQueryPathComponents:rootElem]; } return [self evaluateQueryPathComponents:[_path queryPathComponents]]; } /* query KVC */ - (NSException *)setQueryPathValue:(id)_value { if (_value == self) return nil; return [NSException exceptionWithName:@"QueryPathEvalException" reason:@"cannot set query-path value on object" userInfo:nil]; } - (id)queryPathValue { return self; } - (void)takeValue:(id)_value forQueryPath:(NSString *)_qp { [[[self evaluateQueryPath:_qp] setQueryPathValue:_value] raise]; } - (id)valueForQueryPath:(NSString *)_qp { return [[self evaluateQueryPath:_qp] queryPathValue]; } @end /* NSObject(QPEval) */ @implementation NSArray(QPEval) - (NSArray *)queryPathCursorArray { return self; } - (NSArray *)evaluateQueryPathComponent:(NSString *)_pc inContext:(id)_ctx { unsigned i, j, count; NSArray *array; id *objs; if ((count = [self count]) == 0) return [NSArray array]; objs = calloc(count + 1, sizeof(id)); for (i = 0, j = 0; i < count; i++) { id obj; obj = [self objectAtIndex:i]; obj = [obj evaluateQueryPathComponent:_pc inContext:_ctx]; if (obj) { objs[j] = obj; j++; } } array = [NSArray arrayWithObjects:objs count:j]; if (objs) free(objs); return array; } @end /* NSArray(QPEval) */ @implementation NSSet(QPEval) - (NSArray *)evaluateQueryPathComponent:(NSString *)_pc inContext:(id)_ctx { return [[self allObjects] evaluateQueryPathComponent:_pc inContext:(id)_ctx]; } - (NSArray *)evaluateQueryPathComponents:(NSArray *)_pcs { return [[self allObjects] evaluateQueryPathComponents:_pcs]; } @end /* NSSet(QPEval) */ SOPE/sope-xml/DOM/DOMPYXOutputter.h0000644000000000000000000000177112242733417015645 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DOMPYXOutputter_H__ #define __DOMPYXOutputter_H__ #import @interface NGDOMPYXOutputter : NSObject { } - (void)outputDocument:(id)_document to:(id)_target; @end #endif /* __DOMPYXOutputter_H__ */ SOPE/sope-xml/DOM/DOMTreeWalker.m0000644000000000000000000001614512242733417015304 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include "common.h" @implementation NGDOMTreeWalker - (id)initWithRootNode:(id)_rootNode whatToShow:(unsigned long)_whatToShow filter:(id)_filter expandEntityReferences:(BOOL)_flag { NSAssert(_rootNode, @"missing root-node !"); if ((self = [super init])) { self->root = [_rootNode retain]; self->whatToShow = _whatToShow; self->filter = [_filter retain]; self->expandEntityReferences = _flag; [self setCurrentNode:_rootNode]; } return self; } - (void)dealloc { [self->visibleChildren release]; [self->currentNode release]; [self->root release]; [self->filter release]; [super dealloc]; } /* attributes */ - (id)root { return self->root; } - (unsigned long)whatToShow { return self->whatToShow; } - (id)filter { return self->filter; } - (BOOL)expandEntityReferences { return self->expandEntityReferences; } - (void)setCurrentNode:(id)_node { if (_node == self->currentNode) /* same node */ return; ASSIGN(self->currentNode, _node); /* clear state caches */ [self->visibleChildren release]; self->visibleChildren = nil; } - (id)currentNode { return self->currentNode; } /* internals */ - (BOOL)_shouldShowNode:(id)_node { if (self->whatToShow == DOM_SHOW_ALL) return YES; switch([_node nodeType]) { case DOM_ATTRIBUTE_NODE: return (self->whatToShow & DOM_SHOW_ATTRIBUTE) != 0 ? YES : NO; case DOM_CDATA_SECTION_NODE: return (self->whatToShow & DOM_SHOW_CDATA_SECTION) != 0 ? YES : NO; case DOM_COMMENT_NODE: return (self->whatToShow & DOM_SHOW_COMMENT) != 0 ? YES : NO; case DOM_DOCUMENT_NODE: return (self->whatToShow & DOM_SHOW_DOCUMENT) != 0 ? YES : NO; case DOM_DOCUMENT_FRAGMENT_NODE: return (self->whatToShow & DOM_SHOW_DOCUMENT_FRAGMENT) != 0 ? YES : NO; case DOM_ELEMENT_NODE: return (self->whatToShow & DOM_SHOW_ELEMENT) != 0 ? YES : NO; case DOM_PROCESSING_INSTRUCTION_NODE: return (self->whatToShow & DOM_SHOW_PROCESSING_INSTRUCTION) != 0 ? YES:NO; case DOM_TEXT_NODE: return (self->whatToShow & DOM_SHOW_TEXT) != 0 ? YES : NO; case DOM_DOCUMENT_TYPE_NODE: return (self->whatToShow & DOM_SHOW_DOCUMENT_TYPE) != 0 ? YES : NO; case DOM_ENTITY_NODE: return (self->whatToShow & DOM_SHOW_ENTITY) != 0 ? YES : NO; case DOM_ENTITY_REFERENCE_NODE: return (self->whatToShow & DOM_SHOW_ENTITY_REFERENCE) != 0 ? YES : NO; case DOM_NOTATION_NODE: return (self->whatToShow & DOM_SHOW_NOTATION) != 0 ? YES : NO; default: return YES; } } - (BOOL)_isVisibleNode:(id)_node { if (![self _shouldShowNode:_node]) return NO; if (self->filter) return [self->filter acceptNode:_node] == DOM_FILTER_ACCEPT ? YES : NO; return YES; } - (unsigned short)_navTypeOfNode:(id)_node { if (![self _shouldShowNode:_node]) return DOM_FILTER_SKIP; if (self->filter) return [self->filter acceptNode:_node] == DOM_FILTER_ACCEPT ? YES : NO; return DOM_FILTER_ACCEPT; } - (NSArray *)_ensureVisibleChildren { static NSArray *emptyArray = nil; id children; unsigned count; if (self->visibleChildren) return self->visibleChildren; children = [[self currentNode] childNodes]; if ((count = [children count]) > 0) { unsigned i; NSMutableArray *ma; ma = [[NSMutableArray alloc] initWithCapacity:(count + 1)]; for (i = 0; i < count; i++) { id childNode; childNode = [children objectAtIndex:i]; if ([self _isVisibleNode:childNode]) [ma addObject:childNode]; } self->visibleChildren = [ma copy]; [ma release]; ma = nil; } else { if (emptyArray == nil) emptyArray = [[NSArray alloc] init]; self->visibleChildren = [emptyArray retain]; } return self->visibleChildren; } - (BOOL)_hasVisibleChildren { return [[self _ensureVisibleChildren] count] > 0 ? YES : NO; } - (id)_visibleChildren { return [self _ensureVisibleChildren]; } - (id)_firstVisibleChild { NSArray *a = [self _ensureVisibleChildren]; if ([a count] == 0) return nil; return [a objectAtIndex:0]; } - (id)_lastVisibleChild { NSArray *a = [self _ensureVisibleChildren]; unsigned count; if ((count = [a count]) == 0) return nil; return [a objectAtIndex:(count - 1)]; } - (id)_visibleParentNode { id node; for (node = [[self currentNode] parentNode]; node; node =[node parentNode]) { if ([self _isVisibleNode:node]) return node; if (node == [self root]) /* do not step above root */ break; } return nil; } - (id)_nextVisibleSibling { id node; for (node = [(id)[self currentNode] nextSibling]; node != nil; node = [node nextSibling]) { if ([self _isVisibleNode:node]) return node; } return nil; } - (id)_previousVisibleSibling { id node; for (node = [(id)[self currentNode] previousSibling]; node != nil; node = [node previousSibling]) { if ([self _isVisibleNode:node]) return node; } return nil; } /* operations */ - (id)parentNode { id parent; if ((parent = [self _visibleParentNode])) { [self setCurrentNode:parent]; return parent; } else return nil; } - (id)firstChild { if ([self _hasVisibleChildren]) { id child; child = [self _firstVisibleChild]; [self setCurrentNode:child]; return child; } else return nil; } - (id)lastChild { if ([self _hasVisibleChildren]) { id child; child = [self _lastVisibleChild]; [self setCurrentNode:child]; return child; } else return nil; } - (id)previousSibling { id node; if ((node = [self _previousVisibleSibling])) { [self setCurrentNode:node]; return node; } else return nil; } - (id)nextSibling { id node; if ((node = [self _nextVisibleSibling])) { [self setCurrentNode:node]; return node; } else return nil; } - (id)previousNode { [self doesNotRecognizeSelector:_cmd]; return nil; } - (id)nextNode { [self doesNotRecognizeSelector:_cmd]; return nil; } @end /* NGDOMTreeWalker */ SOPE/sope-xml/DOM/COPYING0000644000000000000000000006130312242733417013550 0ustar rootroot GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 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. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] 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 Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, 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 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 a program 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. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, 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 companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. 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, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library 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 compile 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) 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. c) 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. d) 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 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. 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 to 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 Library 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 Appendix: 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 Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library 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! SOPE/sope-xml/DOM/DOMBuilderFactory.m0000644000000000000000000000554512242733417016157 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "DOMBuilderFactory.h" #include #include #include #include "common.h" @implementation DOMBuilderFactory static id factory = nil; + (id)standardDOMBuilderFactory { if (factory == nil) factory = [[self alloc] init]; return factory; } /* primary method */ - (id)createDOMBuilderWithXmlReader:(id)_r { DOMSaxBuilder *builder; if (_r == nil) return nil; builder = [[DOMSaxBuilder alloc] initWithXMLReader:_r]; return [builder autorelease]; } /* reader constructors */ - (SaxXMLReaderFactory *)readerFactory { return [SaxXMLReaderFactory standardXMLReaderFactory]; } - (id)createDOMBuilder { id reader; if ((reader = [[self readerFactory] createXMLReader]) == nil) { NSLog(@"%s:%i: could not create default DOM builder " @"because no SAX default reader could be constructed.", __PRETTY_FUNCTION__, __LINE__); return nil; } return [self createDOMBuilderWithXmlReader:reader]; } - (id)createDOMBuilderWithName:(NSString *)_name { id reader; if ((reader = [[self readerFactory] createXMLReaderWithName:_name]) == nil) { NSLog(@"%s:%i: could not create DOM builder '%@' " @"because no SAX reader named '%@' could be constructed.", __PRETTY_FUNCTION__, __LINE__, _name, _name); return nil; } return [self createDOMBuilderWithXmlReader:reader]; } - (id)createDOMBuilderForMimeType:(NSString *)_mtype { id reader; reader = [[self readerFactory] createXMLReaderForMimeType:_mtype]; if (reader == nil) { NSLog(@"%s:%i: could not create DOM builder for MIME type '%@' " @"because no SAX proper reader could be constructed.", __PRETTY_FUNCTION__, __LINE__, _mtype); return nil; } return [self createDOMBuilderWithXmlReader:reader]; } - (NSArray *)availableDOMBuilders { return [NSArray arrayWithObject:@"DOMSaxBuilder"]; } @end /* DOMBuilderFactory */ SOPE/sope-xml/DOM/DOMBuilderFactory.h0000644000000000000000000000303712242733417016144 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DOMBuilderFactory_H__ #define __DOMBuilderFactory_H__ #import #include /* To get a reader for HTML files: reader = [factory createDOMBuilderForMimeType:@"text/html"]; for XML files: reader = [factory createDOMBuilderForMimeType:@"text/xml"]; a specific reader: reader = [factory createDOMBuilderWithName:@"libxmlSAXDriver"]; */ @class NSDictionary; @interface DOMBuilderFactory : NSObject { } + (id)standardDOMBuilderFactory; - (id)createDOMBuilder; - (id)createDOMBuilderWithName:(NSString *)_name; - (id)createDOMBuilderForMimeType:(NSString *)_mtype; - (NSArray *)availableDOMBuilders; @end #endif /* __DOMBuilderFactory_H__ */ SOPE/sope-xml/DOM/DOMNodeFilter.h0000644000000000000000000000341212242733417015256 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DOMNodeFilter_H__ #define __DOMNodeFilter_H__ #import typedef enum { DOM_FILTER_ACCEPT = 1, DOM_FILTER_REJECT = 2, DOM_FILTER_SKIP = 3 } DOMNodeFilterType; /* constants for whatToShow */ #define DOM_SHOW_ALL 0xFFFFFFFF #define DOM_SHOW_ELEMENT 0x00000001 #define DOM_SHOW_ATTRIBUTE 0x00000002 #define DOM_SHOW_TEXT 0x00000004 #define DOM_SHOW_CDATA_SECTION 0x00000008 #define DOM_SHOW_ENTITY_REFERENCE 0x00000010 #define DOM_SHOW_ENTITY 0x00000020 #define DOM_SHOW_PROCESSING_INSTRUCTION 0x00000040 #define DOM_SHOW_COMMENT 0x00000080 #define DOM_SHOW_DOCUMENT 0x00000100 #define DOM_SHOW_DOCUMENT_TYPE 0x00000200 #define DOM_SHOW_DOCUMENT_FRAGMENT 0x00000400 #define DOM_SHOW_NOTATION 0x00000800 @interface NGDOMNodeFilter : NSObject - (DOMNodeFilterType)acceptNode:(id)_node; @end #endif /* __DOMNodeFilter_H__ */ SOPE/sope-xml/DOM/DOMDocument.m0000644000000000000000000002213212242733417015006 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include "DOMSaxBuilder.h" #include "DOMNode+QueryPath.h" #include "common.h" //#define PROF_DEALLOC 1 @implementation NGDOMDocument + (id)documentFromData:(NSData *)_data { id builder; builder = [[[DOMSaxBuilder alloc] init] autorelease]; return [builder buildFromData:_data]; } + (id)documentFromString:(NSString *)_string { return [self documentFromData: [_string dataUsingEncoding:NSISOLatin1StringEncoding]]; } + (id)documentFromURI:(NSString *)_uri { id builder; builder = [[[DOMSaxBuilder alloc] init] autorelease]; return [builder buildFromContentsOfFile:_uri]; } - (id)initWithName:(NSString *)_qname namespaceURI:(NSString *)_uri documentType:(id)_doctype dom:(NGDOMImplementation *)_dom { self->dom = [_dom retain]; self->qname = [_qname copy]; self->uri = [_uri copy]; self->doctype = [_doctype retain]; return self; } - (void)dealloc { #if PROF_DEALLOC NSDate *start = [NSDate date]; #endif [self->errors release]; [self->warnings release]; [self->dom release]; [self->qname release]; [self->uri release]; [self->doctype release]; [super dealloc]; #if PROF_DEALLOC printf("%s: %.3fs\n", __PRETTY_FUNCTION__, [NSDate timeIntervalSinceDate:start]); #endif } /* errors/warnings */ - (void)addErrors:(NSArray *)_errors { if (self->errors == nil) self->errors = [_errors copy]; else { NSArray *tmp; tmp = self->errors; self->errors = [[tmp arrayByAddingObjectsFromArray:_errors] copy]; [tmp release]; } } - (void)addWarnings:(NSArray *)_errors { if (self->warnings == nil) self->warnings = [_errors copy]; else { NSArray *tmp; tmp = self->warnings; self->warnings = [[tmp arrayByAddingObjectsFromArray:_errors] copy]; [tmp release]; } } /* attributes */ - (id)doctype { return self->doctype; } - (NGDOMImplementation *)implementation { return self->dom; } - (id)documentElement { id children; unsigned i, count; if ((children = [self childNodes]) == nil) return nil; for (i = 0, count = [children count]; i < count; i++) { id node; node = [children objectAtIndex:i]; if ([node nodeType] == DOM_ELEMENT_NODE) return node; } return nil; } /* node */ - (BOOL)_isValidChildNode:(id)_node { switch ([_node nodeType]) { case DOM_ELEMENT_NODE: case DOM_PROCESSING_INSTRUCTION_NODE: case DOM_COMMENT_NODE: case DOM_DOCUMENT_TYPE_NODE: return YES; default: return NO; } } - (DOMNodeType)nodeType { return DOM_DOCUMENT_NODE; } - (id)attributes { return nil; } - (IDOMDocument)ownerDocument { return nil; } - (id)parentNode { /* document cannot be nested */ return nil; } - (id)nextSibling { /* document cannot be nested */ return nil; } - (id)previousSibling { /* document cannot be nested */ return nil; } - (void)_walk_getElementsByTagName:(id)_walker { id node; node = [_walker currentNode]; if ([node nodeType] != DOM_ELEMENT_NODE) return; if (![[node tagName] isEqualToString: [(NSArray *)[_walker context] objectAtIndex:0]]) /* tagname doesn't match */ return; [[(NSArray *)[_walker context] objectAtIndex:1] addObject:node]; } - (void)_walk_getElementsByTagNameAddAll:(id)_walker { id node; node = [_walker currentNode]; if ([node nodeType] != DOM_ELEMENT_NODE) return; [(NSMutableArray *)[_walker context] addObject:node]; } - (id)getElementsByTagName:(NSString *)_tagName { /* introduced in DOM2, should return a *live* list ! */ NSMutableArray *array; NGDOMNodePreorderWalker *walker; SEL sel; id ctx; if (![self hasChildNodes]) return nil; if (_tagName == nil) return nil; array = [NSMutableArray arrayWithCapacity:4]; if ([_tagName isEqualToString:@"*"]) { _tagName = nil; ctx = array; sel = @selector(_walk_getElementsByTagNameAddAll:); } else { ctx = [NSArray arrayWithObjects:_tagName, array, nil]; sel = @selector(_walk_getElementsByTagName:); } walker = [[NGDOMNodePreorderWalker alloc] initWithTarget:self selector:sel context:ctx]; [walker walkNode:self]; [walker release]; walker = nil; return [[array copy] autorelease]; } - (id)getElementsByTagName:(NSString *)_tagName namespaceURI:(NSString *)_uri { [self doesNotRecognizeSelector:_cmd]; return nil; } - (id)getElementById:(NSString *)_eid { /* Introduced in DOM2 Note: The DOM implementation must have information that says which attributes are of type ID. Attributes with the name "ID" are not of type ID unless so defined. Implementations that do not know whether attributes are of type ID or not are expected to return null. */ return nil; } /* factory */ - (Class)domElementClass { return [self->dom domElementClass]; } - (Class)domElementNSClass { return [self->dom domElementNSClass]; } - (Class)domDocumentFragmentClass { return [self->dom domDocumentFragmentClass]; } - (Class)domTextNodeClass { return [self->dom domTextNodeClass]; } - (Class)domCommentClass { return [self->dom domCommentClass]; } - (Class)domCDATAClass { return [self->dom domCDATAClass]; } - (Class)domProcessingInstructionClass { return [self->dom domProcessingInstructionClass]; } - (Class)domAttributeClass { return [self->dom domAttributeClass]; } - (Class)domAttributeNSClass { return [self->dom domAttributeNSClass]; } - (Class)domEntityReferenceClass { return [self->dom domEntityReferenceClass]; } - (id)createElement:(NSString *)_tagName { id elem; elem = [[[self domElementClass] alloc] initWithTagName:_tagName]; return [elem autorelease]; } - (id)createElement:(NSString *)_tagName namespaceURI:(NSString *)_uri { id elem; elem = [[[self domElementNSClass] alloc] initWithTagName:_tagName namespaceURI:_uri]; return [elem autorelease]; } - (id)createDocumentFragment { id elem; elem = [[[self domDocumentFragmentClass] alloc] init]; return [elem autorelease]; } - (id)createTextNode:(NSString *)_data { id elem; elem = [[[self domTextNodeClass] alloc] initWithString:_data]; return [elem autorelease]; } - (id)createComment:(NSString *)_data { id elem; elem = [[[self domCommentClass] alloc] initWithString:_data]; return [elem autorelease]; } - (id)createCDATASection:(NSString *)_data { id elem; elem = [[[self domCDATAClass] alloc] initWithString:_data]; return [elem autorelease]; } - (id)createProcessingInstruction: (NSString *)_target data:(NSString *)_data { id elem; elem = [[[self domProcessingInstructionClass] alloc] initWithTarget:_target data:_data]; return [elem autorelease]; } - (id)createAttribute:(NSString *)_name { id elem; elem = [[[self domAttributeClass] alloc] initWithName:_name]; return [elem autorelease]; } - (id)createAttribute:(NSString *)_name namespaceURI:(NSString *)_uri { id elem; elem = [[[self domAttributeNSClass] alloc] initWithName:_name namespaceURI:_uri]; return [elem autorelease]; } - (id)createEntityReference:(NSString *)_name { id elem; elem = [[[self domEntityReferenceClass] alloc] initWithName:_name]; return [elem autorelease]; } /* QPValues */ - (NSException *)setQueryPathValue:(id)_value { return [NSException exceptionWithName:@"QueryPathEvalException" reason:@"cannot set query-path value on DOMDocument !" userInfo:nil]; } - (id)queryPathValue { return [self documentElement]; } /* Key/Value Coding */ - (id)valueForKey:(NSString *)_key { if ([_key hasPrefix:@"/"]) return [self lookupQueryPath:_key]; return [super valueForKey:_key]; } @end /* NGDOMDocument */ SOPE/sope-xml/DOM/DOMProcessingInstruction.h0000644000000000000000000000253012242733417017601 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DOMProcessingInstruction_H__ #define __DOMProcessingInstruction_H__ #include @class NSString; @interface NGDOMProcessingInstruction : NGDOMNode { id parent; NSString *target; NSString *data; } /* attributes */ - (NSString *)target; - (void)setData:(NSString *)_data; - (NSString *)data; /* node */ @end @interface NGDOMProcessingInstruction(PrivateCtors) /* use DOMDocument for constructing DOMProcessingInstructions ! */ - (id)initWithTarget:(NSString *)_target data:(NSString *)_data; @end #endif /* __DOMProcessingInstruction_H__ */ SOPE/sope-xml/DOM/DOMNodeWalker.h0000644000000000000000000000263112242733417015260 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DOMNodeWalker_H__ #define __DOMNodeWalker_H__ #import @interface NGDOMNodeWalker : NSObject { id target; SEL selector; id ctx; BOOL isStopped; id rootNode; id currentParentNode; id currentNode; } - (id)initWithTarget:(id)_target selector:(SEL)_selector context:(id)_ctx; /* context */ - (id)context; - (id)rootNode; - (id)currentParentNode; - (id)currentNode; /* walking */ - (void)walkNode:(id)_node; - (void)stopWalking; @end @interface NGDOMNodePreorderWalker : NGDOMNodeWalker @end @interface NGDOMNodePostorderWalker : NGDOMNodeWalker @end #endif /* __DOMNodeWalker_H__ */ SOPE/sope-xml/DOM/DOMDocumentType.m0000644000000000000000000000354312242733417015655 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "DOMDocumentType.h" #include "common.h" @implementation NGDOMDocumentType - (id)initWithName:(NSString *)_name publicId:(NSString *)_pubId systemId:(NSString *)_sysId dom:(id)_dom { [self release]; return nil; } /* attributes */ - (NSString *)name { return nil; } - (id)entities { return nil; } - (id)notations { return nil; } - (NSString *)publicId { return nil; } - (NSString *)systemId { return nil; } - (NSString *)internalSubset { return nil; } /* node */ - (DOMNodeType)nodeType { return DOM_DOCUMENT_TYPE_NODE; } - (BOOL)_isValidChildNode:(id)_node { return NO; } - (BOOL)hasChildNodes { return NO; } - (id)childNodes { return nil; } - (id)attributes { return nil; } /* parent node */ - (void)_domNodeRegisterParentNode:(id)_parent { self->parent = _parent; } - (void)_domNodeForgetParentNode:(id)_parent { if (_parent == self->parent) /* the node's parent was deallocated */ self->parent = nil; } - (id)parentNode { return self->parent; } @end /* NGDOMDocumentType */ SOPE/sope-xml/DOM/DOMElement.h0000644000000000000000000000404212242733417014614 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DOMElement_H__ #define __DOMElement_H__ #include /* Why is there no removeAttributeNodeNS method? There is, but it's called removeAttributeNode. We needed both setAttributeNode and setAttributeNodeNS, because those functions use different rules to select which (if any) existing Attr the new one will replace. setAttributeNode bases this decision on the nodeName, while setAttributeNodeNS looks at the combination of namespaceURI and localname. However, when you remove a specific Attr Node, its nodeName, localname, and namespaceURI are ignored, and there's no need for a second method to support this. */ @class NSString, NSMutableDictionary, NSMutableArray; @interface NGDOMElement : NGDOMNodeWithChildren < DOMElement > { id parent; NSString *tagName; NSMutableDictionary *keyToAttribute; NSMutableArray *attributes; NSString *namespaceURI; NSString *prefix; /* positional info */ unsigned line; /* caches */ id attrNodeMap; } @end @interface NGDOMElement(PrivateCtors) /* use DOMDocument for constructing DOMElements ! */ - (id)initWithTagName:(NSString *)_tagName; - (id)initWithTagName:(NSString *)_tagName namespaceURI:(NSString *)_uri; @end #endif /* __DOMElement_H__ */ SOPE/sope-xml/DOM/DOMEntity.h0000644000000000000000000000221712242733417014501 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DOMEntity_H__ #define __DOMEntity_H__ #include @class NSString; @interface NGDOMEntity : NGDOMNodeWithChildren { } /* attributes */ - (NSString *)publicId; - (NSString *)systemId; - (NSString *)notationName; /* node */ @end @interface NGDOMEntity(PrivateCtors) /* use DOMDocument for constructing DOMEntity's ! */ @end #endif /* __DOMEntity_H__ */ SOPE/sope-xml/DOM/DOMNode+QPEval.m0000644000000000000000000000220412242733417015237 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NSObject+QPEval.h" #include "DOMNode.h" #include "DOMDocument.h" #include "common.h" @implementation NGDOMNode(QPEval) - (id)queryPathRootObjectInContext:(id)_ctx { return [self ownerDocument]; } @end /* NGDOMNode(QPEval) */ @implementation NGDOMDocument(QPEval) - (id)queryPathRootObjectInContext:(id)_ctx { return self; } @end /* NGDOMNode(QPEval) */ SOPE/sope-xml/DOM/DOMSaxBuilder.m0000644000000000000000000001055312242733417015276 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "DOMSaxBuilder.h" #include "DOMSaxHandler.h" #include "DOMAttribute.h" #include "DOMDocument.h" #include "common.h" #include @implementation DOMSaxBuilder - (id)initWithXMLReader:(id)_saxParser { if (_saxParser == nil) { [self release]; return nil; } ASSIGN(self->parser, _saxParser); self->sax = [[DOMSaxHandler alloc] init]; [self->parser setContentHandler:self->sax]; [self->parser setDTDHandler:self->sax]; [self->parser setErrorHandler:self->sax]; [self->parser setProperty:@"http://xml.org/sax/properties/declaration-handler" to:self->sax]; [self->parser setProperty:@"http://xml.org/sax/properties/lexical-handler" to:self->sax]; return self; } - (id)initWithXMLReaderForMimeType:(id)_mimeType { id reader; reader = [[SaxXMLReaderFactory standardXMLReaderFactory] createXMLReaderForMimeType:_mimeType]; if (reader == nil) { NSLog(@"%s: could not find a SAX driver bundle for type '%@' !\n", __PRETTY_FUNCTION__, _mimeType); [self release]; return nil; } return [self initWithXMLReader:reader]; } - (id)init { id reader; reader = [[SaxXMLReaderFactory standardXMLReaderFactory] createXMLReader]; if (reader == nil) { NSLog(@"%s: could not load a SAX driver bundle !\n", __PRETTY_FUNCTION__); [self release]; return nil; } return [self initWithXMLReader:reader]; } - (void)dealloc { [self->parser release]; [self->sax release]; [super dealloc]; } /* DOM building */ - (id)_docAfterParsing { id doc; doc = [[self->sax document] retain]; [(id)doc addErrors:[self->sax errors]]; [(id)doc addWarnings:[self->sax warnings]]; [self->sax clear]; return [doc autorelease]; } - (id)buildFromData:(NSData *)_data { NSAutoreleasePool *pool; id doc; if (_data == nil) { NSLog(@"missing data .."); return nil; } NSAssert(self->sax, @"missing sax handler .."); NSAssert(self->parser, @"missing XML parser .."); pool = [[NSAutoreleasePool alloc] init]; { [self->parser parseFromSource:_data]; doc = [[self _docAfterParsing] retain]; } [pool release]; #if DEBUG NSAssert(self->sax, @"missing sax handler .."); NSAssert(self->parser, @"missing XML parser .."); #endif return [doc autorelease]; } - (id)buildFromContentsOfFile:(NSString *)_path { NSAutoreleasePool *pool; id doc; if ([_path length] == 0) return nil; pool = [[NSAutoreleasePool alloc] init]; { _path = [@"file://" stringByAppendingString:_path]; [self->parser parseFromSystemId:_path]; doc = [[self _docAfterParsing] retain]; } [pool release]; return [doc autorelease]; } - (id)buildFromSource:(id)_source systemId:(NSString *)_sysId { NSAutoreleasePool *pool; id doc; if (_source == nil) return nil; pool = [[NSAutoreleasePool alloc] init]; { [self->parser parseFromSource:_source systemId:_sysId]; doc = [[self _docAfterParsing] retain]; } [pool release]; return [doc autorelease]; } - (id)buildFromSource:(id)_source { return [self buildFromSource:_source systemId:nil]; } - (id)buildFromSystemId:(NSString *)_sysId { NSAutoreleasePool *pool; id doc; if ([_sysId length] == 0) return nil; pool = [[NSAutoreleasePool alloc] init]; { [self->parser parseFromSystemId:_sysId]; doc = [[self _docAfterParsing] retain]; } [pool release]; return [doc autorelease]; } @end /* DOMSaxBuilder */ SOPE/sope-xml/DOM/COPYRIGHT0000644000000000000000000000010612242733417014002 0ustar rootrootCopyright (C) 2000-2005 SKYRIX Software AG Contact: info@skyrix.com SOPE/sope-xml/DOM/DOMComment.h0000644000000000000000000000173412242733417014632 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DOMComment_H__ #define __DOMComment_H__ #include @class NSString; @interface NGDOMComment : NGDOMCharacterData < DOMComment > { } @end #endif /* __DOMComment_H__ */ SOPE/sope-xml/DOM/DOMNodeIterator.m0000644000000000000000000000372212242733417015633 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include "common.h" @implementation NGDOMNodeIterator - (id)initWithRootNode:(id)_rootNode whatToShow:(unsigned long)_whatToShow filter:(id)_filter expandEntityReferences:(BOOL)_flag { NSAssert(_rootNode, @"missing root-node !"); if ((self = [super init])) { self->root = [_rootNode retain]; self->whatToShow = _whatToShow; self->filter = [_filter retain]; self->expandEntityReferences = _flag; self->lastNode = nil; self->beforeFirst = YES; self->afterLast = NO; } return self; } - (void)dealloc { [self->lastNode release]; [self->root release]; [self->filter release]; [super dealloc]; } /* attributes */ - (id)root { return self->root; } - (unsigned long)whatToShow { return self->whatToShow; } - (id)filter { return self->filter; } - (BOOL)expandEntityReferences { return self->expandEntityReferences; } /* operations */ - (id)nextNode { [self doesNotRecognizeSelector:_cmd]; return nil; } - (id)previousNode { [self doesNotRecognizeSelector:_cmd]; return nil; } - (void)detach { } @end /* NGDOMNodeIterator */ SOPE/sope-xml/DOM/DOMSaxHandler.m0000644000000000000000000002526712242733417015275 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "DOMSaxHandler.h" #include "DOMImplementation.h" #include "DOMDocument.h" #include "DOMElement.h" #include "common.h" #include @interface NSObject(LineInfoProtocol) - (void)setLine:(int)_line; @end @implementation DOMSaxHandler static BOOL printErrors = NO; - (id)initWithDOMImplementation:(id)_domImpl { if ((self = [super init])) { self->dom = [_domImpl retain]; self->maxErrorCount = 100; // this also includes NPSOBJ in HTML ! } return self; } - (id)init { static id idom = nil; if (idom == nil) idom = [[NGDOMImplementation alloc] init]; return [self initWithDOMImplementation:idom]; } - (void)dealloc { [self->document release]; [self->dom release]; [self->locator release]; [self->fatals release]; [self->errors release]; [self->warnings release]; [super dealloc]; } - (void)setDocumentLocator:(id)_loc { ASSIGN(self->locator, _loc); } - (id)document { return self->document; } - (void)clear { ASSIGN(self->document, (id)nil); [self->fatals removeAllObjects]; [self->errors removeAllObjects]; [self->warnings removeAllObjects]; self->errorCount = 0; } - (int)errorCount { return self->errorCount; } - (int)fatalErrorCount { return [self->fatals count]; } - (int)warningCount { return [self->warnings count]; } - (int)maxErrorCount { return self->maxErrorCount; } - (NSArray *)warnings { return [[self->warnings copy] autorelease]; } - (NSArray *)errors { return [[self->errors copy] autorelease]; } - (NSArray *)fatalErrors { return [[self->fatals copy] autorelease]; } /* attributes */ - (id)_nodeForSaxAttrWithName:(NSString *)_name namespace:(NSString *)_uri rawName:(NSString *)_rawName type:(NSString *)_saxType value:(NSString *)_saxValue { id attr; NSString *nsPrefix; attr = [self->document createAttribute:_name namespaceURI:_uri]; if (attr == nil) return nil; nsPrefix = nil; if (_uri) { NSRange r; r = [_rawName rangeOfString:@":"]; if (r.length > 0) nsPrefix = [_rawName substringToIndex:r.location]; } if (nsPrefix) [attr setPrefix:nsPrefix]; /* add content to attribute */ if ([_saxType isEqualToString:@"CDATA"] || (_saxType == nil)) { id content; NSAssert(self->document, @"missing document object"); if ((content = [self->document createTextNode:_saxValue])) [attr appendChild:content]; else NSLog(@"couldn't create text node !"); } else NSLog(@"unsupported sax attr type '%@' !", _saxType); return attr; } /* document */ - (void)startDocument { id docType; [self->document release]; self->document = nil; self->errorCount = 0; self->tagDepth = 0; docType = [self->dom createDocumentType:nil publicId:[self->locator publicId] systemId:[self->locator systemId]]; self->document = [self->dom createDocumentWithName:nil namespaceURI:nil documentType:docType]; self->document = [self->document retain]; //NSLog(@"started doc: %@", self->document); self->currentElement = self->document; } - (void)endDocument { self->currentElement = nil; } - (void)startPrefixMapping:(NSString *)_prefix uri:(NSString *)_uri { //printf("ns-map: %s=%s\n", [_prefix cString], [_uri cString]); } - (void)endPrefixMapping:(NSString *)_prefix { //printf("ns-unmap: %s\n", [_prefix cString]); } - (void)startElement:(NSString *)_localName namespace:(NSString *)_ns rawName:(NSString *)_rawName attributes:(id)_attrs { id elem; NSString *nsPrefix; self->tagDepth++; elem = [self->document createElement:_localName namespaceURI:_ns]; if (elem == nil) { NSLog(@"%s: couldn't create element for tag '%@'", __PRETTY_FUNCTION__, _rawName); return; } if ([elem respondsToSelector:@selector(setLine:)]) [elem setLine:[self->locator lineNumber]]; if (_ns) { NSRange r; r = [_rawName rangeOfString:@":"]; nsPrefix = (r.length > 0) ? [_rawName substringToIndex:r.location] : (NSString *)nil; } else nsPrefix = nil; if (nsPrefix) [elem setPrefix:nsPrefix]; NSAssert(self->currentElement, @"no current element !"); [self->currentElement appendChild:elem]; self->currentElement = elem; /* process attributes */ { unsigned i, count; for (i = 0, count = [_attrs count]; i < count; i++) { id attr; // NSLog(@"attr %@", [_attrs nameAtIndex:i]); attr = [self _nodeForSaxAttrWithName:[_attrs nameAtIndex:i] namespace:[_attrs uriAtIndex:i] rawName:[_attrs rawNameAtIndex:i] type:[_attrs typeAtIndex:i] value:[_attrs valueAtIndex:i]]; if (attr == nil) { NSLog(@"couldn't create attribute for SAX attr %@, element %@", attr, elem); continue; } /* add node to element */ if ([elem setAttributeNodeNS:attr] == nil) NSLog(@"couldn't add attribute %@ to element %@", attr, elem); } } } - (void)endElement:(NSString *)_localName namespace:(NSString *)_ns rawName:(NSString *)_rawName { id parent; parent = [self->currentElement parentNode]; #if DEBUG NSAssert1(parent, @"no parent for current element %@ !", self->currentElement); #endif self->currentElement = parent; self->tagDepth--; } - (void)characters:(unichar *)_chars length:(int)_len { id charNode; NSString *data; data = [[NSString alloc] initWithCharacters:_chars length:_len]; charNode = [self->document createTextNode:data]; [data release]; data = nil; [self->currentElement appendChild:charNode]; } - (void)ignorableWhitespace:(unichar *)_chars length:(int)_len { } - (void)processingInstruction:(NSString *)_pi data:(NSString *)_data { id piNode; piNode = [self->document createProcessingInstruction:_pi data:_data]; [self->currentElement appendChild:piNode]; } #if 0 - (xmlEntityPtr)getEntity:(NSString *)_name { NSLog(@"get entity %@", _name); return NULL; } - (xmlEntityPtr)getParameterEntity:(NSString *)_name { NSLog(@"get para entity %@", _name); return NULL; } #endif /* lexical handler */ - (void)comment:(unichar *)_chars length:(int)_len { id commentNode; NSString *data; if (_len == 0) return; data = [[NSString alloc] initWithCharacters:_chars length:_len]; commentNode = [self->document createComment:data]; [data release]; data = nil; [self->currentElement appendChild:commentNode]; } - (void)startDTD:(NSString *)_name publicId:(NSString *)_pub systemId:(NSString *)_sys { self->inDTD = YES; } - (void)endDTD { self->inDTD = NO; } - (void)startCDATA { self->inCDATA = YES; } - (void)endCDATA { self->inCDATA = NO; } /* entities */ - (id)resolveEntityWithPublicId:(NSString *)_pubId systemId:(NSString *)_sysId { NSLog(@"shall resolve entity with '%@' '%@'", _pubId, _sysId); return nil; } /* errors */ - (void)warning:(SaxParseException *)_exception { NSString *sysId; int line; sysId = [[_exception userInfo] objectForKey:@"systemId"]; line = [[[_exception userInfo] objectForKey:@"line"] intValue]; NSLog(@"DOM XML WARNING(%@:%i): %@", sysId, line, [_exception reason]); if (self->warnings == nil) self->warnings = [[NSMutableArray alloc] initWithCapacity:32]; if (_exception) [self->warnings addObject:_exception]; } - (void)error:(SaxParseException *)_exception { self->errorCount++; if (printErrors) { NSString *sysId; int line; sysId = [[_exception userInfo] objectForKey:@"systemId"]; line = [[[_exception userInfo] objectForKey:@"line"] intValue]; NSLog(@"DOM XML ERROR(%@:%i[%@]): %@ (errcount=%i,max=%i)", sysId, line, [[_exception userInfo] objectForKey:@"parser"], [_exception reason], self->errorCount, self->maxErrorCount); } if (self->errors == nil) self->errors = [[NSMutableArray alloc] initWithCapacity:32]; if (_exception) [self->errors addObject:_exception]; } - (void)fatalError:(SaxParseException *)_exception { NSString *sysId; int line; sysId = [[_exception userInfo] objectForKey:@"systemId"]; line = [[[_exception userInfo] objectForKey:@"line"] intValue]; NSLog(@"DOM XML FATAL(%@:%i[%@]): %@", sysId, line, [[_exception userInfo] objectForKey:@"parser"], [_exception reason]); if (self->fatals == nil) self->fatals = [[NSMutableArray alloc] initWithCapacity:32]; if (_exception) [self->fatals addObject:_exception]; [_exception raise]; } /* DTD */ - (void)notationDeclaration:(NSString *)_name publicId:(NSString *)_pubId systemId:(NSString *)_sysId { NSLog(@"decl: notation %@ pub=%@ sys=%@", _name, _pubId, _sysId); } - (void)unparsedEntityDeclaration:(NSString *)_name publicId:(NSString *)_pubId systemId:(NSString *)_sysId notationName:(NSString *)_notName { NSLog(@"decl: unparsed entity %@ pub=%@ sys=%@ not=%@", _name, _pubId, _sysId, _notName); } /* decl */ - (void)attributeDeclaration:(NSString *)_attributeName elementName:(NSString *)_elementName type:(NSString *)_type defaultType:(NSString *)_defType defaultValue:(NSString *)_defValue { NSLog(@"decl: attr %@[%@] type '%@' default '%@'[%@]", _attributeName, _elementName, _type, _defValue, _defType); } - (void)elementDeclaration:(NSString *)_name contentModel:(NSString *)_model { NSLog(@"decl: element %@ model %@", _name, _model); } - (void)externalEntityDeclaration:(NSString *)_name publicId:(NSString *)_pub systemId:(NSString *)_sys { NSLog(@"decl: e-entity %@ pub %@ sys %@", _name, _pub, _sys); } - (void)internalEntityDeclaration:(NSString *)_name value:(NSString *)_value { NSLog(@"decl: i-entity %@ value %@", _name, _value); } @end /* DOMSaxHandler */ @implementation DOMSaxHandler(SubHandler) - (NSUInteger)tagDepth { return self->tagDepth; } - (id)object { return [self document]; } - (void)setNamespaces:(NSString *)_namespaces { // not yet implemented } @end /* DOMSaxHandler(SubHandler) */ SOPE/sope-xml/DOM/ChangeLog0000644000000000000000000001500312242733417014263 0ustar rootroot2006-09-20 Helge Hess * DOMPYXOutputter.m, DOMXMLOutputter.m: use -UTF8String instead of -cString on Apple machines to avoid a warning (v4.9.24) 2006-09-20 Helge Hess * GNUmakefile.preamble: filter out -O% flags for files using exception handlers, enable -O2 per default (v4.5.23) 2006-07-03 Helge Hess * fixed gcc 4.1 warnings, use %p for pointer formats (v4.5.22) 2006-06-04 Helge Hess * DOMElement.m: added missing -localName implementation (v4.5.21) 2005-08-17 Helge Hess * GNUmakefile: removed duplicate definition of EDOM.h (v4.5.20) 2005-08-07 Helge Hess * DOMDocumentFragment.m: fixed some prototypes (v4.5.19) 2005-07-30 Helge Hess * DOMElement.m: evaluate KVC keys starting with a slash '/' as query path expressions (by stripping of the slash!), return an attribute node for keys starting with '@' (v4.5.18) * v4.5.17 * DOMDocument.m: evaluate KVC keys starting with a slash '/' as query path expressions * DOMNode.m: changed to return 'nil' for unknown KVC keys instead of raising an exception 2005-05-03 Helge Hess * DOMTreeWalker.m: fixed a MacOSX 10.4 warning (v4.5.16) * renamed most implementations from DOMxx to NGDOMxx to avoid linking issues with Tiger WebKit (still incomplete). Note that protocols are still the same, so 'real' DOM apps will continue to work ;-) (v4.5.15) 2005-04-23 Helge Hess * fixed loads of @protocol related gcc 4.0 warnings (v4.5.14) 2004-12-14 Marcus Mueller * DOM.xcode: minor cleanup 2004-09-22 Marcus Mueller * DOM.xcode: minor fixes 2004-09-21 Marcus Mueller * DOM.xcode: Fixed dependencies to resemble the make process more closely. Our aim should be to stick to the make process as closely as possible, so we shouldn't introduce dependencies in non-toplevel projects. 2004-08-29 Helge Hess * added hack to install the project in FHS locations - the library, its headers, the tools and the resources will be installed in FHS_INSTALL_ROOT if specified (eg make FHS_INSTALL_ROOT=/usr/local) (v4.3.13) 2004-08-26 Marcus Mueller * DOM.xcode: new Xcode project 2004-08-25 Helge Hess * DOMSaxHandler.m: do not print DOM parsing errors per default (consumers need to check the errors array) (v4.3.12) 2004-08-20 Helge Hess * moved to SOPE 4.3 (v4.3.11) 2004-06-09 Helge Hess * v4.2.10 * GNUmakefile.preamble: added prebinding info * GNUmakefile: moved preamble stuff to GNUmakefile.preamble, also build DOM.framework on non-libFoundation systems 2004-05-05 Marcus Mueller * GNUmakefile.preamble: added support for building with GNUSTEP_BUILD_DIR environment variable set for recent gnustep-make package. (v4.2.9) 2004-02-27 Helge Hess * DOMElement.m: added -description method to _DOMElementAttrNamedNodeMap class (v4.2.8) 2003-11-19 Helge Hess * GNUmakefile: removed autodoc target 2003-10-30 Helge Hess * DOMDocument.m, DOMElement.m DOMQueryPathExpression.m: fixed some Xcode warnings (v4.2.7) 2003-07-18 Helge Hess * DOMNode.m, DOMXMLOutputter.m: removed a warning on gstep-base, patch provided by Filip Van Raemdonck (v4.2.6) 2003-01-07 Helge Hess * common.h: removed dependency on FoundationExt on MacOSX (v4.2.5) Thu Jan 2 10:49:31 2003 Helge Hess * changes for MacOSX, does not use RETAIN macros anymore (methods are used), -doesNotRecognizeSelector: instead of -notImplemented (v4.2.4) 2002-09-28 Helge Hess * removed some compilation warnings (v4.2.3) 2002-06-11 Helge Hess * track positional information in elements Sun May 5 18:40:10 2002 Helge Hess * added DOMBuilderFactory to create DOMBuilder instances Thu May 2 12:43:12 2002 Helge Hess * DOMXMLOutputter.m: added protocols to output methods * changed to use -rangeOfString: instead of -indexOfString: Thu Apr 4 18:12:17 2002 Martin Spindler * DOMSaxHandler.m: added SubHandler category Tue Feb 12 20:48:41 2002 Helge Hess * made independend from EOControl/NGExtensions Tue Nov 13 16:16:26 2001 Helge Hess * DOMSaxBuilder.m: added SAX errors to DOM document * DOMDocument.m: ivars for storing errors/warnings * DOMSaxHandler.m: track error messages Mon Oct 22 09:54:03 2001 Helge Hess * removed special namespace variants of DOMAttribute/DOMElement Mon Oct 1 15:59:16 2001 Helge Hess * DOMSaxBuilder.h: create DOM builder by MIME-type Fri Sep 28 16:17:17 2001 Helge Hess * DOMElement.m: added -getElementsByTagName: * DOM+JS.m: added JS bindings for DOM objects * DOMElement.m: added JS bindings to (private) AttrNamedNodeMap class * DOMProtocols.h: added ObjC protocols for DOM types Thu Aug 23 12:03:41 2001 Helge Hess * DOMSaxBuilder.m: clear sax handler after parsing * DOMSaxHandler.m added method to clear handler Sat Aug 11 13:56:47 2001 Helge Hess * DOMSaxHandler.m: changed to use less -autorelease calls Tue Jul 3 16:26:26 2001 Helge Hess * DOMElement.m: allow * pattern in -hasAttribute:namespaceURI: Thu Jun 7 19:48:41 2001 Helge Hess * DOMNode+QueryPath.m: improved query-path parsing (namespaces made possible), fixed deep child element search Thu Mar 8 12:33:27 2001 Helge Hess * DOMDocument.m: fixed bug Fri Mar 2 20:10:27 2001 Helge Hess * DOMElement.m: added ms patch Fri Feb 23 13:26:39 2001 Helge Hess * DOMElement.m: added ms bugfix * DOMAttribute.m: improved -description Fri Feb 2 10:08:32 2001 Helge Hess * DOMNode+QueryPath.m: added partial support for NS in paths SOPE/sope-xml/DOM/DOM-Info.plist0000644000000000000000000000132712242733417015102 0ustar rootroot CFBundleDevelopmentRegion English CFBundleExecutable DOM CFBundleGetInfoString CFBundleIdentifier org.OpenGroupware.SOPE.xml.DOM CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType FMWK CFBundleShortVersionString CFBundleSignature ???? CFBundleVersion 4.5 SOPE/sope-xml/DOM/DOMNodeIterator.h0000644000000000000000000000251312242733417015623 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DOMNodeIterator_H__ #define __DOMNodeIterator_H__ #import @interface NGDOMNodeIterator : NSObject { id root; unsigned long whatToShow; id filter; BOOL expandEntityReferences; /* position */ id lastNode; BOOL beforeFirst; BOOL afterLast; } /* attributes */ - (id)root; - (unsigned long)whatToShow; - (id)filter; - (BOOL)expandEntityReferences; /* operators */ - (id)nextNode; - (id)previousNode; - (void)detach; @end #endif /* __DOMNodeIterator_H__ */ SOPE/sope-xml/DOM/DOMPYXOutputter.m0000644000000000000000000001275412242733417015655 0ustar rootroot/* Copyright (C) 2000-2009 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "DOMPYXOutputter.h" #include "DOMDocument.h" #include "DOMElement.h" #include "common.h" @interface NGDOMPYXOutputter(Privates) - (void)outputNode:(id)_node to:(id)_target; - (void)outputNodeList:(id)_nodeList to:(id)_target; @end @implementation NGDOMPYXOutputter - (void)write:(NSString *)s to:(id)_target { #ifndef __APPLE__ printf("%s", [s cString]); #else printf("%s", [s UTF8String]); #endif } - (BOOL)currentElementPreservesWhitespace { return NO; } - (void)outputAttributeNode:(id)_attrNode ofNode:(id)_node to:(id)_target { [self write:@"A" to:_target]; [self write:[_attrNode name] to:_target]; [self write:@" " to:_target]; [self write:[_attrNode nodeValue] to:_target]; [self write:@"\n" to:_target]; } - (void)outputAttributeNodes:(id)_nodes ofNode:(id)_node to:(id)_target { unsigned i, count; if ((count = [_nodes length]) == 0) return; for (i = 0; i < count; i++) { [self outputAttributeNode:[_nodes objectAtIndex:i] ofNode:_node to:_target]; } } - (void)outputTextNode:(id)_node to:(id)_target { NSString *s; unsigned len; s = [_node data]; if ((len = [s length]) == 0) return; if ([s rangeOfString:@"\n"].length != 0) { s = [[s componentsSeparatedByString:@"\n"] componentsJoinedByString:@"\\n"]; } [self write:@"-" to:_target]; [self write:s to:_target]; [self write:@"\n" to:_target]; } - (void)outputCommentNode:(id)_node to:(id)_target { [self write:@"" to:_target]; if (![self currentElementPreservesWhitespace]) [self write:@"\n" to:_target]; } - (void)outputElementNode:(id)_node to:(id)_target { NSString *tagName; // NSString *ns; /* needs to declare namespaces !!! */ tagName = [_node tagName]; if ([[_node prefix] length] > 0) { NSString *p = [_node prefix]; p = [p stringByAppendingString:@":"]; tagName = [p stringByAppendingString:tagName]; // ns = [NSString stringWithFormat:@" xmlns:%@=\"%@\"", // [_node prefix], // [_node namespaceURI]]; } // else if ([[_node namespaceURI] length] > 0) { // ns = [NSString stringWithFormat:@" xmlns=\"%@\"", [_node namespaceURI]]; // } // else // ns = nil; [self write:@"(" to:_target]; [self write:tagName to:_target]; [self write:@"\n" to:_target]; [self outputAttributeNodes:[_node attributes] ofNode:_node to:_target]; if ([_node hasChildNodes]) [self outputNodeList:[_node childNodes] to:_target]; [self write:@")" to:_target]; [self write:tagName to:_target]; [self write:@"\n" to:_target]; } - (void)outputCDATA:(id)_node to:(id)_target { NSString *s; s = [_node data]; if ([s rangeOfString:@"\n"].length != 0) { /* escape newlines */ s = [[s componentsSeparatedByString:@"\n"] componentsJoinedByString:@"\\n"]; } [self write:@"-" to:_target]; [self write:s to:_target]; [self write:@"\n" to:_target]; } - (void)outputPI:(id)_node to:(id)_target { [self write:@"?" to:_target]; [self write:[_node target] to:_target]; [self write:@" " to:_target]; [self write:[_node data] to:_target]; [self write:@"\n" to:_target]; } - (void)outputNode:(id)_node to:(id)_target { switch ([_node nodeType]) { case DOM_ELEMENT_NODE: [self outputElementNode:_node to:_target]; break; case DOM_CDATA_SECTION_NODE: [self outputCDATA:_node to:_target]; break; case DOM_PROCESSING_INSTRUCTION_NODE: [self outputPI:_node to:_target]; break; case DOM_TEXT_NODE: [self outputTextNode:_node to:_target]; break; case DOM_COMMENT_NODE: [self outputCommentNode:_node to:_target]; break; default: NSLog(@"cannot output node %@", _node); break; } } - (void)outputNodeList:(id)_nodeList to:(id)_target { id children; unsigned i, count; children = _nodeList; for (i = 0, count = [children count]; i < count; i++) [self outputNode:[children objectAtIndex:i] to:_target]; } - (void)outputDocument:(id)_document to:(id)_target { if (![_document hasChildNodes]) return; NS_DURING [self outputNodeList:[_document childNodes] to:_target]; NS_HANDLER #ifndef __APPLE__ fprintf(stderr, "%s\n", [[localException description] cString]); #else fprintf(stderr, "%s\n", [[localException description] UTF8String]); #endif #if DEBUG abort(); #endif NS_ENDHANDLER; } @end /* DOMPYXOutputter */ SOPE/sope-xml/DOM/DOMText.m0000644000000000000000000000322612242733417014157 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "DOMText.h" @interface NSObject(UsedFdExt) - (id)doesNotRecognizeSelector:(SEL)_sel; @end @implementation NGDOMText /* node */ - (DOMNodeType)nodeType { return DOM_TEXT_NODE; } - (BOOL)_isValidChildNode:(id)_node { return NO; } - (BOOL)hasChildNodes { return NO; } - (id)childNodes { return nil; } - (id)appendChild:(id)_node { return nil; } - (id)attributes { return nil; } - (id)splitText:(NSUInteger)_offset { [self doesNotRecognizeSelector:_cmd]; return nil; } /* Level 3 Methods */ - (BOOL)isWhitespaceInElementContent { return NO; } - (NSString *)wholeText { [self doesNotRecognizeSelector:_cmd]; return nil; } - (id)replaceWholeText:(NSString *)_content { [self doesNotRecognizeSelector:_cmd]; return nil; } @end /* NGDOMText */ SOPE/sope-xml/DOM/SxXML-DOM.graffle0000644000000000000000000016053212242733417015441 0ustar rootroot CanvasColor w 1.000000e+00 ColumnAlign 0 ColumnSpacing 5.400000e+01 GraphDocumentVersion 2 GraphicsList Bounds {{14, 14}, {67, 36}} Class ShapedGraphic FitText YES ID 1404 Shape Rectangle Style fill Draws NO shadow Draws NO stroke Draws NO Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica-BoldOblique;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\i\b\fs48 \cf0 DOM} Bounds {{18, 549}, {167, 18}} Class ShapedGraphic ID 1403 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/DOM/DOMQueryPathExpression.h Shape Rectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 DOMQueryPathExpression} Class Group Graphics Bounds {{18, 342}, {126, 18}} Class ShapedGraphic ID 1386 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/DOM/DOMProtocols.h Shape Rectangle Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica-Oblique;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\i\fs24 \cf0 DOMCharacterData} Class Group Graphics Bounds {{216, 378}, {99, 18}} Class ShapedGraphic ID 1388 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/DOM/DOMProtocols.h Shape Rectangle Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica-Oblique;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\i\fs24 \cf0 DOMComment} Bounds {{105, 378}, {95, 18}} Class ShapedGraphic ID 1389 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/DOM/DOMComment.h Shape Rectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 DOMComment} Class LineGraphic Head ID 1389 ID 1390 Points {216, 387} {200, 387} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 1388 ID 1387 Class Group Graphics Bounds {{261, 342}, {126, 18}} Class ShapedGraphic ID 1392 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/DOM/DOMProtocols.h Shape Rectangle Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica-Oblique;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\i\fs24 \cf0 DOMCDATASection} Bounds {{261, 306}, {124, 18}} Class ShapedGraphic ID 1393 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/DOM/DOMCDATASection.h Shape Rectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 DOMCDATASection} ID 1391 Class Group Graphics Bounds {{171, 342}, {63, 18}} Class ShapedGraphic ID 1395 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/DOM/DOMProtocols.h Shape Rectangle Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica-Oblique;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\i\fs24 \cf0 DOMText} Bounds {{171, 306}, {63, 18}} Class ShapedGraphic ID 1396 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/DOM/DOMText.h Shape Rectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 DOMText} ID 1394 Bounds {{19, 306}, {125, 18}} Class ShapedGraphic ID 1397 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/DOM/DOMCharacterData.h Shape Rectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 DOMCharacterData} Class LineGraphic Head ID 1389 ID 1398 Points {90.375, 324} {143.625, 378} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 1397 Class LineGraphic Head ID 1393 ID 1399 Points {323.75, 342} {323.25, 324} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 1392 Class LineGraphic Head ID 1393 ID 1400 Points {234, 315} {261, 315} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 1396 Class LineGraphic Head ID 1396 ID 1401 Points {202.5, 342} {202.5, 324} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 1395 Class LineGraphic Head ID 1396 ID 1402 Points {144, 315} {171, 315} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 1397 ID 1385 Class Group Graphics Bounds {{22, 108}, {122, 18}} Class ShapedGraphic ID 1382 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/DOM/DOMDocumentType.h Shape Rectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 DOMDocumentType} Bounds {{22, 81}, {158, 18}} Class ShapedGraphic ID 1383 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/DOM/DOMProcessingInstruction.h Shape Rectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 DOMProcessingInstruction} Bounds {{22, 135}, {122, 18}} Class ShapedGraphic ID 1384 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/DOM/DOMNotation.h Shape Rectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 DOMNotation} ID 1381 Class Group Graphics Bounds {{252, 36}, {72, 18}} Class ShapedGraphic ID 1379 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/DOM/DOMProtocols.h Shape Rectangle Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica-Oblique;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\i\fs24 \cf0 DOMNode} Bounds {{162, 36}, {72, 18}} Class ShapedGraphic ID 1380 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/DOM/DOMNode.h Shape Rectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 DOMNode} ID 1378 Bounds {{189, 243}, {167, 18}} Class ShapedGraphic ID 1377 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/DOM/DOMEntity.h Shape Rectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 DOMEntity} Bounds {{18, 522}, {167, 18}} Class ShapedGraphic ID 1376 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/DOM/DOMTreeWalker.h Shape Rectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 DOMTreeWalker} Class Group Graphics Bounds {{275, 423}, {81, 18}} Class ShapedGraphic ID 1373 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/DOM/DOMBuilder.h Shape Rectangle Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica-Oblique;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\i\fs24 \cf0 DOMBuilder} Bounds {{153, 423}, {104, 18}} Class ShapedGraphic ID 1374 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/DOM/DOMSaxBuilder.h Shape Rectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 DOMSaxBuilder} Class LineGraphic Head ID 1374 ID 1375 Points {275, 432} {257, 432} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 1373 ID 1372 Class Group Graphics Bounds {{18, 459}, {117, 18}} Class ShapedGraphic ID 1370 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/DOM/DOMSaxHandler.h Shape Rectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 DOMSaxHandler} Bounds {{18, 423}, {117, 18}} Class ShapedGraphic ID 1371 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/SaxObjC/SaxDefaultHandler.h Shape Rectangle Style fill Color b 5.000000e-01 g 1.000000e+00 r 1.000000e+00 Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 SaxDefaultHandler} ID 1369 Class Group Graphics Bounds {{364, 459}, {122, 18}} Class ShapedGraphic ID 1367 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/DOM/DOMPYXOutputter.h Shape Rectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 DOMPYXOutputter} Bounds {{364, 486}, {122, 18}} Class ShapedGraphic ID 1368 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/DOM/DOMXMLOutputter.h Shape Rectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 DOMXMLOutputter} ID 1366 Bounds {{365, 639}, {121, 18}} Class ShapedGraphic ID 1365 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/DOM/DOMImplementation.h Shape Rectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 DOMImplementation} Bounds {{364, 585}, {122, 18}} Class ShapedGraphic ID 1364 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/DOM/DOMNodeFilter.h Shape Rectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 DOMNodeFilter} Bounds {{365, 558}, {121, 18}} Class ShapedGraphic ID 1363 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/DOM/DOMNodeIterator.h Shape Rectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 DOMNodeIterator} Class Group Graphics Bounds {{372, 189}, {99, 18}} Class ShapedGraphic ID 1361 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/DOM/DOMProtocols.h Shape Rectangle Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica-Oblique;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\i\fs24 \cf0 DOMElement} Bounds {{189, 189}, {167, 18}} Class ShapedGraphic ID 1362 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/DOM/DOMElement.h Shape Rectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 DOMElement} ID 1360 Bounds {{189, 216}, {167, 18}} Class ShapedGraphic ID 1359 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/DOM/DOMEntityReference.h Shape Rectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 DOMEntityReference} Bounds {{364, 612}, {122, 18}} Class ShapedGraphic ID 1358 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/DOM/DOMBuilderFactory.h Shape Rectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 DOMBuilderFactory} Class Group Graphics Bounds {{372, 270}, {99, 18}} Class ShapedGraphic ID 1356 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/DOM/DOMProtocols.h Shape Rectangle Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica-Oblique;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\i\fs24 \cf0 DOMDocument} Bounds {{189, 270}, {167, 18}} Class ShapedGraphic ID 1357 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/DOM/DOMDocument.h Shape Rectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 DOMDocument} ID 1355 Class Group Graphics Bounds {{372, 135}, {99, 18}} Class ShapedGraphic ID 1353 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/DOM/DOMProtocols.h Shape Rectangle Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica-Oblique;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\i\fs24 \cf0 DOMAttr} Bounds {{189, 135}, {167, 18}} Class ShapedGraphic ID 1354 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/DOM/DOMAttribute.h Shape Rectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 DOMAttribute} ID 1352 Class Group Graphics Bounds {{372, 162}, {153, 18}} Class ShapedGraphic ID 1350 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/DOM/DOMProtocols.h Shape Rectangle Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica-Oblique;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\i\fs24 \cf0 DOMDocumentFragment} Bounds {{189, 162}, {167, 18}} Class ShapedGraphic ID 1351 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/DOM/DOMDocumentFragment.h Shape Rectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 DOMDocumentFragment} ID 1349 Bounds {{288, 90}, {140, 18}} Class ShapedGraphic ID 1348 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/DOM/DOMNode.h Shape Rectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 DOMNodeWithChildren} Class Group Graphics Bounds {{135, 630}, {162, 18}} Class ShapedGraphic ID 1343 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/DOM/DOMNodeWalker.h Shape Rectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 DOMNodePostorderWalker} Bounds {{85, 603}, {113, 18}} Class ShapedGraphic ID 1344 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/DOM/DOMNodeWalker.h Shape Rectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 DOMNodeWalker} Bounds {{27, 657}, {162, 18}} Class ShapedGraphic ID 1345 Link url file://localhost/Volumes/Jaguar/Users/helge/dev/pkg42/skyrix-xml-42/DOM/DOMNodeWalker.h Shape Rectangle Text Text {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 DOMNodePreorderWalker} Class LineGraphic Head ID 1343 ID 1346 Points {166.333, 621} {191.167, 630} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 1344 Class LineGraphic Head ID 1345 ID 1347 Points {135.917, 621} {113.583, 657} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 1344 ID 1342 Class LineGraphic Head ID 1348 ID 1341 Points {224.667, 54} {331.333, 90} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 1380 Class LineGraphic Head ID 1397 ID 1340 Points {81.125, 342} {81.375, 324} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 1386 Class LineGraphic Head ID 1397 ID 1339 Points {194.117, 54} {85.3833, 306} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 1380 Class LineGraphic Head ID 1382 ID 1338 Points {183.625, 54} {97.375, 108} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 1380 Class LineGraphic Head ID 1380 ID 1337 Points {252, 45} {234, 45} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 1379 Class LineGraphic Head ID 1383 ID 1336 Points {178.6, 54} {120.4, 81} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 1380 Class LineGraphic Head ID 1377 ID 1335 Points {352.971, 108} {277.529, 243} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 1348 Class LineGraphic Head ID 1370 ID 1334 Points {76.5, 441} {76.5, 459} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 1371 Class LineGraphic Head ID 1384 ID 1333 Points {187.545, 54} {93.4545, 135} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 1380 Class LineGraphic Head ID 1362 ID 1332 Points {372, 198} {356, 198} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 1361 Class LineGraphic Head ID 1362 ID 1331 Points {350.227, 108} {280.273, 189} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 1348 Class LineGraphic Head ID 1359 ID 1330 Points {351.893, 108} {278.607, 216} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 1348 Class LineGraphic Head ID 1357 ID 1329 Points {372, 279} {356, 279} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 1356 Class LineGraphic Head ID 1357 ID 1328 Points {353.725, 108} {276.775, 270} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 1348 Class LineGraphic Head ID 1354 ID 1327 Points {372, 144} {356, 144} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 1353 Class LineGraphic Head ID 1354 ID 1326 Points {340.9, 108} {289.6, 135} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 1348 Class LineGraphic Head ID 1351 ID 1325 Points {372, 171} {356, 171} Style stroke Color b 0.000000e+00 g 0.000000e+00 r 1.000000e+00 HeadArrow 0 TailArrow FilledBall Tail ID 1350 Class LineGraphic Head ID 1351 ID 1324 Points {347.312, 108} {283.188, 162} Style stroke HeadArrow FilledArrow TailArrow 0 Tail ID 1348 GridInfo HPages 1 ImageCounter 1 IsPalette NO Layers Lock NO Name Layer 1 Print YES View YES LayoutInfo AutoAdjust YES HierarchicalOrientation 0 MagneticFieldCenter {0, 0} MagnetsEnabled YES PageBreakColor w 3.333333e-01 PageBreaks YES PageSetup BAt0eXBlZHN0cmVhbYED6IQBQISEhAtOU1ByaW50SW5mbwGEhAhOU09iamVjdACFkoSE hBNOU011dGFibGVEaWN0aW9uYXJ5AISEDE5TRGljdGlvbmFyeQCUhAFpEpKEhIQITlNT dHJpbmcBlIQBKxBOU0pvYkRpc3Bvc2l0aW9uhpKEmZkPTlNQcmludFNwb29sSm9ihpKE mZkOTlNCb3R0b21NYXJnaW6GkoSEhAhOU051bWJlcgCEhAdOU1ZhbHVlAJSEASqEhAFm nSSGkoSZmQtOU1BhcGVyTmFtZYaShJmZBkxldHRlcoaShJmZD05TUHJpbnRBbGxQYWdl c4aShJ2chIQBc54AhpKEmZkNTlNSaWdodE1hcmdpboaShJ2cn50khpKEmZkITlNDb3Bp ZXOGkoSdnISEAVOfAYaShJmZD05TU2NhbGluZ0ZhY3RvcoaShJ2chIQBZKABhpKEmZkL TlNGaXJzdFBhZ2WGkoSdnKmfAYaShJmZFE5TVmVydGljYWxQYWdpbmF0aW9uhpKEnZyk ngCGkoSZmRVOU0hvcml6b25hbFBhZ2luYXRpb26GkoSdnKSeAIaShJmZFk5TSG9yaXpv bnRhbGx5Q2VudGVyZWSGkoSdnKSeAYaShJmZDE5TTGVmdE1hcmdpboaShJ2cn50khpKE mZkNTlNPcmllbnRhdGlvboaShJ2cpJ4AhpKEmZkZTlNQcmludFJldmVyc2VPcmllbnRh dGlvboaSo5KEmZkKTlNMYXN0UGFnZYaShJ2chJeXgn////+GkoSZmQtOU1RvcE1hcmdp boaShJ2cn50khpKEmZkUTlNWZXJ0aWNhbGx5Q2VudGVyZWSGkrSShJmZC05TUGFwZXJT aXplhpKEnpyEhAx7X05TU2l6ZT1mZn2hgQJkgQMYhoaG RowAlign 0 RowSpacing 9.000000e+00 VPages 1 WindowInfo Frame {{137, 41}, {731, 892}} VisibleRegion {{-88, -46.5}, {716, 814.75}} Zoom 1 SOPE/sope-xml/DOM/DOMTreeWalker.h0000644000000000000000000000355212242733417015275 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DOMTreeWalker_H__ #define __DOMTreeWalker_H__ #import #include @class NSArray; @interface NGDOMTreeWalker : NSObject { id root; unsigned long whatToShow; id filter; BOOL expandEntityReferences; id currentNode; /* cache state */ NSArray *visibleChildren; } /* attributes */ - (id)root; - (unsigned long)whatToShow; - (id)filter; - (BOOL)expandEntityReferences; - (void)setCurrentNode:(id)_node; - (id)currentNode; /* operations */ - (id)parentNode; - (id)firstChild; - (id)lastChild; - (id)previousSibling; - (id)nextSibling; - (id)previousNode; - (id)nextNode; @end @interface NGDOMTreeWalker(PrivateCtors) /* use DOMDocument(DocumentTraversal) for constructing DOMTreeWalker's ! */ - (id)initWithRootNode:(id)_rootNode whatToShow:(unsigned long)_whatToShow filter:(id)_filter expandEntityReferences:(BOOL)_flag; @end #endif /* __DOMTreeWalker_H__ */ SOPE/sope-xml/DOM/DOMImplementation.m0000644000000000000000000000502412242733417016216 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "DOMImplementation.h" #include "DOMDocument.h" #include "DOMDocumentFragment.h" #include "common.h" @implementation NGDOMImplementation - (id)init { self->elementClass = NSClassFromString(@"NGDOMElement"); self->textNodeClass = NSClassFromString(@"NGDOMText"); self->attrClass = NSClassFromString(@"NGDOMAttribute"); return self; } - (Class)domDocumentClass { return [NGDOMDocument class]; } - (Class)domDocumentTypeClass { return NSClassFromString(@"NGDOMDocumentType"); } - (Class)domElementClass { return self->elementClass; } - (Class)domElementNSClass { return self->elementClass; } - (Class)domDocumentFragmentClass { return NSClassFromString(@"NGDOMDocumentFragment"); } - (Class)domTextNodeClass { return self->textNodeClass; } - (Class)domCommentClass { return NSClassFromString(@"NGDOMComment"); } - (Class)domCDATAClass { return NSClassFromString(@"NGDOMCDATA"); } - (Class)domProcessingInstructionClass { return NSClassFromString(@"NGDOMProcessingInstruction"); } - (Class)domAttributeClass { return self->attrClass; } - (Class)domAttributeNSClass { return self->attrClass; } - (Class)domEntityReferenceClass { return NSClassFromString(@"NGDOMEntityReference"); } - (id)createDocumentWithName:(NSString *)_qname namespaceURI:(NSString *)_uri documentType:(id)_doctype { id doc; doc = [[[self domDocumentClass] alloc] initWithName:_qname namespaceURI:_uri documentType:_doctype dom:self]; return [doc autorelease]; } - (id)createDocumentType:(NSString *)_qname publicId:(NSString *)_pubId systemId:(NSString *)_sysId { id doc; doc = [[[self domDocumentTypeClass] alloc] initWithName:_qname publicId:_pubId systemId:_sysId dom:self]; return [doc autorelease]; } @end /* NGDOMImplementation */ SOPE/sope-xml/DOM/DOMDocumentFragment.h0000644000000000000000000000242512242733417016470 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DOMDocumentFragment_H__ #define __DOMDocumentFragment_H__ #include @class NSString; @class NGDOMImplementation; @interface NGDOMDocumentFragment : NGDOMNodeWithChildren < DOMDocumentFragment > { } @end @interface NGDOMDocumentFragment(PrivateCtors) /* use DOMImplementation for constructing DOMDocumentFragment's ! */ - (id)initWithName:(NSString *)_name publicId:(NSString *)_p systemId:(NSString *)_s dom:(NGDOMImplementation *)_dom; @end #endif /* __DOMDocumentFragment_H__ */ SOPE/sope-xml/DOM/DOMQueryPathExpression.h0000644000000000000000000000446712242733417017240 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DOMQueryPathExpression_H__ #define __DOMQueryPathExpression_H__ #import @class NSString, NSArray; @interface DOMQueryPathExpression : NSObject /* Syntax: First the QueryPath is separated into path components, then the path components are evaluated: '-' - placed in front of the path component, makes the search flat '/' - select DOM root node (usually the document-element) '.' - select current node '..' - select DOM parent node '*' - select all child elements (either deep or non-deep) '!x' - evaluate keypath 'x' on node '?x' - lookup processing instruction 'x' (either deep or non-deep) '@x' - lookup attribute 'x', if x is '*', select all attributes (the map) x may contain a ':' for namespace queries any other string: select a child-node with the string as the name. Samples: "./head/title" - lookup the 'title' node contained in the 'head' child node "./@name" - lookup the 'name' attribute of the current node "./?blah" - lookup the PI 'blah' starting with the current node "./!values" - call 'valueForKey:@"values"' on the current node "/-title" - flat search for 'title' element */ + (id)queryPathWithString:(NSString *)_string; + (id)queryPathWithComponents:(NSArray *)_string; + (NSArray *)queryPathComponentsOfString:(NSString *)_path; - (id)evaluateWithNode:(id)_node; // DEPRECATED !!! - (id)evaluateWithNodeList:(id)_nodeList; @end #endif /* __DOMQueryPathExpression_H__ */ SOPE/sope-xml/DOM/DOMNode.h0000644000000000000000000000302612242733417014111 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DOMNode_H__ #define __DOMNode_H__ #import #include @class NSMutableArray, NSData; @class NGDOMDocument; @interface NGDOMNode : NSObject < DOMNode > { } @end @interface NGDOMNode(Additions) - (NSString *)nodeTypeString; - (NSString *)xmlStringValue; - (NSData *)xmlDataValue; - (NSString *)textValue; @end @interface NGDOMNodeWithChildren : NGDOMNode { @private NSMutableArray *childNodes; } @end @interface NSObject(DOMNodePrivate) - (id)_domNodeBeforeNode:(id)_node; - (id)_domNodeAfterNode:(id)_node; - (void)_domNodeRegisterParentNode:(id)_parentNode; - (void)_domNodeForgetParentNode:(id)_parentNode; @end NSString *DOMNodeName(id _node); NSString *DOMNodeValue(id _node); #endif /* __DOMNode_H__ */ SOPE/sope-xml/DOM/DOMDocumentFragment.m0000644000000000000000000000302112242733417016466 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "DOMDocumentFragment.h" #include "common.h" @implementation NGDOMDocumentFragment /* node */ - (BOOL)_isValidChildNode:(id)_node { switch ([_node nodeType]) { case DOM_ELEMENT_NODE: case DOM_PROCESSING_INSTRUCTION_NODE: case DOM_COMMENT_NODE: case DOM_TEXT_NODE: case DOM_CDATA_SECTION_NODE: case DOM_ENTITY_REFERENCE_NODE: return YES; default: return NO; } } - (DOMNodeType)nodeType { return DOM_DOCUMENT_FRAGMENT_NODE; } - (id)attributes { return nil; } /* parent node */ - (id)parentNode { return nil; } - (id)nextSibling { return nil; } - (id)previousSibling { return nil; } @end /* NGDOMDocumentFragment */ SOPE/sope-xml/DOM/EDOM.h0000644000000000000000000000174312242733417013414 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DOM_EDOM_H__ #define __DOM_EDOM_H__ /* Extended Objective-C specific DOM stuff */ #include #include #include #endif /* __DOM_EDOM_H__ */ SOPE/sope-xml/DOM/DOMAttribute.h0000644000000000000000000000474212242733417015175 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DOMAttribute_H__ #define __DOMAttribute_H__ #include /* Why is Attr a Node? Can it have children? Can it be a child? Attr is a Node because its value is actually carried by its children, which may be a mixture of Text and EntityReference nodes, and because making it a Node allows us to store it in a NamedNodeMap for easy retrieval. The getAttribute method hides this detail by returning a string representing the concatenation of all these children, and similarly setAttribute replaces the Attr's contents with a single Text node holding the new string. To create or manipulate other children of an Attr, you have to access the Attr node directly via the getAttributeNode and setAttributeNode methods, or by retrieving it from the element's "attributes" NamedNodeMap. Section 1.1.1 of the Level 1 DOM Recommendation gives a list of which nodes can be parents and children of which other nodes. Attr is not a legal child of any node, so attempts to insert it as one will throw a DOMException (HIERARCHY_REQUEST_ERR). Note that: parentNode, nextSibling, previousSibling always return nil !!! */ @interface NGDOMAttribute : NGDOMNodeWithChildren < DOMAttr > { id element; NSString *name; NSString *namespaceURI; NSString *prefix; BOOL isSpecified; NSString *value; } @end @interface NGDOMAttribute(PrivateCtors) /* use DOMDocument for constructing DOMAttributes ! */ - (id)initWithName:(NSString *)_name; - (id)initWithName:(NSString *)_name namespaceURI:(NSString *)_uri; @end @interface NGDOMAttribute(ObjCValues) - (NSString *)stringValue; - (int)intValue; - (double)doubleValue; @end /* DOMAttribute(Values) */ #endif /* __DOMAttribute_H__ */ SOPE/sope-xml/DOM/DOMNode+Enum.m0000644000000000000000000000341712242733417015022 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "DOMNode+Enum.h" #include "common.h" @interface _DOMNodeParentNodeEnumerator : NSEnumerator { id currentNode; } + (id)enumeratorWithDOMNode:(id)_node; @end @implementation NSObject(DOMNodeEnum) - (NSEnumerator *)domParentNodeEnumerator { return [_DOMNodeParentNodeEnumerator enumeratorWithDOMNode: [(NGDOMNode *)self parentNode]]; } @end /* NSObject(DOMNodeEnum) */ @implementation NGDOMNode(Enum) - (NSEnumerator *)parentNodeEnumerator { return [self domParentNodeEnumerator]; } @end /* NGDOMNode(Enum) */ @implementation _DOMNodeParentNodeEnumerator + (id)enumeratorWithDOMNode:(id)_node { _DOMNodeParentNodeEnumerator *e; e = [self alloc]; e->currentNode = [_node retain]; return [e autorelease]; } - (void)dealloc { [self->currentNode release]; [super dealloc]; } - (id)nextObject { id old; old = self->currentNode; self->currentNode = [[old parentNode] retain]; return [old autorelease]; } @end /* _DOMNodeParentNodeEnumerator */ SOPE/sope-xml/DOM/GNUmakefile.preamble0000644000000000000000000000271412242733417016356 0ustar rootroot# compilation settings include ./Version libDOM_HEADER_FILES_DIR = . libDOM_HEADER_FILES_INSTALL_DIR = /DOM libDOM_INTERFACE_VERSION=$(MAJOR_VERSION).$(MINOR_VERSION) libDOM_INSTALL_DIR=$(SOPE_SYSLIBDIR) libDOM_VERSION=$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBMINOR_VERSION) DOM_INTERFACE_VERSION=$(MAJOR_VERSION).$(MINOR_VERSION) DOM_VERSION=$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBMINOR_VERSION) # framework support DOM_HEADER_FILES = $(libDOM_HEADER_FILES) DOM_OBJC_FILES = $(libDOM_OBJC_FILES) ADDITIONAL_CPPFLAGS += \ -O2 \ -Wall -DCOMPILE_FOR_GSTEP_MAKE=1 \ -DSOPE_MAJOR_VERSION=$(MAJOR_VERSION) \ -DSOPE_MINOR_VERSION=$(MINOR_VERSION) \ -DSOPE_SUBMINOR_VERSION=$(SUBMINOR_VERSION) ADDITIONAL_INCLUDE_DIRS += -I.. -I../.. libDOM_LIBRARIES_DEPEND_UPON += -lSaxObjC $(BASE_LIBS) ifneq ($(GNUSTEP_BUILD_DIR),) libDOM_LIB_DIRS += -L$(GNUSTEP_BUILD_DIR)/../SaxObjC/$(GNUSTEP_OBJ_DIR_NAME) DOM_LIB_DIRS += -F$(GNUSTEP_BUILD_DIR)/../SaxObjC/ else libDOM_LIB_DIRS += -L../SaxObjC/$(GNUSTEP_OBJ_DIR) DOM_LIB_DIRS += -F../SaxObjC/ endif # Apple ifeq ($(FOUNDATION_LIB),apple) libDOM_PREBIND_ADDR="0xC0200000" libDOM_LDFLAGS += -seg1addr $(libDOM_PREBIND_ADDR) #ADDITIONAL_INCLUDE_DIRS += -framework SaxObjC DOM_FRAMEWORK_LIBS += -framework SaxObjC DOM_LIBRARIES_DEPEND_UPON += -framework SaxObjC endif ifeq ($(FOUNDATION_LIB),nx) domxml_LDFLAGS += -framework Foundation testqp_LDFLAGS += -framework Foundation endif SOPE/sope-xml/DOM/DOMNodeFilter.m0000644000000000000000000000166212242733417015270 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "DOMNodeFilter.h" @implementation NGDOMNodeFilter - (DOMNodeFilterType)acceptNode:(id)_node { return DOM_FILTER_ACCEPT; } @end /* NGDOMNodeFilter */ SOPE/sope-xml/DOM/DOMNode.m0000644000000000000000000001732012242733417014120 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include "common.h" NSString *DOMNodeName(id _node) { switch ([_node nodeType]) { case DOM_ATTRIBUTE_NODE: return [(id)_node name]; case DOM_CDATA_SECTION_NODE: return @"#cdata-section"; case DOM_COMMENT_NODE: return @"#comment"; case DOM_DOCUMENT_NODE: return @"#document"; case DOM_DOCUMENT_FRAGMENT_NODE: return @"#document-fragment"; case DOM_ELEMENT_NODE: return [(id)_node tagName]; case DOM_PROCESSING_INSTRUCTION_NODE: return [(id)_node target]; case DOM_TEXT_NODE: return @"#text"; case DOM_DOCUMENT_TYPE_NODE: case DOM_ENTITY_NODE: case DOM_ENTITY_REFERENCE_NODE: case DOM_NOTATION_NODE: default: NSLog(@"ERROR: unknown node type %i !", [_node nodeType]); return nil; } } NSString *DOMNodeValue(id _node) { switch ([_node nodeType]) { case DOM_ATTRIBUTE_NODE: return [_node value]; case DOM_CDATA_SECTION_NODE: case DOM_COMMENT_NODE: case DOM_TEXT_NODE: return [(id)_node data]; case DOM_DOCUMENT_NODE: case DOM_DOCUMENT_FRAGMENT_NODE: case DOM_ELEMENT_NODE: return nil; case DOM_PROCESSING_INSTRUCTION_NODE: return [(id)_node data]; case DOM_DOCUMENT_TYPE_NODE: case DOM_ENTITY_NODE: case DOM_ENTITY_REFERENCE_NODE: case DOM_NOTATION_NODE: default: NSLog(@"ERROR: unknown node type %i !", [_node nodeType]); return nil; } } @implementation NGDOMNode - (void)_domNodeRegisterParentNode:(id)_parent { } - (void)_domNodeForgetParentNode:(id)_parent { } /* owner */ - (IDOMDocument)ownerDocument { id node; for (node = [self parentNode]; node; node = [node parentNode]) { if ([node nodeType] == DOM_DOCUMENT_NODE) return node; if ([node nodeType] == DOM_DOCUMENT_FRAGMENT_NODE) return node; } return nil; } /* attributes */ - (DOMNodeType)nodeType { return DOM_UNKNOWN_NODE; } - (NSString *)nodeName { return DOMNodeName(self); } - (NSString *)nodeValue { return DOMNodeValue(self); } - (id)subclassResponsibility:(SEL)_sel { [self doesNotRecognizeSelector:_sel]; return nil; } - (NSString *)localName { /* introduced in DOM level 2 */ return [self subclassResponsibility:_cmd]; } - (NSString *)namespaceURI { /* introduced in DOM level 2 */ return [self subclassResponsibility:_cmd]; } - (void)setPrefix:(NSString *)_prefix { /* introduced in DOM level 2 */ [self subclassResponsibility:_cmd]; } - (NSString *)prefix { /* introduced in DOM level 2 */ return [self subclassResponsibility:_cmd]; } /* element attributes */ - (id)attributes { /* returns a NamedNodeList */ return [self subclassResponsibility:_cmd]; } /* modification */ - (BOOL)_isValidChildNode:(id)_node { return NO; } - (id)removeChild:(id)_node { return nil; } - (id)appendChild:(id)_node { return nil; } /* navigation */ - (id)parentNode { return [self subclassResponsibility:_cmd]; } - (id)previousSibling { NGDOMNode *parent; if ((parent = (NGDOMNode *)[self parentNode]) == nil) return nil; if (parent == nil) return nil; if (![parent respondsToSelector:@selector(_domNodeBeforeNode:)]) return nil; return [parent _domNodeBeforeNode:self]; } - (id)nextSibling { NGDOMNode *parent; if ((parent = (NGDOMNode *)[self parentNode]) == nil) return nil; if (parent == nil) return nil; if (![parent respondsToSelector:@selector(_domNodeBeforeNode:)]) return nil; return [parent _domNodeAfterNode:self]; } - (id)childNodes { return nil; } - (BOOL)hasChildNodes { return NO; } - (id)firstChild { return nil; } - (id)lastChild { return nil; } /* key/value coding */ - (id)valueForUndefinedKey:(NSString *)_key { /* default is to raise an exception, we just return nil */ return nil; } /* description */ - (NSString *)description { return [NSString stringWithFormat: @"<0x%p[%@]: name=%@ parent=%@ type=%i #children=%i>", self, NSStringFromClass([self class]), [self nodeName], [[self parentNode] nodeName], [self nodeType], [self hasChildNodes] ? [[self childNodes] length] : 0]; } @end /* NGDOMNode */ #include "DOMXMLOutputter.h" #include "DOMCharacterData.h" @implementation NGDOMNode(Additions) - (NSString *)nodeTypeString { switch ([self nodeType]) { case DOM_ATTRIBUTE_NODE: return @"attribute"; case DOM_CDATA_SECTION_NODE: return @"cdata-section"; case DOM_COMMENT_NODE: return @"comment"; case DOM_DOCUMENT_NODE: return @"document"; case DOM_DOCUMENT_FRAGMENT_NODE: return @"document-fragment"; case DOM_ELEMENT_NODE: return @"element"; case DOM_PROCESSING_INSTRUCTION_NODE: return @"processing-instruction"; case DOM_TEXT_NODE: return @"text"; case DOM_DOCUMENT_TYPE_NODE: return @"document-type"; case DOM_ENTITY_NODE: return @"entity"; case DOM_ENTITY_REFERENCE_NODE: return @"entity-reference"; case DOM_NOTATION_NODE: return @"notation"; default: return @"unknown"; } } - (NSString *)xmlStringValue { DOMXMLOutputter *out; NSMutableString *s; NSString *r; s = [[NSMutableString alloc] initWithCapacity:1024]; out = [[DOMXMLOutputter alloc] init]; [out outputNode:self to:s]; [out release]; r = [s copy]; [s release]; return [r autorelease]; } - (NSData *)xmlDataValue { return [[self xmlStringValue] dataUsingEncoding:NSUTF8StringEncoding]; } - (NSString *)textValue { NSMutableString *s; s = [NSMutableString stringWithCapacity:256]; switch ([self nodeType]) { case DOM_ELEMENT_NODE: case DOM_DOCUMENT_NODE: case DOM_ATTRIBUTE_NODE: if ([self hasChildNodes]) { id children; unsigned i, count; children = [self childNodes]; for (i = 0, count = [children count]; i < count; i++) { NSString *cs; cs = [[children objectAtIndex:i] textValue]; if (cs) [s appendString:cs]; } } break; case DOM_TEXT_NODE: case DOM_COMMENT_NODE: case DOM_CDATA_SECTION_NODE: [s appendString:[(id)self data]]; break; default: return nil; } return [[s copy] autorelease]; } @end /* NGDOMNode(Additions) */ @implementation NSArray(DOMNodeList) - (unsigned)length { return [self count]; } @end /* NSObject(DOMNodeList) */ SOPE/sope-xml/DOM/DOMAttribute.m0000644000000000000000000001021512242733417015172 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "DOMAttribute.h" #include "DOMDocument.h" #include "common.h" @implementation NGDOMAttribute - (id)initWithName:(NSString *)_name namespaceURI:(NSString *)_uri { if ((self = [super init])) { self->name = [_name copy]; self->namespaceURI = [_uri copy]; } return self; } - (id)initWithName:(NSString *)_name { return [self initWithName:_name namespaceURI:nil]; } - (void)dealloc { [self->prefix release]; [self->name release]; [self->namespaceURI release]; [super dealloc]; } /* element tracking */ - (void)_domNodeRegisterParentNode:(id)_element { self->element = _element; } - (void)_domNodeForgetParentNode:(id)_element { if (_element == self->element) self->element = nil; } /* attributes */ - (IDOMElement)ownerElement { return self->element; } - (IDOMDocument)ownerDocument { return [[self ownerElement] ownerDocument]; } - (BOOL)specified { return self->isSpecified; } - (NSString *)name { return self->name; } - (NSString *)namespaceURI { return self->namespaceURI; } - (void)setPrefix:(NSString *)_prefix { id old = self->prefix; self->prefix = [_prefix copy]; [old release]; } - (NSString *)prefix { return self->prefix; } - (void)setValue:(NSString *)_value { id child; self->isSpecified = YES; /* remove all existing children */ while ((child = [self lastChild])) [self removeChild:child]; child = [[self ownerDocument] createTextNode:_value]; NSAssert1(child, @"couldn't create text-node child for value '%@' !", _value); [self appendChild:child]; } - (NSString *)_stringValueOfChildNode:(id)_node { return [_node nodeValue]; } - (NSString *)value { id children; unsigned count; if (![self hasChildNodes]) return nil; children = [self childNodes]; if ((count = [children count]) == 0) return nil; if (count == 1) { return [self _stringValueOfChildNode:[children objectAtIndex:0]]; } else { unsigned i; NSMutableString *s; s = [NSMutableString stringWithCapacity:256]; for (i = 0; i < count; i++) { [s appendString: [self _stringValueOfChildNode:[children objectAtIndex:i]]]; } return [[s copy] autorelease]; } } /* node */ - (BOOL)_isValidChildNode:(id)_node { switch ([_node nodeType]) { case DOM_TEXT_NODE: case DOM_ENTITY_REFERENCE_NODE: return YES; default: return NO; } } - (DOMNodeType)nodeType { return DOM_ATTRIBUTE_NODE; } - (id)attributes { return nil; } - (id)parentNode { return nil; } - (id)nextSibling { return nil; } - (id)previousSibling { return nil; } /* description */ - (NSString *)description { return [NSString stringWithFormat:@"<0x%p[%@]: {%@}%@%s '%@'>", self, NSStringFromClass([self class]), self->namespaceURI, [self name], [self specified] ? " specified" : "", [self stringValue]]; } /* ObjCValues */ - (NSString *)stringValue { return [self value]; } - (int)intValue { return [[self stringValue] intValue]; } - (double)doubleValue { return [[self stringValue] doubleValue]; } /* QPValues */ - (NSException *)setQueryPathValue:(id)_value { [self setValue:[_value stringValue]]; return nil; } - (id)queryPathValue { return [self value]; } @end /* NGDOMAttribute */ SOPE/sope-xml/DOM/NSObject+DOM.m0000644000000000000000000000206312242733417014753 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "common.h" @implementation NSObject(DOMNode) - (id)_domNodeBeforeNode:(id)_node { return nil; } - (id)_domNodeAfterNode:(id)_node { return nil; } - (void)_domNodeForgetParentNode:(id)_parent { } - (void)_domNodeRegisterParentNode:(id)_parent { } @end /* NSObject(DOMNode) */ SOPE/sope-xml/DOM/DOMDocument.h0000644000000000000000000000365712242733417015014 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DOMDocument_H__ #define __DOMDocument_H__ #include @class NSString, NSArray; @class NGDOMImplementation; @interface NGDOMDocument : NGDOMNodeWithChildren < DOMDocument > { NSString *qname; NSString *uri; id doctype; NGDOMImplementation *dom; NSArray *errors; NSArray *warnings; } + (id)documentFromData:(NSData *)_data; + (id)documentFromString:(NSString *)_string; + (id)documentFromURI:(NSString *)_uri; /* errors/warnings */ - (void)addErrors:(NSArray *)_errors; - (void)addWarnings:(NSArray *)_errors; @end @interface NGDOMDocument(DocumentTraversal) - (id)createNodeIterator:(id)_node whatToShow:(unsigned long)_whatToShow filter:(id)_filter; - (id)createTreeWalker:(id)_node whatToShow:(unsigned long)_whatToShow filter:(id)_filter expandEntityReferences:(BOOL)_expandEntityReferences; @end @interface NGDOMDocument(PrivateCtors) /* use DOMImplementation for constructing DOMDocument ! */ - (id)initWithName:(NSString *)_qname namespaceURI:(NSString *)_uri documentType:(id)_doctype dom:(NGDOMImplementation *)_dom; @end #endif /* __DOMDocument_H__ */ SOPE/sope-xml/DOM/DOMCDATASection.h0000644000000000000000000000207612242733417015371 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DOMCDATASection_H__ #define __DOMCDATASection_H__ #include @interface NGDOMCDATASection : NGDOMText < DOMCDATASection > { } @end @interface NGDOMCDATASection(PrivateCtors) /* use DOMDocument for constructing DOMCDATASection's ! */ @end #endif /* __DOMCDATASection_H__ */ SOPE/sope-xml/DOM/TODO0000644000000000000000000000011412242733417013176 0ustar rootrootTODOs for DOM ============= - add a DOM builder which uses NSXMLParser API SOPE/sope-xml/DOM/NSObject+StringValue.m0000644000000000000000000000226212242733417016600 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "common.h" @implementation NSObject(StringValue) - (NSString *)stringValue { return [self description]; } @end /* NSObject(StringValue) */ @implementation NSString(StringValue) - (NSString *)stringValue { return self; } @end /* NSObject(StringValue) */ @implementation NSMutableString(StringValue) - (NSString *)stringValue { return [[self copy] autorelease]; } @end /* NSObject(StringValue) */ SOPE/sope-xml/DOM/DOMSaxHandler.h0000644000000000000000000000277512242733417015267 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DOMSaxHandler_H__ #define __DOMSaxHandler_H__ #include @class NSMutableArray; @interface DOMSaxHandler : SaxDefaultHandler { id locator; BOOL inDTD; BOOL inCDATA; int maxErrorCount; NSMutableArray *errors; NSMutableArray *warnings; NSMutableArray *fatals; /* dom */ id dom; id document; int errorCount; /* dom building */ id currentElement; /* */ unsigned tagDepth; } - (id)initWithDOMImplementation:(id)_domImpl; /* access result */ - (id)document; - (void)clear; - (int)maxErrorCount; - (int)errorCount; - (int)fatalErrorCount; - (int)warningCount; - (NSArray *)warnings; - (NSArray *)errors; - (NSArray *)fatalErrors; @end #endif /* __DOMSaxHandler_H__ */ SOPE/sope-xml/DOM/DOMBuilder.h0000644000000000000000000000243212242733417014612 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DOMBuilder_H__ #define __DOMBuilder_H__ #import #include /* A protocol which defines the behaviour of DOM builders (classes which build DOM trees from some kind of resource). */ @protocol DOMBuilder /* parsing */ - (id)buildFromSource:(id)_source; - (id)buildFromSource:(id)_source systemId:(NSString *)_sysId; - (id)buildFromSystemId:(NSString *)_sysId; @end #endif /* __DOMBuilder_H__ */ SOPE/sope-xml/DOM/DOMXMLOutputter.h0000644000000000000000000000235212242733417015621 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DOMXMLOutputter_H__ #define __DOMXMLOutputter_H__ #import #include /* DOMXMLOutputter Class to generate a text representation of an DOM node to stdout. */ @class NSMutableArray; @interface DOMXMLOutputter : NSObject { NSMutableArray *stack; unsigned indent; } - (void)outputNode:(id)_node to:(id)_target; - (void)outputDocument:(id)_document to:(id)_target; @end #endif /* __DOMXMLOutputter_H__ */ SOPE/sope-xml/DOM/DOMSaxBuilder.h0000644000000000000000000000230712242733417015267 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DOMSaxBuilder_H__ #define __DOMSaxBuilder_H__ #import #include @class NSString, NSData; @interface DOMSaxBuilder : NSObject < DOMBuilder > { id parser; id sax; } - (id)initWithXMLReader:(id)_saxParser; - (id)initWithXMLReaderForMimeType:(id)_mimeType; - (id)buildFromContentsOfFile:(NSString *)_path; - (id)buildFromData:(NSData *)_data; @end #endif /* __DOMSaxBuilder_H__ */ SOPE/sope-xml/DOM/DOMElement.m0000644000000000000000000004710412242733417014627 0ustar rootroot/* Copyright (C) 2000-2006 SKYRIX Software AG Copyright (C) 2006 Helge Hess This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include "DOMNode+QueryPath.h" #include "common.h" @interface _DOMElementAttrNamedNodeMap : NSObject < DOMNamedNodeMap > { NGDOMElement *element; /* non-retained */ } - (id)initWithElement:(id)_element; - (id)objectEnumerator; - (void)invalidate; @end /* _DOMElementAttrNamedNodeMap */ @interface NGDOMElement(Privates) - (NSUInteger)_numberOfAttributes; - (id)_attributeNodeAtIndex:(NSUInteger)_idx; - (id)attributeNode:(NSString *)_localName; - (id)attributeNode:(NSString *)_localName namespaceURI:(NSString *)_ns; @end static NSNull *null = nil; @implementation NGDOMElement - (id)initWithTagName:(NSString *)_tagName namespaceURI:(NSString *)_uri { if (null == nil) null = [[NSNull null] retain]; if ((self = [super init])) { self->tagName = [_tagName copy]; self->namespaceURI = [_uri copy]; } return self; } - (id)initWithTagName:(NSString *)_tagName { return [self initWithTagName:_tagName namespaceURI:nil]; } - (void)dealloc { [self->attributes makeObjectsPerformSelector: @selector(_domNodeForgetParentNode:) withObject:self]; [self->attrNodeMap invalidate]; [self->attrNodeMap release]; [self->keyToAttribute release]; [self->attributes release]; [self->tagName release]; [self->namespaceURI release]; [self->prefix release]; [super dealloc]; } /* attributes */ - (NSString *)tagName { return self->tagName; } - (NSString *)localName { return self->tagName; } - (void)setPrefix:(NSString *)_prefix { id old = self->prefix; self->prefix = [_prefix copy]; [old release]; } - (NSString *)prefix { return self->prefix; } - (NSString *)namespaceURI { return self->namespaceURI; } - (void)setLine:(NSInteger)_line { self->line = _line; } - (NSUInteger)line { return self->line; } /* lookup */ - (void)_walk_getElementsByTagName:(id)_walker { id node; node = [_walker currentNode]; if ([node nodeType] != DOM_ELEMENT_NODE) return; if (![[node tagName] isEqualToString: [(NSArray *)[_walker context] objectAtIndex:0]]) /* tagname doesn't match */ return; [[(NSArray *)[_walker context] objectAtIndex:1] addObject:node]; } - (void)_walk_getElementsByTagNameAddAll:(id)_walker { id node; node = [_walker currentNode]; if ([node nodeType] != DOM_ELEMENT_NODE) return; [(NSMutableArray *)[_walker context] addObject:node]; } - (id)getElementsByTagName:(NSString *)_tagName { /* introduced in DOM2, should return a *live* list ! */ NGDOMNodePreorderWalker *walker; NSMutableArray *array; SEL sel; id ctx; if (![self hasChildNodes]) return nil; if (_tagName == nil) return nil; array = [NSMutableArray arrayWithCapacity:4]; if ([_tagName isEqualToString:@"*"]) { _tagName = nil; ctx = array; sel = @selector(_walk_getElementsByTagNameAddAll:); } else { ctx = [NSArray arrayWithObjects:_tagName, array, nil]; sel = @selector(_walk_getElementsByTagName:); } walker = [[NGDOMNodePreorderWalker alloc] initWithTarget:self selector:sel context:ctx]; [walker walkNode:self]; [walker release]; walker = nil; return [[array copy] autorelease]; } - (id)getElementsByTagName:(NSString *)_tagName namespaceURI:(NSString *)_uri { // TODO: implement [self doesNotRecognizeSelector:_cmd]; return nil; } /* element attributes */ - (void)_ensureAttrs { if (self->attributes == nil) self->attributes = [[NSMutableArray alloc] init]; if (self->keyToAttribute == nil) self->keyToAttribute = [[NSMutableDictionary alloc] init]; } - (void)_attributeSetChanged { } - (NSUInteger)_numberOfAttributes { return [self->attributes count]; } - (id)_attributeNodeAtIndex:(NSUInteger)_idx { if (_idx >= [self->attributes count]) return nil; return [self->attributes objectAtIndex:_idx]; } - (id)_keyForAttribute:(id)_attrNode { return [_attrNode name]; } - (id)_nskeyForLocalName:(NSString *)attrName namespaceURI:(NSString *)nsURI { id key; if (attrName == nil) return nil; if (nsURI) { id objs[2]; objs[0] = attrName; objs[1] = nsURI; key = [NSArray arrayWithObjects:objs count:2]; } else key = attrName; return key; } - (id)_nskeyForAttribute:(id)_attrNode { NSString *attrName; if ((attrName = [_attrNode name]) == nil) { NSLog(@"WARNING: attribute %@ has no valid attribute name !", _attrNode); return nil; } return [self _nskeyForLocalName:attrName namespaceURI:[_attrNode namespaceURI]]; } - (BOOL)hasAttribute:(NSString *)_attrName { return [self hasAttribute:_attrName namespaceURI:[self namespaceURI]]; } - (void)setAttribute:(NSString *)_attrName value:(NSString *)_value { [self setAttribute:_attrName namespaceURI:[self namespaceURI] value:_value]; #if 0 // ms: ?? id node; NSAssert1(_attrName, @"invalid attribute name '%@'", _attrName); if ((node = [self->keyToAttribute objectForKey:_attrName]) == nil) { /* create new node */ node = [[self ownerDocument] createAttribute:_attrName]; } NSAssert(node, @"couldn't find/create node for attribute"); node = [self setAttributeNode:node]; [node setValue:_value]; #endif } - (id)attributeNode:(NSString *)_attrName { return [self attributeNode:_attrName namespaceURI:[self namespaceURI]]; } - (NSString *)attribute:(NSString *)_attrName { return [[self attributeNode:_attrName] value]; } - (BOOL)hasAttribute:(NSString *)_localName namespaceURI:(NSString *)_ns { id objs[2]; id key; if ([_ns isEqualToString:@"*"]) { /* match any namespace */ NSEnumerator *e; id attr; if ((attr = [self->keyToAttribute objectForKey:_localName])) return YES; e = [self->keyToAttribute keyEnumerator]; while ((key = [e nextObject])) { if ([key isKindOfClass:[NSArray class]]) { if ([[key objectAtIndex:0] isEqualToString:_localName]) return YES; } } return NO; } objs[0] = _localName; objs[1] = _ns ? _ns : (NSString *)null; key = [NSArray arrayWithObjects:objs count:2]; return [self->keyToAttribute objectForKey:key] ? YES : NO; } - (void)setAttribute:(NSString *)_localName namespaceURI:(NSString *)_ns value:(NSString *)_value { id key; id node; key = [self _nskeyForLocalName:_localName namespaceURI:_ns]; NSAssert2(key, @"invalid (ns-)attribute name localName='%@', uri='%@'", _localName, _ns); if ((node = [self->keyToAttribute objectForKey:key]) == nil) { /* create new node */ node = [[self ownerDocument] createAttribute:_localName namespaceURI:_ns]; } NSAssert(node, @"couldn't find/create node for attribute"); node = [self setAttributeNodeNS:node]; [node setValue:_value]; } - (id)attributeNode:(NSString *)_localName namespaceURI:(NSString *)_ns { id objs[2]; id key; if ([_ns isEqualToString:@"*"]) { /* match any namespace */ NSEnumerator *e; id attr; if ((attr = [self->keyToAttribute objectForKey:_localName])) return attr; e = [self->keyToAttribute keyEnumerator]; while ((key = [e nextObject])) { if ([key isKindOfClass:[NSArray class]]) { if ([[key objectAtIndex:0] isEqualToString:_localName]) return [self->keyToAttribute objectForKey:key]; } } return nil; } objs[0] = _localName; objs[1] = _ns ? _ns : (NSString *)null; key = [NSArray arrayWithObjects:objs count:2]; return [self->keyToAttribute objectForKey:key]; } - (NSString *)attribute:(NSString *)_localName namespaceURI:(NSString *)_ns { return [[self attributeNode:_localName namespaceURI:_ns] value]; } - (id)setAttributeNodeNS:(id)_attrNode { id key, oldNode; if (_attrNode == nil) /* invalid node parameters */ return nil; if ((key = [self _nskeyForAttribute:_attrNode]) == nil) /* couldn't get key */ return nil; [self _ensureAttrs]; /* check if the key is already added */ if ((oldNode = [self->keyToAttribute objectForKey:key])) { if (oldNode == _attrNode) { /* already contained */ // NSLog(@"node is already set !"); return _attrNode; } /* replace existing node */ [self->attributes replaceObjectAtIndex: [self->attributes indexOfObject:oldNode] withObject:_attrNode]; [self->keyToAttribute setObject:_attrNode forKey:key]; [(id)_attrNode _domNodeRegisterParentNode:self]; [self _attributeSetChanged]; return _attrNode; } else { /* add node */ NSAssert(self->keyToAttribute, @"missing keyToAttribute"); NSAssert(self->attributes, @"missing attrs"); [self->keyToAttribute setObject:_attrNode forKey:key]; [self->attributes addObject:_attrNode]; [(id)_attrNode _domNodeRegisterParentNode:self]; [self _attributeSetChanged]; // NSLog(@"added attr %@, elem %@", _attrNode, self); return _attrNode; } } - (void)removeAttribute:(NSString *)_attr namespaceURI:(NSString *)_uri { id node; id key; key = [self _nskeyForLocalName:_attr namespaceURI:_uri]; NSAssert2(key, @"invalid (ns-)attribute name '%@', '%@'", _attr, _uri); node = [self->keyToAttribute objectForKey:key]; [self removeAttributeNodeNS:node]; } - (id)removeAttributeNodeNS:(id)_attrNode { id key, oldNode; if (_attrNode == nil) /* invalid node parameters */ return nil; if (self->attributes == nil) /* no attributes are set up */ return nil; if ((key = [self _nskeyForAttribute:_attrNode]) == nil) /* couldn't get key for node */ return nil; if ((oldNode = [self->keyToAttribute objectForKey:key])) { /* the node's key exists */ if (oldNode != _attrNode) { /* the node has the same key, but isn't the same */ return nil; } /* ok, found the node, let's remove ! */ [[_attrNode retain] autorelease]; [self->keyToAttribute removeObjectForKey:key]; [self->attributes removeObjectIdenticalTo:_attrNode]; [(id)_attrNode _domNodeForgetParentNode:self]; [self _attributeSetChanged]; return _attrNode; } else /* no such attribute is stored */ return nil; } - (id)setAttributeNode:(id)_attrNode { [self doesNotRecognizeSelector:_cmd]; return nil; } - (id)removeAttributeNode:(id)_attrNode { [self doesNotRecognizeSelector:_cmd]; return nil; } - (void)removeAttribute:(NSString *)_attr { id node; NSAssert1(_attr, @"invalid attribute name '%@'", _attr); node = [self->keyToAttribute objectForKey:_attr]; [self removeAttributeNode:node]; } /* node */ - (BOOL)_isValidChildNode:(id)_node { switch ([_node nodeType]) { case DOM_ELEMENT_NODE: case DOM_TEXT_NODE: case DOM_COMMENT_NODE: case DOM_PROCESSING_INSTRUCTION_NODE: case DOM_CDATA_SECTION_NODE: case DOM_ENTITY_REFERENCE_NODE: return YES; default: return NO; } } - (DOMNodeType)nodeType { return DOM_ELEMENT_NODE; } - (id)attributes { /* returns a named-node-map */ if (self->attrNodeMap == nil) { self->attrNodeMap = [[_DOMElementAttrNamedNodeMap alloc] initWithElement:self]; } return self->attrNodeMap; } /* parent node */ - (void)_domNodeRegisterParentNode:(id)_parent { self->parent = _parent; } - (void)_domNodeForgetParentNode:(id)_parent { if (_parent == self->parent) /* the node's parent was deallocated */ self->parent = nil; } - (id)parentNode { return self->parent; } /* description */ - (NSString *)description { return [NSString stringWithFormat: @"<0x%p[%@]: name=%@ parent=%@ #attrs=%i #children=%i>", self, NSStringFromClass([self class]), [self nodeName], [[self parentNode] nodeName], [self _numberOfAttributes], [self hasChildNodes] ? [[self childNodes] length] : 0]; } /* QPValues */ - (NSException *)setQueryPathValue:(id)_value { return [NSException exceptionWithName:@"QueryPathEvalException" reason:@"cannot set query-path value on DOMElement !" userInfo:nil]; } - (id)queryPathValue { return [self childNodes]; } /* key/value coding */ - (id)valueForKey:(NSString *)_key { if ([_key hasPrefix:@"/"]) return [self lookupQueryPath:[_key substringFromIndex:1]]; if ([_key hasPrefix:@"@"]) { return [[self attributes] namedItem:[_key substringFromIndex:1] namespaceURI:@"*"]; } return [super valueForKey:_key]; } @end /* NGDOMElement */ @implementation _DOMElementAttrNamedNodeMap - (id)initWithElement:(id)_element { self->element = _element; return self; } - (void)invalidate { self->element = nil; } static inline void _checkValid(_DOMElementAttrNamedNodeMap *self) { if (self->element == nil) { NSCAssert(self->element, @"named node map is invalid (element was deallocated) !"); } } /* access */ static NSString *_XNSUri(NSString *_name) { NSRange r1; if (![_name hasPrefix:@"{"]) return nil; r1 = [_name rangeOfString:@"}"]; if (r1.length == 0) return nil; r1.length = (r1.location - 2); r1.location = 1; return [_name substringWithRange:r1]; } static NSString *_XNSLocalName(NSString *_name) { NSRange r; r = [_name rangeOfString:@"}"]; return r.length == 0 ? _name : [_name substringFromIndex:(r.location + r.length)]; } - (NSUInteger)length { _checkValid(self); return [self->element _numberOfAttributes]; } - (id)objectAtIndex:(NSUInteger)_idx { _checkValid(self); return [self->element _attributeNodeAtIndex:_idx]; } - (IDOMNode)namedItem:(NSString *)_name { NSString *nsuri; _checkValid(self); if ((nsuri = _XNSUri(_name))) return [self namedItem:_XNSLocalName(_name) namespaceURI:nsuri]; return [self->element attributeNode:_name]; } - (IDOMNode)setNamedItem:(IDOMNode)_node { _checkValid(self); // TODO: is the cast correct? return [self->element setAttributeNode:(id)_node]; } - (IDOMNode)removeNamedItem:(NSString *)_name { NSString *nsuri; id node; _checkValid(self); if ((nsuri = _XNSUri(_name))) return [self removeNamedItem:_XNSLocalName(_name) namespaceURI:nsuri]; if ((node = [self->element attributeNode:_name])) { node = [node retain]; [self->element removeAttribute:_name]; return [node autorelease]; } else return nil; } /* DOM2 access */ - (IDOMNode)namedItem:(NSString *)_name namespaceURI:(NSString *)_uri { return [self->element attributeNode:_name namespaceURI:_uri]; } - (IDOMNode)setNamedItemNS:(IDOMNode)_node { _checkValid(self); // TODO: is the cast correct? return [self->element setAttributeNodeNS:(id)_node]; } - (IDOMNode)removeNamedItem:(NSString *)_name namespaceURI:(NSString *)_uri { id node; _checkValid(self); if ((node = [self->element attributeNode:_name namespaceURI:_uri])) { node = [node retain]; [self->element removeAttribute:_name namespaceURI:_uri]; return [node autorelease]; } else return nil; } /* mimic NSArray */ - (NSUInteger)count { _checkValid(self); return [self->element _numberOfAttributes]; } - (id)objectEnumerator { NSMutableArray *ma; unsigned i, count; _checkValid(self); if ((count = [self->element _numberOfAttributes]) == 0) return nil; ma = [NSMutableArray arrayWithCapacity:count]; for (i = 0; i < count; i++) [ma addObject:[self->element _attributeNodeAtIndex:i]]; return [ma objectEnumerator]; } /* mimic NSDictionary */ - (void)setObject:(id)_value forKey:(id)_key { _checkValid(self); [self takeValue:_value forKey:[_key stringValue]]; } - (id)objectForKey:(id)_key { _checkValid(self); return [self valueForKey:[_key stringValue]]; } /* KVC */ - (void)takeValue:(id)_value forKey:(NSString *)_key { id node; _checkValid(self); if ((node = [self->element attributeNode:_key namespaceURI:@"*"])) { [node setValue:[_value stringValue]]; } else { [self->element setAttribute:_key namespaceURI:@"xhtml" value:[_value stringValue]]; } } - (id)valueForKey:(NSString *)_key { id v; _checkValid(self); if ((v = [self namedItem:_key])) return [v value]; if ((v = [self namedItem:_key namespaceURI:@"*"])) return [v value]; return nil; } /* JSSupport */ - (id)_jsprop_length { return [NSNumber numberWithInt:[self length]]; } - (id)_jsfunc_item:(NSArray *)_args { unsigned count; if ((count = [_args count]) == 0) return nil; return [self objectAtIndex:[[_args objectAtIndex:0] intValue]]; } - (id)_jsfunc_getNamedItem:(NSArray *)_args { unsigned count; if ((count = [_args count]) == 0) return nil; return [self namedItem:[[_args objectAtIndex:0] stringValue]]; } - (id)_jsfunc_getNamedItemNS:(NSArray *)_args { unsigned count; if ((count = [_args count]) == 0) return nil; if (count == 1) return [self namedItem:[[_args objectAtIndex:0] stringValue]]; else { return [self namedItem:[[_args objectAtIndex:1] stringValue] namespaceURI:[[_args objectAtIndex:0] stringValue]]; } } - (id)_jsfunc_setNamedItem:(NSArray *)_args { unsigned i, count; id last = nil; for (i = 0, count = [_args count]; i < count; i++) last = [self setNamedItem:[_args objectAtIndex:i]]; return last; } - (id)_jsfunc_setNamedItemNS:(NSArray *)_args { unsigned i, count; id last = nil; for (i = 0, count = [_args count]; i < count; i++) last = [self setNamedItemNS:[_args objectAtIndex:i]]; return last; } - (id)_jsfunc_removeNamedItem:(NSArray *)_args { unsigned count; if ((count = [_args count]) == 0) return nil; return [self namedItem:[[_args objectAtIndex:0] stringValue]]; } - (id)_jsfunc_removeNamedItemNS:(NSArray *)_args { unsigned count; if ((count = [_args count]) == 0) return nil; if (count == 1) return [self removeNamedItem:[[_args objectAtIndex:0] stringValue]]; else { return [self removeNamedItem:[[_args objectAtIndex:1] stringValue] namespaceURI:[[_args objectAtIndex:0] stringValue]]; } } /* description */ - (NSString *)description { NSMutableString *ms; NSEnumerator *e; id attr; ms = [NSMutableString stringWithCapacity:1024]; [ms appendFormat:@"<0x%p[%@]:", self, NSStringFromClass([self class])]; [ms appendFormat:@" element=%@", self->element]; [ms appendString:@" attributes:\n"]; e = [self objectEnumerator]; while ((attr = [e nextObject]) != nil) { [ms appendString:[attr description]]; [ms appendString:@"\n"]; } [ms appendString:@">"]; return ms; } @end /* _DOMElementAttrNamedNodeMap */ SOPE/sope-xml/DOM/DOMEntityReference.m0000644000000000000000000000272112242733417016325 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "DOMEntityReference.h" #include "common.h" @implementation NGDOMEntityReference - (id)initWithName:(NSString *)_name { self->name = [_name copy]; return self; } - (void)dealloc { [self->name release]; [super dealloc]; } - (DOMNodeType)nodeType { return DOM_ENTITY_REFERENCE_NODE; } - (id)attributes { return nil; } /* parent node */ - (void)_domNodeRegisterParentNode:(id)_parent { self->parent = _parent; } - (void)_domNodeForgetParentNode:(id)_parent { if (_parent == self->parent) /* the node's parent was deallocated */ self->parent = nil; } - (id)parentNode { return self->parent; } @end /* NGDOMEntityReference */ SOPE/sope-xml/DOM/DOMNode+QueryPath.h0000644000000000000000000000243412242733417016031 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DOM_DOMNodeQueryPath_H__ #define __DOM_DOMNodeQueryPath_H__ #include #include /* Perform query path lookups on a DOM node. Look into DOMQueryPathExpression for the actual path syntax. */ @class NSString, NSArray; @interface NGDOMNode(QueryPath) /* Evaluate a stack of path specifiers. */ - (id)lookupPathComponents:(NSArray *)_path; /* Same like above using a string */ - (id)lookupQueryPath:(NSString *)_path; @end #endif /* __DOM_DOMNodeQueryPath_H__ */ SOPE/sope-xml/DOM/common.h0000644000000000000000000000223612242733417014156 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DOM_common_H__ #define __DOM_common_H__ #import #ifndef ASSIGN # define ASSIGN(object, value) \ ({id __object = (id)object; \ id __value = (id)value; \ if (__value != __object) { if (__value) [__value retain]; \ if (__object) [__object release]; \ object = __value;}}) #endif #endif /* __DOM_common_H__ */ SOPE/sope-xml/DOM/DOMNodeWithChildren.m0000644000000000000000000001026412242733417016425 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include "common.h" @implementation NGDOMNodeWithChildren - (void)dealloc { [self->childNodes makeObjectsPerformSelector: @selector(_domNodeForgetParentNode:) withObject:nil]; [self->childNodes release]; [super dealloc]; } - (void)_ensureChildNodes { if (self->childNodes == nil) self->childNodes = [[NSMutableArray alloc] init]; } - (BOOL)_isValidChildNode:(id)_node { return YES; } /* navigation */ - (id)childNodes { [self _ensureChildNodes]; /* casting NSMutableArray to DOMNodeList */ return (id)self->childNodes; } - (BOOL)hasChildNodes { return [self->childNodes count] > 0 ? YES : NO; } - (id)firstChild { return [self->childNodes count] > 0 ? [self->childNodes objectAtIndex:0] : nil; } - (id)lastChild { NSUInteger count; return (count = [self->childNodes count]) > 0 ? [self->childNodes objectAtIndex:(count - 1)] : nil; } /* modification */ - (id)removeChild:(id)_node { NSUInteger idx; if (self->childNodes == nil) /* this node has no childnodes ! */ return nil; if ((idx = [self->childNodes indexOfObject:_node]) == NSNotFound) /* given node is not a child of this node ! */ return nil; [[_node retain] autorelease]; [self->childNodes removeObjectAtIndex:idx]; [(id)_node _domNodeForgetParentNode:self]; return _node; } - (id)appendChild:(id)_node { if (_node == nil) /* adding a 'nil' node ?? */ return nil; if ([_node nodeType] == DOM_DOCUMENT_FRAGMENT_NODE) { id fragNodes; NSUInteger i, count; NSMutableArray *cache; fragNodes = [_node childNodes]; if ((count = [fragNodes count]) == 0) /* no nodes to add */ return nil; /* copy to cache, since 'childNodes' result is 'live' and appendChild modifies the tree */ cache = [NSMutableArray arrayWithCapacity:count]; for (i = 0; i < count; i++) [cache addObject:[fragNodes objectAtIndex:i]]; /* append nodes (in reverse order [array implemention is assumed]) .. */ for (i = count = [cache count]; i > 0; i--) [self appendChild:[cache objectAtIndex:(i - 1)]]; } else { id oldParent; if ((oldParent = [_node parentNode])) [oldParent removeChild:_node]; [self _ensureChildNodes]; [self->childNodes addObject:_node]; [(id)_node _domNodeRegisterParentNode:self]; } /* return the node 'added' */ return _node; } /* sibling navigation */ - (id)_domNodeBeforeNode:(id)_node { NSUInteger idx; if ((idx = [self->childNodes indexOfObject:_node]) == NSNotFound) /* given node isn't a child of this node */ return nil; if (idx == 0) /* given node is the first child */ return nil; return [self->childNodes objectAtIndex:(idx - 1)]; } - (id)_domNodeAfterNode:(id)_node { NSUInteger idx, count; if ((count = [self->childNodes count]) == 0) /* this node has no children at all .. */ return nil; if ((idx = [self->childNodes indexOfObject:_node]) == NSNotFound) /* given node isn't a child of this node */ return nil; if (idx == (count - 1)) /* given node is the last child */ return nil; return [self->childNodes objectAtIndex:(idx + 1)]; } @end /* NGDOMNodeWithChildren */ SOPE/sope-xml/DOM/Version0000644000000000000000000000004512242733417014061 0ustar rootroot# version file SUBMINOR_VERSION:=24 SOPE/sope-xml/DOM/DOMCharacterData.h0000644000000000000000000000201512242733417015707 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DOMCharacterData_H__ #define __DOMCharacterData_H__ #include @class NSString; @interface NGDOMCharacterData : NGDOMNode < DOMCharacterData > { id parent; NSString *data; } @end #endif /* __DOMCharacterData_H__ */ SOPE/sope-xml/DOM/DOMNode+QueryPath.m0000644000000000000000000000255712242733417016044 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "DOMNode+QueryPath.h" #include "DOMQueryPathExpression.h" #include "common.h" @implementation NGDOMNode(QueryPath) - (id)lookupPathComponents:(NSArray *)_path { DOMQueryPathExpression *expr; if (_path == nil) return nil; expr = [DOMQueryPathExpression queryPathWithComponents:_path]; return [expr evaluateWithNode:self]; } - (id)lookupQueryPath:(NSString *)_path { DOMQueryPathExpression *expr; if (_path == nil) return nil; expr = [DOMQueryPathExpression queryPathWithString:_path]; return [expr evaluateWithNode:self]; } @end /* DOMNode(QueryPath) */ SOPE/sope-xml/DOM/DOMNode+Enum.h0000644000000000000000000000216012242733417015007 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DOM_DOMNodeEnum_H__ #define __DOM_DOMNodeEnum_H__ #include @class NSEnumerator; @interface NSObject(DOMNodeEnum) - (NSEnumerator *)domParentNodeEnumerator; @end /* NSObject(DOMNodeEnum) */ @interface NGDOMNode(Enum) - (NSEnumerator *)parentNodeEnumerator; @end /* NGDOMNode(Enum) */ #endif /* __DOM_DOMNodeEnum_H__ */ SOPE/sope-xml/DOM/DOMDocumentType.h0000644000000000000000000000247412242733417015652 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DOMDocumentType_H__ #define __DOMDocumentType_H__ #include @interface NGDOMDocumentType : NGDOMNode { id parent; } /* attributes */ - (NSString *)name; - (id)entities; - (id)notations; - (NSString *)publicId; - (NSString *)systemId; - (NSString *)internalSubset; /* node */ @end @interface NGDOMDocumentType(PrivateCtors) /* use DOMDocument for constructing DOMDocumentType's ! */ - (id)initWithName:(NSString *)_name publicId:(NSString *)_pubId systemId:(NSString *)_sysId; @end #endif /* __DOMDocumentType_H__ */ SOPE/sope-xml/DOM/DOMCharacterData.m0000644000000000000000000000512212242733417015716 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "DOMCharacterData.h" #include "common.h" @implementation NGDOMCharacterData - (id)initWithString:(NSString *)_s { if ((self = [super init])) { self->data = [_s copy]; } return self; } - (void)dealloc { [self->data release]; [super dealloc]; } /* attributes */ - (void)setData:(NSString *)_data { id old = self->data; self->data = [_data copy]; [old release]; } - (NSString *)data { return self->data; } - (NSUInteger)length { return [self->data length]; } /* operations */ - (NSString *)substringData:(NSUInteger)_offset count:(NSUInteger)_count { NSRange r; r.location = _offset; r.length = _count; return [[self data] substringWithRange:r]; } - (void)appendData:(NSString *)_data { id old; old = self->data; self->data = old ? [old stringByAppendingString:_data] : _data; [old release]; } - (void)insertData:(NSString *)_data offset:(NSUInteger)_offset { [self doesNotRecognizeSelector:_cmd]; } - (void)deleteData:(NSUInteger)_offset count:(NSUInteger)_count { NSRange r; id new, old; r.location = _offset; r.length = _count; new = [self->data substringWithRange:r]; old = self->data; self->data = [new copy]; [old release]; } - (void)replaceData:(NSUInteger)_offset count:(NSUInteger)_c with:(NSString *)_s { [self doesNotRecognizeSelector:_cmd]; } /* parent node */ - (void)_domNodeRegisterParentNode:(id)_parent { self->parent = _parent; } - (void)_domNodeForgetParentNode:(id)_parent { if (_parent == self->parent) /* the node's parent was deallocated */ self->parent = nil; } - (id)parentNode { return self->parent; } /* QPValues */ - (NSException *)setQueryPathValue:(id)_value { [self setData:[_value stringValue]]; return nil; } - (id)queryPathValue { return [self data]; } @end /* NGDOMCharacterData(QPValues) */ SOPE/sope-xml/DOM/NSObject+StringValue.h0000644000000000000000000000175512242733417016601 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DOM_NSObject_StringValue_H__ #define __DOM_NSObject_StringValue_H__ #import @interface NSObject(StringValue) - (NSString *)stringValue; @end #endif /* __DOM_NSObject_StringValue_H__ */ SOPE/sope-xml/DOM/DOMNotation.m0000644000000000000000000000257112242733417015030 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "DOMNotation.h" @implementation NGDOMNotation - (DOMNodeType)nodeType { return DOM_NOTATION_NODE; } - (BOOL)_isValidChildNode:(id)_node { return NO; } - (BOOL)hasChildNodes { return NO; } - (id)childNodes { return nil; } - (id)appendChild:(id)_node { return nil; } - (id)attributes { return nil; } /* parent node */ - (id)parentNode { return nil; } - (id)nextSibling { return nil; } - (id)previousSibling { return nil; } @end /* NGDOMNotation */ SOPE/sope-xml/DOM/DOM.h0000644000000000000000000000264012242733417013304 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DOM_H__ #define __DOM_H__ /* Standard DOM stuff */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #endif /* __DOM_H__ */ SOPE/sope-xml/DOM/DOMNamedNodeMap.h0000644000000000000000000000155712242733417015523 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DOMNamedNodeMap_H__ #define __DOMNamedNodeMap_H__ #endif /* __DOMNamedNodeMap_H__ */ SOPE/sope-xml/DOM/DOMNodeWalker.m0000644000000000000000000000605512242733417015271 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "DOMNodeWalker.h" #include "DOMNode.h" #include "common.h" @interface NGDOMNodeWalker(Privates) - (void)_processCurrentNode; @end @implementation NGDOMNodeWalker - (id)initWithTarget:(id)_target selector:(SEL)_selector context:(id)_ctx { self->target = [_target retain]; self->selector = _selector; self->ctx = [_ctx retain]; if (self->target == nil) { [self release]; return nil; } if (self->selector == NULL) { [self release]; return nil; } return self; } - (void)dealloc { [self->ctx release]; [self->rootNode release]; [self->target release]; [super dealloc]; } /* accessors */ - (id)context { return self->ctx; } - (id)rootNode { return self->rootNode; } - (id)currentParentNode { return self->currentParentNode; } - (id)currentNode { return self->currentNode; } /* private */ - (void)_processCurrentNode { [self->target performSelector:self->selector withObject:self]; } - (void)_beforeChildren { } - (void)_afterChildren { } - (void)_walkNodeUsingChildNodes:(id)_node { if (self->isStopped) return; self->currentNode = _node; [self _beforeChildren]; if (self->isStopped) return; if ([_node hasChildNodes]) { id children; unsigned i, count; id oldParent; oldParent = self->currentParentNode; self->currentParentNode = self->currentNode; children = [_node childNodes]; for (i = 0, count = [children count]; i < count; i++) { [self _walkNodeUsingChildNodes:[children objectAtIndex:i]]; if (self->isStopped) return; } self->currentParentNode = oldParent; } [self _afterChildren]; if (self->isStopped) return; } /* public */ - (void)walkNode:(id)_node { self->rootNode = [_node retain]; self->isStopped = NO; self->currentParentNode = nil; [self _walkNodeUsingChildNodes:_node]; [self->rootNode release]; self->rootNode = nil; } - (void)stopWalking { self->isStopped = YES; } @end /* NGDOMNodeWalker */ @implementation NGDOMNodePreorderWalker - (void)_beforeChildren { [self _processCurrentNode]; } - (void)_afterChildren { } @end /* NGDOMNodePreorderWalker */ @implementation NGDOMNodePostorderWalker - (void)_beforeChildren { } - (void)_afterChildren { [self _processCurrentNode]; } @end /* NGDOMNodePreorderWalker */ SOPE/sope-xml/DOM/DOMComment.m0000644000000000000000000000231012242733417014626 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "DOMComment.h" @implementation NGDOMComment /* node */ - (DOMNodeType)nodeType { return DOM_COMMENT_NODE; } - (BOOL)_isValidChildNode:(id)_node { return NO; } - (BOOL)hasChildNodes { return NO; } - (id)childNodes { return nil; } - (id)appendChild:(id)_node { return nil; } - (id)attributes { return nil; } @end /* NGDOMComment */ SOPE/sope-xml/DOM/DOMProcessingInstruction.m0000644000000000000000000000460412242733417017612 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "DOMProcessingInstruction.h" #include "common.h" @implementation NGDOMProcessingInstruction - (id)initWithTarget:(NSString *)_target data:(NSString *)_data { if ((self = [super init])) { self->target = [_target copy]; self->data = [_data copy]; } return self; } - (void)dealloc { [self->target release]; [self->data release]; [super dealloc]; } /* attributes */ - (NSString *)target { return self->target; } - (void)setData:(NSString *)_data { id old = self->data; self->data = [_data copy]; [old release]; } - (NSString *)data { return self->data; } /* node */ - (DOMNodeType)nodeType { return DOM_PROCESSING_INSTRUCTION_NODE; } - (id)attributes { return nil; } - (BOOL)_isValidChildNode:(id)_node { return NO; } - (BOOL)hasChildNodes { /* PI's have no children ! */ return NO; } - (id)childNodes { /* PI's have no children ! */ return nil; } - (id)appendChild:(id)_node { /* PI's have no children ! */ return nil; } /* parent node */ - (void)_domNodeRegisterParentNode:(id)_parent { self->parent = _parent; } - (void)_domNodeForgetParentNode:(id)_parent { if (_parent == self->parent) /* the node's parent was deallocated */ self->parent = nil; } - (id)parentNode { return self->parent; } /* description */ - (NSString *)description { return [NSString stringWithFormat:@"<0x%p[%@]: target=%@ data='%@'>", self, NSStringFromClass([self class]), [self target], [self data]]; } @end /* NGDOMProcessingInstruction */ SOPE/sope-xml/DOM/DOMProtocols.h0000644000000000000000000001622212242733417015212 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DOM_DOMProtocols_H__ #define __DOM_DOMProtocols_H__ /* Protocols for DOM objects ... IDL taken from http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010913/DOM3-Core.html */ typedef enum { DOM_UNKNOWN_NODE = 0, DOM_ATTRIBUTE_NODE = 1, DOM_CDATA_SECTION_NODE = 2, DOM_COMMENT_NODE = 3, DOM_DOCUMENT_FRAGMENT_NODE = 4, DOM_DOCUMENT_NODE = 5, DOM_DOCUMENT_TYPE_NODE = 6, DOM_ELEMENT_NODE = 7, DOM_ENTITY_NODE = 8, DOM_ENTITY_REFERENCE_NODE = 9, DOM_NOTATION_NODE = 10, DOM_PROCESSING_INSTRUCTION_NODE = 11, DOM_TEXT_NODE = 12 } DOMNodeType; // TODO: find out which GCC version started to have forward protocols decls ... //#define HAVE_FORWARD_PROTOCOLS 1 #if HAVE_FORWARD_PROTOCOLS @protocol DOMNode; @protocol DOMAttr, DOMCDATASection, DOMComment, DOMDocumentFragment; @protocol DOMDocument, DOMDocumentType, DOMElement, DOMEntity; @protocol DOMEntityReference, DOMNotation, DOMProcessingInstruction; @protocol DOMText; // NOTE: _ONLY_ use those defines for forward declarations! #define IDOMNode id #define IDOMDocument id #define IDOMElement id #else #define IDOMNode id #define IDOMDocument id #define IDOMElement id #endif @protocol DOMNodeList - (NSUInteger)length; - (id)objectAtIndex:(NSUInteger)_idx; // returns the proper attribute node @end /* DOMNodeList */ @protocol DOMNamedNodeMap - (NSUInteger)length; - (id)objectAtIndex:(NSUInteger)_idx; // returns the proper attribute node - (IDOMNode)namedItem:(NSString *)_name; - (IDOMNode)setNamedItem:(IDOMNode)_node; - (IDOMNode)removeNamedItem:(NSString *)_name; /* DOM2 access */ - (IDOMNode)namedItem:(NSString *)_name namespaceURI:(NSString *)_uri; - (IDOMNode)setNamedItemNS:(IDOMNode)_node; - (IDOMNode)removeNamedItem:(NSString *)_name namespaceURI:(NSString *)_uri; @end /* DOMNamedNodeMap */ @protocol DOMNode - (DOMNodeType)nodeType; - (NSString *)nodeName; - (NSString *)nodeValue; - (NSString *)localName; - (NSString *)namespaceURI; - (void)setPrefix:(NSString *)_prefix; - (NSString *)prefix; /* element attributes */ - (id)attributes; /* navigation */ - (id)parentNode; - (id)previousSibling; - (id)nextSibling; - (id)childNodes; - (BOOL)hasChildNodes; - (id)firstChild; - (id)lastChild; /* modification */ - (id)appendChild:(id)_node; - (id)removeChild:(id)_node; /* owner */ - (IDOMDocument)ownerDocument; @end /* DOMNode */ @protocol DOMDocumentFragment < DOMNode > @end @protocol DOMAttr < DOMNode > - (NSString *)name; - (BOOL)specified; - (void)setValue:(NSString *)_value; - (NSString *)value; /* owner */ - (IDOMElement)ownerElement; @end /* DOMAttr */ @protocol DOMCharacterData < DOMNode > - (void)setData:(NSString *)_data; - (NSString *)data; - (NSUInteger)length; - (NSString *)substringData:(NSUInteger)_offset count:(NSUInteger)_count; - (void)appendData:(NSString *)_data; - (void)insertData:(NSString *)_data offset:(NSUInteger)_offset; - (void)deleteData:(NSUInteger)_offset count:(NSUInteger)_count; - (void)replaceData:(NSUInteger)_offs count:(NSUInteger)_count with:(NSString *)_s; @end /* DOMCharacterData */ @protocol DOMComment < DOMCharacterData > @end /* DOMComment */ @protocol DOMText < DOMCharacterData > - (id)splitText:(NSUInteger)_offset; /* DOM Level 3 */ - (BOOL)isWhitespaceInElementContent; - (NSString *)wholeText; - (id)replaceWholeText:(NSString *)_content; @end @protocol DOMCDATASection < DOMText > @end @protocol DOMElement < DOMNode > /* attributes */ - (NSString *)tagName; /* lookup */ - (id)getElementsByTagName:(NSString *)_tagName; - (id)getElementsByTagName:(NSString *)_tagName namespaceURI:(NSString *)_uri; /* element attributes */ - (BOOL)hasAttribute:(NSString *)_attrName; - (BOOL)hasAttribute:(NSString *)_localName namespaceURI:(NSString *)_ns; - (void)setAttribute:(NSString *)_attrName value:(NSString *)_value; - (void)setAttribute:(NSString *)_localName namespaceURI:(NSString *)_ns value:(NSString *)_value; - (NSString *)attribute:(NSString *)_attrName; - (NSString *)attribute:(NSString *)_localName namespaceURI:(NSString *)_ns; - (void)removeAttribute:(NSString *)_attrName; - (void)removeAttribute:(NSString *)_attrName namespaceURI:(NSString *)_ns; - (id)setAttributeNode:(id)_attrNode; - (id)removeAttributeNode:(id)_attrNode; - (id)setAttributeNodeNS:(id)_attrNode; - (id)removeAttributeNodeNS:(id)_attrNode; @end /* DOMElement */ @protocol DOMDocumentType < DOMNode > @end /* DOMDocumentType */ @protocol DOMProcessingInstruction < DOMNode > - (NSString *)target; - (NSString *)data; @end /* DOMProcessingInstruction */ @protocol DOMEntityReference < DOMNode > @end @class NGDOMImplementation; @protocol DOMDocument < DOMNode > - (id)doctype; - (NGDOMImplementation *)implementation; - (id)documentElement; - (id)getElementsByTagName:(NSString *)_tagName; - (id)getElementsByTagName:(NSString *)_tagName namespaceURI:(NSString *)_uri; - (id)getElementById:(NSString *)_eid; /* creation */ - (id)createElement:(NSString *)_tagName; - (id)createElement:(NSString *)_tagName namespaceURI:(NSString *)_uri; - (id)createDocumentFragment; - (id)createTextNode:(NSString *)_data; - (id)createComment:(NSString *)_data; - (id)createCDATASection:(NSString *)_data; - (id) createProcessingInstruction:(NSString *)_target data:(NSString *)_data; - (id)createAttribute:(NSString *)_name; - (id)createAttribute:(NSString *)_name namespaceURI:(NSString *)_uri; - (id)createEntityReference:(NSString *)_name; @end /* DOMDocument */ #endif /* __DOM_DOMProtocols_H__ */ SOPE/sope-xml/umbrella.make0000644000000000000000000000136712242733420014536 0ustar rootroot# build umbrella framework for this subproject ifeq ($(frameworks),yes) FRAMEWORK_NAME = sope-xml sope-xml_RESOURCE_FILES += Version sope-xml_C_FILES = dummy.c sope-xml_UMBRELLA_FRAMEWORKS = \ SaxObjC \ DOM \ XmlRpc sope-xml_PREBIND_ADDR = 0xC0FF0000 # generic (consolidate in gstep-make) $(FRAMEWORK_NAME)_LDFLAGS += \ $(foreach fwname,$($(FRAMEWORK_NAME)_UMBRELLA_FRAMEWORKS),\ -framework $(fwname)) \ $(foreach fwname,$($(FRAMEWORK_NAME)_UMBRELLA_FRAMEWORKS),\ -sub_umbrella $(fwname)) \ -headerpad_max_install_names \ -seg1addr $($(FRAMEWORK_NAME)_PREBIND_ADDR) # library/framework search pathes DEP_DIRS += SaxObjC DOM XmlRpc ADDITIONAL_LIB_DIRS += \ $(foreach dir,$(DEP_DIRS),-F$(GNUSTEP_BUILD_DIR)/$(dir)) endif SOPE/sope-xml/libxmlSAXDriver/0000755000000000000000000000000012242733420015104 5ustar rootrootSOPE/sope-xml/libxmlSAXDriver/fhs.make0000644000000000000000000000136212242733420016525 0ustar rootroot# postprocessing # FHS support (this is a hack and is going to be done by gstep-make!) ifneq ($(FHS_INSTALL_ROOT),) ifeq ($(findstring _64, $(GNUSTEP_TARGET_CPU)), _64) FHS_LIB_DIR=$(FHS_INSTALL_ROOT)/lib64/ else FHS_LIB_DIR=$(FHS_INSTALL_ROOT)/lib/ endif FHS_SAX_DIR=$(FHS_LIB_DIR)sope-$(MAJOR_VERSION).$(MINOR_VERSION)/saxdrivers/ fhs-sax-dirs :: $(MKDIRS) $(FHS_SAX_DIR) move-bundles-to-fhs :: fhs-sax-dirs @echo "moving bundles $(BUNDLE_INSTALL_DIR) to $(FHS_SAX_DIR) .." for i in $(BUNDLE_NAME); do \ j="$(FHS_SAX_DIR)/$${i}$(BUNDLE_EXTENSION)"; \ if test -d $$j; then rm -r $$j; fi; \ mv "$(BUNDLE_INSTALL_DIR)/$${i}$(BUNDLE_EXTENSION)" $$j; \ done move-to-fhs :: move-bundles-to-fhs after-install :: move-to-fhs endif SOPE/sope-xml/libxmlSAXDriver/README0000644000000000000000000000033612242733420015766 0ustar rootrootlibxmlSAXDriver =============== This directory contains the sources for a SAX driver bundle that works on top of the libxml2 library. It can be used for processing XML, but also for parsing HTML. Requirements: - libxml2 SOPE/sope-xml/libxmlSAXDriver/GNUmakefile0000644000000000000000000000114712242733420017161 0ustar rootroot# GNUstep makefile include ../../config.make include $(GNUSTEP_MAKEFILES)/common.make include ../Version include ./Version BUNDLE_NAME = libxmlSAXDriver BUNDLE_EXTENSION = .sax BUNDLE_INSTALL_DIR = $(SOPE_SAXDRIVERS) libxmlSAXDriver_PCH_FILE = common.h libxmlSAXDriver_OBJC_FILES = \ libxmlSAXDriver.m \ libxmlHTMLSAXDriver.m \ libxmlDocSAXDriver.m \ libxmlSAXLocator.m \ TableCallbacks.m \ libxmlSAXDriver_RESOURCE_FILES = bundle-info.plist Version libxmlSAXDriver_LOCALIZED_RESOURCE_FILES = -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/bundle.make -include GNUmakefile.postamble SOPE/sope-xml/libxmlSAXDriver/GNUmakefile.postamble0000644000000000000000000000042112242733420021140 0ustar rootroot# postprocessing # add bundle-info.plist file ifneq ($(GNUSTEP_BUILD_DIR),) after-all :: @(cp bundle-info.plist \ $(GNUSTEP_BUILD_DIR)/$(BUNDLE_NAME)$(BUNDLE_EXTENSION)) else after-all :: @(cd $(BUNDLE_NAME)$(BUNDLE_EXTENSION);\ cp ../bundle-info.plist .) endif SOPE/sope-xml/libxmlSAXDriver/COPYING0000644000000000000000000006130312242733420016142 0ustar rootroot GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 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. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] 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 Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, 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 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 a program 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. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, 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 companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. 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, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library 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 compile 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) 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. c) 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. d) 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 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. 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 to 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 Library 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 Appendix: 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 Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library 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! SOPE/sope-xml/libxmlSAXDriver/libxmlSAXLocator.h0000644000000000000000000000266712242733420020457 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __libxmlSAXLocator_H__ #define __libxmlSAXLocator_H__ #import #import #include @interface libxmlSAXLocator : NSObject < SaxLocator > { @public id parser; void *ctx; const xmlChar *(*getPublicId)(void *ctx); const xmlChar *(*getSystemId)(void *ctx); int (*getLineNumber)(void *ctx); int (*getColumnNumber)(void *ctx); } - (id)initWithSaxLocator:(xmlSAXLocatorPtr)_loc parser:(id)_parser; - (void)clear; /* accessors */ - (int)columnNumber; - (int)lineNumber; - (NSString *)publicId; - (NSString *)systemId; @end #endif /* __libxmlSAXLocator_H__ */ SOPE/sope-xml/libxmlSAXDriver/libxmlDocSAXDriver.m0000644000000000000000000004474412242733420020744 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import "libxmlDocSAXDriver.h" #import "libxmlSAXLocator.h" #include #include #include "common.h" #include #include #include @interface libxmlDocSAXDriver(PrivateMethods) - (void)tearDownParser; - (BOOL)walkDocumentTree:(xmlDocPtr)_doc; - (BOOL)processNode:(xmlNodePtr)_node; - (BOOL)processTextNode:(xmlNodePtr)_node; - (BOOL)processChildren:(xmlNodePtr)children; @end static int _UTF8ToUTF16(unsigned char **sourceStart, unsigned char *sourceEnd, unichar **targetStart, const unichar *targetEnd); static inline NSString *xmlCharsToString(const xmlChar *_s) { static Class NSStringClass = Nil; if (NSStringClass == Nil) NSStringClass = [NSString class]; return _s ? [[NSStringClass alloc] initWithUTF8String:(const char*)_s] : nil; } static NSString *SaxDeclHandlerProperty = @"http://xml.org/sax/properties/declaration-handler"; static NSString *SaxLexicalHandlerProperty = @"http://xml.org/sax/properties/lexical-handler"; @implementation libxmlDocSAXDriver static libxmlDocSAXDriver *activeDriver = nil; static void warning(void *udata, const char *msg, ...); static void error(void *udata, const char *msg, ...); static void fatalError(void *udata, const char *msg, ...); static void setLocator(void *udata, xmlSAXLocatorPtr _locator); - (id)init { if ((self = [super init])) { self->encodeEntities = NO; } return self; } - (void)dealloc { [self tearDownParser]; [self->lexicalHandler release]; [self->declHandler release]; [self->contentHandler release]; [self->dtdHandler release]; [self->errorHandler release]; [self->entityResolver release]; [super dealloc]; } /* features & properties */ - (void)setFeature:(NSString *)_name to:(BOOL)_value { [SaxNotRecognizedException raise:@"FeatureException" format:@"don't know feature %@", _name]; } - (BOOL)feature:(NSString *)_name { [SaxNotRecognizedException raise:@"FeatureException" format:@"don't know feature %@", _name]; return NO; } - (void)setProperty:(NSString *)_name to:(id)_value { if ([_name isEqualToString:SaxLexicalHandlerProperty]) { ASSIGN(self->lexicalHandler, _value); return; } if ([_name isEqualToString:SaxDeclHandlerProperty]) { ASSIGN(self->declHandler, _value); return; } [SaxNotRecognizedException raise:@"PropertyException" format:@"don't know property %@", _name]; } - (id)property:(NSString *)_name { if ([_name isEqualToString:SaxLexicalHandlerProperty]) return self->lexicalHandler; if ([_name isEqualToString:SaxDeclHandlerProperty]) return self->declHandler; [SaxNotRecognizedException raise:@"PropertyException" format:@"don't know property %@", _name]; return nil; } /* handlers */ - (void)setDTDHandler:(id)_handler { ASSIGN(self->dtdHandler, _handler); } - (id)dtdHandler { return self->dtdHandler; } - (void)setErrorHandler:(id)_handler { ASSIGN(self->errorHandler, _handler); } - (id)errorHandler { return self->errorHandler; } - (void)setEntityResolver:(id)_handler { ASSIGN(self->entityResolver, _handler); } - (id)entityResolver { return self->entityResolver; } - (void)setContentHandler:(id)_handler { ASSIGN(self->contentHandler, _handler); } - (id)contentHandler { return self->contentHandler; } /* libxml */ - (void)setupParserWithDocumentPath:(NSString *)_path { static xmlSAXHandler sax; NSAssert(self->ctxt == NULL, @"DocSAX parser context already setup !"); memcpy(&sax, &xmlDefaultSAXHandler, sizeof(xmlSAXHandler)); sax.error = error; sax.warning = warning; sax.fatalError = fatalError; sax.setDocumentLocator = setLocator; NSAssert(activeDriver == nil, @"a parser is already running !"); activeDriver = self; self->ctxt = xmlCreatePushParserCtxt(&sax /* sax */, NULL /*self*/ /* userdata */, NULL /* chunk */, 0 /* chunklen */, [_path cString] /* filename */); self->doc = NULL; } - (void)tearDownParser { if (activeDriver == self) activeDriver = nil; if (self->doc) { xmlFreeDoc(self->doc); self->doc = NULL; } if (self->ctxt) { xmlFreeParserCtxt(self->ctxt); self->ctxt = NULL; } } /* IO */ - (void)pushBytes:(const char *)_bytes count:(unsigned)_len { if (_len == 0) return; NSAssert(self->ctxt, @"missing DocSAX parser context"); xmlParseChunk(self->ctxt, _bytes, _len, 0); } - (void)pushEOF { char dummyByte; xmlParseChunk(self->ctxt, &dummyByte, 0, 1 /* terminate */); self->doc = ((xmlParserCtxtPtr)ctxt)->myDoc; } /* parsing */ - (void)_parseFromData:(NSData *)_data systemId:(NSString *)_sysId { NSAutoreleasePool *pool; pool = [[NSAutoreleasePool alloc] init]; /* parse into structure */ [self setupParserWithDocumentPath:_sysId]; [self pushBytes:[_data bytes] count:[_data length]]; [self pushEOF]; if (self->doc == NULL) { NSLog(@"Couldn't parse file: %@", _sysId); [self tearDownParser]; } else { //NSLog(@"parsed file: %@", _sysId); [self walkDocumentTree:self->doc]; [self tearDownParser]; } [pool release]; } - (void)parseFromSource:(id)_source systemId:(NSString *)_sysId { if ([_source isKindOfClass:[NSData class]]) { [self _parseFromData:_source systemId:nil]; return; } if ([_source isKindOfClass:[NSString class]]) { [self _parseFromData:[_source dataUsingEncoding:NSISOLatin1StringEncoding] systemId:nil]; return; } if ([_source isKindOfClass:[NSURL class]]) { NSData *data; data = [_source isFileURL] ? (NSData *)[NSData dataWithContentsOfMappedFile:[_source path]] : [_source resourceDataUsingCache:YES]; [self _parseFromData:data systemId:[_source absoluteString]]; return; } { SaxParseException *e; NSDictionary *ui; ui = [[NSDictionary alloc] initWithObjectsAndKeys: _source ? _source : (id)@"", @"source", self, @"parser", nil]; e = (id)[SaxParseException exceptionWithName:@"SaxIOException" reason:@"cannot handle data-source" userInfo:ui]; [ui release]; ui = nil; [self->errorHandler fatalError:e]; } } - (void)parseFromSource:(id)_source { if ([_source isKindOfClass:[NSString class]]) [self parseFromSource:_source systemId:@""]; else if ([_source isKindOfClass:[NSData class]]) [self parseFromSource:_source systemId:@""]; else if ([_source isKindOfClass:[NSURL class]]) [self parseFromSource:_source systemId:[_source absoluteString]]; else [self parseFromSource:_source systemId:@""]; } - (void)parseFromSystemId:(NSString *)_sysId { NSAutoreleasePool *pool; NSData *data; if (![_sysId hasPrefix:@"file://"]) { /* exception */ return; } pool = [[NSAutoreleasePool alloc] init]; /* cut off file:// */ _sysId = [_sysId substringFromIndex:7]; /* load data */ data = [NSData dataWithContentsOfFile:_sysId]; [self _parseFromData:data systemId:_sysId]; [pool release]; } /* process attribute nodes */ - (SaxAttributes *)processAttributes:(xmlAttrPtr)_attributes { xmlAttrPtr attribute; SaxAttributes *attributes; if (_attributes == NULL) /* nothing to process */ return nil; /* setup or clear attribute cache */ attributes = [[SaxAttributes alloc] init]; /* add attributes */ for (attribute = _attributes; attribute; attribute = attribute->next) { NSString *name; NSString *value; NSString *nsuri; #if 0 printf("attr name '%s' has NS '%s'\n", attribute->name, attribute->ns ? "yes" : "no"); #endif name = xmlCharsToString(attribute->name); value = @""; if (attribute->children) { xmlChar *t; if ((t = xmlNodeListGetString(doc, attribute->children, 0))) { value = xmlCharsToString(t); free(t); /* should be xmlFree ?? */ } } nsuri = (attribute->ns != NULL) ? xmlCharsToString(attribute->ns->href) : (NSString *)nil; [attributes addAttribute:name uri:nsuri rawName:name type:@"CDATA" value:value]; [nsuri release]; nsuri = nil; [name release]; name = nil; [value release]; value = nil; } return attributes; } /* walking the tree, generating SAX events */ - (BOOL)_resolveEntityReferences { return YES; } - (BOOL)processEntityRefNode:(xmlNodePtr)_node { if ([self _resolveEntityReferences]) return [self processTextNode:_node]; else { NSString *refName; NSString *entityValue; refName = xmlCharsToString(_node->name); entityValue = xmlCharsToString(_node->content); #if 0 NSLog(@"%s:%i: Ignoring entity ref: '%@' %s\n", __PRETTY_FUNCTION__, __LINE__, refName, _node->content); #endif [entityValue release]; [refName release]; return YES; } } - (BOOL)processDocumentNode:(xmlNodePtr)node { BOOL result; [self->contentHandler startDocument]; [self->contentHandler startPrefixMapping:@"" uri:@"http://www.w3.org/XML/1998/namespace"]; result = [self processChildren:node->children]; [self->contentHandler endPrefixMapping:@""]; [self->contentHandler endDocument]; return result; } - (BOOL)processTextNode:(xmlNodePtr)_node { static unichar c = '\0'; if (self->contentHandler == nil) return YES; if (_node->content) { xmlChar *chars; if (self->encodeEntities) { /* should use the DocSAX encoding routine (htmlEncodeEntities) ??? */ chars = xmlEncodeEntitiesReentrant(self->doc, _node->content); } else chars = _node->content; if (chars == NULL) { [self->contentHandler characters:&c length:0]; } else { void *data, *ts; unsigned len; len = strlen((char *)chars); data = ts = calloc(len + 1, sizeof(unichar)); /* GC ?! */ if (_UTF8ToUTF16((void *)&chars, (void *)(chars + len), (void *)&ts, ts + (len * sizeof(unichar)))) { free(data); NSLog(@"ERROR(%s:%i): couldn't convert UTF8 to UTF16 !", __PRETTY_FUNCTION__, __LINE__); return NO; } [self->contentHandler characters:data length:(unsigned)(ts - data)]; free(data); } } else [self->contentHandler characters:&c length:0]; return YES; } - (BOOL)processCommentNode:(xmlNodePtr)_node { unichar c = '\0'; if (self->lexicalHandler == nil) return YES; if (_node->content) { xmlChar *chars; /* uses the DocSAX encoding routine !!!!!!!!!! */ chars = xmlEncodeEntitiesReentrant(self->doc, _node->content); if (chars == NULL) { [self->lexicalHandler comment:&c length:0]; } else { void *data, *ts; unsigned len; len = strlen((const char *)chars); data = ts = calloc(len + 1, sizeof(unichar)); /* GC ?! */ if (_UTF8ToUTF16((void *)&chars, (void *)(chars + len), (void *)&ts, ts + (len * sizeof(unichar)))) { free(data); NSLog(@"ERROR(%s:%i): couldn't convert UTF8 to UTF16 !", __PRETTY_FUNCTION__, __LINE__); return NO; } [self->lexicalHandler comment:data length:(ts - data)]; free(data); } } else [self->lexicalHandler comment:&c length:0]; return YES; } - (BOOL)processDTDNode:(xmlNodePtr)node { /* do nothing with DTD nodes .. */ return YES; } - (BOOL)processEntityNode:(xmlNodePtr)node { /* do nothing with entity nodes .. */ NSLog(@"%s:%i: ignoring entity node (name='%s') ...", __PRETTY_FUNCTION__, __LINE__, node->name); return YES; } - (BOOL)processPINode:(xmlNodePtr)node { NSString *piName; NSString *piValue; piName = xmlCharsToString(node->name); piValue = xmlCharsToString(node->content); [self->contentHandler processingInstruction:piName data:piValue]; [piName release]; [piValue release]; return YES; } - (BOOL)processElementNode:(xmlNodePtr)node { id attrs; NSString *tagName; NSString *nsuri; BOOL result; self->depth++; tagName = xmlCharsToString(node->name); nsuri = (node->ns != NULL) ? xmlCharsToString(node->ns->href) : (NSString *)nil; attrs = [self processAttributes:node->properties]; [self->contentHandler startElement:tagName namespace:nsuri rawName:tagName attributes:attrs]; [attrs release]; attrs = nil; result = [self processChildren:node->children]; [self->contentHandler endElement:tagName namespace:nsuri rawName:tagName]; self->depth--; [nsuri release]; nsuri = nil; [tagName release]; tagName = nil; [attrs release]; attrs = nil; return result; } - (BOOL)processChildren:(xmlNodePtr)children { xmlNodePtr node; if (children == NULL) return YES; for (node = children; node; node = node->next) { [self processNode:node]; } return YES; } - (BOOL)processNode:(xmlNodePtr)_node { switch(_node->type) { case XML_ELEMENT_NODE: return [self processElementNode:_node]; case XML_ATTRIBUTE_NODE: NSLog(@"invalid place for attribute-node !"); return NO; case XML_TEXT_NODE: return [self processTextNode:_node]; case XML_CDATA_SECTION_NODE: return [self processTextNode:_node]; case XML_ENTITY_REF_NODE: return [self processEntityRefNode:_node]; case XML_ENTITY_NODE: return [self processEntityNode:_node]; case XML_PI_NODE: return [self processPINode:_node]; case XML_COMMENT_NODE: return [self processCommentNode:_node]; case XML_DOCUMENT_NODE: return [self processDocumentNode:_node]; case XML_DTD_NODE: return [self processDTDNode:_node]; default: NSLog(@"WARNING: UNKNOWN node type %i\n", _node->type); break; } return NO; } - (BOOL)walkDocumentTree:(xmlDocPtr)_doc { int type; BOOL result; type = ((xmlDocPtr)self->doc)->type; ((xmlDocPtr)self->doc)->type = XML_DOCUMENT_NODE; result = [self processNode:(xmlNodePtr)self->doc]; ((xmlDocPtr)self->doc)->type = type; return result; } /* callbacks */ static SaxParseException * mkException(libxmlDocSAXDriver *self, NSString *key, const char *msg, va_list va) { NSString *s, *reason; NSDictionary *ui; SaxParseException *e; int count = 0, i; id keys[7], values[7]; id tmp; NSRange r; s = [NSString stringWithCString:msg]; s = [[[NSString alloc] initWithFormat:s arguments:va] autorelease]; r = [s rangeOfString:@"\n"]; reason = (r.length > 0) ? [s substringToIndex:r.location] : s; if ([reason length] == 0) reason = @"unknown reason"; keys[0] = @"parser"; values[0] = self; count++; keys[1] = @"depth"; values[1] = [NSNumber numberWithInt:self->depth]; count++; if ([s length] > 0) { keys[count] = @"errorMessage"; values[count] = s; count++; } // NSLog(@"locator: %@", self->locator); if ((i = [self->locator lineNumber]) >= 0) { keys[count] = @"line"; values[count] = [NSNumber numberWithInt:i]; count++; } if ((i = [self->locator columnNumber]) >= 0) { keys[count] = @"column"; values[count] = [NSNumber numberWithInt:i]; count++; } if ((tmp = [self->locator publicId])) { keys[count] = @"publicId"; values[count] = tmp; count++; } if ((tmp = [self->locator systemId])) { keys[count] = @"systemId"; values[count] = tmp; count++; } ui = [NSDictionary dictionaryWithObjects:values forKeys:keys count:count]; e = (id)[SaxParseException exceptionWithName:key reason:reason userInfo:ui]; return e; } static void warning(void *udata, const char *msg, ...) { va_list args; SaxParseException *e; NSCAssert(activeDriver, @"no driver is active !"); va_start(args, msg); e = mkException(activeDriver, @"SAXWarning", msg, args); va_end(args); [activeDriver->errorHandler warning:e]; } static void error(void *udata, const char *msg, ...) { va_list args; SaxParseException *e; NSCAssert(activeDriver, @"no driver is active !"); va_start(args, msg); e = mkException(activeDriver, @"SAXError", msg, args); va_end(args); [activeDriver->errorHandler error:e]; } static void fatalError(void *udata, const char *msg, ...) { va_list args; SaxParseException *e; NSCAssert(activeDriver, @"no driver is active !"); va_start(args, msg); e = mkException(activeDriver, @"SAXFatalError", msg, args); va_end(args); [activeDriver->errorHandler fatalError:e]; } static void setLocator(void *udata, xmlSAXLocatorPtr _locator) { NSCAssert(activeDriver, @"no driver is active !"); [activeDriver->locator release]; activeDriver->locator = [[libxmlSAXLocator alloc] initWithSaxLocator:_locator parser:activeDriver]; activeDriver->locator->ctx = activeDriver->ctxt; [activeDriver->contentHandler setDocumentLocator:activeDriver->locator]; } @end /* libxmlDocSAXDriver */ #include "unicode.h" SOPE/sope-xml/libxmlSAXDriver/libxmlDocSAXDriver.h0000644000000000000000000000306512242733420020726 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include /* recognized properties: http://xml.org/sax/properties/declaration-handler http://xml.org/sax/properties/lexical-handler http://www.skyrix.com/sax/properties/html-namespace */ @class libxmlSAXLocator; @interface libxmlDocSAXDriver : NSObject < SaxXMLReader > { id contentHandler; id dtdHandler; id errorHandler; id entityResolver; id lexicalHandler; id declHandler; unsigned depth; BOOL encodeEntities; libxmlSAXLocator *locator; /* libxml */ void *doc; void *ctxt; } @end SOPE/sope-xml/libxmlSAXDriver/COPYRIGHT0000644000000000000000000000010612242733420016374 0ustar rootrootCopyright (C) 2000-2005 SKYRIX Software AG Contact: info@skyrix.com SOPE/sope-xml/libxmlSAXDriver/libxmlSAXLocator.m0000644000000000000000000000441412242733420020454 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import "libxmlSAXLocator.h" #include "common.h" @implementation libxmlSAXLocator - (id)initWithSaxLocator:(xmlSAXLocatorPtr)_loc parser:(id)_parser { if (_loc == NULL) { [self release]; return nil; } self->parser = _parser; self->getPublicId = _loc->getPublicId; self->getSystemId = _loc->getSystemId; self->getLineNumber = _loc->getLineNumber; self->getColumnNumber = _loc->getColumnNumber; return self; } - (void)clear { self->parser = nil; } /* accessors */ - (int)columnNumber { //return -1; NSAssert(self->ctx, @"missing locator ctx .."); return self->getColumnNumber ? self->getColumnNumber(self->ctx) : -1; } - (int)lineNumber { //return -1; NSAssert(self->ctx, @"missing locator ctx .."); return self->getLineNumber ? self->getLineNumber(self->ctx) : -1; } - (NSString *)publicId { const xmlChar *s; //return nil; s = self->getPublicId ? self->getPublicId(self->ctx) : NULL; return s ? [NSString stringWithCString:(const char *)s] : nil; } - (NSString *)systemId { const xmlChar *s; //return nil; s = self->getSystemId ? self->getSystemId(self->ctx) : NULL; return s ? [NSString stringWithCString:(const char *)s] : nil; } /* description */ - (NSString *)description { return [NSString stringWithFormat:@"<0x%p[%@]: pub=%@ sys=%@ L%i C%i>", self, NSStringFromClass([self class]), [self publicId], [self systemId], [self lineNumber], [self columnNumber]]; } @end /* libxmlSaxLocator */ SOPE/sope-xml/libxmlSAXDriver/unicode.h0000644000000000000000000000652712242733420016715 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Unicode support */ typedef unsigned long UCS4; typedef unsigned short UCS2; typedef unsigned short UTF16; typedef unsigned char UTF8; #define unichar UTF16 static const int halfShift = 10; static const UCS4 halfBase = 0x0010000UL; static const UCS4 halfMask = 0x3FFUL; static const UCS4 kSurrogateHighStart = 0xD800UL; static const UCS4 kSurrogateLowStart = 0xDC00UL; static const UCS4 kReplacementCharacter = 0x0000FFFDUL; static const UCS4 kMaximumUCS2 = 0x0000FFFFUL; static const UCS4 kMaximumUTF16 = 0x0010FFFFUL; static UCS4 offsetsFromUTF8[6] = { 0x00000000UL, 0x00003080UL, 0x000E2080UL, 0x03C82080UL, 0xFA082080UL, 0x82082080UL }; static char bytesFromUTF8[256] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5 }; static int _UTF8ToUTF16(unsigned char **sourceStart, unsigned char *sourceEnd, unichar **targetStart, const unichar *targetEnd) { int result = 0; register UTF8 *source = *sourceStart; register UTF16 *target = *targetStart; while (source < sourceEnd) { register UCS4 ch = 0; register unsigned short extraBytesToWrite = bytesFromUTF8[*source]; if (source + extraBytesToWrite > sourceEnd) { result = 1; break; }; switch(extraBytesToWrite) { /* note: code falls through cases! */ case 5: ch += *source++; ch <<= 6; case 4: ch += *source++; ch <<= 6; case 3: ch += *source++; ch <<= 6; case 2: ch += *source++; ch <<= 6; case 1: ch += *source++; ch <<= 6; case 0: ch += *source++; }; ch -= offsetsFromUTF8[extraBytesToWrite]; if (target >= targetEnd) { result = 2; break; }; if (ch <= kMaximumUCS2) { *target++ = ch; } else if (ch > kMaximumUTF16) { *target++ = kReplacementCharacter; } else { if (target + 1 >= targetEnd) { result = 2; break; }; ch -= halfBase; *target++ = (ch >> halfShift) + kSurrogateHighStart; *target++ = (ch & halfMask) + kSurrogateLowStart; }; }; *sourceStart = source; *targetStart = target; return result; } SOPE/sope-xml/libxmlSAXDriver/ChangeLog0000644000000000000000000002320512242733420016660 0ustar rootroot2009-03-24 Wolfgang Sourdeau * libxmlHTMLSAXDriver.m: added a hack to allow the content-handler to specify the input charset (hh: this hack should be fixed) (v4.7.29) 2009-03-24 Wolfgang Sourdeau * libxmlSAXDriver.m (_startElement): autorelease "nsDict" when its instantiated from a copy of "ns" (v4.7.28) 2006-07-03 Helge Hess * libXMLSaxDriver.m: fixed last changes for libFoundation (v4.5.24) 2007-03-18 Marcus Mueller * libxmlSAXDriver.m: rewrote decoding of hexadecimal entities as this used functionality not present in libFoundation (v4.7.26) 2007-03-15 Marcus Mueller * libxmlSAXDriver.m: properly decode #%i; values in attributes - libxml2 doesn't decode them properly, but the driver is expected to do so. While fixing this also refrained from using the global uniqued string cache for these values (I guess the former is correct for tags and attribute names, but using it for values feels somewhat odd). (v4.7.25) 2006-07-03 Helge Hess * v4.5.24 * use %p for pointer formats, fixed gcc 4.1 warnings * improved retain-count for exception userInfo dicts 2005-11-17 Helge Hess * properly include string.h to avoid warnings (v4.5.23) 2005-09-14 Helge Hess * libxmlSAXDriver.m: improved 'activeDriver' handling in some edge condition (v4.5.22) 2005-08-16 Helge Hess * install into SaxObjC framework Resources when being used with OSX (v4.5.21) 2005-07-20 Helge Hess * TableCallbacks.m: fixed a compilation issues with either gcc 4.0.1 or Sarge (v4.5.20) 2005-05-06 Helge Hess * libxmlSAXDriver.m: minor improvements to error messages (v4.5.19) 2005-05-03 Helge Hess * fixed loads of gcc 4.0 warnings (v4.5.18) 2004-12-14 Marcus Mueller * libxmlSAXDriver.xcode: minor fixes 2004-11-04 Helge Hess * use Version file for install directory location 2004-11-04 Helge Hess * fhs.make, GNUmakefile: use Version file to set install dir 2004-09-22 Marcus Mueller * libxmlSAXDriver.xcode: minor fixes 2004-09-21 Marcus Mueller * libxmlSAXDriver.xcode: Fixed library search path * libxmlSAXDriver.xcode: Fixed dependencies to resemble the make process more closely. Our aim should be to stick to the make process as closely as possible, so we shouldn't introduce dependencies in non-toplevel projects. Also added a new copy files phase to copy the resulting bundle to a well-known place where the SaxObjC framework can later pick it up for inclusion in its framework wrapper. 2004-08-29 Helge Hess * added hack to install the project in FHS locations - the SAX driver will be installed in FHS_INSTALL_ROOT if specified (eg make FHS_INSTALL_ROOT=/usr/local) (v4.3.17) 2004-08-26 Marcus Mueller * libxmlSAXDriver.xcode: new Xcode project 2004-08-25 Helge Hess * v4.3.16 * libxmlHTMLSAXDriver.m: generate SAX events (HTML/BODY) for empty documents * libxmlDocSAXDriver.m, libxmlHTMLSAXDriver.m: allows NSURL objects as the source for parsing 2004-08-24 Helge Hess * GNUmakefile: install SAX driver in Library/SaxDrivers-4.3/ (v4.3.15) * GNUmakefile: install SAX driver in Library/SaxDrivers/4.3/ (v4.3.14) 2004-05-07 Helge Hess * libxmlHTMLSAXDriver.m: do not report unclosed entity references (as they often appear as query parameters in URLs) per default, can be enabled using the libxmlHTMLSAXDriverReportUnclosedEntityRefs default (v4.2.13) * libxmlHTMLSAXDriver.m: invalid tags are now reported to the SAX error handler if you enable the libxmlHTMLSAXDriverReportInvalidTags default (v4.2.12) 2004-05-05 Marcus Mueller * v4.2.11 * GNUmakefile, GNUmakefile.preamble: added support for building with GNUSTEP_BUILD_DIR environment variable set for recent gnustep-make package. * GNUmakefile.preamble: get libxml_INCLUDE_DIR and libxml_LIBS via xml2-config instead of hardcoding. This plays nicely on systems that use their own libxml as well as on GNUstep installations that install an own copy of libxml2 in GNUSTEP_ROOT, because xml2-config will be found in PATH prior to the system one. 2003-12-10 Helge Hess * GNUmakefile: install driver in GNUSTEP_INSTALLATION_DIR instead of GNUSTEP_USER_DIR, as "demanded" by Nicola ;-) (v4.2.10) 2003-12-03 Helge Hess * GNUmakefile: include common.make from GNUSTEP_MAKEFILES (v4.2.9) 2003-10-15 Helge Hess * created GNUmakefile.preamble, look for libxml2 in Fink (/sw/lib) if we are building on darwin6 (v4.2.8) 2003-10-13 Helge Hess * libxmlSAXDriver.m: fixed a void-return issue (v4.2.7) 2003-08-29 Helge Hess * libxmlSAXDriver.m: fixed compilation on Cocoa (v4.2.6) 2003-07-21 Helge Hess * libxmlSAXDriver.m: improved XML charset detection (v4.2.5) 2003-07-02 Helge Hess * libxmlHTMLSAXDriver.m: proper handling of system-id (v4.2.4) * libxmlHTMLSAXDriver.m: changed not to report "invalid tag" errors, used for allowing SKYOBJ tags in .html files (v4.2.3) * unicode.h: removed some unused statics 2003-06-23 Helge Hess * v4.2.2 * added Version file to bundle * libxmlHTMLSAXDriver.m: do not log unsupported features 2003-01-14 Helge Hess * GNUmakefile (ADDITIONAL_INCLUDE_DIRS): added /usr/include/libxml2 for cases were we compile without sxsys-libxml2 2003-01-07 Helge Hess * removed dependency on FoundationExt on MacOSX Thu Jan 2 10:53:25 2003 Helge Hess * replaced usage of RETAIN macros with method calls Thu Oct 17 20:27:14 2002 Helge Hess * libxmlSAXDriver.m: fixed a rare problem where an element was popped from the namespace stack in endDocument, but the stack was empty 2002-06-04 Helge Hess * GNUmakefile: fixed linking of libSaxObjC if SaxObjC isn't installed yet Sun May 5 18:57:02 2002 Helge Hess * removed SAX1 document handler Thu May 2 12:21:48 2002 Helge Hess * added own NSMapTable callbacks since NSNonOwnedCStringMapKeyCallBacks aren't available on MacOSX and gstep-base * changed bundle to use -rangeOfString: instead of -indexOfString: Mon Feb 11 17:33:52 2002 Helge Hess * libxmlSAXDriver.m: fixed bug in XML charset detection Sat Feb 9 13:39:55 2002 Helge Hess * libxmlSAXDriver.m: made less sensible regarding whitespace before XML declaration * libxmlSAXDriver.m: added charset detection for NSString's containing XML Wed Nov 14 13:02:13 2001 Helge Hess * libxmlHTMLSAXDriver.m: fixed bug: unicode length was incorrectly calculated * libxmlHTMLSAXDriver.m: check for empty text nodes Tue Nov 13 16:22:13 2001 Helge Hess * libxmlHTMLSAXDriver.m: don't throw exception on unrecognized features Mon Nov 5 14:13:45 2001 Helge Hess * libxmlSAXDriver.m: fixed bug (_cdataBlock called libxml characters()) Fri Nov 2 12:56:54 2001 Helge Hess * libxmlSAXDriver.m: prefix all libxml SAX callbacks with underscore (libxml 2.4.7 compatibility) Wed Oct 24 18:31:52 2001 Helge Hess * all drivers: fixed bug in UTF8-UTF16 conversion (incorrect length was passed to -characters:length: SAX callback !!!) Mon Aug 27 19:39:07 2001 Helge Hess * libxmlHTMLSAXDriver.m: use UTF8 for parsing Mon Aug 27 18:25:41 2001 Helge Hess * again: more stable in error conditions ;-) Fri Aug 24 19:50:44 2001 Helge Hess * libxmlHTMLSAXDriver.m: more stable in error conditions Fri Aug 17 18:35:56 2001 Helge Hess * libxmlHTMLSAXDriver.m: place autorelease pool around parsing Fri Aug 17 18:18:35 2001 Helge Hess * libxmlHTMLSAXDriver.m: added string uniquing table * libxmlSAXDriver.m: added string uniquing table Thu Aug 16 13:46:06 2001 Helge Hess * libxmlSAXDriver.m: cache SaxAttributes for efficiency, SAX callbacks may not reuse SaxAttributes objects but must copy them ... Thu Aug 9 20:11:01 2001 Helge Hess * libxmlSAXDriver.m: reduced use of autorelease Fri Mar 9 10:40:53 2001 Helge Hess * libxmlSAXDriver.m: fixed bug with declaration of default-namespace Wed Feb 7 10:33:39 2001 Helge Hess * libxmlSAXDriver.m: add support for NSURL Fri Jan 12 16:36:42 2001 Helge Hess * libxmlSAXDriver.m: changed locator handling, lost reentrancy Wed Jan 3 14:50:07 2001 Helge Hess * libxmlSAXDriver.m: removed caching of SaxAttrs Tue Dec 12 20:20:02 2000 Helge Hess * added a driver for the libxml's HTML parser 2000-10-09 * libxmlSAXDriver.m: fixed bug with NSData parsing SOPE/sope-xml/libxmlSAXDriver/libxmlSAXDriver.h0000644000000000000000000000372712242733420020305 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __libxmlSAXDriver_H__ #define __libxmlSAXDriver_H__ #import #include #include #include #include #include #include #include #include @class NSMutableArray; @class SaxAttributes; @class libxmlSAXLocator; @interface libxmlSAXDriver : NSObject < SaxXMLReader > { @private id contentHandler; id dtdHandler; id errorHandler; id entityResolver; id lexicalHandler; id declHandler; void *sax; /* ptr to libxml sax structure */ void *ctxt; /* libxml parser context */ void *entity; /* used during entity lookup */ int depth; NSMutableArray *nsStack; BOOL fNamespaces; BOOL fNamespacePrefixes; /* cache */ libxmlSAXLocator *locator; SaxAttributes *attrs; } @end #endif /* __libxmlSAXDriver_H__ */ SOPE/sope-xml/libxmlSAXDriver/libxmlSAXDriver.m0000644000000000000000000013024112242733420020302 0ustar rootroot/* Copyright (C) 2000-2007 SKYRIX Software AG Copyright (C) 2007 Helge Hess This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "libxmlSAXDriver.h" #include "libxmlSAXLocator.h" #include "TableCallbacks.h" #include #include #include "common.h" #include #include /* TODO: xmlChar is really UTF-8, not cString !!! */ static NSString *SaxDeclHandlerProperty = @"http://xml.org/sax/properties/declaration-handler"; static NSString *SaxLexicalHandlerProperty = @"http://xml.org/sax/properties/lexical-handler"; #if 0 static NSString *SaxDOMNodeProperty = @"http://xml.org/sax/properties/dom-node"; static NSString *SaxXMLStringProperty = @"http://xml.org/sax/properties/xml-string"; #endif static int _UTF8ToUTF16(unsigned char **sourceStart, unsigned char *sourceEnd, unichar **targetStart, const unichar *targetEnd); static NSMapTable *uniqueStrings = NULL; // THREAD static Class NSStringClass = Nil; static inline NSString *xmlCharsToString(const xmlChar *_s) { NSString *s; char *newkey; if (_s == NULL) return nil; // TODO: does the uniquer really make sense? // best would to have an -initWithUTF...nocopy:YES if (uniqueStrings == NULL) { uniqueStrings = NSCreateMapTable(libxmlNonOwnedCStringMapKeyCallBacks, NSObjectMapValueCallBacks, 128); } else if ((s = NSMapGet(uniqueStrings, _s))) { /* found a string in cache ... */ return [s retain]; } newkey = malloc(strlen((const char *)_s) + 2); strcpy(newkey, (const char *)_s); if (NSStringClass == Nil) NSStringClass = [NSString class]; s = [[NSStringClass alloc] initWithUTF8String:(const char *)_s]; NSMapInsert(uniqueStrings, newkey, s); return s; } static inline NSString *xmlCharsToDecodedString(const xmlChar *_s) { NSString *s; BOOL needsDecoding = NO; unichar (*charAt)(id, SEL, unsigned int); unsigned i, len, last; if (_s == NULL) return nil; if (NSStringClass == Nil) NSStringClass = [NSString class]; s = [[NSStringClass alloc] initWithUTF8String:(const char *)_s]; len = [s length]; charAt = (void *)[s methodForSelector:@selector(characterAtIndex:)]; for (i = 0; i < len; i++) { if (charAt(s, @selector(characterAtIndex:), i) == '&') { needsDecoding = YES; last = 0; break; } } if (needsDecoding) { // TODO: This needs *serious* cleanup. Two small unichar buffers // would be 10x faster and half the codesize. NSMutableString *ds; ds = [[NSMutableString alloc] initWithCapacity:len]; for (; i < len; i++) { if (charAt(s, @selector(characterAtIndex:), i) == '&') { NSRange r; r = NSMakeRange(last, i - last); [ds appendString:[s substringWithRange:r]]; if (charAt(s, @selector(characterAtIndex:), i + 1) == '#') { NSRange vr; unichar c; r = NSMakeRange(i + 2, len - i - 2); r = [s rangeOfString:@";" options:0 range:r]; c = (unichar)charAt(s, @selector(characterAtIndex:), i + 2); /* hex value? */ if (c == 'x' || c == 'X') { const char *shex; unsigned value; vr = NSMakeRange(i + 3, r.location - i - 3); shex = [[s substringWithRange:vr] cString]; sscanf(shex, "%x", &value); c = (unichar)value; } else { vr = NSMakeRange(i + 2, r.location - i - 2); c = (unichar)[[s substringWithRange:vr] intValue]; } [ds appendString:[NSString stringWithCharacters:&c length:1]]; i = NSMaxRange(r); last = i; } else { if ((charAt(s, @selector(characterAtIndex:), i + 1) == 'a') && (charAt(s, @selector(characterAtIndex:), i + 2) == 'm') && (charAt(s, @selector(characterAtIndex:), i + 3) == 'p')) { [ds appendString:@"&"]; i += 5; } else if ((charAt(s, @selector(characterAtIndex:), i + 1) == 'q') && (charAt(s, @selector(characterAtIndex:), i + 2) == 'u') && (charAt(s, @selector(characterAtIndex:), i + 3) == 'o') && (charAt(s, @selector(characterAtIndex:), i + 4) == 't')) { [ds appendString:@"\""]; i += 6; } else if ((charAt(s, @selector(characterAtIndex:), i + 1) == 'a') && (charAt(s, @selector(characterAtIndex:), i + 2) == 'p') && (charAt(s, @selector(characterAtIndex:), i + 3) == 'o') && (charAt(s, @selector(characterAtIndex:), i + 4) == 's')) { [ds appendString:@"'"]; i += 6; } else if ((charAt(s, @selector(characterAtIndex:), i + 1) == 'l') && (charAt(s, @selector(characterAtIndex:), i + 2) == 't')) { [ds appendString:@"<"]; i += 4; } else if ((charAt(s, @selector(characterAtIndex:), i + 1) == 'g') && (charAt(s, @selector(characterAtIndex:), i + 2) == 't')) { [ds appendString:@">"]; i += 4; } else { NSRange r; r = NSMakeRange(i + 1, len - i - 1); r = [s rangeOfString:@";" options:0 range:r]; r = NSMakeRange(i, r.location - i); [ds appendString:[s substringWithRange:r]]; i = NSMaxRange(r); } last = i; } } } if (last != (len - 1)) [ds appendString:[s substringFromIndex:last]]; [s release]; s = ds; } return s; } extern xmlParserCtxtPtr xmlCreateMemoryParserCtxt(char *buffer, int size); @implementation libxmlSAXDriver static libxmlSAXDriver *activeDriver = nil; // THREAD #define SETUP_ACTDRIVER \ { if (activeDriver != nil) { \ NSLog(@"ERROR(%s): %@ there is an active driver set (0x%p), " \ @"override!", \ __PRETTY_FUNCTION__, self, activeDriver);\ }\ activeDriver = self;} #define TEARDOWN_ACTDRIVER \ { if (activeDriver == self) activeDriver = nil; \ else if (activeDriver != nil) { \ NSLog(@"ERROR(%s): %@ activeDriver global var mixed up 0x%p, " \ @"probably a THREAD issue.", \ __PRETTY_FUNCTION__, self, activeDriver); } } static void _startElement(libxmlSAXDriver *self, const xmlChar *name, const xmlChar **atts); static void _endElement(libxmlSAXDriver *self, const xmlChar *name); static void _startDocument(libxmlSAXDriver *self); static void _endDocument(libxmlSAXDriver *self); static void _characters(libxmlSAXDriver *self, const xmlChar *chars, int len); static void _ignorableWhiteSpace(libxmlSAXDriver *self, const xmlChar *chars, int len); static void __pi(libxmlSAXDriver *self, const xmlChar *target, const xmlChar *data); static void _comment(libxmlSAXDriver *self, const xmlChar *value); static xmlParserInputPtr _resolveEntity(libxmlSAXDriver *self, const xmlChar *pub, const xmlChar *sys) __attribute__((unused)); static xmlEntityPtr _getEntity(libxmlSAXDriver *self, const xmlChar *name) __attribute__((unused)); static void _warning(libxmlSAXDriver *self, const char *msg, ...); static void _error(libxmlSAXDriver *self, const char *msg, ...); static void _fatalError(libxmlSAXDriver *self, const char *msg, ...); static void _setLocator(void *udata, xmlSAXLocatorPtr _locator); static void _cdataBlock(libxmlSAXDriver *self, const xmlChar *value, int len); static void _entityDecl(libxmlSAXDriver *self, const xmlChar *name, int type, const xmlChar *publicId, const xmlChar *systemId, xmlChar *content) __attribute__((unused)); static void _notationDecl(libxmlSAXDriver *self, const xmlChar *name, const xmlChar *publicId, const xmlChar *systemId) __attribute__((unused)); static void _unparsedEntityDecl(libxmlSAXDriver *self, const xmlChar *name, const xmlChar *publicId, const xmlChar *systemId, const xmlChar *notationName) __attribute__((unused)); static void _elementDecl(libxmlSAXDriver *self, const xmlChar *name, int type, xmlElementContentPtr content) __attribute__((unused)); static void _attrDecl(libxmlSAXDriver *self, const xmlChar *elem, const xmlChar *name, int type, int def, const xmlChar *defaultValue, xmlEnumerationPtr tree) __attribute__((unused)); static void _internalSubset(libxmlSAXDriver *ctx, const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID); static void _externalSubset(libxmlSAXDriver *ctx, const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID); static void _reference(libxmlSAXDriver *ctx, const xmlChar *name); #if 0 static int _isStandalone(libxmlSAXDriver *self); static int _hasInternalSubset(libxmlSAXDriver *self); static int _hasExternalSubset(libxmlSAXDriver *self); #endif static xmlSAXHandler saxHandler = { (void*)_internalSubset, /* internalSubset */ #if 1 NULL,NULL,NULL, #else (void*)_isStandalone, /* isStandalone */ (void*)_hasInternalSubset, /* hasInternalSubset */ (void*)_hasExternalSubset, /* hasExternalSubset */ #endif #if HANDLE_XML_ENTITIES (void*)_resolveEntity, /* resolveEntity */ (void*)_getEntity, /* getEntity */ #else NULL, NULL, #endif #if HANDLE_XML_DELCS (void*)_entityDecl, /* entityDecl */ (void*)_notationDecl, /* notationDecl */ (void*)_attrDecl, /* attributeDecl */ (void*)_elementDecl, /* elementDecl */ (void*)_unparsedEntityDecl, /* unparsedEntityDecl */ #else NULL, NULL, NULL, NULL, NULL, #endif (void*)_setLocator, /* setDocumentLocator */ (void*)_startDocument, /* startDocument */ (void*)_endDocument, /* endDocument */ (void*)_startElement, /* startElement */ (void*)_endElement, /* endElement */ (void*)_reference, /* reference */ (void*)_characters, /* characters */ (void*)_ignorableWhiteSpace, /* ignorableWhitespace */ (void*)__pi, /* processingInstruction */ (void*)_comment, /* comment */ (void*)_warning, /* warning */ (void*)_error, /* error */ (void*)_fatalError, /* fatalError */ NULL, /* getParameterEntity */ (void*)_cdataBlock, /* cdataBlock */ (void*)_externalSubset /* externalSubset */ }; - (id)init { self->sax = &saxHandler; self->nsStack = [[NSMutableArray alloc] init]; /* feature defaults */ self->fNamespaces = YES; self->fNamespacePrefixes = NO; return self; } - (void)dealloc { [self->attrs release]; [self->nsStack release]; [self->declHandler release]; [self->lexicalHandler release]; [self->contentHandler release]; [self->dtdHandler release]; [self->errorHandler release]; [self->entityResolver release]; [self->locator clear]; [self->locator release]; if (self->entity) free(self->entity); [super dealloc]; } /* properties */ - (void)setProperty:(NSString *)_name to:(id)_value { if ([_name isEqualToString:SaxLexicalHandlerProperty]) { ASSIGN(self->lexicalHandler, _value); return; } if ([_name isEqualToString:SaxDeclHandlerProperty]) { ASSIGN(self->declHandler, _value); return; } [SaxNotRecognizedException raise:@"PropertyException" format:@"don't know property %@", _name]; } - (id)property:(NSString *)_name { if ([_name isEqualToString:SaxLexicalHandlerProperty]) return self->lexicalHandler; if ([_name isEqualToString:SaxDeclHandlerProperty]) return self->declHandler; [SaxNotRecognizedException raise:@"PropertyException" format:@"don't know property %@", _name]; return nil; } /* features */ - (void)setFeature:(NSString *)_name to:(BOOL)_value { if ([_name isEqualToString:@"http://xml.org/sax/features/namespaces"]) { self->fNamespaces = _value; return; } if ([_name isEqualToString: @"http://xml.org/sax/features/namespace-prefixes"]) { self->fNamespacePrefixes = _value; return; } [SaxNotRecognizedException raise:@"FeatureException" format:@"don't know feature %@", _name]; } - (BOOL)feature:(NSString *)_name { if ([_name isEqualToString:@"http://xml.org/sax/features/namespaces"]) return self->fNamespaces; if ([_name isEqualToString: @"http://xml.org/sax/features/namespace-prefixes"]) return self->fNamespacePrefixes; if ([_name isEqualToString: @"http://www.skyrix.com/sax/features/predefined-namespaces"]) return YES; [SaxNotRecognizedException raise:@"FeatureException" format:@"don't know feature %@", _name]; return NO; } /* handlers */ - (void)setDTDHandler:(id)_handler { ASSIGN(self->dtdHandler, _handler); } - (id)dtdHandler { return self->dtdHandler; } - (void)setErrorHandler:(id)_handler { ASSIGN(self->errorHandler, _handler); } - (id)errorHandler { return self->errorHandler; } - (void)setEntityResolver:(id)_handler { ASSIGN(self->entityResolver, _handler); } - (id)entityResolver { return self->entityResolver; } - (void)setContentHandler:(id)_handler { ASSIGN(self->contentHandler, _handler); } - (id)contentHandler { return self->contentHandler; } /* parsing */ - (NSStringEncoding)encodingForXMLEncodingString:(NSString *)_enc { // TODO: use the string-charset functions in NGExtensions _enc = [_enc lowercaseString]; if ([_enc isEqualToString:@"utf-8"]) return NSUTF8StringEncoding; if ([_enc isEqualToString:@"iso-8859-1"]) return NSISOLatin1StringEncoding; #ifndef NeXT_Foundation_LIBRARY if ([_enc isEqualToString:@"iso-8859-9"]) return NSISOLatin9StringEncoding; #endif if ([_enc isEqualToString:@"iso-8859-2"]) return NSISOLatin2StringEncoding; if ([_enc isEqualToString:@"ascii"]) return NSASCIIStringEncoding; NSLog(@"%s: UNKNOWN XML ENCODING '%@'", __PRETTY_FUNCTION__, _enc); return 0; } - (NSData *)dataForXMLString:(NSString *)_string { NSData *data; NSRange r; data = nil; r = [_string rangeOfString:@"?>"]; if ([_string hasPrefix:@" 0) { xmlDecl = [_string substringFromIndex:(r.location + 10)]; r = [xmlDecl rangeOfString:@"'"]; xmlDecl = (r.length > 0) ? [xmlDecl substringToIndex:r.location] : (NSString *)nil; } else { r = [xmlDecl rangeOfString:@"encoding=\""]; if (r.length > 0) { xmlDecl = [_string substringFromIndex:(r.location + r.length)]; r = [xmlDecl rangeOfString:@"\""]; xmlDecl = r.length > 0 ? [xmlDecl substringToIndex:r.location] : (NSString *)nil; } else xmlDecl = nil; } if ([xmlDecl length] > 0) { NSStringEncoding enc; if ((enc = [self encodingForXMLEncodingString:xmlDecl]) != 0) { data = [_string dataUsingEncoding:enc]; if (data == nil) { NSLog(@"WARNING(%s): couldn't get data for string '%@', " @"encoding %i !", __PRETTY_FUNCTION__, _string, enc); return nil; } } } } if (data == nil) data = [_string dataUsingEncoding:NSUTF8StringEncoding]; return data; } - (void)parseFromSource:(id)_source systemId:(NSString *)_sysId { NSAutoreleasePool *pool; if (_source == nil) { /* no source ??? */ return; } if ([_source isKindOfClass:[NSString class]]) { /* convert strings to UTF8 data */ if (_sysId == nil) _sysId = @""; _source = [self dataForXMLString:_source]; } else if ([_source isKindOfClass:[NSURL class]]) { if (_sysId == nil) _sysId = [_source absoluteString]; _source = [_source resourceDataUsingCache:NO]; } else if ([_source isKindOfClass:[NSData class]]) { if (_sysId == nil) _sysId = @""; } else { SaxParseException *e; NSDictionary *ui; ui = [[NSDictionary alloc] initWithObjectsAndKeys: _source ? _source : (id)@"", @"source", self, @"parser", nil]; e = (id)[SaxParseException exceptionWithName:@"SaxIOException" reason:@"cannot handle data-source" userInfo:ui]; [ui release]; ui = nil; [self->errorHandler fatalError:e]; return; } pool = [[NSAutoreleasePool alloc] init]; /* start parsing */ { unsigned char *src, *start; unsigned len; void *oldsax; if ((len = [_source length]) == 0) { /* no content ... */ return; } /* zero-terminate the data !!! */ src = malloc(len + 2); [_source getBytes:src length:len]; src[len] = '\0'; start = src; if (len > 5) { unsigned char *tmp; if ((tmp = (unsigned char *)strstr((char *)src, "ctxt = xmlCreateMemoryParserCtxt((void *)start, len); if (self->ctxt == nil) { SaxParseException *e; NSDictionary *ui; NSLog(@"%s: couldn't create memory parser ctx (src=0x%p, len=%d) !", __PRETTY_FUNCTION__, src, len); TEARDOWN_ACTDRIVER; ui = nil; e = (id)[SaxParseException exceptionWithName:@"SaxIOException" reason:@"couldn't create memory parser context" userInfo:ui]; [self->errorHandler fatalError:e]; return; } if (((xmlParserCtxtPtr)self->ctxt)->input != NULL && [_sysId length] > 0) { ((xmlParserInputPtr)((xmlParserCtxtPtr)self->ctxt)->input)->filename = [_sysId cString]; } oldsax = ((xmlParserCtxtPtr)self->ctxt)->sax; ((xmlParserCtxtPtr)self->ctxt)->sax = self->sax; ((xmlParserCtxtPtr)self->ctxt)->userData = self; xmlParseDocument(ctxt); if (!(((xmlParserCtxtPtr)self->ctxt)->wellFormed)) NSLog(@"%@: not well formed 1", _sysId); if (((xmlParserCtxtPtr)self->ctxt)->input != NULL && [_sysId length] > 0) { ((xmlParserInputPtr)((xmlParserCtxtPtr)self->ctxt)->input)->filename = NULL; } ((xmlParserCtxtPtr)self->ctxt)->sax = oldsax; ((xmlParserCtxtPtr)self->ctxt)->userData = NULL; xmlFreeParserCtxt(ctxt); TEARDOWN_ACTDRIVER; if (src != NULL) { free(src); src = NULL; } } [pool release]; } - (void)parseFromSource:(id)_source { [self parseFromSource:_source systemId:nil]; } static int mfread(void *f, char *buf, int len) { int l; l = fread(buf, 1, len, f); //printf("read %i bytes\n", l); return l; } static int mfclose(void *f) { return fclose(f); } - (void)parseFromSystemId:(NSString *)_sysId { /* _sysId is a URI */ NSAutoreleasePool *pool; if (![_sysId hasPrefix:@"file:"]) { SaxParseException *e; NSDictionary *ui; NSURL *url; if ((url = [NSURL URLWithString:_sysId])) { [self parseFromSource:url systemId:_sysId]; return; } ui = [[NSDictionary alloc] initWithObjectsAndKeys: _sysId ? _sysId : (NSString *)@"", @"systemID", self, @"parser", nil]; e = (id)[SaxParseException exceptionWithName:@"SaxIOException" reason:@"cannot handle system-id" userInfo:ui]; [ui release]; ui = nil; [self->errorHandler fatalError:e]; return; } pool = [[NSAutoreleasePool alloc] init]; /* cut off file:// */ if ([_sysId hasPrefix:@"file://"]) _sysId = [_sysId substringFromIndex:7]; else _sysId = [_sysId substringFromIndex:5]; /* start parsing .. */ #if 0 ret = xmlSAXUserParseFile(self->sax, (void *)self, [_sysId cString]); #else { FILE *f; f = fopen([_sysId cString], "r"); if (f == NULL) { SaxParseException *e; NSDictionary *ui; #if DEBUG NSLog(@"%s: missing file '%@'", __PRETTY_FUNCTION__, _sysId); #endif ui = [[NSDictionary alloc] initWithObjectsAndKeys: _sysId ? _sysId : (NSString *)@"", @"path", self, @"parser", nil]; e = (id)[SaxParseException exceptionWithName:@"SaxIOException" reason:@"can't find file" userInfo:ui]; [ui release]; ui = nil; [self->errorHandler fatalError:e]; [pool release]; return; } self->ctxt = xmlCreateIOParserCtxt(self->sax, self /* userdata */, mfread, /* ioread */ mfclose, /* ioclose */ f, /* ioctx */ XML_CHAR_ENCODING_UTF8 /* encoding */); if (((xmlParserCtxtPtr)self->ctxt)->input != NULL && [_sysId length] > 0) { ((xmlParserInputPtr)((xmlParserCtxtPtr)self->ctxt)->input)->filename = [_sysId cString]; } SETUP_ACTDRIVER; xmlParseDocument(self->ctxt); TEARDOWN_ACTDRIVER; if (((xmlParserCtxtPtr)self->ctxt)->input != NULL && [_sysId length] > 0) { ((xmlParserInputPtr)((xmlParserCtxtPtr)self->ctxt)->input)->filename = NULL; } if (!(((xmlParserCtxtPtr)self->ctxt)->wellFormed)) NSLog(@"%@: not well formed 2", _sysId); ((xmlParserCtxtPtr)self->ctxt)->sax = NULL; xmlFreeParserCtxt(self->ctxt); } #endif [pool release]; } /* entities */ - (NSString *)replacementStringForEntityNamed:(NSString *)_entityName { // TODO: check, how this is used, could explain some problems //NSLog(@"get entity: %@", _entityName); return [[@"&" stringByAppendingString:_entityName] stringByAppendingString:@";"]; } /* namespace support */ - (NSString *)nsUriForPrefix:(NSString *)_prefix { NSEnumerator *e; NSDictionary *ns; e = [self->nsStack reverseObjectEnumerator]; while ((ns = [e nextObject])) { NSString *uri; if ((uri = [ns objectForKey:_prefix])) { //NSLog(@"prefix %@ -> uri %@", _prefix, uri); return uri; } } //NSLog(@"prefix %@ -> uri %@", _prefix, nil); return nil; } - (NSString *)defaultNamespace { return [self nsUriForPrefix:@":"]; } - (void)declarePrefix:(NSString *)_prefix namespaceURI:(NSString *)_uri { NSMutableDictionary *ns = nil; NSDictionary *newns; unsigned count; NSCAssert(self->nsStack, @"missing namespace stack"); if ((count = [self->nsStack count]) == 0) ns = [[NSMutableDictionary alloc] initWithCapacity:2]; else ns = [[self->nsStack lastObject] mutableCopy]; if ([_prefix length] == 0) _prefix = @":"; [ns setObject:_uri forKey:_prefix]; newns = [ns copy]; [ns release]; if (count == 0) [self->nsStack addObject:newns]; else [self->nsStack replaceObjectAtIndex:(count - 1) withObject:newns]; [newns release]; } /* ---------- libxml sax connection ---------- */ static void _startElement(libxmlSAXDriver *self, const xmlChar *name, const xmlChar **atts) { NSString *ename, *rawName, *euri; NSDictionary *nsDict = nil; NSRange r; /* first scan for namespace declaration */ if (atts) { NSMutableDictionary *ns = nil; int i; for (i = 0; atts[i]; i += 2) { const xmlChar *an = atts[i]; /* check for attr-names beginning with 'xmlns' */ if (an[0] != 'x') continue; if (an[1] != 'm') continue; if (an[2] != 'l') continue; if (an[3] != 'n') continue; if (an[4] != 's') continue; /* ok, found ns decl */ if (ns == nil) ns = [[NSMutableDictionary alloc] init]; if (an[5] == ':') { /* eg */ NSString *prefix, *uri; if (an[6] == '\0') { /* invalid, namespace name may not be empty ! */ NSLog(@"WARNING(%s): empty namespace prefix !", __PRETTY_FUNCTION__); } prefix = xmlCharsToString(&(an[6])); uri = xmlCharsToString(atts[i + 1]); //NSLog(@"prefix %@ uri %@", prefix, uri); NSCAssert(ns, @"missing namespace dictionary"); [ns setObject:uri forKey:prefix]; if (self->fNamespaces) [self->contentHandler startPrefixMapping:prefix uri:uri]; [prefix release]; prefix = nil; [uri release]; uri = nil; } else { /* eg */ NSString *uri; uri = xmlCharsToString(atts[i + 1]); [ns setObject:uri forKey:@":"]; //NSLog(@"prefix default uri %@", uri); [uri release]; uri = nil; } } nsDict = [ns copy]; [nsDict autorelease]; [ns release]; } /* manage namespace stack */ if (nsDict == nil) nsDict = [NSDictionary dictionary]; NSCAssert(self->nsStack, @"missing namespace stack"); [self->nsStack addObject:nsDict]; /* process element name */ rawName = xmlCharsToString(name); r = [rawName rangeOfString:@":"]; if (r.length > 0) { /* eg: */ NSString *prefix; prefix = [rawName substringToIndex:r.location]; ename = [rawName substringFromIndex:(r.location + r.length)]; euri = [self nsUriForPrefix:prefix]; } else { ename = rawName; euri = [self defaultNamespace]; } /* create sax attrs */ if (self->attrs == nil) self->attrs = [[SaxAttributes alloc] init]; else [self->attrs clear]; if (atts) { int i; for (i = 0; atts[i]; i += 2) { NSString *name, *rawName, *uri; NSString *type, *value; NSRange r; if (!self->fNamespacePrefixes) { if (atts[i][0] == 'x') { const unsigned char *an = atts[i]; if (strstr((char *)an, "xmlns") == (char *)an) continue; } } rawName = xmlCharsToString(atts[i]); r = [rawName rangeOfString:@":"]; if (r.length > 0) { /* explicit attribute namespace, eg '' */ NSString *prefix; prefix = [rawName substringToIndex:r.location]; name = [rawName substringFromIndex:(r.location + r.length)]; uri = [self nsUriForPrefix:prefix]; } else { /* plain attribute, eg '' */ name = rawName; uri = euri; /* attr inherits namespace from element-name */ } type = @"CDATA"; value = xmlCharsToDecodedString(atts[i + 1]); [self->attrs addAttribute:name uri:uri rawName:rawName type:type value:value]; [value release]; value = nil; [rawName release]; rawName = nil; } } self->depth++; /* send notification */ [self->contentHandler startElement:ename namespace:euri rawName:rawName attributes:self->attrs]; [rawName release]; rawName = nil; [self->attrs clear]; } static void _endElement(libxmlSAXDriver *self, const xmlChar *name) { NSString *ename, *rawName, *uri; NSRange r; rawName = xmlCharsToString(name); r = [rawName rangeOfString:@":"]; if (r.length > 0) { /* eg: */ NSString *prefix; prefix = [rawName substringToIndex:r.location]; ename = [rawName substringFromIndex:(r.location + r.length)]; uri = [self nsUriForPrefix:prefix]; } else { ename = rawName; uri = [self defaultNamespace]; } [self->contentHandler endElement:ename namespace:uri rawName:rawName]; self->depth--; [rawName release]; rawName = nil; /* process namespace stack */ if (self->fNamespaces) { NSDictionary *ns; NSEnumerator *keys; NSString *key; ns = [self->nsStack lastObject]; keys = [ns keyEnumerator]; while ((key = [keys nextObject])) { if ([key isEqualToString:@":"]) continue; [self->contentHandler endPrefixMapping:key]; } } [self->nsStack removeLastObject]; } static void _startDocument(libxmlSAXDriver *self) { static NSDictionary *defNS = nil; id keys[2], values[2]; //NSLog(@"start doc 0x%p", self); if (defNS == nil) { keys[0] = @"xml"; values[0] = @"http://www.w3.org/XML/1998/namespace"; keys[1] = @":"; values[1] = @""; defNS = [[NSDictionary alloc] initWithObjects:values forKeys:keys count:2]; } if ([self->nsStack count] == 0) [self->nsStack addObject:defNS]; else [self->nsStack insertObject:defNS atIndex:0]; [self->contentHandler startDocument]; } static void _endDocument(libxmlSAXDriver *self) { [self->contentHandler endDocument]; if ([self->nsStack count] > 0) [self->nsStack removeObjectAtIndex:0]; else { NSLog(@"libxmlSAXDriver: inconsistent state, " @"nothing on NS stack in endDocument !"); } } static void _characters(libxmlSAXDriver *self, const xmlChar *chars, int len) { /* need to transform UTF8 to UTF16 */ unichar *data, *ts; if (len == 0) { unichar c = 0; data = &c; [self->contentHandler characters:data length:0]; return; } if (chars == NULL) { [self->contentHandler characters:NULL length:0]; return; } data = ts = calloc(len + 1, sizeof(unichar)); /* GC ?! */ if (_UTF8ToUTF16((void *)&chars, (void *)(chars + len), (void *)&ts, ts + (len * sizeof(unichar)))) { free(data); NSLog(@"ERROR(%s:%i): couldn't convert UTF8 to UTF16 !", __PRETTY_FUNCTION__, __LINE__); } else { [self->contentHandler characters:data length:((unsigned)(ts - data))]; free(data); } } static void _ignorableWhiteSpace(libxmlSAXDriver *self, const xmlChar *chars, int len) { /* need to transform UTF8 to UTF16 */ unichar *data, *ts; if (len == 0) { unichar c = 0; data = &c; [self->contentHandler ignorableWhitespace:data length:len]; return; } if (chars == NULL) { [self->contentHandler ignorableWhitespace:NULL length:0]; return; } data = ts = calloc(len + 1, sizeof(unichar)); /* GC ?! */ if (_UTF8ToUTF16((void *)&chars, (void *)(chars + len), (void *)&ts, ts + (len * sizeof(unichar)))) { free(data); NSLog(@"ERROR(%s:%i): couldn't convert UTF8 to UTF16 !", __PRETTY_FUNCTION__, __LINE__); } else { [self->contentHandler ignorableWhitespace:data length:(ts - data)]; free(data); } } static void __pi(libxmlSAXDriver *self, const xmlChar *pi, const xmlChar *data) { NSString *epi, *edata; epi = xmlCharsToString(pi); edata = xmlCharsToString(data); [self->contentHandler processingInstruction:epi data:edata]; [epi release]; epi = nil; [edata release]; edata = nil; } static void _comment(libxmlSAXDriver *self, const xmlChar *value) { if (self->lexicalHandler) { /* need to transform UTF8 to UTF16 */ unichar *data; register int i, len; len = strlen((const char *)value); data = calloc(len +1 ,sizeof(unichar)); /* GC ?! */ for (i = 0; i < len; i++) data[i] = value[i]; [self->lexicalHandler comment:data length:len]; if (data) { free(data); data = NULL; } } } static void _setLocator(void *udata, xmlSAXLocatorPtr _locator) { if (activeDriver == nil) { NSLog(@"ERROR(%s): no driver is active !", __PRETTY_FUNCTION__); return; } [activeDriver->locator release]; activeDriver->locator = [[libxmlSAXLocator alloc] initWithSaxLocator:_locator parser:activeDriver]; activeDriver->locator->ctx = activeDriver->ctxt; [activeDriver->contentHandler setDocumentLocator:activeDriver->locator]; } static xmlParserInputPtr _resolveEntity(libxmlSAXDriver *self, const xmlChar *pub, const xmlChar *sys) { NSString *pubId, *sysId; id src; pubId = xmlCharsToString(pub); sysId = xmlCharsToString(sys); src = [self->entityResolver resolveEntityWithPublicId:pubId systemId:sysId]; if (src == nil) { //return xmlLoadExternalEntity(sys, pub, self); return NULL; } NSLog(@"ignored entity src %@", src); [pubId release]; pubId = nil; [sysId release]; sysId = nil; return NULL; } static xmlEntityPtr _getEntity(libxmlSAXDriver *self, const xmlChar *name) { xmlEntityPtr p; NSString *ename, *s; if ((p = xmlGetPredefinedEntity(name))) return p; if (self->entity == NULL) /* setup shared entity structure */ self->entity = calloc(1, sizeof(xmlEntity)); ename = xmlCharsToString(name); s = [self replacementStringForEntityNamed:ename]; /* need to convert to unicode ! */ /* fill entity structure */ p = self->entity; p->name = (unsigned char *)[ename cString]; p->etype = XML_INTERNAL_GENERAL_ENTITY; p->orig = (void *)[ename cString]; p->content = (void *)[s cString]; p->length = [s cStringLength]; [ename release]; ename = nil; return p; } static void _cdataBlock(libxmlSAXDriver *self, const xmlChar *value, int len) { [self->lexicalHandler startCDATA]; _characters(self, value, len); [self->lexicalHandler endCDATA]; } static SaxParseException * mkException(libxmlSAXDriver *self, NSString *key, const char *msg, va_list va) { NSString *s, *reason; NSDictionary *ui; SaxParseException *e; NSRange r; int count = 0, i; id keys[7], values[7]; id tmp; s = [NSString stringWithCString:msg]; s = [[[NSString alloc] initWithFormat:s arguments:va] autorelease]; r = [s rangeOfString:@"\n"]; reason = r.length > 0 ? [s substringToIndex:r.location] : s; if ([reason length] == 0) reason = @"unknown reason"; keys[0] = @"parser"; values[0] = self; count++; keys[1] = @"depth"; values[1] = [NSNumber numberWithInt:self->depth]; count++; if ([s length] > 0) { keys[count] = @"errorMessage"; values[count] = s; count++; } if ((i = [self->locator lineNumber]) >= 0) { keys[count] = @"line"; values[count] = [NSNumber numberWithInt:i]; count++; } if ((i = [self->locator columnNumber]) >= 0) { keys[count] = @"column"; values[count] = [NSNumber numberWithInt:i]; count++; } if ((tmp = [self->locator publicId])) { keys[count] = @"publicId"; values[count] = tmp; count++; } if ((tmp = [self->locator systemId])) { keys[count] = @"systemId"; values[count] = tmp; count++; } ui = [NSDictionary dictionaryWithObjects:values forKeys:keys count:count]; e = (id)[SaxParseException exceptionWithName:key reason:reason userInfo:ui]; return e; } static void _warning(libxmlSAXDriver *self, const char *msg, ...) { va_list args; SaxParseException *e; va_start(args, msg); e = mkException(self, @"SAXWarning", msg, args); va_end(args); [self->errorHandler warning:e]; } static void _error(libxmlSAXDriver *self, const char *msg, ...) { va_list args; SaxParseException *e; va_start(args, msg); e = mkException(self, @"SAXError", msg, args); va_end(args); [self->errorHandler error:e]; } static void _fatalError(libxmlSAXDriver *self, const char *msg, ...) { va_list args; SaxParseException *e; va_start(args, msg); e = mkException(self, @"SAXFatalError", msg, args); va_end(args); [self->errorHandler fatalError:e]; } static void _entityDecl(libxmlSAXDriver *self, const xmlChar *name, int type, const xmlChar *publicId, const xmlChar *systemId, xmlChar *content) { NSString *ename, *pubId, *sysId; NSString *value; ename = xmlCharsToString(name); pubId = xmlCharsToString(publicId); sysId = xmlCharsToString(systemId); value = xmlCharsToString(content); switch (type) { case XML_INTERNAL_GENERAL_ENTITY: case XML_INTERNAL_PARAMETER_ENTITY: case XML_INTERNAL_PREDEFINED_ENTITY: [self->declHandler internalEntityDeclaration:ename value:value]; break; case XML_EXTERNAL_GENERAL_PARSED_ENTITY: case XML_EXTERNAL_PARAMETER_ENTITY: [self->declHandler externalEntityDeclaration:ename publicId:pubId systemId:sysId]; break; case XML_EXTERNAL_GENERAL_UNPARSED_ENTITY: /* is content really =notationName ??? */ NSLog(@"unparsed ext entity .."); [self->dtdHandler unparsedEntityDeclaration:ename publicId:pubId systemId:sysId notationName:value]; break; default: [NSException raise:@"InvalidEntityType" format:@"don't know entity type with code %i", type]; } [ename release]; [pubId release]; [sysId release]; [value release]; } static void _unparsedEntityDecl(libxmlSAXDriver *self,const xmlChar *name, const xmlChar *publicId, const xmlChar *systemId, const xmlChar *notationName) { if (self->dtdHandler) { NSString *ename, *nname, *pubId, *sysId; ename = xmlCharsToString(name); nname = xmlCharsToString(notationName); pubId = xmlCharsToString(publicId); sysId = xmlCharsToString(systemId); [self->dtdHandler unparsedEntityDeclaration:ename publicId:pubId systemId:sysId notationName:nname]; [ename release]; [nname release]; [pubId release]; [sysId release]; } } static void _notationDecl(libxmlSAXDriver *self, const xmlChar *name, const xmlChar *publicId, const xmlChar *systemId) { if (self->dtdHandler) { NSString *nname, *pubId, *sysId; nname = xmlCharsToString(name); pubId = xmlCharsToString(publicId); sysId = xmlCharsToString(systemId); [self->dtdHandler notationDeclaration:nname publicId:pubId systemId:sysId]; [nname release]; [pubId release]; [sysId release]; } } static NSString *_occurString(xmlElementContentOccur _occurType) __attribute__((unused)); static NSString *_occurString(xmlElementContentOccur _occurType) { switch (_occurType) { case XML_ELEMENT_CONTENT_ONCE: return @""; case XML_ELEMENT_CONTENT_OPT: return @"?"; case XML_ELEMENT_CONTENT_MULT: return @"*"; case XML_ELEMENT_CONTENT_PLUS: return @"+"; } return @""; } static void _addElemModel(xmlElementContentPtr p, NSMutableString *s, int pt) { if (p == NULL) return; switch (p->type) { case XML_ELEMENT_CONTENT_PCDATA: if (pt == -1) [s appendString:@"("]; [s appendString:@"#PCDATA"]; if (pt == -1) [s appendString:@")"]; break; case XML_ELEMENT_CONTENT_ELEMENT: { NSString *ename; ename = xmlCharsToString(p->name); if (pt == -1) [s appendString:@"("]; [s appendString:ename]; if (pt == -1) [s appendString:@")"]; [ename release]; ename = nil; break; } case XML_ELEMENT_CONTENT_SEQ: if (pt != XML_ELEMENT_CONTENT_SEQ) [s appendString:@"("]; _addElemModel(p->c1, s, XML_ELEMENT_CONTENT_SEQ); [s appendString:@","]; _addElemModel(p->c2, s, XML_ELEMENT_CONTENT_SEQ); if (pt != XML_ELEMENT_CONTENT_SEQ) [s appendString:@")"]; break; case XML_ELEMENT_CONTENT_OR: if (pt != XML_ELEMENT_CONTENT_OR) [s appendString:@"("]; _addElemModel(p->c1, s, XML_ELEMENT_CONTENT_OR); [s appendString:@"|"]; _addElemModel(p->c2, s, XML_ELEMENT_CONTENT_OR); if (pt != XML_ELEMENT_CONTENT_OR) [s appendString:@")"]; break; } switch (p->ocur) { case XML_ELEMENT_CONTENT_ONCE: break; case XML_ELEMENT_CONTENT_OPT: [s appendString:@"?"]; break; case XML_ELEMENT_CONTENT_MULT: [s appendString:@"*"]; break; case XML_ELEMENT_CONTENT_PLUS: [s appendString:@"+"]; break; } } static void _elementDecl(libxmlSAXDriver *self, const xmlChar *name, int type, xmlElementContentPtr content) { if (self->declHandler) { NSString *ename, *model; ename = xmlCharsToString(name); if (content) { NSMutableString *emodel; emodel = [[NSMutableString alloc] init]; _addElemModel(content, emodel, -1); model = [[emodel copy] autorelease]; [emodel release]; } else model = nil; [self->declHandler elementDeclaration:ename contentModel:model]; [ename release]; ename = nil; } } static void _attrDecl(libxmlSAXDriver *self, const xmlChar *elem, const xmlChar *name, int type, int def, const xmlChar *defaultValue, xmlEnumerationPtr tree) { if (self->declHandler) { NSString *ename, *aname, *defValue, *atype, *defType; ename = xmlCharsToString(elem); aname = xmlCharsToString(name); defValue = xmlCharsToString(defaultValue); atype = nil; defType = nil; switch (type) { case XML_ATTRIBUTE_CDATA: atype = @"CDATA"; break; case XML_ATTRIBUTE_ID: atype = @"ID"; break; case XML_ATTRIBUTE_IDREF: atype = @"IDREF"; break; case XML_ATTRIBUTE_IDREFS: atype = @"IDREFS"; break; case XML_ATTRIBUTE_ENTITY: atype = @"ENTITY"; break; case XML_ATTRIBUTE_ENTITIES: atype = @"ENTITIES"; break; case XML_ATTRIBUTE_NMTOKEN: atype = @"NMTOKEN"; break; case XML_ATTRIBUTE_NMTOKENS: atype = @"NMTOKENS"; break; case XML_ATTRIBUTE_ENUMERATION: atype = @"ENUMERATION"; break; case XML_ATTRIBUTE_NOTATION: atype = @"NOTATION"; break; default: [NSException raise:@"InvalidAttributeType" format:@"don't know attr type with code %i", type]; } switch (def) { case XML_ATTRIBUTE_NONE: defType = nil; break; case XML_ATTRIBUTE_REQUIRED: defType = @"#REQUIRED"; break; case XML_ATTRIBUTE_IMPLIED: defType = @"#IMPLIED"; break; case XML_ATTRIBUTE_FIXED: defType = @"#FIXED"; break; default: [NSException raise:@"InvalidAttributeDefaultType" format:@"don't know attr default type with code %i", def]; } [self->declHandler attributeDeclaration:aname elementName:ename type:atype defaultType:defType defaultValue:defValue]; [ename release]; [aname release]; [defValue release]; } } #if 0 static int isStandalone(libxmlSAXDriver *self) { } static int hasInternalSubset(libxmlSAXDriver *self) { } static int hasExternalSubset(libxmlSAXDriver *self) { } #endif static void _externalSubset(libxmlSAXDriver *ctx, const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID) { } static void _internalSubset(libxmlSAXDriver *ctx, const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID) { } static void _reference(libxmlSAXDriver *ctx, const xmlChar *name) { #if 0 NSString *refName; refName = xmlCharsToString(name); NSLog(@"reference: '%@'", refName); [refName release]; #endif } @end /* libxmlSAXDriver */ #include "unicode.h" SOPE/sope-xml/libxmlSAXDriver/GNUmakefile.preamble0000644000000000000000000000215112242733420020743 0ustar rootroot# compilation settings ifeq ($(frameworks),yes) BUNDLE_INSTALL_DIR := $(FRAMEWORK_INSTALL_DIR)/SaxObjC.framework/Resources/SaxDrivers/ endif ADDITIONAL_CPPFLAGS += -funsigned-char ADDITIONAL_INCLUDE_DIRS += -I../.. -I.. ADDITIONAL_INCLUDE_DIRS += $(shell xml2-config --cflags) libxml_LIBS := $(shell xml2-config --libs) ifneq ($(frameworks),yes) libxmlSAXDriver_BUNDLE_LIBS += -lSaxObjC $(libxml_LIBS) else libxmlSAXDriver_BUNDLE_LIBS += -framework SaxObjC $(libxml_LIBS) endif # library/framework search pathes DEP_DIRS = ../SaxObjC ifneq ($(frameworks),yes) ADDITIONAL_LIB_DIRS += \ $(foreach dir,$(DEP_DIRS),\ -L$(GNUSTEP_BUILD_DIR)/$(dir)/$(GNUSTEP_OBJ_DIR_NAME)) else ADDITIONAL_LIB_DIRS += \ $(foreach dir,$(DEP_DIRS),-F$(GNUSTEP_BUILD_DIR)/$(dir)) endif ifeq ($(findstring _64, $(GNUSTEP_TARGET_CPU)), _64) SYSTEM_LIB_DIR += -L/usr/local/lib64 -L/usr/lib64 else SYSTEM_LIB_DIR += -L/usr/local/lib -L/usr/lib endif # platform specific options ifeq ($(GNUSTEP_TARGET_OS),darwin6) ADDITIONAL_LIB_DIRS += -L/sw/lib endif ifeq ($(FOUNDATION_LIB),nx) libxmlSAXDriver_LDFLAGS += -framework Foundation endif SOPE/sope-xml/libxmlSAXDriver/TableCallbacks.m0000644000000000000000000000445612242733420020122 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "TableCallbacks.h" #include "common.h" #include //#define NSNonOwnedCStringMapKeyCallBacks NSNonOwnedPointerMapKeyCallBacks /* From Aho, Sethi & Ullman: Principles of compiler design. */ static unsigned __hashCString(void *table, const void *aString) { register const char* p = (char*)aString; register unsigned hash = 0, hash2; register int i, n; n = aString ? strlen(aString) : 0; for(i=0; i < n; i++) { hash <<= 4; hash += *p++; if((hash2 = hash & 0xf0000000)) hash ^= (hash2 >> 24) ^ hash2; } return hash; } static BOOL __compareCString(void *table, const void *anObject1, const void *anObject2) { if (anObject1 == NULL && anObject2 == NULL) return YES; if (anObject1 == NULL || anObject2 == NULL) return NO; return strcmp((char*)anObject1, (char*)anObject2) == 0; } static void __retain(void *table, const void *anObject) {} static void TableCallbacksRelease(void *table, void *anObject) {} static NSString *__describe(void *table, const void *anObject) { return [NSString stringWithFormat:@"%p", anObject]; } const NSMapTableKeyCallBacks libxmlNonOwnedCStringMapKeyCallBacks = { (NSUInteger(*)(NSMapTable *, const void *))__hashCString, (BOOL(*)(NSMapTable *, const void *, const void *))__compareCString, (void (*)(NSMapTable *, const void *anObject))__retain, (void (*)(NSMapTable *, void *anObject))TableCallbacksRelease, (NSString *(*)(NSMapTable *, const void *))__describe, (const void *)NULL }; SOPE/sope-xml/libxmlSAXDriver/bundle-info.plist0000644000000000000000000000100512242733420020357 0ustar rootroot{ requires = { bundleManagerVersion = 1; classes = ( { name = NSObject; } ); }; provides = { SAXDrivers = ( { name = libxmlSAXDriver; sourceTypes = ( "text/xml" ); }, { name = libxmlHTMLSAXDriver; sourceTypes = ( "text/html" ); }, ); classes = ( { name = libxmlSAXDriver; }, { name = libxmlDocSAXDriver; }, { name = libxmlHTMLSAXDriver; }, ); }; } SOPE/sope-xml/libxmlSAXDriver/TableCallbacks.h0000644000000000000000000000176012242733420020110 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __libxml_TableCallbacks_H__ #define __libxml_TableCallbacks_H__ #import extern const NSMapTableKeyCallBacks libxmlNonOwnedCStringMapKeyCallBacks; #endif /* __libxml_TableCallbacks_H__ */ SOPE/sope-xml/libxmlSAXDriver/libxmlSAXDriver-Info.plist0000644000000000000000000000144212242733420022072 0ustar rootroot CFBundleDevelopmentRegion English CFBundleExecutable libxmlSAXDriver CFBundleGetInfoString CFBundleIconFile CFBundleIdentifier org.OpenGroupware.sope-xml.libxmlSAXDriver CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType BNDL CFBundleShortVersionString CFBundleSignature ???? CFBundleVersion 4.7.26 SOPE/sope-xml/libxmlSAXDriver/common.h0000644000000000000000000000230212242733420016542 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __libxmlSAXDriver_common_H__ #define __libxmlSAXDriver_common_H__ #import #ifndef ASSIGN # define ASSIGN(object, value) \ ({id __object = (id)object; \ id __value = (id)value; \ if (__value != __object) { if (__value) [__value retain]; \ if (__object) [__object release]; \ object = __value;}}) #endif #endif /* __libxmlSAXDriver_common_H__ */ SOPE/sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.h0000644000000000000000000000321112242733420020756 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include /* recognized properties: http://xml.org/sax/properties/declaration-handler http://xml.org/sax/properties/lexical-handler http://www.skyrix.com/sax/properties/html-namespace */ @class libxmlSAXLocator; @interface libxmlHTMLSAXDriver : NSObject < SaxXMLReader > { NSObject *contentHandler; id dtdHandler; id errorHandler; id entityResolver; id lexicalHandler; id declHandler; NSString *namespaceURI; unsigned depth; BOOL encodeEntities; libxmlSAXLocator *locator; /* libxml */ void *doc; void *ctxt; SaxAttributes *attributes; } @end SOPE/sope-xml/libxmlSAXDriver/Version0000644000000000000000000000004012242733420016446 0ustar rootroot# version SUBMINOR_VERSION:=29 SOPE/sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.m0000644000000000000000000005400212242733420020767 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import "libxmlHTMLSAXDriver.h" #import "libxmlSAXLocator.h" #include "TableCallbacks.h" #include #include #include "common.h" #include #include #include @interface NSObject(contentHandlerExtensions) - (xmlCharEncoding)contentEncoding; @end @interface libxmlHTMLSAXDriver(PrivateMethods) - (void)tearDownParser; - (BOOL)walkDocumentTree:(xmlDocPtr)_doc; - (BOOL)processNode:(xmlNodePtr)_node; - (BOOL)processChildren:(xmlNodePtr)children; @end static int _UTF8ToUTF16(unsigned char **sourceStart, unsigned char *sourceEnd, unichar **targetStart, const unichar *targetEnd); static BOOL logUnsupportedFeatures = NO; static BOOL reportInvalidTags = NO; static BOOL reportUnclosedEntities = NO; static NSMapTable *uniqueStrings = NULL; // THREAD static Class NSStringClass = Nil; /* error string detection */ /* TODO: obviously this may change between libxml versions or even localisations ... why doesn't libxml support error codes ? (or does it ?) */ static const char *tagInvalidMsg = "tag %s invalid"; static const char *unclosedEntityInvalidMsg = "htmlParseEntityRef: expecting ';'"; #if 0 static const char *unexpectedNobrCloseMsg = "Unexpected end tag : %s"; #endif static inline NSString *xmlCharsToString(const xmlChar *_s) { NSString *s; char *newkey; if (_s == NULL) return nil; if (uniqueStrings == NULL) { uniqueStrings = NSCreateMapTable(libxmlNonOwnedCStringMapKeyCallBacks, NSObjectMapValueCallBacks, 128); } else if ((s = NSMapGet(uniqueStrings, _s))) { /* found a string in cache ... */ return [s retain]; } newkey = malloc(strlen((char *)_s) + 2); strcpy(newkey, (char *)_s); if (NSStringClass == Nil) NSStringClass = [NSString class]; s = [[NSStringClass alloc] initWithUTF8String:(const char *)_s]; NSMapInsert(uniqueStrings, newkey, s); return s; } static NSString *SaxDeclHandlerProperty = @"http://xml.org/sax/properties/declaration-handler"; static NSString *SaxLexicalHandlerProperty = @"http://xml.org/sax/properties/lexical-handler"; static NSString *XMLNS_XHTML = @"http://www.w3.org/1999/xhtml"; @implementation libxmlHTMLSAXDriver static libxmlHTMLSAXDriver *activeDriver = nil; static void warning(void *udata, const char *msg, ...); static void error(void *udata, const char *msg, ...); static void fatalError(void *udata, const char *msg, ...); static void setLocator(void *udata, xmlSAXLocatorPtr _locator); + (void)initialize { NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; reportInvalidTags = [ud boolForKey:@"libxmlHTMLSAXDriverReportInvalidTags"]; reportUnclosedEntities = [ud boolForKey:@"libxmlHTMLSAXDriverReportUnclosedEntityRefs"]; } - (id)init { if ((self = [super init])) { self->namespaceURI = [XMLNS_XHTML copy]; self->encodeEntities = NO; } return self; } - (void)dealloc { [self tearDownParser]; [self->attributes release]; [self->namespaceURI release]; [self->lexicalHandler release]; [self->declHandler release]; [self->contentHandler release]; [self->dtdHandler release]; [self->errorHandler release]; [self->entityResolver release]; [super dealloc]; } /* features & properties */ - (void)setFeature:(NSString *)_name to:(BOOL)_value { if (logUnsupportedFeatures) NSLog(@"%s: don't know feature %@", __PRETTY_FUNCTION__, _name); } - (BOOL)feature:(NSString *)_name { if (logUnsupportedFeatures) NSLog(@"%s: don't know feature %@", __PRETTY_FUNCTION__, _name); return NO; } - (void)setProperty:(NSString *)_name to:(id)_value { if ([_name isEqualToString:SaxLexicalHandlerProperty]) { ASSIGN(self->lexicalHandler, _value); return; } if ([_name isEqualToString:SaxDeclHandlerProperty]) { ASSIGN(self->declHandler, _value); return; } [SaxNotRecognizedException raise:@"PropertyException" format:@"don't know property %@", _name]; } - (id)property:(NSString *)_name { if ([_name isEqualToString:SaxLexicalHandlerProperty]) return self->lexicalHandler; if ([_name isEqualToString:SaxDeclHandlerProperty]) return self->declHandler; [SaxNotRecognizedException raise:@"PropertyException" format:@"don't know property %@", _name]; return nil; } /* handlers */ - (void)setDTDHandler:(id)_handler { ASSIGN(self->dtdHandler, _handler); } - (id)dtdHandler { return self->dtdHandler; } - (void)setErrorHandler:(id)_handler { ASSIGN(self->errorHandler, _handler); } - (id)errorHandler { return self->errorHandler; } - (void)setEntityResolver:(id)_handler { ASSIGN(self->entityResolver, _handler); } - (id)entityResolver { return self->entityResolver; } - (void)setContentHandler:(id )_handler { ASSIGN(self->contentHandler, _handler); } - (id )contentHandler { return self->contentHandler; } /* libxml */ - (void)setupParserWithDocumentPath:(NSString *)_path { xmlSAXHandler sax; xmlCharEncoding charEncoding; if (self->ctxt != NULL) { NSLog(@"WARNING(%s): HTML parser context already setup !", __PRETTY_FUNCTION__); [self tearDownParser]; } memcpy(&sax, &htmlDefaultSAXHandler, sizeof(xmlSAXHandler)); sax.error = error; sax.warning = warning; sax.fatalError = fatalError; sax.setDocumentLocator = setLocator; if (activeDriver != nil) { NSLog(@"WARNING(%s): %@ there is an active driver set (%@), override !", __PRETTY_FUNCTION__, self, activeDriver); } activeDriver = self; // hh: thats really a very ugly hack. The content-handler is for handling // content, not for dealing with the input data. // TBD: the charset should be derived from the input (and this method should // probably take a charset) if ([self->contentHandler respondsToSelector:@selector(contentEncoding)]) charEncoding = [self->contentHandler contentEncoding]; else charEncoding = XML_CHAR_ENCODING_8859_1; // TBD: do not use cString (nor UTF8String) but NSFileManager to convert // a string into a path self->ctxt = htmlCreatePushParserCtxt(&sax /* sax */, NULL /*self*/ /* userdata */, NULL /* chunk */, 0 /* chunklen */, [_path cString] /* filename */, charEncoding /* encoding */); self->doc = NULL; } - (void)tearDownParser { if (activeDriver == self) activeDriver = nil; if (self->doc) { xmlFreeDoc(self->doc); self->doc = NULL; } if (self->ctxt) { htmlFreeParserCtxt(self->ctxt); self->ctxt = NULL; } } /* IO */ - (void)pushBytes:(const char *)_bytes count:(unsigned)_len { if (_len == 0) return; NSAssert(self->ctxt, @"missing HTML parser context"); htmlParseChunk(self->ctxt, _bytes, _len, 0); } - (void)pushEOF { char dummyByte; htmlParseChunk(self->ctxt, &dummyByte, 0, 1 /* terminate */); self->doc = ((xmlParserCtxtPtr)ctxt)->myDoc; } /* parsing */ - (void)_handleEmptyDataInSystemId:(NSString *)_sysId { /* An empty HTML file _is_ valid?! I guess it equals to , wrong? => hh */ [self->contentHandler startDocument]; [self->contentHandler startPrefixMapping:@"" uri:self->namespaceURI]; [self->contentHandler startElement:@"html" namespace:XMLNS_XHTML rawName:@"html" attributes:nil]; [self->contentHandler startElement:@"body" namespace:XMLNS_XHTML rawName:@"body" attributes:nil]; [self->contentHandler endElement:@"body" namespace:XMLNS_XHTML rawName:@"body"]; [self->contentHandler endElement:@"html" namespace:XMLNS_XHTML rawName:@"html"]; [self->contentHandler endPrefixMapping:@""]; [self->contentHandler endDocument]; } - (void)_parseFromData:(NSData *)_data systemId:(NSString *)_sysId { NSAutoreleasePool *pool; if ([_data length] == 0) { [self _handleEmptyDataInSystemId:_sysId]; return; } pool = [[NSAutoreleasePool alloc] init]; /* parse into structure */ [self setupParserWithDocumentPath:_sysId]; [self pushBytes:[_data bytes] count:[_data length]]; [self pushEOF]; if (self->doc == NULL) { NSLog(@"Could not parse HTML file: %@", _sysId); [self tearDownParser]; } else { [self walkDocumentTree:self->doc]; [self tearDownParser]; } [pool release]; } - (void)parseFromSource:(id)_source systemId:(NSString *)_sysId { NSAutoreleasePool *pool; pool = [[NSAutoreleasePool alloc] init]; if ([_source isKindOfClass:[NSData class]]) { [self _parseFromData:_source systemId:_sysId]; return; } if ([_source isKindOfClass:[NSString class]]) { [self _parseFromData:[_source dataUsingEncoding:NSISOLatin1StringEncoding] systemId:_sysId]; return; } if ([_source isKindOfClass:[NSURL class]]) { NSData *data; data = [_source isFileURL] ? (NSData *)[NSData dataWithContentsOfMappedFile:[_source path]] : [_source resourceDataUsingCache:YES]; [self _parseFromData:data systemId:[_source absoluteString]]; return; } { SaxParseException *e; NSDictionary *ui; ui = [[NSDictionary alloc] initWithObjectsAndKeys: _source ? _source : (id)@"", @"source", self, @"parser", nil]; e = (id)[SaxParseException exceptionWithName:@"SaxIOException" reason:@"can not handle data-source" userInfo:ui]; [ui release]; ui = nil; [self->errorHandler fatalError:e]; } [self tearDownParser]; [pool release]; } - (void)parseFromSource:(id)_source { if ([_source isKindOfClass:[NSString class]]) [self parseFromSource:_source systemId:@""]; else if ([_source isKindOfClass:[NSData class]]) [self parseFromSource:_source systemId:@""]; else if ([_source isKindOfClass:[NSURL class]]) [self parseFromSource:_source systemId:[_source absoluteString]]; else [self parseFromSource:_source systemId:@""]; } - (void)parseFromSystemId:(NSString *)_sysId { NSAutoreleasePool *pool; NSData *data; if (![_sysId hasPrefix:@"file://"]) { /* exception */ return; } pool = [[NSAutoreleasePool alloc] init]; /* cut off file:// */ _sysId = [_sysId substringFromIndex:7]; /* load data */ data = [NSData dataWithContentsOfFile:_sysId]; [self _parseFromData:data systemId:_sysId]; [pool release]; } /* process attribute nodes */ - (void)processAttributes:(xmlAttrPtr)_attributes { xmlAttrPtr attribute; /* setup or clear attribute cache */ if (self->attributes == nil) attributes = [[SaxAttributes alloc] init]; else [attributes clear]; if (_attributes == NULL) /* nothing to process */ return; /* add attributes */ for (attribute = _attributes; attribute; attribute = attribute->next) { NSString *name, *xhtmlName; NSString *value; #if 0 printf("attr name '%s' has NS '%s'\n", attribute->name, attribute->ns ? "yes" : "no"); #endif name = xmlCharsToString(attribute->name); xhtmlName = [name lowercaseString]; value = @""; if (attribute->children) { xmlChar *t; if ((t = xmlNodeListGetString(doc, attribute->children, 0))) { value = xmlCharsToString(t); free(t); /* should be xmlFree ?? */ } } [attributes addAttribute:xhtmlName uri:self->namespaceURI rawName:name type:@"CDATA" value:value]; [name release]; name = nil; [value release]; value = nil; } return; } /* walking the tree, generating SAX events */ - (BOOL)processEntityRefNode:(xmlNodePtr)node { NSLog(@"Ignoring entity ref: '%s'\n", node->name); return YES; } - (BOOL)processDocumentNode:(xmlNodePtr)node { BOOL result; [self->contentHandler startDocument]; [self->contentHandler startPrefixMapping:@"" uri:self->namespaceURI]; result = [self processChildren:node->children]; [self->contentHandler endPrefixMapping:@""]; [self->contentHandler endDocument]; return result; } - (BOOL)processTextNode:(xmlNodePtr)_node { static unichar c = '\0'; xmlChar *chars; unsigned len; if (self->contentHandler == nil) return YES; if (_node->content == NULL) { [self->contentHandler characters:&c length:0]; return YES; } if (self->encodeEntities) { /* should use the HTML encoding routine (htmlEncodeEntities) ??? */ chars = xmlEncodeEntitiesReentrant(self->doc, _node->content); } else chars = _node->content; if (chars == NULL) { [self->contentHandler characters:&c length:0]; return YES; } if ((len = strlen((char *)chars)) == 0) { unichar c = '\0'; [self->contentHandler characters:&c length:0]; return YES; } { void *data, *ts; data = ts = calloc(len + 2, sizeof(unichar)); /* GC ?! */ if (_UTF8ToUTF16((void *)&chars, (void *)(chars + len), (void *)&ts, ts + (len * sizeof(unichar)))) { NSLog(@"ERROR(%s:%i): couldn't convert UTF8 to UTF16 !", __PRETTY_FUNCTION__, __LINE__); if (data) free(data); return NO; } len = (ts - data) / 2; [self->contentHandler characters:data length:len]; if (data) free(data); } return YES; } - (BOOL)processCommentNode:(xmlNodePtr)_node { unichar c = '\0'; if (self->lexicalHandler == nil) return YES; if (_node->content) { xmlChar *chars; /* uses the HTML encoding routine !!!!!!!!!! */ chars = xmlEncodeEntitiesReentrant(self->doc, _node->content); if (chars == NULL) { [self->lexicalHandler comment:&c length:0]; } else { unsigned len; if ((len = strlen((char *)chars)) > 0) { void *data, *ts; data = ts = calloc(len + 1, sizeof(unichar)); /* GC ?! */ if (_UTF8ToUTF16((void *)&chars, (void *)(chars + len), (void *)&ts, ts + (len * sizeof(unichar)))) { free(data); NSLog(@"ERROR(%s:%i): couldn't convert UTF8 to UTF16 !", __PRETTY_FUNCTION__, __LINE__); return NO; } len = (ts - data) / 2; [self->lexicalHandler comment:data length:len]; free(data); } else { unichar c = '\0'; [self->lexicalHandler comment:&c length:0]; } } } else [self->lexicalHandler comment:&c length:0]; return YES; } - (BOOL)processDTDNode:(xmlNodePtr)node { /* do nothing with DTD nodes .. */ return YES; } - (BOOL)processEntityNode:(xmlNodePtr)node { /* do nothing with entity nodes .. */ NSLog(@"%s:%i: ignoring entity node ..", __PRETTY_FUNCTION__, __LINE__); return YES; } - (BOOL)processPINode:(xmlNodePtr)node { /* do nothing with PI nodes .. */ return YES; } - (BOOL)processElementNode:(xmlNodePtr)node { NSString *tagName, *xhtmlName; BOOL result; self->depth++; tagName = xmlCharsToString(node->name); xhtmlName = [tagName lowercaseString]; [self processAttributes:node->properties]; [self->contentHandler startElement:xhtmlName namespace:self->namespaceURI rawName:tagName attributes:self->attributes]; [self->attributes clear]; result = [self processChildren:node->children]; [self->contentHandler endElement:xhtmlName namespace:self->namespaceURI rawName:tagName]; self->depth--; [tagName release]; return result; } - (BOOL)processChildren:(xmlNodePtr)children { xmlNodePtr node; if (children == NULL) return YES; for (node = children; node; node = node->next) { [self processNode:node]; } return YES; } - (BOOL)processNode:(xmlNodePtr)_node { switch(_node->type) { case XML_ELEMENT_NODE: return [self processElementNode:_node]; case XML_ATTRIBUTE_NODE: NSLog(@"invalid place for attribute-node !"); return NO; case HTML_TEXT_NODE: return [self processTextNode:_node]; case XML_CDATA_SECTION_NODE: return [self processTextNode:_node]; case HTML_ENTITY_REF_NODE: return [self processEntityRefNode:_node]; case XML_ENTITY_NODE: return [self processEntityNode:_node]; case XML_PI_NODE: return [self processPINode:_node]; case HTML_COMMENT_NODE: return [self processCommentNode:_node]; case XML_HTML_DOCUMENT_NODE: return [self processDocumentNode:_node]; case XML_DTD_NODE: return [self processDTDNode:_node]; default: NSLog(@"WARNING: UNKNOWN node type %i\n", _node->type); break; } return NO; } - (BOOL)walkDocumentTree:(xmlDocPtr)_doc { int type; BOOL result; type = ((xmlDocPtr)self->doc)->type; ((xmlDocPtr)self->doc)->type = XML_HTML_DOCUMENT_NODE; result = [self processNode:(xmlNodePtr)self->doc]; ((xmlDocPtr)self->doc)->type = type; return result; } /* callbacks */ static SaxParseException * mkException(libxmlHTMLSAXDriver *self, NSString *key, const char *msg, va_list va) { NSString *s, *reason; NSDictionary *ui; SaxParseException *e; int count = 0, i; id keys[7], values[7]; id tmp; NSRange r; s = [NSString stringWithCString:msg]; s = [[[NSString alloc] initWithFormat:s arguments:va] autorelease]; r = [s rangeOfString:@"\n"]; reason = (r.length > 0) ? [s substringToIndex:r.location] : s; if ([reason length] == 0) reason = @"unknown reason"; keys[0] = @"parser"; values[0] = self; count++; keys[1] = @"depth"; values[1] = [NSNumber numberWithInt:self->depth]; count++; if ([s length] > 0) { keys[count] = @"errorMessage"; values[count] = s; count++; } // NSLog(@"locator: %@", self->locator); if ((i = [self->locator lineNumber]) >= 0) { keys[count] = @"line"; values[count] = [NSNumber numberWithInt:i]; count++; } if ((i = [self->locator columnNumber]) >= 0) { keys[count] = @"column"; values[count] = [NSNumber numberWithInt:i]; count++; } if ((tmp = [self->locator publicId])) { keys[count] = @"publicId"; values[count] = tmp; count++; } if ((tmp = [self->locator systemId])) { keys[count] = @"systemId"; values[count] = tmp; count++; } ui = [NSDictionary dictionaryWithObjects:values forKeys:keys count:count]; e = (id)[SaxParseException exceptionWithName:key reason:reason userInfo:ui]; return e; } static void warning(void *udata, const char *msg, ...) { va_list args; SaxParseException *e; if (activeDriver == nil) { NSLog(@"ERROR(%s): no driver is active !", __PRETTY_FUNCTION__); return; } va_start(args, msg); e = mkException(activeDriver, @"SAXWarning", msg, args); va_end(args); [activeDriver->errorHandler warning:e]; } static void error(void *udata, const char *msg, ...) { va_list args; SaxParseException *e; if (!reportInvalidTags && msg != NULL) { if (toupper(msg[0]) == 'T') { if (strncasecmp(tagInvalidMsg, msg, strlen(tagInvalidMsg)) == 0) return; } #if 0 else if (toupper(msg[0]) == 'U') { if (strncasecmp(unexpectedNobrCloseMsg, msg, strlen(unexpectedNobrCloseMsg)) == 0) return; printf("MSG: '%s'\n", msg); } #endif } if (!reportUnclosedEntities && msg != NULL && toupper(msg[0]) == 'H') { if (strncasecmp(unclosedEntityInvalidMsg, msg, strlen(unclosedEntityInvalidMsg)) == 0) return; } if (activeDriver == nil) { NSLog(@"ERROR(%s): no driver is active !", __PRETTY_FUNCTION__); return; } /* msg is a format, eg 'tag %s is invalid' */ va_start(args, msg); e = mkException(activeDriver, @"SAXError", msg, args); va_end(args); [activeDriver->errorHandler error:e]; } static void fatalError(void *udata, const char *msg, ...) { va_list args; SaxParseException *e; if (activeDriver == nil) { NSLog(@"ERROR(%s): no driver is active !", __PRETTY_FUNCTION__); return; } va_start(args, msg); e = mkException(activeDriver, @"SAXFatalError", msg, args); va_end(args); [activeDriver->errorHandler fatalError:e]; } static void setLocator(void *udata, xmlSAXLocatorPtr _locator) { if (activeDriver == nil) { NSLog(@"ERROR(%s): no driver is active !", __PRETTY_FUNCTION__); return; } [activeDriver->locator release]; activeDriver->locator = [[libxmlSAXLocator alloc] initWithSaxLocator:_locator parser:activeDriver]; activeDriver->locator->ctx = activeDriver->ctxt; [activeDriver->contentHandler setDocumentLocator:activeDriver->locator]; } @end /* libxmlHTMLSAXDriver */ #include "unicode.h" SOPE/sope-xml/TODO0000644000000000000000000000050512242733420012555 0ustar rootrootTODO ==== - add SAX wrapper for Parsifal ? http://www.saunalahti.fi/~samiuus/toni/xmlproc/ - add a DOM builder which can create a DOM from a libxml2 or CoreFoundation DOM tree instead of using SAX (should be much more efficient) - write a SAX driver based on NSXMLParser (should be an almost trivial 1:1 mapping) SOPE/sope-xml/README-OSX.txt0000644000000000000000000000041712242733417014242 0ustar rootrootPlease refer to ../README-OSX.txt for compilation directives. Prebinding Notes (DEPRECATED, for reference only) ================================================= sope-xml: 0xC0000000 - 0xC0FFFFFF 0xC0000000 SaxObjC 0xC0200000 DOM 0xC0400000 XmlRpc 0xC0FF0000 sope-xml SOPE/sope-xml/Version0000644000000000000000000000037712242733420013444 0ustar rootroot# # This file is included by library makefiles to set the version information # of the executable. MAJOR_VERSION=4 MINOR_VERSION=9 # subminor versions are set in the Version files contained in the library path SOPE_MAJOR_VERSION=4 SOPE_MINOR_VERSION=9 SOPE/sope-xml/dummy.c0000644000000000000000000000151112242733420013362 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // required for compilation of empty MacOSX frameworks ... SOPE/COPYRIGHT0000644000000000000000000000010512242733417011616 0ustar rootrootCopyright (C) 2000-2005 SKYRIX Software AG Contact: info@skyrix.com SOPE/sope-json/0000755000000000000000000000000012242733417012244 5ustar rootrootSOPE/sope-json/GNUmakefile0000644000000000000000000000032512242733417014316 0ustar rootroot# GNUstep makefile include ../config.make include $(GNUSTEP_MAKEFILES)/common.make SUBPROJECTS += SBJson -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/aggregate.make -include GNUmakefile.postamble SOPE/sope-json/SBJson/0000755000000000000000000000000012242733417013402 5ustar rootrootSOPE/sope-json/SBJson/Installation.markdown0000644000000000000000000000261312242733417017611 0ustar rootrootSuper-simple installation ========================= By *far* the simplest way to start using JSON in your iPhone, iPad, or Mac application is to simply copy all the source files (the contents of the `Classes` folder) into your own Xcode project. 1. In the Finder, open the `json-framework/Classes` folder and select all the files. 1. Drop-and-drop them on the **Classes** group in the **Groups & Files** menu of your Xcode project. 1. Tick the **Copy items into destination group's folder** option. 1. Use `#import "JSON.h"` in your source files. That should be it. Now create that Twitter client! Upgrading --------- If you're upgrading from a previous version, make sure you're deleting the old JSON classes first, moving all the files to Trash. Trouble-shooting ---------------- Check to see if the answers to the [Frequently Asked Questions][faq] are of any help. [faq]: http://github.com/stig/json-framework/wiki/FrequentlyAskedQuestions Alternative installation instructions ===================================== Copying the JSON Classes into your project isn't the *only* way to use this framework. I've created a couple of examples that link to this framework rather than copy the sources. Check them out at github: * [Linking to JSON Framework on the iPhone, iPad & iPod Touch](http://github.com/stig/JsonSampleIPhone) * [Linking to JSON Framework on the Mac](http://github.com/stig/JsonSampleMac) SOPE/sope-json/SBJson/GNUmakefile0000644000000000000000000000027712242733417015462 0ustar rootroot# GNUstep makefile include $(GNUSTEP_MAKEFILES)/common.make SUBPROJECTS += Classes -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/aggregate.make -include GNUmakefile.postamble SOPE/sope-json/SBJson/Changes.markdown0000644000000000000000000001605612242733417016526 0ustar rootroot# JSON Framework Changes ## Version 2.3.1 (September 25th, 2010) ### Changes * Renamed .md files to .markdown. * Removed bench target--use [Sam Soffes's benchmarks][json-benchmark] instead. [json-benchmark]: http://github.com/samsoffes/json-benchmark ### Bug fixes * [Issue 2][issue#2]: Linkage not supported by default distribution. * [Issue 4][issue#4]: Writer reported to occasionally fail infinity check. * [Issue 8][issue#8]: Installation.markdown refers to missing JSON folder. [issue#2]: http://github.com/stig/json-framework/issues/closed/#issue/2 [issue#4]: http://github.com/stig/json-framework/issues/closed/#issue/4 [issue#8]: http://github.com/stig/json-framework/issues/closed/#issue/8 ## Version 2.3 (August 7, 2010) * Renamed README.md to Readme.md * Updated version number ## Version 2.3beta1 (July 31, 2010) ### Changes * **Parsing performance improvements.** [Issue 56][issue-56]: Dewvinci & Tobias Hoehmann came up with a patch to improve parsing of short JSON texts with lots of numbers by over 60%. * **Refactored tests to be more data-driven.** This should make the source leaner and easier to maintain. * **Removed problematic SDK** [Issue 33][issue-33], [58][issue-58], [63][issue-63], and [64][issue-64]: The vast majority of the issues people are having with this framework were related to the somewhat mystical Custom SDK. This has been removed in this version. * **Removed the deprecated SBJSON facade** [Issue 71][issue-71]: You should use the SBJsonParser or SBJsonWriter classes, or the category methods, instead. This also let us remove the SBJsonParser and SBJsonWriter categories; these were only there to support the facade, but made the code less transparent. * **Removed the deprecated fragment support** [Issue 70][issue-70]: Fragments were a bad idea from the start, but deceptively useful while writing the framework's test suite. This has now been rectified. [issue-56]: http://code.google.com/p/json-framework/issues/detail?id=56 [issue-33]: http://code.google.com/p/json-framework/issues/detail?id=33 [issue-58]: http://code.google.com/p/json-framework/issues/detail?id=58 [issue-63]: http://code.google.com/p/json-framework/issues/detail?id=63 [issue-64]: http://code.google.com/p/json-framework/issues/detail?id=64 [issue-70]: http://code.google.com/p/json-framework/issues/detail?id=70 [issue-71]: http://code.google.com/p/json-framework/issues/detail?id=71 ### Bug Fixes * [Issue 38][issue-38]: Fixed header-inclusion issue. * [Issue 74][issue-74]: Fix bug in handling of Infinity, -Infinity & NaN. * [Issue 68][issue-68]: Fixed documentation bug [issue-38]: http://code.google.com/p/json-framework/issues/detail?id=39 [issue-74]: http://code.google.com/p/json-framework/issues/detail?id=74 [issue-68]: http://code.google.com/p/json-framework/issues/detail?id=68 ## Version 2.2.3 (March 7, 2010) * **Added -all_load to libjsontests linker flags.** This allows the tests to run with more recent versions of GCC. * **Unable to do a JSONRepresentation for a first-level proxy object.** [Issue 54][issue-54] & [60][issue-60]: Allow the -proxyForJson method to be called for first-level proxy objects, in addition to objects that are embedded in other objects. [issue-54]: http://code.google.com/p/json-framework/issues/detail?id=54 [issue-60]: http://code.google.com/p/json-framework/issues/detail?id=60 ## Version 2.2.2 (September 12, 2009) * **Fixed error-reporting logic in category methods.** Reported by Mike Monaco. * **iPhone SDK built against iPhoneOS 3.0.** This has been updated from 2.2.1. ## Version 2.2.1 (August 1st, 2009) * **Added svn:ignore property to build directory.** Requested by Rony Kubat. * **Fixed potential corruption in category methods.** If category methods were used in multiple threads they could potentially cause a crash. Reported by dprotaso / Relium. ## Version 2.2 (June 6th, 2009) No changes since 2.2beta1. ## Version 2.2beta1 (May 30th, 2009) * **Renamed method for custom object support** Renamed the -jsonRepresentationProxy method to -proxyForJson. ## Version 2.2alpha5 (May 25th, 2009) * **Added support for custom objects (generation only)** Added an optional -jsonRepresentationProxy method that you can implement (either directly or as category) to enable JSON.framework to create a JSON representation of any object type. See the Tests/ProxyTest.m file for more information on how this works. * **Moved maxDepth to SBJsonBase** Throw errors when the input is nested too deep for writing json as well as parsing. This allows us to exit cleanly rather than break the stack if someone accidentally creates a recursive structure. ## Version 2.2alpha4 (May 21st, 2009) * **Renamed protocols and moved method declarations** Renamed SBJsonWriterOptions and SBJsonParserOptions protocols to be the same as their primary implementations and moved their one public method there. * **Implemented proxy methods in SBJSON** This facade now implements the same methods as the SBJsonWriter and SBJsonParser objects, and simply forwards to them. * **Extracted private methods to private protocol** Don't use these please. * **Improved documentation generation** Classes now inherit documentation from their superclasses and protocols they implement. ## Version 2.2alpha3 (May 16th, 2009) * **Reintroduced the iPhone Custom SDK** For the benefit of users who prefer not to copy the JSON source files into their project. Also updated it to be based on iPhoneOS v2.2.1. * **Deprecated methods for dealing with fragments** Tweaked the new interface classes to support the old fragment-methods one more version. ## Version 2.2alpha2 (May 11th, 2009) * **Added a Changes file.** So people can see what the changes are for each version without having to go to the project home page. * **Updated Credits.** Some people that have provided patches (or other valuable contributions) had been left out. I've done my best to add those in. (If you feel that you or someone else are still missing, please let me know.) * **Removed .svn folders from distribution.** The JSON source folder had a .svn folder in it, which could have caused problems when dragging it into your project. ## Version 2.2alpha1 (May 10th, 2009) * **Improved installation instructions, particularly for the iPhone.** Getting the SDK to work properly in all configurations has proved to be a headache. Therefore the SDK has been removed in favour of instructions for simply copying the source files into your project. * **Split the SBJSON class into a writer and parser class.** SBJSON remains as a facade for backwards compatibility. This refactoring also quashed warnings reported by the Clang static analyser. * **Improved interface for dealing with errors.** Rather than having to pass in a pointer to an NSError object, you can now simply call a method to get the error stack back if there was an error. (The NSError-based API remains in the SBJSON facade, but is not present in the new classes.) * **Documentation updates.** Minor updates to the documentation. Release notes for earlier releases can be found here: http://code.google.com/p/json-framework/wiki/ReleaseNotes SOPE/sope-json/SBJson/Classes/0000755000000000000000000000000012242733417014777 5ustar rootrootSOPE/sope-json/SBJson/Classes/NSString+SBJSON.h0000644000000000000000000000376012242733417017657 0ustar rootroot/* Copyright (C) 2009 Stig Brautaset. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #import /** @brief Adds JSON parsing methods to NSString This is a category on NSString that adds methods for parsing the target string. */ @interface NSString (NSString_SBJSON) /** @brief Returns the NSDictionary or NSArray represented by the current string's JSON representation. Returns the dictionary or array represented in the receiver, or nil on error. Returns the NSDictionary or NSArray represented by the current string's JSON representation. */ - (id)JSONValue; @end SOPE/sope-json/SBJson/Classes/GNUmakefile0000644000000000000000000000100712242733417017047 0ustar rootroot# GNUstep makefile -include ../../../config.make include $(GNUSTEP_MAKEFILES)/common.make LIBRARY_NAME = SBJson SBJson_VERSION=2.3.1 SBJson_INCLUDE_DIRS = -std=gnu99 SBJson_HEADER_FILES = \ SBJson.h \ NSObject+SBJSON.h \ NSString+SBJSON.h \ SBJsonBase.h \ SBJsonParser.h \ SBJsonWriter.h SBJson_OBJC_FILES = \ NSObject+SBJSON.m \ NSString+SBJSON.m \ SBJsonBase.m \ SBJsonParser.m \ SBJsonWriter.m -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/library.make -include GNUmakefile.postamble SOPE/sope-json/SBJson/Classes/SBJsonParser.h0000644000000000000000000000621712242733417017471 0ustar rootroot/* Copyright (C) 2009 Stig Brautaset. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #import #import "SBJsonBase.h" /** @brief The JSON parser class. JSON is mapped to Objective-C types in the following way: @li Null -> NSNull @li String -> NSMutableString @li Array -> NSMutableArray @li Object -> NSMutableDictionary @li Boolean -> NSNumber (initialised with -initWithBool:) @li Number -> (NSNumber | NSDecimalNumber) Since Objective-C doesn't have a dedicated class for boolean values, these turns into NSNumber instances. These are initialised with the -initWithBool: method, and round-trip back to JSON properly. (They won't silently suddenly become 0 or 1; they'll be represented as 'true' and 'false' again.) As an optimisation short JSON integers turn into NSNumber instances, while complex ones turn into NSDecimalNumber instances. We can thus avoid any loss of precision as JSON allows ridiculously large numbers. */ @interface SBJsonParser : SBJsonBase { @private const char *c; } /** @brief Return the object represented by the given string Returns the object represented by the passed-in string or nil on error. The returned object can be a string, number, boolean, null, array or dictionary. @param repr the json string to parse */ - (id)objectWithString:(NSString *)repr; /** @brief Return the object represented by the given string Returns the object represented by the passed-in string or nil on error. The returned object can be a string, number, boolean, null, array or dictionary. @param jsonText the json string to parse @param error pointer to an NSError object to populate on error */ - (id)objectWithString:(NSString*)jsonText error:(NSError**)error; @end SOPE/sope-json/SBJson/Classes/SBJsonBase.h0000644000000000000000000000566712242733417017117 0ustar rootroot/* Copyright (C) 2009 Stig Brautaset. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #import extern NSString * SBJSONErrorDomain; enum { EUNSUPPORTED = 1, EPARSENUM, EPARSE, EFRAGMENT, ECTRL, EUNICODE, EDEPTH, EESCAPE, ETRAILCOMMA, ETRAILGARBAGE, EEOF, EINPUT }; /** @brief Common base class for parsing & writing. This class contains the common error-handling code and option between the parser/writer. */ @interface SBJsonBase : NSObject { NSMutableArray *errorTrace; @protected NSUInteger depth, maxDepth; } /** @brief The maximum recursing depth. Defaults to 512. If the input is nested deeper than this the input will be deemed to be malicious and the parser returns nil, signalling an error. ("Nested too deep".) You can turn off this security feature by setting the maxDepth value to 0. */ // @property NSUInteger maxDepth; /** @brief Return an error trace, or nil if there was no errors. Note that this method returns the trace of the last method that failed. You need to check the return value of the call you're making to figure out if the call actually failed, before you know call this method. */ #if GNUSTEP - (NSArray *) errorTrace; #else @property(copy,readonly) NSArray* errorTrace; #endif /// @internal for use in subclasses to add errors to the stack trace - (void)addErrorWithCode:(NSUInteger)code description:(NSString*)str; /// @internal for use in subclasess to clear the error before a new parsing attempt - (void)clearErrorTrace; @end SOPE/sope-json/SBJson/Classes/SBJsonParser.m0000644000000000000000000003607412242733417017502 0ustar rootroot/* Copyright (C) 2009,2010 Stig Brautaset. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #import "SBJsonParser.h" @interface SBJsonParser (SBJsonPrivate) - (BOOL)scanValue:(NSObject **)o; - (BOOL)scanRestOfArray:(NSMutableArray **)o; - (BOOL)scanRestOfDictionary:(NSMutableDictionary **)o; - (BOOL)scanRestOfNull:(NSNull **)o; - (BOOL)scanRestOfFalse:(NSNumber **)o; - (BOOL)scanRestOfTrue:(NSNumber **)o; - (BOOL)scanRestOfString:(NSMutableString **)o; // Cannot manage without looking at the first digit - (BOOL)scanNumber:(NSNumber **)o; - (BOOL)scanHexQuad:(unichar *)x; - (BOOL)scanUnicodeChar:(unichar *)x; - (BOOL)scanIsAtEnd; @end #define skipWhitespace(c) while (isspace(*c)) c++ #define skipDigits(c) while (isdigit(*c)) c++ @implementation SBJsonParser static char ctrl[0x22]; + (void)initialize { ctrl[0] = '\"'; ctrl[1] = '\\'; for (int i = 1; i < 0x20; i++) ctrl[i+1] = i; ctrl[0x21] = 0; } - (id)objectWithString:(NSString *)repr { [self clearErrorTrace]; if (!repr) { [self addErrorWithCode:EINPUT description:@"Input was 'nil'"]; return nil; } depth = 0; c = [repr UTF8String]; id o; if (![self scanValue:&o]) { return nil; } // We found some valid JSON. But did it also contain something else? if (![self scanIsAtEnd]) { [self addErrorWithCode:ETRAILGARBAGE description:@"Garbage after JSON"]; return nil; } NSAssert1(o, @"Should have a valid object from %@", repr); // Check that the object we've found is a valid JSON container. if (![o isKindOfClass:[NSDictionary class]] && ![o isKindOfClass:[NSArray class]] && ![o isKindOfClass:[NSNull class]]) { [self addErrorWithCode:EFRAGMENT description:@"Valid fragment, but not JSON"]; return nil; } return o; } - (id)objectWithString:(NSString*)repr error:(NSError**)error { id tmp = [self objectWithString:repr]; if (tmp) return tmp; if (error) *error = [errorTrace lastObject]; return nil; } /* In contrast to the public methods, it is an error to omit the error parameter here. */ - (BOOL)scanValue:(NSObject **)o { skipWhitespace(c); switch (*c++) { case '{': return [self scanRestOfDictionary:(NSMutableDictionary **)o]; break; case '[': return [self scanRestOfArray:(NSMutableArray **)o]; break; case '"': return [self scanRestOfString:(NSMutableString **)o]; break; case 'f': return [self scanRestOfFalse:(NSNumber **)o]; break; case 't': return [self scanRestOfTrue:(NSNumber **)o]; break; case 'n': return [self scanRestOfNull:(NSNull **)o]; break; case '-': case '0'...'9': c--; // cannot verify number correctly without the first character return [self scanNumber:(NSNumber **)o]; break; case '+': [self addErrorWithCode:EPARSENUM description: @"Leading + disallowed in number"]; return NO; break; case 0x0: [self addErrorWithCode:EEOF description:@"Unexpected end of string"]; return NO; break; default: [self addErrorWithCode:EPARSE description: @"Unrecognised leading character"]; return NO; break; } NSAssert(0, @"Should never get here"); return NO; } - (BOOL)scanRestOfTrue:(NSNumber **)o { if (!strncmp(c, "rue", 3)) { c += 3; *o = [NSNumber numberWithBool:YES]; return YES; } [self addErrorWithCode:EPARSE description:@"Expected 'true'"]; return NO; } - (BOOL)scanRestOfFalse:(NSNumber **)o { if (!strncmp(c, "alse", 4)) { c += 4; *o = [NSNumber numberWithBool:NO]; return YES; } [self addErrorWithCode:EPARSE description: @"Expected 'false'"]; return NO; } - (BOOL)scanRestOfNull:(NSNull **)o { if (!strncmp(c, "ull", 3)) { c += 3; *o = [NSNull null]; return YES; } [self addErrorWithCode:EPARSE description: @"Expected 'null'"]; return NO; } - (BOOL)scanRestOfArray:(NSMutableArray **)o { if (maxDepth && ++depth > maxDepth) { [self addErrorWithCode:EDEPTH description: @"Nested too deep"]; return NO; } *o = [NSMutableArray arrayWithCapacity:8]; for (; *c ;) { id v; skipWhitespace(c); if (*c == ']' && c++) { depth--; return YES; } if (![self scanValue:&v]) { [self addErrorWithCode:EPARSE description:@"Expected value while parsing array"]; return NO; } [*o addObject:v]; skipWhitespace(c); if (*c == ',' && c++) { skipWhitespace(c); if (*c == ']') { [self addErrorWithCode:ETRAILCOMMA description: @"Trailing comma disallowed in array"]; return NO; } } } [self addErrorWithCode:EEOF description: @"End of input while parsing array"]; return NO; } - (BOOL)scanRestOfDictionary:(NSMutableDictionary **)o { if (maxDepth && ++depth > maxDepth) { [self addErrorWithCode:EDEPTH description: @"Nested too deep"]; return NO; } *o = [NSMutableDictionary dictionaryWithCapacity:7]; for (; *c ;) { id k, v; skipWhitespace(c); if (*c == '}' && c++) { depth--; return YES; } if (!(*c == '\"' && c++ && [self scanRestOfString:&k])) { [self addErrorWithCode:EPARSE description: @"Object key string expected"]; return NO; } skipWhitespace(c); if (*c != ':') { [self addErrorWithCode:EPARSE description: @"Expected ':' separating key and value"]; return NO; } c++; if (![self scanValue:&v]) { NSString *string = [NSString stringWithFormat:@"Object value expected for key: %@", k]; [self addErrorWithCode:EPARSE description: string]; return NO; } [*o setObject:v forKey:k]; skipWhitespace(c); if (*c == ',' && c++) { skipWhitespace(c); if (*c == '}') { [self addErrorWithCode:ETRAILCOMMA description: @"Trailing comma disallowed in object"]; return NO; } } } [self addErrorWithCode:EEOF description: @"End of input while parsing object"]; return NO; } - (BOOL)scanRestOfString:(NSMutableString **)o { // if the string has no control characters in it, return it in one go, without any temporary allocations. size_t len = strcspn(c, ctrl); if (len && *(c + len) == '\"') { *o = [[[NSMutableString alloc] initWithBytes:(char*)c length:len encoding:NSUTF8StringEncoding] autorelease]; c += len + 1; return YES; } *o = [NSMutableString stringWithCapacity:16]; do { // First see if there's a portion we can grab in one go. // Doing this caused a massive speedup on the long string. len = strcspn(c, ctrl); if (len) { // check for id t = [[NSString alloc] initWithBytesNoCopy:(char*)c length:len encoding:NSUTF8StringEncoding freeWhenDone:NO]; if (t) { [*o appendString:t]; [t release]; c += len; } } if (*c == '"') { c++; return YES; } else if (*c == '\\') { unichar uc = *++c; switch (uc) { case '\\': case '/': case '"': break; case 'b': uc = '\b'; break; case 'n': uc = '\n'; break; case 'r': uc = '\r'; break; case 't': uc = '\t'; break; case 'f': uc = '\f'; break; case 'u': c++; if (![self scanUnicodeChar:&uc]) { [self addErrorWithCode:EUNICODE description: @"Broken unicode character"]; return NO; } c--; // hack. break; default: [self addErrorWithCode:EESCAPE description: [NSString stringWithFormat:@"Illegal escape sequence '0x%x'", uc]]; return NO; break; } #if GNUSTEP [*o appendFormat: @"%C", uc]; #else CFStringAppendCharacters((CFMutableStringRef)*o, &uc, 1); #endif c++; } else if (*c < 0x20) { [self addErrorWithCode:ECTRL description: [NSString stringWithFormat:@"Unescaped control character '0x%x'", *c]]; return NO; } else { NSLog(@"should not be able to get here"); } } while (*c); [self addErrorWithCode:EEOF description:@"Unexpected EOF while parsing string"]; return NO; } - (BOOL)scanUnicodeChar:(unichar *)x { unichar hi, lo; if (![self scanHexQuad:&hi]) { [self addErrorWithCode:EUNICODE description: @"Missing hex quad"]; return NO; } if (hi >= 0xd800) { // high surrogate char? if (hi < 0xdc00) { // yes - expect a low char if (!(*c == '\\' && ++c && *c == 'u' && ++c && [self scanHexQuad:&lo])) { [self addErrorWithCode:EUNICODE description: @"Missing low character in surrogate pair"]; return NO; } if (lo < 0xdc00 || lo >= 0xdfff) { [self addErrorWithCode:EUNICODE description:@"Invalid low surrogate char"]; return NO; } hi = (hi - 0xd800) * 0x400 + (lo - 0xdc00) + 0x10000; } else if (hi < 0xe000) { [self addErrorWithCode:EUNICODE description:@"Invalid high character in surrogate pair"]; return NO; } } *x = hi; return YES; } - (BOOL)scanHexQuad:(unichar *)x { *x = 0; for (int i = 0; i < 4; i++) { unichar uc = *c; c++; int d = (uc >= '0' && uc <= '9') ? uc - '0' : (uc >= 'a' && uc <= 'f') ? (uc - 'a' + 10) : (uc >= 'A' && uc <= 'F') ? (uc - 'A' + 10) : -1; if (d == -1) { [self addErrorWithCode:EUNICODE description:@"Missing hex digit in quad"]; return NO; } *x *= 16; *x += d; } return YES; } - (BOOL)scanNumber:(NSNumber **)o { BOOL simple = YES; const char *ns = c; // The logic to test for validity of the number formatting is relicensed // from JSON::XS with permission from its author Marc Lehmann. // (Available at the CPAN: http://search.cpan.org/dist/JSON-XS/ .) if ('-' == *c) c++; if ('0' == *c && c++) { if (isdigit(*c)) { [self addErrorWithCode:EPARSENUM description: @"Leading 0 disallowed in number"]; return NO; } } else if (!isdigit(*c) && c != ns) { [self addErrorWithCode:EPARSENUM description: @"No digits after initial minus"]; return NO; } else { skipDigits(c); } // Fractional part if ('.' == *c && c++) { simple = NO; if (!isdigit(*c)) { [self addErrorWithCode:EPARSENUM description: @"No digits after decimal point"]; return NO; } skipDigits(c); } // Exponential part if ('e' == *c || 'E' == *c) { simple = NO; c++; if ('-' == *c || '+' == *c) c++; if (!isdigit(*c)) { [self addErrorWithCode:EPARSENUM description: @"No digits after exponent"]; return NO; } skipDigits(c); } // If we are only reading integers, don't go through the expense of creating an NSDecimal. // This ends up being a very large perf win. if (simple) { BOOL negate = NO; long long val = 0; const char *d = ns; if (*d == '-') { negate = YES; d++; } while (isdigit(*d)) { val *= 10; if (val < 0) goto longlong_overflow; val += *d - '0'; if (val < 0) goto longlong_overflow; d++; } *o = [NSNumber numberWithLongLong:negate ? -val : val]; return YES; } else { // jumped to by simple branch, if an overflow occured longlong_overflow:; id str = [[NSString alloc] initWithBytesNoCopy:(char*)ns length:c - ns encoding:NSUTF8StringEncoding freeWhenDone:NO]; [str autorelease]; if (str && (*o = [NSDecimalNumber decimalNumberWithString:str locale:nil])) { return YES; } [self addErrorWithCode:EPARSENUM description: @"Failed creating decimal instance"]; return NO; } } - (BOOL)scanIsAtEnd { skipWhitespace(c); return !*c; } @end SOPE/sope-json/SBJson/Classes/NSObject+SBJSON.h0000644000000000000000000000413712242733417017616 0ustar rootroot/* Copyright (C) 2009 Stig Brautaset. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #import /** @brief Adds JSON generation to Foundation classes This is a category on NSObject that adds methods for returning JSON representations of standard objects to the objects themselves. This means you can call the -JSONRepresentation method on an NSArray object and it'll do what you want. */ @interface NSObject (NSObject_SBJSON) /** @brief Returns a string containing the receiver encoded in JSON. This method is added as a category on NSObject but is only actually supported for the following objects: @li NSDictionary @li NSArray */ - (NSString *)JSONRepresentation; @end SOPE/sope-json/SBJson/Classes/NSObject+SBJSON.m0000644000000000000000000000357512242733417017630 0ustar rootroot/* Copyright (C) 2009 Stig Brautaset. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #import "NSObject+SBJSON.h" #import "SBJsonWriter.h" @implementation NSObject (NSObject_SBJSON) - (NSString *)JSONRepresentation { SBJsonWriter *jsonWriter = [SBJsonWriter new]; NSString *json = [jsonWriter stringWithObject:self]; if (!json) NSLog(@"-JSONRepresentation failed. Error trace is: %@", [jsonWriter errorTrace]); [jsonWriter release]; return json; } @end SOPE/sope-json/SBJson/Classes/SBJsonWriter.m0000644000000000000000000002157112242733417017516 0ustar rootroot/* Copyright (C) 2009 Stig Brautaset. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include #import "SBJsonWriter.h" @interface SBJsonWriter (SBJsonPrivate) - (BOOL)appendValue:(id)fragment into:(NSMutableString*)json; - (BOOL)appendArray:(NSArray*)fragment into:(NSMutableString*)json; - (BOOL)appendDictionary:(NSDictionary*)fragment into:(NSMutableString*)json; - (BOOL)appendString:(NSString*)fragment into:(NSMutableString*)json; - (NSString*)indent; @end @implementation SBJsonWriter #if !GNUSTEP @synthesize sortKeys; @synthesize humanReadable; #endif static NSMutableCharacterSet *kEscapeChars; + (void)initialize { kEscapeChars = [[NSMutableCharacterSet characterSetWithRange: NSMakeRange(0,32)] retain]; [kEscapeChars addCharactersInString: @"\"\\"]; } #if GNUSTEP - (void) setHumanReadable: (BOOL) newValue { humanReadable = newValue; } - (BOOL) humanReadable { return humanReadable; } #endif #if GNUSTEP - (void) setSortKeys: (BOOL) newValue { sortKeys = newValue; } - (BOOL) sortKeys { return sortKeys; } #endif - (NSString*)stringWithObject:(id)value { [self clearErrorTrace]; if ([value isKindOfClass:[NSDictionary class]] || [value isKindOfClass:[NSArray class]]) { depth = 0; NSMutableString *json = [NSMutableString stringWithCapacity:128]; if ([self appendValue:value into:json]) return json; } if ([value respondsToSelector:@selector(proxyForJson)]) { NSString *tmp = [self stringWithObject:[value proxyForJson]]; if (tmp) return tmp; } [self addErrorWithCode:EFRAGMENT description:@"Not valid type for JSON"]; return nil; } - (NSString*)stringWithObject:(id)value error:(NSError**)error { NSString *tmp = [self stringWithObject:value]; if (tmp) return tmp; if (error) *error = [errorTrace lastObject]; return nil; } - (NSString*)indent { return [@"\n" stringByPaddingToLength:1 + 2 * depth withString:@" " startingAtIndex:0]; } - (BOOL)appendValue:(id)fragment into:(NSMutableString*)json { if ([fragment isKindOfClass:[NSDictionary class]]) { if (![self appendDictionary:fragment into:json]) return NO; } else if ([fragment isKindOfClass:[NSArray class]]) { if (![self appendArray:fragment into:json]) return NO; } else if ([fragment isKindOfClass:[NSString class]]) { if (![self appendString:fragment into:json]) return NO; } else if ([fragment isKindOfClass:[NSNumber class]]) { if ('c' == *[fragment objCType]) { [json appendString:[fragment boolValue] ? @"true" : @"false"]; #if !GNUSTEP } else if ([fragment isEqualToNumber:(NSNumber*)kCFNumberNaN]) { [self addErrorWithCode:EUNSUPPORTED description:@"NaN is not a valid number in JSON"]; return NO; #endif } else if (isinf([fragment doubleValue])) { [self addErrorWithCode:EUNSUPPORTED description:@"Infinity is not a valid number in JSON"]; return NO; } else { [json appendString:[fragment stringValue]]; } } else if ([fragment isKindOfClass:[NSNull class]]) { [json appendString:@"null"]; } else if ([fragment respondsToSelector:@selector(proxyForJson)]) { [self appendValue:[fragment proxyForJson] into:json]; } else { [self addErrorWithCode:EUNSUPPORTED description:[NSString stringWithFormat:@"JSON serialisation not supported for %@", [fragment class]]]; return NO; } return YES; } - (BOOL)appendArray:(NSArray*)fragment into:(NSMutableString*)json { #if GNUSTEP NSEnumerator *fragmentEnum; id value; fragmentEnum = [fragment objectEnumerator]; #endif if (maxDepth && ++depth > maxDepth) { [self addErrorWithCode:EDEPTH description: @"Nested too deep"]; return NO; } [json appendString:@"["]; BOOL addComma = NO; #if GNUSTEP while ((value = [fragmentEnum nextObject])) #else for (id value in fragment) #endif { if (addComma) [json appendString:@","]; else addComma = YES; if ([self humanReadable]) [json appendString:[self indent]]; if (![self appendValue:value into:json]) { return NO; } } depth--; if ([self humanReadable] && [fragment count]) [json appendString:[self indent]]; [json appendString:@"]"]; return YES; } - (BOOL)appendDictionary:(NSDictionary*)fragment into:(NSMutableString*)json { if (maxDepth && ++depth > maxDepth) { [self addErrorWithCode:EDEPTH description: @"Nested too deep"]; return NO; } [json appendString:@"{"]; NSString *colon = [self humanReadable] ? @" : " : @":"; BOOL addComma = NO; NSArray *keys = [fragment allKeys]; #if GNUSTEP NSEnumerator *keysEnum; id value; keysEnum = [keys objectEnumerator]; #endif if (sortKeys) keys = [keys sortedArrayUsingSelector:@selector(compare:)]; #if GNUSTEP while ((value = [keysEnum nextObject])) { #else for (id value in keys) { #endif if (addComma) [json appendString:@","]; else addComma = YES; if ([self humanReadable]) [json appendString:[self indent]]; if (![value isKindOfClass:[NSString class]]) { [self addErrorWithCode:EUNSUPPORTED description: @"JSON object key must be string"]; return NO; } if (![self appendString:value into:json]) return NO; [json appendString:colon]; if (![self appendValue:[fragment objectForKey:value] into:json]) { [self addErrorWithCode:EUNSUPPORTED description:[NSString stringWithFormat:@"Unsupported value for key %@ in object", value]]; return NO; } } depth--; if ([self humanReadable] && [fragment count]) [json appendString:[self indent]]; [json appendString:@"}"]; return YES; } - (BOOL)appendString:(NSString*)fragment into:(NSMutableString*)json { [json appendString:@"\""]; NSRange esc = [fragment rangeOfCharacterFromSet:kEscapeChars]; if ( !esc.length ) { // No special chars -- can just add the raw string: [json appendString:fragment]; } else { NSUInteger length = [fragment length]; for (NSUInteger i = 0; i < length; i++) { unichar uc = [fragment characterAtIndex:i]; switch (uc) { case '"': [json appendString:@"\\\""]; break; case '\\': [json appendString:@"\\\\"]; break; case '\t': [json appendString:@"\\t"]; break; case '\n': [json appendString:@"\\n"]; break; case '\r': [json appendString:@"\\r"]; break; case '\b': [json appendString:@"\\b"]; break; case '\f': [json appendString:@"\\f"]; break; default: if (uc < 0x20) { [json appendFormat:@"\\u%04x", uc]; } else { #if GNUSTEP [json appendFormat: @"%C", uc]; #else CFStringAppendCharacters((CFMutableStringRef)json, &uc, 1); #endif } break; } } } [json appendString:@"\""]; return YES; } @end SOPE/sope-json/SBJson/Classes/NSString+SBJSON.m0000644000000000000000000000353512242733417017664 0ustar rootroot/* Copyright (C) 2007-2009 Stig Brautaset. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #import "NSString+SBJSON.h" #import "SBJsonParser.h" @implementation NSString (NSString_SBJSON) - (id)JSONValue { SBJsonParser *jsonParser = [SBJsonParser new]; id repr = [jsonParser objectWithString:self]; if (!repr) NSLog(@"-JSONValue failed. Error trace is: %@", [jsonParser errorTrace]); [jsonParser release]; return repr; } @end SOPE/sope-json/SBJson/Classes/SBJsonWriter.h0000644000000000000000000001121112242733417017477 0ustar rootroot/* Copyright (C) 2009 Stig Brautaset. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #import #import "SBJsonBase.h" /** @brief The JSON writer class. Objective-C types are mapped to JSON types in the following way: @li NSNull -> Null @li NSString -> String @li NSArray -> Array @li NSDictionary -> Object @li NSNumber (-initWithBool:) -> Boolean @li NSNumber -> Number In JSON the keys of an object must be strings. NSDictionary keys need not be, but attempting to convert an NSDictionary with non-string keys into JSON will throw an exception. NSNumber instances created with the +initWithBool: method are converted into the JSON boolean "true" and "false" values, and vice versa. Any other NSNumber instances are converted to a JSON number the way you would expect. */ @interface SBJsonWriter : SBJsonBase { @private BOOL sortKeys, humanReadable; } /** @brief Whether we are generating human-readable (multiline) JSON. Set whether or not to generate human-readable JSON. The default is NO, which produces JSON without any whitespace. (Except inside strings.) If set to YES, generates human-readable JSON with linebreaks after each array value and dictionary key/value pair, indented two spaces per nesting level. */ #if GNUSTEP - (void) setHumanReadable: (BOOL) newValue; - (BOOL) humanReadable; #else @property BOOL humanReadable; #endif /** @brief Whether or not to sort the dictionary keys in the output. If this is set to YES, the dictionary keys in the JSON output will be in sorted order. (This is useful if you need to compare two structures, for example.) The default is NO. */ #if GNUSTEP - (void) setSortKeys: (BOOL) newValue; - (BOOL) sortKeys; #else @property BOOL sortKeys; #endif /** @brief Return JSON representation (or fragment) for the given object. Returns a string containing JSON representation of the passed in value, or nil on error. If nil is returned and @p error is not NULL, @p *error can be interrogated to find the cause of the error. @param value any instance that can be represented as a JSON fragment */ - (NSString*)stringWithObject:(id)value; /** @brief Return JSON representation (or fragment) for the given object. Returns a string containing JSON representation of the passed in value, or nil on error. If nil is returned and @p error is not NULL, @p *error can be interrogated to find the cause of the error. @param value any instance that can be represented as a JSON fragment @param error pointer to object to be populated with NSError on failure */- (NSString*)stringWithObject:(id)value error:(NSError**)error; @end /** @brief Allows generation of JSON for otherwise unsupported classes. If you have a custom class that you want to create a JSON representation for you can implement this method in your class. It should return a representation of your object defined in terms of objects that can be translated into JSON. For example, a Person object might implement it like this: @code - (id)proxyForJson { return [NSDictionary dictionaryWithObjectsAndKeys: name, @"name", phone, @"phone", email, @"email", nil]; } @endcode */ @interface NSObject (SBProxyForJson) - (id)proxyForJson; @end SOPE/sope-json/SBJson/Classes/SBJson.h0000644000000000000000000000531512242733417016312 0ustar rootroot/* Copyright (C) 2009-2010 Stig Brautaset. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** @mainpage A strict JSON parser and generator for Objective-C JSON (JavaScript Object Notation) is a lightweight data-interchange format. This framework provides two apis for parsing and generating JSON. One standard object-based and a higher level api consisting of categories added to existing Objective-C classes. This framework does its best to be as strict as possible, both in what it accepts and what it generates. For example, it does not support trailing commas in arrays or objects. Nor does it support embedded comments, or anything else not in the JSON specification. This is considered a feature. @section Links @li Project home page. @li Online version of the API documentation. */ // This setting of 1 is best if you copy the source into your project. // The build transforms the 1 to a 0 when building the framework and static lib. #if 1 #import "SBJsonParser.h" #import "SBJsonWriter.h" #import "NSObject+SBJSON.h" #import "NSString+SBJSON.h" #else #import #import #import #import #endif SOPE/sope-json/SBJson/Classes/SBJsonBase.m0000644000000000000000000000562612242733417017117 0ustar rootroot/* Copyright (C) 2009 Stig Brautaset. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #import "SBJsonBase.h" NSString * SBJSONErrorDomain = @"org.brautaset.JSON.ErrorDomain"; @implementation SBJsonBase #if !GNUSTEP @synthesize errorTrace; @synthesize maxDepth; #endif - (id)init { self = [super init]; if (self) maxDepth = 512; return self; } - (void)dealloc { [errorTrace release]; [super dealloc]; } #if GNUSTEP - (NSArray *) errorTrace { return errorTrace; } - (void) setMaxDepth: (NSUInteger) newMaxDepth { maxDepth = newMaxDepth; } - (NSUInteger) maxDepth { return maxDepth; } #endif - (void)addErrorWithCode:(NSUInteger)code description:(NSString*)str { NSDictionary *userInfo; if (!errorTrace) { errorTrace = [NSMutableArray new]; userInfo = [NSDictionary dictionaryWithObject:str forKey:NSLocalizedDescriptionKey]; } else { userInfo = [NSDictionary dictionaryWithObjectsAndKeys: str, NSLocalizedDescriptionKey, [errorTrace lastObject], NSUnderlyingErrorKey, nil]; } NSError *error = [NSError errorWithDomain:SBJSONErrorDomain code:code userInfo:userInfo]; [self willChangeValueForKey:@"errorTrace"]; [errorTrace addObject:error]; [self didChangeValueForKey:@"errorTrace"]; } - (void)clearErrorTrace { [self willChangeValueForKey:@"errorTrace"]; [errorTrace release]; errorTrace = nil; [self didChangeValueForKey:@"errorTrace"]; } @end SOPE/sope-json/SBJson/Classes/JSON.h0000644000000000000000000000530512242733417015724 0ustar rootroot/* Copyright (C) 2009-2010 Stig Brautaset. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** @mainpage A strict JSON parser and generator for Objective-C JSON (JavaScript Object Notation) is a lightweight data-interchange format. This framework provides two apis for parsing and generating JSON. One standard object-based and a higher level api consisting of categories added to existing Objective-C classes. This framework does its best to be as strict as possible, both in what it accepts and what it generates. For example, it does not support trailing commas in arrays or objects. Nor does it support embedded comments, or anything else not in the JSON specification. This is considered a feature. @section Links @li Project home page. @li Online version of the API documentation. */ // This setting of 1 is best if you copy the source into your project. // The build transforms the 1 to a 0 when building the framework and static lib. #if 1 #import "SBJsonParser.h" #import "SBJsonWriter.h" #import "NSObject+SBJSON.h" #import "NSString+SBJSON.h" #else #import #import #import #import #endif SOPE/sope-json/SBJson/JSON.xcodeproj/0000755000000000000000000000000012242733417016147 5ustar rootrootSOPE/sope-json/SBJson/JSON.xcodeproj/project.pbxproj0000644000000000000000000027350312242733417021235 0ustar rootroot// !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 45; objects = { /* Begin PBXAggregateTarget section */ BCC047160FB651AF00F9F2D3 /* Documentation */ = { isa = PBXAggregateTarget; buildConfigurationList = BCC047190FB651CD00F9F2D3 /* Build configuration list for PBXAggregateTarget "Documentation" */; buildPhases = ( BCC047150FB651AF00F9F2D3 /* Install Docset */, BC3A1CB112023B860051A978 /* Refresh Online Docs */, ); dependencies = ( ); name = Documentation; productName = Documentation; }; /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ 5351577A0F6E3BE100C8AABD /* SBJsonParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 535157780F6E3BE100C8AABD /* SBJsonParser.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5351577B0F6E3BE100C8AABD /* SBJsonParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 535157790F6E3BE100C8AABD /* SBJsonParser.m */; }; 5351577C0F6E3BE100C8AABD /* SBJsonParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 535157780F6E3BE100C8AABD /* SBJsonParser.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5351577D0F6E3BE100C8AABD /* SBJsonParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 535157790F6E3BE100C8AABD /* SBJsonParser.m */; }; 535157A50F6EE4A800C8AABD /* SBJsonWriter.h in Headers */ = {isa = PBXBuildFile; fileRef = 535157A30F6EE4A800C8AABD /* SBJsonWriter.h */; settings = {ATTRIBUTES = (Private, ); }; }; 535157A60F6EE4A800C8AABD /* SBJsonWriter.m in Sources */ = {isa = PBXBuildFile; fileRef = 535157A40F6EE4A800C8AABD /* SBJsonWriter.m */; }; 535157A70F6EE4A800C8AABD /* SBJsonWriter.h in Headers */ = {isa = PBXBuildFile; fileRef = 535157A30F6EE4A800C8AABD /* SBJsonWriter.h */; settings = {ATTRIBUTES = (Private, ); }; }; 535157A80F6EE4A800C8AABD /* SBJsonWriter.m in Sources */ = {isa = PBXBuildFile; fileRef = 535157A40F6EE4A800C8AABD /* SBJsonWriter.m */; }; 535158700F70DE7A00C8AABD /* SBJsonBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 5351586F0F70DE7A00C8AABD /* SBJsonBase.h */; settings = {ATTRIBUTES = (Private, ); }; }; 535158710F70DE7A00C8AABD /* SBJsonBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 5351586F0F70DE7A00C8AABD /* SBJsonBase.h */; settings = {ATTRIBUTES = (Private, ); }; }; 535158730F70DE7B00C8AABD /* SBJsonBase.m in Sources */ = {isa = PBXBuildFile; fileRef = 535158720F70DE7B00C8AABD /* SBJsonBase.m */; }; 535158740F70DE7B00C8AABD /* SBJsonBase.m in Sources */ = {isa = PBXBuildFile; fileRef = 535158720F70DE7B00C8AABD /* SBJsonBase.m */; }; 53C45B9C0C98A87600546F66 /* ErrorTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 53C45B9B0C98A87600546F66 /* ErrorTest.m */; }; 53D2299C0C96129800276605 /* JSON.h in Headers */ = {isa = PBXBuildFile; fileRef = 53D2299A0C96129800276605 /* JSON.h */; settings = {ATTRIBUTES = (Public, ); }; }; 53D229AD0C961B9900276605 /* JSON.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 53D229810C96121600276605 /* JSON.framework */; }; 53F8A8150E57158200355C72 /* libjson.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FE2BBD800D8B0D3900184787 /* libjson.a */; }; BC0387E811CEC07A0080C552 /* AbstractTest.m in Sources */ = {isa = PBXBuildFile; fileRef = BC0387E711CEC07A0080C552 /* AbstractTest.m */; }; BC0387E911CEC07A0080C552 /* AbstractTest.m in Sources */ = {isa = PBXBuildFile; fileRef = BC0387E711CEC07A0080C552 /* AbstractTest.m */; }; BC74B6EC0FC9FAD0000BD3DD /* MaxDepthTest.m in Sources */ = {isa = PBXBuildFile; fileRef = BC74B6EB0FC9FAD0000BD3DD /* MaxDepthTest.m */; }; BC74B6ED0FC9FAD0000BD3DD /* MaxDepthTest.m in Sources */ = {isa = PBXBuildFile; fileRef = BC74B6EB0FC9FAD0000BD3DD /* MaxDepthTest.m */; }; BC74B7AE0FCA8B89000BD3DD /* ProxyTest.m in Sources */ = {isa = PBXBuildFile; fileRef = BC74B7AD0FCA8B89000BD3DD /* ProxyTest.m */; }; BC74B7AF0FCA8B89000BD3DD /* ProxyTest.m in Sources */ = {isa = PBXBuildFile; fileRef = BC74B7AD0FCA8B89000BD3DD /* ProxyTest.m */; }; BC8F72A71235331400678720 /* WriterTest.m in Sources */ = {isa = PBXBuildFile; fileRef = BC8F72A61235331400678720 /* WriterTest.m */; }; BC8F72A81235331400678720 /* WriterTest.m in Sources */ = {isa = PBXBuildFile; fileRef = BC8F72A61235331400678720 /* WriterTest.m */; }; BCB55A5E1221D09400ACE34F /* array.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A001221D09400ACE34F /* array.json */; }; BCB55A5F1221D09400ACE34F /* array.json.pretty in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A011221D09400ACE34F /* array.json.pretty */; }; BCB55A601221D09400ACE34F /* array.json.terse in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A021221D09400ACE34F /* array.json.terse */; }; BCB55A611221D09400ACE34F /* bool.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A031221D09400ACE34F /* bool.json */; }; BCB55A621221D09400ACE34F /* bool.json.pretty in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A041221D09400ACE34F /* bool.json.pretty */; }; BCB55A631221D09400ACE34F /* bool.json.terse in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A051221D09400ACE34F /* bool.json.terse */; }; BCB55A641221D09400ACE34F /* format.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A061221D09400ACE34F /* format.json */; }; BCB55A651221D09400ACE34F /* format.json.pretty in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A071221D09400ACE34F /* format.json.pretty */; }; BCB55A661221D09400ACE34F /* format.json.terse in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A081221D09400ACE34F /* format.json.terse */; }; BCB55A671221D09400ACE34F /* 1.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A0A1221D09400ACE34F /* 1.json */; }; BCB55A681221D09400ACE34F /* 1.json.pretty in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A0B1221D09400ACE34F /* 1.json.pretty */; }; BCB55A691221D09400ACE34F /* 1.json.terse in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A0C1221D09400ACE34F /* 1.json.terse */; }; BCB55A6A1221D09400ACE34F /* 2.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A0D1221D09400ACE34F /* 2.json */; }; BCB55A6B1221D09400ACE34F /* 2.json.pretty in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A0E1221D09400ACE34F /* 2.json.pretty */; }; BCB55A6C1221D09400ACE34F /* 2.json.terse in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A0F1221D09400ACE34F /* 2.json.terse */; }; BCB55A6D1221D09400ACE34F /* 3.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A101221D09400ACE34F /* 3.json */; }; BCB55A6E1221D09400ACE34F /* 3.json.pretty in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A111221D09400ACE34F /* 3.json.pretty */; }; BCB55A6F1221D09400ACE34F /* 3.json.terse in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A121221D09400ACE34F /* 3.json.terse */; }; BCB55A701221D09400ACE34F /* 4.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A131221D09400ACE34F /* 4.json */; }; BCB55A711221D09400ACE34F /* 4.json.pretty in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A141221D09400ACE34F /* 4.json.pretty */; }; BCB55A721221D09400ACE34F /* 4.json.terse in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A151221D09400ACE34F /* 4.json.terse */; }; BCB55A731221D09400ACE34F /* 5.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A161221D09400ACE34F /* 5.json */; }; BCB55A741221D09400ACE34F /* 5.json.pretty in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A171221D09400ACE34F /* 5.json.pretty */; }; BCB55A751221D09400ACE34F /* 5.json.terse in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A181221D09400ACE34F /* 5.json.terse */; }; BCB55A761221D09400ACE34F /* fail1.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A1A1221D09400ACE34F /* fail1.json */; }; BCB55A771221D09400ACE34F /* fail10.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A1B1221D09400ACE34F /* fail10.json */; }; BCB55A781221D09400ACE34F /* fail11.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A1C1221D09400ACE34F /* fail11.json */; }; BCB55A791221D09400ACE34F /* fail12.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A1D1221D09400ACE34F /* fail12.json */; }; BCB55A7A1221D09400ACE34F /* fail13.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A1E1221D09400ACE34F /* fail13.json */; }; BCB55A7B1221D09400ACE34F /* fail14.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A1F1221D09400ACE34F /* fail14.json */; }; BCB55A7C1221D09400ACE34F /* fail15.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A201221D09400ACE34F /* fail15.json */; }; BCB55A7D1221D09400ACE34F /* fail16.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A211221D09400ACE34F /* fail16.json */; }; BCB55A7E1221D09400ACE34F /* fail17.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A221221D09400ACE34F /* fail17.json */; }; BCB55A7F1221D09400ACE34F /* fail18.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A231221D09400ACE34F /* fail18.json */; }; BCB55A801221D09400ACE34F /* fail19.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A241221D09400ACE34F /* fail19.json */; }; BCB55A811221D09400ACE34F /* fail2.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A251221D09400ACE34F /* fail2.json */; }; BCB55A821221D09400ACE34F /* fail20.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A261221D09400ACE34F /* fail20.json */; }; BCB55A831221D09400ACE34F /* fail21.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A271221D09400ACE34F /* fail21.json */; }; BCB55A841221D09400ACE34F /* fail22.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A281221D09400ACE34F /* fail22.json */; }; BCB55A851221D09400ACE34F /* fail23.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A291221D09400ACE34F /* fail23.json */; }; BCB55A861221D09400ACE34F /* fail24.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A2A1221D09400ACE34F /* fail24.json */; }; BCB55A871221D09400ACE34F /* fail25.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A2B1221D09400ACE34F /* fail25.json */; }; BCB55A881221D09400ACE34F /* fail26.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A2C1221D09400ACE34F /* fail26.json */; }; BCB55A891221D09400ACE34F /* fail27.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A2D1221D09400ACE34F /* fail27.json */; }; BCB55A8A1221D09400ACE34F /* fail28.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A2E1221D09400ACE34F /* fail28.json */; }; BCB55A8B1221D09400ACE34F /* fail29.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A2F1221D09400ACE34F /* fail29.json */; }; BCB55A8C1221D09400ACE34F /* fail3.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A301221D09400ACE34F /* fail3.json */; }; BCB55A8D1221D09400ACE34F /* fail30.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A311221D09400ACE34F /* fail30.json */; }; BCB55A8E1221D09400ACE34F /* fail31.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A321221D09400ACE34F /* fail31.json */; }; BCB55A8F1221D09400ACE34F /* fail32.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A331221D09400ACE34F /* fail32.json */; }; BCB55A901221D09400ACE34F /* fail33.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A341221D09400ACE34F /* fail33.json */; }; BCB55A911221D09400ACE34F /* fail4.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A351221D09400ACE34F /* fail4.json */; }; BCB55A921221D09400ACE34F /* fail5.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A361221D09400ACE34F /* fail5.json */; }; BCB55A931221D09400ACE34F /* fail6.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A371221D09400ACE34F /* fail6.json */; }; BCB55A941221D09400ACE34F /* fail7.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A381221D09400ACE34F /* fail7.json */; }; BCB55A951221D09400ACE34F /* fail8.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A391221D09400ACE34F /* fail8.json */; }; BCB55A961221D09400ACE34F /* fail9.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A3A1221D09400ACE34F /* fail9.json */; }; BCB55A971221D09400ACE34F /* pass1.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A3B1221D09400ACE34F /* pass1.json */; }; BCB55A981221D09400ACE34F /* pass1.json.pretty in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A3C1221D09400ACE34F /* pass1.json.pretty */; }; BCB55A991221D09400ACE34F /* pass1.json.terse in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A3D1221D09400ACE34F /* pass1.json.terse */; }; BCB55A9A1221D09400ACE34F /* pass2.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A3E1221D09400ACE34F /* pass2.json */; }; BCB55A9B1221D09400ACE34F /* pass2.json.pretty in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A3F1221D09400ACE34F /* pass2.json.pretty */; }; BCB55A9C1221D09400ACE34F /* pass2.json.terse in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A401221D09400ACE34F /* pass2.json.terse */; }; BCB55A9D1221D09400ACE34F /* pass3.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A411221D09400ACE34F /* pass3.json */; }; BCB55A9E1221D09400ACE34F /* pass3.json.pretty in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A421221D09400ACE34F /* pass3.json.pretty */; }; BCB55A9F1221D09400ACE34F /* pass3.json.terse in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A431221D09400ACE34F /* pass3.json.terse */; }; BCB55AA01221D09400ACE34F /* null.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A441221D09400ACE34F /* null.json */; }; BCB55AA11221D09400ACE34F /* null.json.pretty in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A451221D09400ACE34F /* null.json.pretty */; }; BCB55AA21221D09400ACE34F /* null.json.terse in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A461221D09400ACE34F /* null.json.terse */; }; BCB55AA31221D09400ACE34F /* number.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A471221D09400ACE34F /* number.json */; }; BCB55AA41221D09400ACE34F /* number.json.pretty in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A481221D09400ACE34F /* number.json.pretty */; }; BCB55AA51221D09400ACE34F /* number.json.terse in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A491221D09400ACE34F /* number.json.terse */; }; BCB55AA61221D09400ACE34F /* object.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A4A1221D09400ACE34F /* object.json */; }; BCB55AA71221D09400ACE34F /* object.json.pretty in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A4B1221D09400ACE34F /* object.json.pretty */; }; BCB55AA81221D09400ACE34F /* object.json.terse in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A4C1221D09400ACE34F /* object.json.terse */; }; BCB55AAA1221D09400ACE34F /* a.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A4F1221D09400ACE34F /* a.json */; }; BCB55AAB1221D09400ACE34F /* a.json.pretty in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A501221D09400ACE34F /* a.json.pretty */; }; BCB55AAC1221D09400ACE34F /* a.json.terse in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A511221D09400ACE34F /* a.json.terse */; }; BCB55AAD1221D09400ACE34F /* b.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A521221D09400ACE34F /* b.json */; }; BCB55AAE1221D09400ACE34F /* b.json.pretty in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A531221D09400ACE34F /* b.json.pretty */; }; BCB55AAF1221D09400ACE34F /* b.json.terse in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A541221D09400ACE34F /* b.json.terse */; }; BCB55AB01221D09400ACE34F /* string-ctrl.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A551221D09400ACE34F /* string-ctrl.json */; }; BCB55AB11221D09400ACE34F /* string-ctrl.json.pretty in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A561221D09400ACE34F /* string-ctrl.json.pretty */; }; BCB55AB21221D09400ACE34F /* string-ctrl.json.terse in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A571221D09400ACE34F /* string-ctrl.json.terse */; }; BCB55AB31221D09400ACE34F /* string-unicode.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A581221D09400ACE34F /* string-unicode.json */; }; BCB55AB41221D09400ACE34F /* string-unicode.json.pretty in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A591221D09400ACE34F /* string-unicode.json.pretty */; }; BCB55AB51221D09400ACE34F /* string-unicode.json.terse in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A5A1221D09400ACE34F /* string-unicode.json.terse */; }; BCB55AB61221D09400ACE34F /* string.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A5B1221D09400ACE34F /* string.json */; }; BCB55AB71221D09400ACE34F /* string.json.pretty in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A5C1221D09400ACE34F /* string.json.pretty */; }; BCB55AB81221D09400ACE34F /* string.json.terse in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A5D1221D09400ACE34F /* string.json.terse */; }; BCB55AB91221D09400ACE34F /* array.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A001221D09400ACE34F /* array.json */; }; BCB55ABA1221D09400ACE34F /* array.json.pretty in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A011221D09400ACE34F /* array.json.pretty */; }; BCB55ABB1221D09400ACE34F /* array.json.terse in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A021221D09400ACE34F /* array.json.terse */; }; BCB55ABC1221D09400ACE34F /* bool.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A031221D09400ACE34F /* bool.json */; }; BCB55ABD1221D09400ACE34F /* bool.json.pretty in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A041221D09400ACE34F /* bool.json.pretty */; }; BCB55ABE1221D09400ACE34F /* bool.json.terse in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A051221D09400ACE34F /* bool.json.terse */; }; BCB55ABF1221D09400ACE34F /* format.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A061221D09400ACE34F /* format.json */; }; BCB55AC01221D09400ACE34F /* format.json.pretty in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A071221D09400ACE34F /* format.json.pretty */; }; BCB55AC11221D09400ACE34F /* format.json.terse in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A081221D09400ACE34F /* format.json.terse */; }; BCB55AC21221D09400ACE34F /* 1.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A0A1221D09400ACE34F /* 1.json */; }; BCB55AC31221D09400ACE34F /* 1.json.pretty in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A0B1221D09400ACE34F /* 1.json.pretty */; }; BCB55AC41221D09400ACE34F /* 1.json.terse in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A0C1221D09400ACE34F /* 1.json.terse */; }; BCB55AC51221D09400ACE34F /* 2.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A0D1221D09400ACE34F /* 2.json */; }; BCB55AC61221D09400ACE34F /* 2.json.pretty in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A0E1221D09400ACE34F /* 2.json.pretty */; }; BCB55AC71221D09400ACE34F /* 2.json.terse in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A0F1221D09400ACE34F /* 2.json.terse */; }; BCB55AC81221D09400ACE34F /* 3.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A101221D09400ACE34F /* 3.json */; }; BCB55AC91221D09400ACE34F /* 3.json.pretty in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A111221D09400ACE34F /* 3.json.pretty */; }; BCB55ACA1221D09400ACE34F /* 3.json.terse in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A121221D09400ACE34F /* 3.json.terse */; }; BCB55ACB1221D09400ACE34F /* 4.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A131221D09400ACE34F /* 4.json */; }; BCB55ACC1221D09400ACE34F /* 4.json.pretty in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A141221D09400ACE34F /* 4.json.pretty */; }; BCB55ACD1221D09400ACE34F /* 4.json.terse in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A151221D09400ACE34F /* 4.json.terse */; }; BCB55ACE1221D09400ACE34F /* 5.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A161221D09400ACE34F /* 5.json */; }; BCB55ACF1221D09400ACE34F /* 5.json.pretty in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A171221D09400ACE34F /* 5.json.pretty */; }; BCB55AD01221D09400ACE34F /* 5.json.terse in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A181221D09400ACE34F /* 5.json.terse */; }; BCB55AD11221D09400ACE34F /* fail1.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A1A1221D09400ACE34F /* fail1.json */; }; BCB55AD21221D09400ACE34F /* fail10.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A1B1221D09400ACE34F /* fail10.json */; }; BCB55AD31221D09400ACE34F /* fail11.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A1C1221D09400ACE34F /* fail11.json */; }; BCB55AD41221D09400ACE34F /* fail12.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A1D1221D09400ACE34F /* fail12.json */; }; BCB55AD51221D09400ACE34F /* fail13.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A1E1221D09400ACE34F /* fail13.json */; }; BCB55AD61221D09400ACE34F /* fail14.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A1F1221D09400ACE34F /* fail14.json */; }; BCB55AD71221D09400ACE34F /* fail15.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A201221D09400ACE34F /* fail15.json */; }; BCB55AD81221D09400ACE34F /* fail16.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A211221D09400ACE34F /* fail16.json */; }; BCB55AD91221D09400ACE34F /* fail17.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A221221D09400ACE34F /* fail17.json */; }; BCB55ADA1221D09400ACE34F /* fail18.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A231221D09400ACE34F /* fail18.json */; }; BCB55ADB1221D09400ACE34F /* fail19.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A241221D09400ACE34F /* fail19.json */; }; BCB55ADC1221D09400ACE34F /* fail2.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A251221D09400ACE34F /* fail2.json */; }; BCB55ADD1221D09400ACE34F /* fail20.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A261221D09400ACE34F /* fail20.json */; }; BCB55ADE1221D09400ACE34F /* fail21.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A271221D09400ACE34F /* fail21.json */; }; BCB55ADF1221D09400ACE34F /* fail22.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A281221D09400ACE34F /* fail22.json */; }; BCB55AE01221D09400ACE34F /* fail23.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A291221D09400ACE34F /* fail23.json */; }; BCB55AE11221D09400ACE34F /* fail24.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A2A1221D09400ACE34F /* fail24.json */; }; BCB55AE21221D09400ACE34F /* fail25.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A2B1221D09400ACE34F /* fail25.json */; }; BCB55AE31221D09400ACE34F /* fail26.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A2C1221D09400ACE34F /* fail26.json */; }; BCB55AE41221D09400ACE34F /* fail27.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A2D1221D09400ACE34F /* fail27.json */; }; BCB55AE51221D09400ACE34F /* fail28.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A2E1221D09400ACE34F /* fail28.json */; }; BCB55AE61221D09400ACE34F /* fail29.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A2F1221D09400ACE34F /* fail29.json */; }; BCB55AE71221D09400ACE34F /* fail3.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A301221D09400ACE34F /* fail3.json */; }; BCB55AE81221D09400ACE34F /* fail30.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A311221D09400ACE34F /* fail30.json */; }; BCB55AE91221D09400ACE34F /* fail31.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A321221D09400ACE34F /* fail31.json */; }; BCB55AEA1221D09400ACE34F /* fail32.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A331221D09400ACE34F /* fail32.json */; }; BCB55AEB1221D09400ACE34F /* fail33.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A341221D09400ACE34F /* fail33.json */; }; BCB55AEC1221D09400ACE34F /* fail4.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A351221D09400ACE34F /* fail4.json */; }; BCB55AED1221D09400ACE34F /* fail5.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A361221D09400ACE34F /* fail5.json */; }; BCB55AEE1221D09400ACE34F /* fail6.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A371221D09400ACE34F /* fail6.json */; }; BCB55AEF1221D09400ACE34F /* fail7.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A381221D09400ACE34F /* fail7.json */; }; BCB55AF01221D09400ACE34F /* fail8.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A391221D09400ACE34F /* fail8.json */; }; BCB55AF11221D09400ACE34F /* fail9.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A3A1221D09400ACE34F /* fail9.json */; }; BCB55AF21221D09400ACE34F /* pass1.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A3B1221D09400ACE34F /* pass1.json */; }; BCB55AF31221D09400ACE34F /* pass1.json.pretty in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A3C1221D09400ACE34F /* pass1.json.pretty */; }; BCB55AF41221D09400ACE34F /* pass1.json.terse in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A3D1221D09400ACE34F /* pass1.json.terse */; }; BCB55AF51221D09400ACE34F /* pass2.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A3E1221D09400ACE34F /* pass2.json */; }; BCB55AF61221D09400ACE34F /* pass2.json.pretty in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A3F1221D09400ACE34F /* pass2.json.pretty */; }; BCB55AF71221D09400ACE34F /* pass2.json.terse in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A401221D09400ACE34F /* pass2.json.terse */; }; BCB55AF81221D09400ACE34F /* pass3.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A411221D09400ACE34F /* pass3.json */; }; BCB55AF91221D09400ACE34F /* pass3.json.pretty in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A421221D09400ACE34F /* pass3.json.pretty */; }; BCB55AFA1221D09400ACE34F /* pass3.json.terse in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A431221D09400ACE34F /* pass3.json.terse */; }; BCB55AFB1221D09400ACE34F /* null.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A441221D09400ACE34F /* null.json */; }; BCB55AFC1221D09400ACE34F /* null.json.pretty in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A451221D09400ACE34F /* null.json.pretty */; }; BCB55AFD1221D09400ACE34F /* null.json.terse in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A461221D09400ACE34F /* null.json.terse */; }; BCB55AFE1221D09400ACE34F /* number.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A471221D09400ACE34F /* number.json */; }; BCB55AFF1221D09400ACE34F /* number.json.pretty in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A481221D09400ACE34F /* number.json.pretty */; }; BCB55B001221D09400ACE34F /* number.json.terse in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A491221D09400ACE34F /* number.json.terse */; }; BCB55B011221D09400ACE34F /* object.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A4A1221D09400ACE34F /* object.json */; }; BCB55B021221D09400ACE34F /* object.json.pretty in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A4B1221D09400ACE34F /* object.json.pretty */; }; BCB55B031221D09400ACE34F /* object.json.terse in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A4C1221D09400ACE34F /* object.json.terse */; }; BCB55B051221D09400ACE34F /* a.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A4F1221D09400ACE34F /* a.json */; }; BCB55B061221D09400ACE34F /* a.json.pretty in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A501221D09400ACE34F /* a.json.pretty */; }; BCB55B071221D09400ACE34F /* a.json.terse in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A511221D09400ACE34F /* a.json.terse */; }; BCB55B081221D09400ACE34F /* b.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A521221D09400ACE34F /* b.json */; }; BCB55B091221D09400ACE34F /* b.json.pretty in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A531221D09400ACE34F /* b.json.pretty */; }; BCB55B0A1221D09400ACE34F /* b.json.terse in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A541221D09400ACE34F /* b.json.terse */; }; BCB55B0B1221D09400ACE34F /* string-ctrl.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A551221D09400ACE34F /* string-ctrl.json */; }; BCB55B0C1221D09400ACE34F /* string-ctrl.json.pretty in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A561221D09400ACE34F /* string-ctrl.json.pretty */; }; BCB55B0D1221D09400ACE34F /* string-ctrl.json.terse in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A571221D09400ACE34F /* string-ctrl.json.terse */; }; BCB55B0E1221D09400ACE34F /* string-unicode.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A581221D09400ACE34F /* string-unicode.json */; }; BCB55B0F1221D09400ACE34F /* string-unicode.json.pretty in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A591221D09400ACE34F /* string-unicode.json.pretty */; }; BCB55B101221D09400ACE34F /* string-unicode.json.terse in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A5A1221D09400ACE34F /* string-unicode.json.terse */; }; BCB55B111221D09400ACE34F /* string.json in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A5B1221D09400ACE34F /* string.json */; }; BCB55B121221D09400ACE34F /* string.json.pretty in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A5C1221D09400ACE34F /* string.json.pretty */; }; BCB55B131221D09400ACE34F /* string.json.terse in Resources */ = {isa = PBXBuildFile; fileRef = BCB55A5D1221D09400ACE34F /* string.json.terse */; }; E75716450C96DB530084A449 /* NSObject+SBJSON.h in Headers */ = {isa = PBXBuildFile; fileRef = E75716430C96DB530084A449 /* NSObject+SBJSON.h */; settings = {ATTRIBUTES = (Private, ); }; }; E75716460C96DB530084A449 /* NSObject+SBJSON.m in Sources */ = {isa = PBXBuildFile; fileRef = E75716440C96DB530084A449 /* NSObject+SBJSON.m */; }; E757164D0C96E39B0084A449 /* NSString+SBJSON.h in Headers */ = {isa = PBXBuildFile; fileRef = E757164B0C96E39B0084A449 /* NSString+SBJSON.h */; settings = {ATTRIBUTES = (Private, ); }; }; E757164E0C96E39B0084A449 /* NSString+SBJSON.m in Sources */ = {isa = PBXBuildFile; fileRef = E757164C0C96E39B0084A449 /* NSString+SBJSON.m */; }; E76A1EBD0C996EFD00A0CC83 /* DataDrivenTest.m in Sources */ = {isa = PBXBuildFile; fileRef = E76A1EB60C996C2000A0CC83 /* DataDrivenTest.m */; }; FE2BBD860D8B0D6000184787 /* JSON.h in Headers */ = {isa = PBXBuildFile; fileRef = 53D2299A0C96129800276605 /* JSON.h */; settings = {ATTRIBUTES = (Public, ); }; }; FE2BBD870D8B0D6000184787 /* NSObject+SBJSON.h in Headers */ = {isa = PBXBuildFile; fileRef = E75716430C96DB530084A449 /* NSObject+SBJSON.h */; settings = {ATTRIBUTES = (Private, ); }; }; FE2BBD880D8B0D6000184787 /* NSObject+SBJSON.m in Sources */ = {isa = PBXBuildFile; fileRef = E75716440C96DB530084A449 /* NSObject+SBJSON.m */; }; FE2BBD8B0D8B0D6000184787 /* NSString+SBJSON.h in Headers */ = {isa = PBXBuildFile; fileRef = E757164B0C96E39B0084A449 /* NSString+SBJSON.h */; settings = {ATTRIBUTES = (Private, ); }; }; FE2BBD8C0D8B0D6000184787 /* NSString+SBJSON.m in Sources */ = {isa = PBXBuildFile; fileRef = E757164C0C96E39B0084A449 /* NSString+SBJSON.m */; }; FE2BBDB60D8B0F1D00184787 /* DataDrivenTest.m in Sources */ = {isa = PBXBuildFile; fileRef = E76A1EB60C996C2000A0CC83 /* DataDrivenTest.m */; }; FE2BBDB70D8B0F1D00184787 /* ErrorTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 53C45B9B0C98A87600546F66 /* ErrorTest.m */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ 53D229920C96122E00276605 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 53D229730C9611FF00276605 /* Project object */; proxyType = 1; remoteGlobalIDString = 53D229800C96121600276605; remoteInfo = JSON; }; FE2BBDB30D8B0F0F00184787 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 53D229730C9611FF00276605 /* Project object */; proxyType = 1; remoteGlobalIDString = FE2BBD7F0D8B0D3900184787; remoteInfo = json; }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ 535157780F6E3BE100C8AABD /* SBJsonParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SBJsonParser.h; sourceTree = ""; }; 535157790F6E3BE100C8AABD /* SBJsonParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SBJsonParser.m; sourceTree = ""; }; 535157A30F6EE4A800C8AABD /* SBJsonWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SBJsonWriter.h; sourceTree = ""; }; 535157A40F6EE4A800C8AABD /* SBJsonWriter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SBJsonWriter.m; sourceTree = ""; }; 5351586F0F70DE7A00C8AABD /* SBJsonBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SBJsonBase.h; sourceTree = ""; }; 535158720F70DE7B00C8AABD /* SBJsonBase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SBJsonBase.m; sourceTree = ""; }; 5355C86B0E392B2A00A18C15 /* ErrorTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ErrorTest.h; sourceTree = ""; }; 5355C86C0E392B2A00A18C15 /* DataDrivenTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataDrivenTest.h; sourceTree = ""; }; 53C45B9B0C98A87600546F66 /* ErrorTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ErrorTest.m; sourceTree = ""; }; 53D229810C96121600276605 /* JSON.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = JSON.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 53D229830C96121600276605 /* JSON-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "JSON-Info.plist"; sourceTree = ""; }; 53D2298D0C96122A00276605 /* Tests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Tests.octest; sourceTree = BUILT_PRODUCTS_DIR; }; 53D2298E0C96122A00276605 /* Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Tests-Info.plist"; sourceTree = ""; }; 53D2299A0C96129800276605 /* JSON.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSON.h; sourceTree = ""; }; BC010B181248A5E400ACC736 /* RefreshOnlineDocs.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = RefreshOnlineDocs.sh; sourceTree = ""; }; BC0387E611CEC07A0080C552 /* AbstractTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AbstractTest.h; sourceTree = ""; }; BC0387E711CEC07A0080C552 /* AbstractTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AbstractTest.m; sourceTree = ""; }; BC3A1CDC12060DAC0051A978 /* Changes.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Changes.md; sourceTree = ""; }; BC3A1CDD12060DAC0051A978 /* Credits.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Credits.md; sourceTree = ""; }; BC3A1CDE12060DAC0051A978 /* Installation.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Installation.md; sourceTree = ""; }; BC3A1CDF12060DAC0051A978 /* License.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = License.md; sourceTree = ""; }; BC74B6EA0FC9FAD0000BD3DD /* MaxDepthTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MaxDepthTest.h; sourceTree = ""; }; BC74B6EB0FC9FAD0000BD3DD /* MaxDepthTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MaxDepthTest.m; sourceTree = ""; }; BC74B7AC0FCA8B89000BD3DD /* ProxyTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProxyTest.h; sourceTree = ""; }; BC74B7AD0FCA8B89000BD3DD /* ProxyTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ProxyTest.m; sourceTree = ""; }; BC8F72A51235331400678720 /* WriterTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WriterTest.h; sourceTree = ""; }; BC8F72A61235331400678720 /* WriterTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WriterTest.m; sourceTree = ""; }; BCB55A001221D09400ACE34F /* array.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = array.json; sourceTree = ""; }; BCB55A011221D09400ACE34F /* array.json.pretty */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = array.json.pretty; sourceTree = ""; }; BCB55A021221D09400ACE34F /* array.json.terse */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = array.json.terse; sourceTree = ""; }; BCB55A031221D09400ACE34F /* bool.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = bool.json; sourceTree = ""; }; BCB55A041221D09400ACE34F /* bool.json.pretty */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = bool.json.pretty; sourceTree = ""; }; BCB55A051221D09400ACE34F /* bool.json.terse */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = bool.json.terse; sourceTree = ""; }; BCB55A061221D09400ACE34F /* format.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = format.json; sourceTree = ""; }; BCB55A071221D09400ACE34F /* format.json.pretty */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = format.json.pretty; sourceTree = ""; }; BCB55A081221D09400ACE34F /* format.json.terse */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = format.json.terse; sourceTree = ""; }; BCB55A0A1221D09400ACE34F /* 1.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = 1.json; sourceTree = ""; }; BCB55A0B1221D09400ACE34F /* 1.json.pretty */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = 1.json.pretty; sourceTree = ""; }; BCB55A0C1221D09400ACE34F /* 1.json.terse */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = 1.json.terse; sourceTree = ""; }; BCB55A0D1221D09400ACE34F /* 2.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = 2.json; sourceTree = ""; }; BCB55A0E1221D09400ACE34F /* 2.json.pretty */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = 2.json.pretty; sourceTree = ""; }; BCB55A0F1221D09400ACE34F /* 2.json.terse */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = 2.json.terse; sourceTree = ""; }; BCB55A101221D09400ACE34F /* 3.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = 3.json; sourceTree = ""; }; BCB55A111221D09400ACE34F /* 3.json.pretty */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = 3.json.pretty; sourceTree = ""; }; BCB55A121221D09400ACE34F /* 3.json.terse */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = 3.json.terse; sourceTree = ""; }; BCB55A131221D09400ACE34F /* 4.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = 4.json; sourceTree = ""; }; BCB55A141221D09400ACE34F /* 4.json.pretty */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = 4.json.pretty; sourceTree = ""; }; BCB55A151221D09400ACE34F /* 4.json.terse */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = 4.json.terse; sourceTree = ""; }; BCB55A161221D09400ACE34F /* 5.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = 5.json; sourceTree = ""; }; BCB55A171221D09400ACE34F /* 5.json.pretty */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = 5.json.pretty; sourceTree = ""; }; BCB55A181221D09400ACE34F /* 5.json.terse */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = 5.json.terse; sourceTree = ""; }; BCB55A1A1221D09400ACE34F /* fail1.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = fail1.json; sourceTree = ""; }; BCB55A1B1221D09400ACE34F /* fail10.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = fail10.json; sourceTree = ""; }; BCB55A1C1221D09400ACE34F /* fail11.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = fail11.json; sourceTree = ""; }; BCB55A1D1221D09400ACE34F /* fail12.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = fail12.json; sourceTree = ""; }; BCB55A1E1221D09400ACE34F /* fail13.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = fail13.json; sourceTree = ""; }; BCB55A1F1221D09400ACE34F /* fail14.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = fail14.json; sourceTree = ""; }; BCB55A201221D09400ACE34F /* fail15.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = fail15.json; sourceTree = ""; }; BCB55A211221D09400ACE34F /* fail16.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = fail16.json; sourceTree = ""; }; BCB55A221221D09400ACE34F /* fail17.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = fail17.json; sourceTree = ""; }; BCB55A231221D09400ACE34F /* fail18.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = fail18.json; sourceTree = ""; }; BCB55A241221D09400ACE34F /* fail19.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = fail19.json; sourceTree = ""; }; BCB55A251221D09400ACE34F /* fail2.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = fail2.json; sourceTree = ""; }; BCB55A261221D09400ACE34F /* fail20.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = fail20.json; sourceTree = ""; }; BCB55A271221D09400ACE34F /* fail21.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = fail21.json; sourceTree = ""; }; BCB55A281221D09400ACE34F /* fail22.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = fail22.json; sourceTree = ""; }; BCB55A291221D09400ACE34F /* fail23.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = fail23.json; sourceTree = ""; }; BCB55A2A1221D09400ACE34F /* fail24.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = fail24.json; sourceTree = ""; }; BCB55A2B1221D09400ACE34F /* fail25.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = fail25.json; sourceTree = ""; }; BCB55A2C1221D09400ACE34F /* fail26.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = fail26.json; sourceTree = ""; }; BCB55A2D1221D09400ACE34F /* fail27.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = fail27.json; sourceTree = ""; }; BCB55A2E1221D09400ACE34F /* fail28.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = fail28.json; sourceTree = ""; }; BCB55A2F1221D09400ACE34F /* fail29.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = fail29.json; sourceTree = ""; }; BCB55A301221D09400ACE34F /* fail3.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = fail3.json; sourceTree = ""; }; BCB55A311221D09400ACE34F /* fail30.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = fail30.json; sourceTree = ""; }; BCB55A321221D09400ACE34F /* fail31.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = fail31.json; sourceTree = ""; }; BCB55A331221D09400ACE34F /* fail32.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = fail32.json; sourceTree = ""; }; BCB55A341221D09400ACE34F /* fail33.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = fail33.json; sourceTree = ""; }; BCB55A351221D09400ACE34F /* fail4.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = fail4.json; sourceTree = ""; }; BCB55A361221D09400ACE34F /* fail5.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = fail5.json; sourceTree = ""; }; BCB55A371221D09400ACE34F /* fail6.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = fail6.json; sourceTree = ""; }; BCB55A381221D09400ACE34F /* fail7.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = fail7.json; sourceTree = ""; }; BCB55A391221D09400ACE34F /* fail8.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = fail8.json; sourceTree = ""; }; BCB55A3A1221D09400ACE34F /* fail9.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = fail9.json; sourceTree = ""; }; BCB55A3B1221D09400ACE34F /* pass1.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = pass1.json; sourceTree = ""; }; BCB55A3C1221D09400ACE34F /* pass1.json.pretty */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = pass1.json.pretty; sourceTree = ""; }; BCB55A3D1221D09400ACE34F /* pass1.json.terse */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = pass1.json.terse; sourceTree = ""; }; BCB55A3E1221D09400ACE34F /* pass2.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = pass2.json; sourceTree = ""; }; BCB55A3F1221D09400ACE34F /* pass2.json.pretty */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = pass2.json.pretty; sourceTree = ""; }; BCB55A401221D09400ACE34F /* pass2.json.terse */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = pass2.json.terse; sourceTree = ""; }; BCB55A411221D09400ACE34F /* pass3.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = pass3.json; sourceTree = ""; }; BCB55A421221D09400ACE34F /* pass3.json.pretty */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = pass3.json.pretty; sourceTree = ""; }; BCB55A431221D09400ACE34F /* pass3.json.terse */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = pass3.json.terse; sourceTree = ""; }; BCB55A441221D09400ACE34F /* null.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = null.json; sourceTree = ""; }; BCB55A451221D09400ACE34F /* null.json.pretty */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = null.json.pretty; sourceTree = ""; }; BCB55A461221D09400ACE34F /* null.json.terse */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = null.json.terse; sourceTree = ""; }; BCB55A471221D09400ACE34F /* number.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = number.json; sourceTree = ""; }; BCB55A481221D09400ACE34F /* number.json.pretty */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = number.json.pretty; sourceTree = ""; }; BCB55A491221D09400ACE34F /* number.json.terse */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = number.json.terse; sourceTree = ""; }; BCB55A4A1221D09400ACE34F /* object.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = object.json; sourceTree = ""; }; BCB55A4B1221D09400ACE34F /* object.json.pretty */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = object.json.pretty; sourceTree = ""; }; BCB55A4C1221D09400ACE34F /* object.json.terse */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = object.json.terse; sourceTree = ""; }; BCB55A4F1221D09400ACE34F /* a.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = a.json; sourceTree = ""; }; BCB55A501221D09400ACE34F /* a.json.pretty */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = a.json.pretty; sourceTree = ""; }; BCB55A511221D09400ACE34F /* a.json.terse */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = a.json.terse; sourceTree = ""; }; BCB55A521221D09400ACE34F /* b.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = b.json; sourceTree = ""; }; BCB55A531221D09400ACE34F /* b.json.pretty */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = b.json.pretty; sourceTree = ""; }; BCB55A541221D09400ACE34F /* b.json.terse */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = b.json.terse; sourceTree = ""; }; BCB55A551221D09400ACE34F /* string-ctrl.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "string-ctrl.json"; sourceTree = ""; }; BCB55A561221D09400ACE34F /* string-ctrl.json.pretty */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "string-ctrl.json.pretty"; sourceTree = ""; }; BCB55A571221D09400ACE34F /* string-ctrl.json.terse */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "string-ctrl.json.terse"; sourceTree = ""; }; BCB55A581221D09400ACE34F /* string-unicode.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "string-unicode.json"; sourceTree = ""; }; BCB55A591221D09400ACE34F /* string-unicode.json.pretty */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "string-unicode.json.pretty"; sourceTree = ""; }; BCB55A5A1221D09400ACE34F /* string-unicode.json.terse */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "string-unicode.json.terse"; sourceTree = ""; }; BCB55A5B1221D09400ACE34F /* string.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = string.json; sourceTree = ""; }; BCB55A5C1221D09400ACE34F /* string.json.pretty */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = string.json.pretty; sourceTree = ""; }; BCB55A5D1221D09400ACE34F /* string.json.terse */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = string.json.terse; sourceTree = ""; }; BCB55B411221D4B800ACE34F /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = ""; }; BCB55B421221D4E200ACE34F /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = ""; }; BCB55B441221D50500ACE34F /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = ""; }; BCC0466C0FB62CF100F9F2D3 /* Readme.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Readme.md; sourceTree = ""; }; BCC047320FB6584C00F9F2D3 /* InstallDocumentation.sh */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = InstallDocumentation.sh; sourceTree = ""; }; E75716430C96DB530084A449 /* NSObject+SBJSON.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSObject+SBJSON.h"; sourceTree = ""; }; E75716440C96DB530084A449 /* NSObject+SBJSON.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSObject+SBJSON.m"; sourceTree = ""; }; E757164B0C96E39B0084A449 /* NSString+SBJSON.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+SBJSON.h"; sourceTree = ""; }; E757164C0C96E39B0084A449 /* NSString+SBJSON.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+SBJSON.m"; sourceTree = ""; }; E76A1EB60C996C2000A0CC83 /* DataDrivenTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DataDrivenTest.m; sourceTree = ""; }; FE2BBD800D8B0D3900184787 /* libjson.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libjson.a; sourceTree = BUILT_PRODUCTS_DIR; }; FE2BBDAB0D8B0EE000184787 /* libjsontests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = libjsontests.octest; sourceTree = BUILT_PRODUCTS_DIR; }; FE2BBDAC0D8B0EE100184787 /* libjsontests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "libjsontests-Info.plist"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 53D2297F0C96121600276605 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; 53D2298A0C96122A00276605 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 53D229AD0C961B9900276605 /* JSON.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; FE2BBD7E0D8B0D3900184787 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; FE2BBDA80D8B0EE000184787 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 53F8A8150E57158200355C72 /* libjson.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 53D229710C9611FF00276605 = { isa = PBXGroup; children = ( 53D229950C96123C00276605 /* Classes */, 53D229960C96124500276605 /* Tests */, BCB559FF1221D09300ACE34F /* Test Data */, 53D229820C96121600276605 /* Products */, BCC0465E0FB62C2B00F9F2D3 /* Resources */, BCC047D30FB742FC00F9F2D3 /* Documents */, BCC046DF0FB6478C00F9F2D3 /* Scripts */, ); sourceTree = ""; }; 53D229820C96121600276605 /* Products */ = { isa = PBXGroup; children = ( 53D229810C96121600276605 /* JSON.framework */, 53D2298D0C96122A00276605 /* Tests.octest */, FE2BBD800D8B0D3900184787 /* libjson.a */, FE2BBDAB0D8B0EE000184787 /* libjsontests.octest */, ); name = Products; sourceTree = ""; }; 53D229950C96123C00276605 /* Classes */ = { isa = PBXGroup; children = ( 53D2299A0C96129800276605 /* JSON.h */, E75716430C96DB530084A449 /* NSObject+SBJSON.h */, E75716440C96DB530084A449 /* NSObject+SBJSON.m */, E757164B0C96E39B0084A449 /* NSString+SBJSON.h */, E757164C0C96E39B0084A449 /* NSString+SBJSON.m */, 5351586F0F70DE7A00C8AABD /* SBJsonBase.h */, 535158720F70DE7B00C8AABD /* SBJsonBase.m */, 535157780F6E3BE100C8AABD /* SBJsonParser.h */, 535157790F6E3BE100C8AABD /* SBJsonParser.m */, 535157A30F6EE4A800C8AABD /* SBJsonWriter.h */, 535157A40F6EE4A800C8AABD /* SBJsonWriter.m */, ); path = Classes; sourceTree = ""; }; 53D229960C96124500276605 /* Tests */ = { isa = PBXGroup; children = ( BC0387E611CEC07A0080C552 /* AbstractTest.h */, BC0387E711CEC07A0080C552 /* AbstractTest.m */, 5355C86C0E392B2A00A18C15 /* DataDrivenTest.h */, E76A1EB60C996C2000A0CC83 /* DataDrivenTest.m */, 5355C86B0E392B2A00A18C15 /* ErrorTest.h */, 53C45B9B0C98A87600546F66 /* ErrorTest.m */, BC74B6EA0FC9FAD0000BD3DD /* MaxDepthTest.h */, BC74B6EB0FC9FAD0000BD3DD /* MaxDepthTest.m */, BC74B7AC0FCA8B89000BD3DD /* ProxyTest.h */, BC74B7AD0FCA8B89000BD3DD /* ProxyTest.m */, BC8F72A51235331400678720 /* WriterTest.h */, BC8F72A61235331400678720 /* WriterTest.m */, ); path = Tests; sourceTree = ""; }; BCB559FF1221D09300ACE34F /* Test Data */ = { isa = PBXGroup; children = ( BCB55A001221D09400ACE34F /* array.json */, BCB55A011221D09400ACE34F /* array.json.pretty */, BCB55A021221D09400ACE34F /* array.json.terse */, BCB55A031221D09400ACE34F /* bool.json */, BCB55A041221D09400ACE34F /* bool.json.pretty */, BCB55A051221D09400ACE34F /* bool.json.terse */, BCB55A061221D09400ACE34F /* format.json */, BCB55A071221D09400ACE34F /* format.json.pretty */, BCB55A081221D09400ACE34F /* format.json.terse */, BCB55A091221D09400ACE34F /* json.org */, BCB55A191221D09400ACE34F /* jsonchecker */, BCB55A441221D09400ACE34F /* null.json */, BCB55A451221D09400ACE34F /* null.json.pretty */, BCB55A461221D09400ACE34F /* null.json.terse */, BCB55A471221D09400ACE34F /* number.json */, BCB55A481221D09400ACE34F /* number.json.pretty */, BCB55A491221D09400ACE34F /* number.json.terse */, BCB55A4A1221D09400ACE34F /* object.json */, BCB55A4B1221D09400ACE34F /* object.json.pretty */, BCB55A4C1221D09400ACE34F /* object.json.terse */, BCB55A4E1221D09400ACE34F /* rfc4627 */, BCB55A551221D09400ACE34F /* string-ctrl.json */, BCB55A561221D09400ACE34F /* string-ctrl.json.pretty */, BCB55A571221D09400ACE34F /* string-ctrl.json.terse */, BCB55A581221D09400ACE34F /* string-unicode.json */, BCB55A591221D09400ACE34F /* string-unicode.json.pretty */, BCB55A5A1221D09400ACE34F /* string-unicode.json.terse */, BCB55A5B1221D09400ACE34F /* string.json */, BCB55A5C1221D09400ACE34F /* string.json.pretty */, BCB55A5D1221D09400ACE34F /* string.json.terse */, ); name = "Test Data"; path = Tests/Data; sourceTree = ""; }; BCB55A091221D09400ACE34F /* json.org */ = { isa = PBXGroup; children = ( BCB55A0A1221D09400ACE34F /* 1.json */, BCB55A0B1221D09400ACE34F /* 1.json.pretty */, BCB55A0C1221D09400ACE34F /* 1.json.terse */, BCB55A0D1221D09400ACE34F /* 2.json */, BCB55A0E1221D09400ACE34F /* 2.json.pretty */, BCB55A0F1221D09400ACE34F /* 2.json.terse */, BCB55A101221D09400ACE34F /* 3.json */, BCB55A111221D09400ACE34F /* 3.json.pretty */, BCB55A121221D09400ACE34F /* 3.json.terse */, BCB55A131221D09400ACE34F /* 4.json */, BCB55A141221D09400ACE34F /* 4.json.pretty */, BCB55A151221D09400ACE34F /* 4.json.terse */, BCB55A161221D09400ACE34F /* 5.json */, BCB55A171221D09400ACE34F /* 5.json.pretty */, BCB55A181221D09400ACE34F /* 5.json.terse */, BCB55B411221D4B800ACE34F /* README */, ); path = json.org; sourceTree = ""; }; BCB55A191221D09400ACE34F /* jsonchecker */ = { isa = PBXGroup; children = ( BCB55A1A1221D09400ACE34F /* fail1.json */, BCB55A1B1221D09400ACE34F /* fail10.json */, BCB55A1C1221D09400ACE34F /* fail11.json */, BCB55A1D1221D09400ACE34F /* fail12.json */, BCB55A1E1221D09400ACE34F /* fail13.json */, BCB55A1F1221D09400ACE34F /* fail14.json */, BCB55A201221D09400ACE34F /* fail15.json */, BCB55A211221D09400ACE34F /* fail16.json */, BCB55A221221D09400ACE34F /* fail17.json */, BCB55A231221D09400ACE34F /* fail18.json */, BCB55A241221D09400ACE34F /* fail19.json */, BCB55A251221D09400ACE34F /* fail2.json */, BCB55A261221D09400ACE34F /* fail20.json */, BCB55A271221D09400ACE34F /* fail21.json */, BCB55A281221D09400ACE34F /* fail22.json */, BCB55A291221D09400ACE34F /* fail23.json */, BCB55A2A1221D09400ACE34F /* fail24.json */, BCB55A2B1221D09400ACE34F /* fail25.json */, BCB55A2C1221D09400ACE34F /* fail26.json */, BCB55A2D1221D09400ACE34F /* fail27.json */, BCB55A2E1221D09400ACE34F /* fail28.json */, BCB55A2F1221D09400ACE34F /* fail29.json */, BCB55A301221D09400ACE34F /* fail3.json */, BCB55A311221D09400ACE34F /* fail30.json */, BCB55A321221D09400ACE34F /* fail31.json */, BCB55A331221D09400ACE34F /* fail32.json */, BCB55A341221D09400ACE34F /* fail33.json */, BCB55A351221D09400ACE34F /* fail4.json */, BCB55A361221D09400ACE34F /* fail5.json */, BCB55A371221D09400ACE34F /* fail6.json */, BCB55A381221D09400ACE34F /* fail7.json */, BCB55A391221D09400ACE34F /* fail8.json */, BCB55A3A1221D09400ACE34F /* fail9.json */, BCB55A3B1221D09400ACE34F /* pass1.json */, BCB55A3C1221D09400ACE34F /* pass1.json.pretty */, BCB55A3D1221D09400ACE34F /* pass1.json.terse */, BCB55A3E1221D09400ACE34F /* pass2.json */, BCB55A3F1221D09400ACE34F /* pass2.json.pretty */, BCB55A401221D09400ACE34F /* pass2.json.terse */, BCB55A411221D09400ACE34F /* pass3.json */, BCB55A421221D09400ACE34F /* pass3.json.pretty */, BCB55A431221D09400ACE34F /* pass3.json.terse */, BCB55B421221D4E200ACE34F /* README */, ); path = jsonchecker; sourceTree = ""; }; BCB55A4E1221D09400ACE34F /* rfc4627 */ = { isa = PBXGroup; children = ( BCB55A4F1221D09400ACE34F /* a.json */, BCB55A501221D09400ACE34F /* a.json.pretty */, BCB55A511221D09400ACE34F /* a.json.terse */, BCB55A521221D09400ACE34F /* b.json */, BCB55A531221D09400ACE34F /* b.json.pretty */, BCB55A541221D09400ACE34F /* b.json.terse */, BCB55B441221D50500ACE34F /* README */, ); path = rfc4627; sourceTree = ""; }; BCC0465E0FB62C2B00F9F2D3 /* Resources */ = { isa = PBXGroup; children = ( 53D229830C96121600276605 /* JSON-Info.plist */, 53D2298E0C96122A00276605 /* Tests-Info.plist */, FE2BBDAC0D8B0EE100184787 /* libjsontests-Info.plist */, ); name = Resources; sourceTree = ""; }; BCC046DF0FB6478C00F9F2D3 /* Scripts */ = { isa = PBXGroup; children = ( BC010B181248A5E400ACC736 /* RefreshOnlineDocs.sh */, BCC047320FB6584C00F9F2D3 /* InstallDocumentation.sh */, ); path = Scripts; sourceTree = ""; }; BCC047D30FB742FC00F9F2D3 /* Documents */ = { isa = PBXGroup; children = ( BC3A1CDC12060DAC0051A978 /* Changes.md */, BC3A1CDD12060DAC0051A978 /* Credits.md */, BC3A1CDE12060DAC0051A978 /* Installation.md */, BC3A1CDF12060DAC0051A978 /* License.md */, BCC0466C0FB62CF100F9F2D3 /* Readme.md */, ); name = Documents; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ 53D2297C0C96121600276605 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( 53D2299C0C96129800276605 /* JSON.h in Headers */, E75716450C96DB530084A449 /* NSObject+SBJSON.h in Headers */, E757164D0C96E39B0084A449 /* NSString+SBJSON.h in Headers */, 5351577C0F6E3BE100C8AABD /* SBJsonParser.h in Headers */, 535157A70F6EE4A800C8AABD /* SBJsonWriter.h in Headers */, 535158700F70DE7A00C8AABD /* SBJsonBase.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; FE2BBD7C0D8B0D3900184787 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( FE2BBD860D8B0D6000184787 /* JSON.h in Headers */, FE2BBD870D8B0D6000184787 /* NSObject+SBJSON.h in Headers */, FE2BBD8B0D8B0D6000184787 /* NSString+SBJSON.h in Headers */, 5351577A0F6E3BE100C8AABD /* SBJsonParser.h in Headers */, 535157A50F6EE4A800C8AABD /* SBJsonWriter.h in Headers */, 535158710F70DE7A00C8AABD /* SBJsonBase.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ 53D229800C96121600276605 /* JSON */ = { isa = PBXNativeTarget; buildConfigurationList = 53D229850C96121700276605 /* Build configuration list for PBXNativeTarget "JSON" */; buildPhases = ( BC5BC69F1249767600F22EB0 /* ShellScript */, 53D2297C0C96121600276605 /* Headers */, 53D2297D0C96121600276605 /* Resources */, 53D2297E0C96121600276605 /* Sources */, 53D2297F0C96121600276605 /* Frameworks */, BC5BC6BE1249E3E500F22EB0 /* ShellScript */, ); buildRules = ( ); dependencies = ( ); name = JSON; productName = JSON; productReference = 53D229810C96121600276605 /* JSON.framework */; productType = "com.apple.product-type.framework"; }; 53D2298C0C96122A00276605 /* Tests */ = { isa = PBXNativeTarget; buildConfigurationList = 53D2298F0C96122A00276605 /* Build configuration list for PBXNativeTarget "Tests" */; buildPhases = ( 53D229880C96122A00276605 /* Resources */, 53D229890C96122A00276605 /* Sources */, 53D2298A0C96122A00276605 /* Frameworks */, 53D2298B0C96122A00276605 /* ShellScript */, ); buildRules = ( ); dependencies = ( 53D229930C96122E00276605 /* PBXTargetDependency */, ); name = Tests; productName = Tests; productReference = 53D2298D0C96122A00276605 /* Tests.octest */; productType = "com.apple.product-type.bundle"; }; FE2BBD7F0D8B0D3900184787 /* libjson */ = { isa = PBXNativeTarget; buildConfigurationList = FE2BBD950D8B0DC900184787 /* Build configuration list for PBXNativeTarget "libjson" */; buildPhases = ( BC5BC69F1249767600F22EB0 /* ShellScript */, FE2BBD7C0D8B0D3900184787 /* Headers */, FE2BBD7D0D8B0D3900184787 /* Sources */, FE2BBD7E0D8B0D3900184787 /* Frameworks */, BC5BC6BE1249E3E500F22EB0 /* ShellScript */, ); buildRules = ( ); dependencies = ( ); name = libjson; productName = json; productReference = FE2BBD800D8B0D3900184787 /* libjson.a */; productType = "com.apple.product-type.library.static"; }; FE2BBDAA0D8B0EE000184787 /* libjsontests */ = { isa = PBXNativeTarget; buildConfigurationList = FE2BBDAF0D8B0EE100184787 /* Build configuration list for PBXNativeTarget "libjsontests" */; buildPhases = ( FE2BBDA60D8B0EE000184787 /* Resources */, FE2BBDA70D8B0EE000184787 /* Sources */, FE2BBDA80D8B0EE000184787 /* Frameworks */, FE2BBDA90D8B0EE000184787 /* ShellScript */, ); buildRules = ( ); dependencies = ( FE2BBDB40D8B0F0F00184787 /* PBXTargetDependency */, ); name = libjsontests; productName = libjsontests; productReference = FE2BBDAB0D8B0EE000184787 /* libjsontests.octest */; productType = "com.apple.product-type.bundle"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 53D229730C9611FF00276605 /* Project object */ = { isa = PBXProject; buildConfigurationList = 53D229740C9611FF00276605 /* Build configuration list for PBXProject "JSON" */; compatibilityVersion = "Xcode 3.1"; hasScannedForEncodings = 0; mainGroup = 53D229710C9611FF00276605; productRefGroup = 53D229820C96121600276605 /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( 53D229800C96121600276605 /* JSON */, 53D2298C0C96122A00276605 /* Tests */, FE2BBD7F0D8B0D3900184787 /* libjson */, FE2BBDAA0D8B0EE000184787 /* libjsontests */, BCC047160FB651AF00F9F2D3 /* Documentation */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ 53D2297D0C96121600276605 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; 53D229880C96122A00276605 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( BCB55A5E1221D09400ACE34F /* array.json in Resources */, BCB55A5F1221D09400ACE34F /* array.json.pretty in Resources */, BCB55A601221D09400ACE34F /* array.json.terse in Resources */, BCB55A611221D09400ACE34F /* bool.json in Resources */, BCB55A621221D09400ACE34F /* bool.json.pretty in Resources */, BCB55A631221D09400ACE34F /* bool.json.terse in Resources */, BCB55A641221D09400ACE34F /* format.json in Resources */, BCB55A651221D09400ACE34F /* format.json.pretty in Resources */, BCB55A661221D09400ACE34F /* format.json.terse in Resources */, BCB55A671221D09400ACE34F /* 1.json in Resources */, BCB55A681221D09400ACE34F /* 1.json.pretty in Resources */, BCB55A691221D09400ACE34F /* 1.json.terse in Resources */, BCB55A6A1221D09400ACE34F /* 2.json in Resources */, BCB55A6B1221D09400ACE34F /* 2.json.pretty in Resources */, BCB55A6C1221D09400ACE34F /* 2.json.terse in Resources */, BCB55A6D1221D09400ACE34F /* 3.json in Resources */, BCB55A6E1221D09400ACE34F /* 3.json.pretty in Resources */, BCB55A6F1221D09400ACE34F /* 3.json.terse in Resources */, BCB55A701221D09400ACE34F /* 4.json in Resources */, BCB55A711221D09400ACE34F /* 4.json.pretty in Resources */, BCB55A721221D09400ACE34F /* 4.json.terse in Resources */, BCB55A731221D09400ACE34F /* 5.json in Resources */, BCB55A741221D09400ACE34F /* 5.json.pretty in Resources */, BCB55A751221D09400ACE34F /* 5.json.terse in Resources */, BCB55A761221D09400ACE34F /* fail1.json in Resources */, BCB55A771221D09400ACE34F /* fail10.json in Resources */, BCB55A781221D09400ACE34F /* fail11.json in Resources */, BCB55A791221D09400ACE34F /* fail12.json in Resources */, BCB55A7A1221D09400ACE34F /* fail13.json in Resources */, BCB55A7B1221D09400ACE34F /* fail14.json in Resources */, BCB55A7C1221D09400ACE34F /* fail15.json in Resources */, BCB55A7D1221D09400ACE34F /* fail16.json in Resources */, BCB55A7E1221D09400ACE34F /* fail17.json in Resources */, BCB55A7F1221D09400ACE34F /* fail18.json in Resources */, BCB55A801221D09400ACE34F /* fail19.json in Resources */, BCB55A811221D09400ACE34F /* fail2.json in Resources */, BCB55A821221D09400ACE34F /* fail20.json in Resources */, BCB55A831221D09400ACE34F /* fail21.json in Resources */, BCB55A841221D09400ACE34F /* fail22.json in Resources */, BCB55A851221D09400ACE34F /* fail23.json in Resources */, BCB55A861221D09400ACE34F /* fail24.json in Resources */, BCB55A871221D09400ACE34F /* fail25.json in Resources */, BCB55A881221D09400ACE34F /* fail26.json in Resources */, BCB55A891221D09400ACE34F /* fail27.json in Resources */, BCB55A8A1221D09400ACE34F /* fail28.json in Resources */, BCB55A8B1221D09400ACE34F /* fail29.json in Resources */, BCB55A8C1221D09400ACE34F /* fail3.json in Resources */, BCB55A8D1221D09400ACE34F /* fail30.json in Resources */, BCB55A8E1221D09400ACE34F /* fail31.json in Resources */, BCB55A8F1221D09400ACE34F /* fail32.json in Resources */, BCB55A901221D09400ACE34F /* fail33.json in Resources */, BCB55A911221D09400ACE34F /* fail4.json in Resources */, BCB55A921221D09400ACE34F /* fail5.json in Resources */, BCB55A931221D09400ACE34F /* fail6.json in Resources */, BCB55A941221D09400ACE34F /* fail7.json in Resources */, BCB55A951221D09400ACE34F /* fail8.json in Resources */, BCB55A961221D09400ACE34F /* fail9.json in Resources */, BCB55A971221D09400ACE34F /* pass1.json in Resources */, BCB55A981221D09400ACE34F /* pass1.json.pretty in Resources */, BCB55A991221D09400ACE34F /* pass1.json.terse in Resources */, BCB55A9A1221D09400ACE34F /* pass2.json in Resources */, BCB55A9B1221D09400ACE34F /* pass2.json.pretty in Resources */, BCB55A9C1221D09400ACE34F /* pass2.json.terse in Resources */, BCB55A9D1221D09400ACE34F /* pass3.json in Resources */, BCB55A9E1221D09400ACE34F /* pass3.json.pretty in Resources */, BCB55A9F1221D09400ACE34F /* pass3.json.terse in Resources */, BCB55AA01221D09400ACE34F /* null.json in Resources */, BCB55AA11221D09400ACE34F /* null.json.pretty in Resources */, BCB55AA21221D09400ACE34F /* null.json.terse in Resources */, BCB55AA31221D09400ACE34F /* number.json in Resources */, BCB55AA41221D09400ACE34F /* number.json.pretty in Resources */, BCB55AA51221D09400ACE34F /* number.json.terse in Resources */, BCB55AA61221D09400ACE34F /* object.json in Resources */, BCB55AA71221D09400ACE34F /* object.json.pretty in Resources */, BCB55AA81221D09400ACE34F /* object.json.terse in Resources */, BCB55AAA1221D09400ACE34F /* a.json in Resources */, BCB55AAB1221D09400ACE34F /* a.json.pretty in Resources */, BCB55AAC1221D09400ACE34F /* a.json.terse in Resources */, BCB55AAD1221D09400ACE34F /* b.json in Resources */, BCB55AAE1221D09400ACE34F /* b.json.pretty in Resources */, BCB55AAF1221D09400ACE34F /* b.json.terse in Resources */, BCB55AB01221D09400ACE34F /* string-ctrl.json in Resources */, BCB55AB11221D09400ACE34F /* string-ctrl.json.pretty in Resources */, BCB55AB21221D09400ACE34F /* string-ctrl.json.terse in Resources */, BCB55AB31221D09400ACE34F /* string-unicode.json in Resources */, BCB55AB41221D09400ACE34F /* string-unicode.json.pretty in Resources */, BCB55AB51221D09400ACE34F /* string-unicode.json.terse in Resources */, BCB55AB61221D09400ACE34F /* string.json in Resources */, BCB55AB71221D09400ACE34F /* string.json.pretty in Resources */, BCB55AB81221D09400ACE34F /* string.json.terse in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; FE2BBDA60D8B0EE000184787 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( BCB55AB91221D09400ACE34F /* array.json in Resources */, BCB55ABA1221D09400ACE34F /* array.json.pretty in Resources */, BCB55ABB1221D09400ACE34F /* array.json.terse in Resources */, BCB55ABC1221D09400ACE34F /* bool.json in Resources */, BCB55ABD1221D09400ACE34F /* bool.json.pretty in Resources */, BCB55ABE1221D09400ACE34F /* bool.json.terse in Resources */, BCB55ABF1221D09400ACE34F /* format.json in Resources */, BCB55AC01221D09400ACE34F /* format.json.pretty in Resources */, BCB55AC11221D09400ACE34F /* format.json.terse in Resources */, BCB55AC21221D09400ACE34F /* 1.json in Resources */, BCB55AC31221D09400ACE34F /* 1.json.pretty in Resources */, BCB55AC41221D09400ACE34F /* 1.json.terse in Resources */, BCB55AC51221D09400ACE34F /* 2.json in Resources */, BCB55AC61221D09400ACE34F /* 2.json.pretty in Resources */, BCB55AC71221D09400ACE34F /* 2.json.terse in Resources */, BCB55AC81221D09400ACE34F /* 3.json in Resources */, BCB55AC91221D09400ACE34F /* 3.json.pretty in Resources */, BCB55ACA1221D09400ACE34F /* 3.json.terse in Resources */, BCB55ACB1221D09400ACE34F /* 4.json in Resources */, BCB55ACC1221D09400ACE34F /* 4.json.pretty in Resources */, BCB55ACD1221D09400ACE34F /* 4.json.terse in Resources */, BCB55ACE1221D09400ACE34F /* 5.json in Resources */, BCB55ACF1221D09400ACE34F /* 5.json.pretty in Resources */, BCB55AD01221D09400ACE34F /* 5.json.terse in Resources */, BCB55AD11221D09400ACE34F /* fail1.json in Resources */, BCB55AD21221D09400ACE34F /* fail10.json in Resources */, BCB55AD31221D09400ACE34F /* fail11.json in Resources */, BCB55AD41221D09400ACE34F /* fail12.json in Resources */, BCB55AD51221D09400ACE34F /* fail13.json in Resources */, BCB55AD61221D09400ACE34F /* fail14.json in Resources */, BCB55AD71221D09400ACE34F /* fail15.json in Resources */, BCB55AD81221D09400ACE34F /* fail16.json in Resources */, BCB55AD91221D09400ACE34F /* fail17.json in Resources */, BCB55ADA1221D09400ACE34F /* fail18.json in Resources */, BCB55ADB1221D09400ACE34F /* fail19.json in Resources */, BCB55ADC1221D09400ACE34F /* fail2.json in Resources */, BCB55ADD1221D09400ACE34F /* fail20.json in Resources */, BCB55ADE1221D09400ACE34F /* fail21.json in Resources */, BCB55ADF1221D09400ACE34F /* fail22.json in Resources */, BCB55AE01221D09400ACE34F /* fail23.json in Resources */, BCB55AE11221D09400ACE34F /* fail24.json in Resources */, BCB55AE21221D09400ACE34F /* fail25.json in Resources */, BCB55AE31221D09400ACE34F /* fail26.json in Resources */, BCB55AE41221D09400ACE34F /* fail27.json in Resources */, BCB55AE51221D09400ACE34F /* fail28.json in Resources */, BCB55AE61221D09400ACE34F /* fail29.json in Resources */, BCB55AE71221D09400ACE34F /* fail3.json in Resources */, BCB55AE81221D09400ACE34F /* fail30.json in Resources */, BCB55AE91221D09400ACE34F /* fail31.json in Resources */, BCB55AEA1221D09400ACE34F /* fail32.json in Resources */, BCB55AEB1221D09400ACE34F /* fail33.json in Resources */, BCB55AEC1221D09400ACE34F /* fail4.json in Resources */, BCB55AED1221D09400ACE34F /* fail5.json in Resources */, BCB55AEE1221D09400ACE34F /* fail6.json in Resources */, BCB55AEF1221D09400ACE34F /* fail7.json in Resources */, BCB55AF01221D09400ACE34F /* fail8.json in Resources */, BCB55AF11221D09400ACE34F /* fail9.json in Resources */, BCB55AF21221D09400ACE34F /* pass1.json in Resources */, BCB55AF31221D09400ACE34F /* pass1.json.pretty in Resources */, BCB55AF41221D09400ACE34F /* pass1.json.terse in Resources */, BCB55AF51221D09400ACE34F /* pass2.json in Resources */, BCB55AF61221D09400ACE34F /* pass2.json.pretty in Resources */, BCB55AF71221D09400ACE34F /* pass2.json.terse in Resources */, BCB55AF81221D09400ACE34F /* pass3.json in Resources */, BCB55AF91221D09400ACE34F /* pass3.json.pretty in Resources */, BCB55AFA1221D09400ACE34F /* pass3.json.terse in Resources */, BCB55AFB1221D09400ACE34F /* null.json in Resources */, BCB55AFC1221D09400ACE34F /* null.json.pretty in Resources */, BCB55AFD1221D09400ACE34F /* null.json.terse in Resources */, BCB55AFE1221D09400ACE34F /* number.json in Resources */, BCB55AFF1221D09400ACE34F /* number.json.pretty in Resources */, BCB55B001221D09400ACE34F /* number.json.terse in Resources */, BCB55B011221D09400ACE34F /* object.json in Resources */, BCB55B021221D09400ACE34F /* object.json.pretty in Resources */, BCB55B031221D09400ACE34F /* object.json.terse in Resources */, BCB55B051221D09400ACE34F /* a.json in Resources */, BCB55B061221D09400ACE34F /* a.json.pretty in Resources */, BCB55B071221D09400ACE34F /* a.json.terse in Resources */, BCB55B081221D09400ACE34F /* b.json in Resources */, BCB55B091221D09400ACE34F /* b.json.pretty in Resources */, BCB55B0A1221D09400ACE34F /* b.json.terse in Resources */, BCB55B0B1221D09400ACE34F /* string-ctrl.json in Resources */, BCB55B0C1221D09400ACE34F /* string-ctrl.json.pretty in Resources */, BCB55B0D1221D09400ACE34F /* string-ctrl.json.terse in Resources */, BCB55B0E1221D09400ACE34F /* string-unicode.json in Resources */, BCB55B0F1221D09400ACE34F /* string-unicode.json.pretty in Resources */, BCB55B101221D09400ACE34F /* string-unicode.json.terse in Resources */, BCB55B111221D09400ACE34F /* string.json in Resources */, BCB55B121221D09400ACE34F /* string.json.pretty in Resources */, BCB55B131221D09400ACE34F /* string.json.terse in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ 53D2298B0C96122A00276605 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n"; }; BC3A1CB112023B860051A978 /* Refresh Online Docs */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 8; files = ( ); inputPaths = ( ); name = "Refresh Online Docs"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 1; shellPath = /bin/sh; shellScript = "exec $SOURCE_ROOT/Scripts/RefreshOnlineDocs.sh"; }; BC5BC69F1249767600F22EB0 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 12; files = ( ); inputPaths = ( ); outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "/usr/bin/perl -pi -e 's/#if 1/#if 0/' $SRCROOT/Classes/JSON.h\n"; showEnvVarsInLog = 0; }; BC5BC6BE1249E3E500F22EB0 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "/usr/bin/perl -pi -e 's/#if 0/#if 1/' $SRCROOT/Classes/JSON.h\n"; showEnvVarsInLog = 0; }; BCC047150FB651AF00F9F2D3 /* Install Docset */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); name = "Install Docset"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "exec $SOURCE_ROOT/Scripts/InstallDocumentation.sh"; }; FE2BBDA90D8B0EE000184787 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n"; }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ 53D2297E0C96121600276605 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( E75716460C96DB530084A449 /* NSObject+SBJSON.m in Sources */, E757164E0C96E39B0084A449 /* NSString+SBJSON.m in Sources */, 5351577D0F6E3BE100C8AABD /* SBJsonParser.m in Sources */, 535157A80F6EE4A800C8AABD /* SBJsonWriter.m in Sources */, 535158730F70DE7B00C8AABD /* SBJsonBase.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; 53D229890C96122A00276605 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 53C45B9C0C98A87600546F66 /* ErrorTest.m in Sources */, E76A1EBD0C996EFD00A0CC83 /* DataDrivenTest.m in Sources */, BC74B6ED0FC9FAD0000BD3DD /* MaxDepthTest.m in Sources */, BC74B7AE0FCA8B89000BD3DD /* ProxyTest.m in Sources */, BC0387E911CEC07A0080C552 /* AbstractTest.m in Sources */, BC8F72A71235331400678720 /* WriterTest.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; FE2BBD7D0D8B0D3900184787 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( FE2BBD880D8B0D6000184787 /* NSObject+SBJSON.m in Sources */, FE2BBD8C0D8B0D6000184787 /* NSString+SBJSON.m in Sources */, 5351577B0F6E3BE100C8AABD /* SBJsonParser.m in Sources */, 535157A60F6EE4A800C8AABD /* SBJsonWriter.m in Sources */, 535158740F70DE7B00C8AABD /* SBJsonBase.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; FE2BBDA70D8B0EE000184787 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( FE2BBDB60D8B0F1D00184787 /* DataDrivenTest.m in Sources */, FE2BBDB70D8B0F1D00184787 /* ErrorTest.m in Sources */, BC74B6EC0FC9FAD0000BD3DD /* MaxDepthTest.m in Sources */, BC74B7AF0FCA8B89000BD3DD /* ProxyTest.m in Sources */, BC0387E811CEC07A0080C552 /* AbstractTest.m in Sources */, BC8F72A81235331400678720 /* WriterTest.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ 53D229930C96122E00276605 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 53D229800C96121600276605 /* JSON */; targetProxy = 53D229920C96122E00276605 /* PBXContainerItemProxy */; }; FE2BBDB40D8B0F0F00184787 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = FE2BBD7F0D8B0D3900184787 /* libjson */; targetProxy = FE2BBDB30D8B0F0F00184787 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ 53D229750C9611FF00276605 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; COPY_PHASE_STRIP = NO; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-Wparentheses"; }; name = Debug; }; 53D229760C9611FF00276605 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_STANDARD_32_BIT)"; COPY_PHASE_STRIP = YES; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; OTHER_CFLAGS = "-Wparentheses"; }; name = Release; }; 53D229860C96121700276605 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; CURRENT_PROJECT_VERSION = 11; DYLIB_COMPATIBILITY_VERSION = 4; DYLIB_CURRENT_VERSION = 11; FRAMEWORK_VERSION = A; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_FIX_AND_CONTINUE = YES; GCC_ENABLE_OBJC_GC = supported; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_MODEL_TUNING = G5; GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/Foundation.framework/Headers/Foundation.h"; GCC_TREAT_WARNINGS_AS_ERRORS = YES; INFOPLIST_FILE = "JSON-Info.plist"; INSTALL_PATH = "@executable_path/../Frameworks"; OTHER_LDFLAGS = ( "-framework", Foundation, ); PREBINDING = NO; PRODUCT_NAME = JSON; SDKROOT = ""; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = SB; }; name = Debug; }; 53D229870C96121700276605 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; CURRENT_PROJECT_VERSION = 11; DYLIB_COMPATIBILITY_VERSION = 4; DYLIB_CURRENT_VERSION = 11; FRAMEWORK_VERSION = A; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_ENABLE_OBJC_GC = supported; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_MODEL_TUNING = G5; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/Foundation.framework/Headers/Foundation.h"; GCC_TREAT_WARNINGS_AS_ERRORS = YES; INFOPLIST_FILE = "JSON-Info.plist"; INSTALL_PATH = "@executable_path/../Frameworks"; OTHER_LDFLAGS = ( "-framework", Foundation, ); PREBINDING = NO; PRODUCT_NAME = JSON; SDKROOT = ""; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = SB; }; name = Release; }; 53D229900C96122A00276605 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; COPY_PHASE_STRIP = NO; FRAMEWORK_SEARCH_PATHS = ( "$(value)", "$(DEVELOPER_FRAMEWORKS_DIR_QUOTED)", ); GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_ENABLE_OBJC_GC = required; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_MODEL_TUNING = G5; GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/Foundation.framework/Headers/Foundation.h"; GCC_TREAT_WARNINGS_AS_ERRORS = YES; INFOPLIST_FILE = "Tests-Info.plist"; INSTALL_PATH = "$(USER_LIBRARY_DIR)/Bundles"; OTHER_LDFLAGS = ( "-framework", Foundation, "-framework", SenTestingKit, ); PREBINDING = NO; PRODUCT_NAME = Tests; SDKROOT = ""; WRAPPER_EXTENSION = octest; }; name = Debug; }; 53D229910C96122A00276605 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; COPY_PHASE_STRIP = YES; FRAMEWORK_SEARCH_PATHS = ( "$(value)", "$(DEVELOPER_FRAMEWORKS_DIR_QUOTED)", ); GCC_C_LANGUAGE_STANDARD = gnu99; GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_ENABLE_OBJC_GC = required; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_MODEL_TUNING = G5; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/Foundation.framework/Headers/Foundation.h"; GCC_TREAT_WARNINGS_AS_ERRORS = YES; INFOPLIST_FILE = "Tests-Info.plist"; INSTALL_PATH = "$(USER_LIBRARY_DIR)/Bundles"; OTHER_LDFLAGS = ( "-framework", Foundation, "-framework", SenTestingKit, ); PREBINDING = NO; PRODUCT_NAME = Tests; SDKROOT = ""; WRAPPER_EXTENSION = octest; }; name = Release; }; BCC047170FB651AF00F9F2D3 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; PRODUCT_NAME = Documentation; }; name = Debug; }; BCC047180FB651AF00F9F2D3 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_ENABLE_FIX_AND_CONTINUE = NO; PRODUCT_NAME = Documentation; ZERO_LINK = NO; }; name = Release; }; FE2BBD840D8B0D3900184787 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; COPY_PHASE_STRIP = NO; DEPLOYMENT_LOCATION = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_FIX_AND_CONTINUE = YES; GCC_ENABLE_OBJC_GC = unsupported; GCC_MODEL_TUNING = G5; GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_TREAT_WARNINGS_AS_ERRORS = YES; OTHER_LDFLAGS = ( "-framework", Foundation, ); PREBINDING = NO; PRIVATE_HEADERS_FOLDER_PATH = /usr/local/include/JSON; PRODUCT_NAME = json; PUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/JSON; SDKROOT = ""; }; name = Debug; }; FE2BBD850D8B0D3900184787 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEPLOYMENT_LOCATION = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_ENABLE_OBJC_GC = unsupported; GCC_MODEL_TUNING = G5; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_TREAT_WARNINGS_AS_ERRORS = YES; OTHER_LDFLAGS = ( "-framework", Foundation, ); PREBINDING = NO; PRIVATE_HEADERS_FOLDER_PATH = /usr/local/include/JSON; PRODUCT_NAME = json; PUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/JSON; SDKROOT = ""; SKIP_INSTALL = NO; }; name = Release; }; FE2BBDAD0D8B0EE100184787 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; COPY_PHASE_STRIP = NO; FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_ENABLE_OBJC_GC = unsupported; GCC_MODEL_TUNING = G5; GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_TREAT_WARNINGS_AS_ERRORS = YES; INFOPLIST_FILE = "libjsontests-Info.plist"; INSTALL_PATH = "$(USER_LIBRARY_DIR)/Bundles"; OTHER_LDFLAGS = ( "-all_load", "-ObjC", "-ljson", "-framework", Foundation, "-framework", SenTestingKit, ); PREBINDING = NO; PRODUCT_NAME = libjsontests; SDKROOT = ""; WRAPPER_EXTENSION = octest; }; name = Debug; }; FE2BBDAE0D8B0EE100184787 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; COPY_PHASE_STRIP = YES; FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_ENABLE_OBJC_GC = unsupported; GCC_MODEL_TUNING = G5; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_TREAT_WARNINGS_AS_ERRORS = YES; INFOPLIST_FILE = "libjsontests-Info.plist"; INSTALL_PATH = "$(USER_LIBRARY_DIR)/Bundles"; OTHER_LDFLAGS = ( "-all_load", "-ObjC", "-ljson", "-framework", Foundation, "-framework", SenTestingKit, ); PREBINDING = NO; PRODUCT_NAME = libjsontests; SDKROOT = ""; WRAPPER_EXTENSION = octest; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 53D229740C9611FF00276605 /* Build configuration list for PBXProject "JSON" */ = { isa = XCConfigurationList; buildConfigurations = ( 53D229750C9611FF00276605 /* Debug */, 53D229760C9611FF00276605 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 53D229850C96121700276605 /* Build configuration list for PBXNativeTarget "JSON" */ = { isa = XCConfigurationList; buildConfigurations = ( 53D229860C96121700276605 /* Debug */, 53D229870C96121700276605 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 53D2298F0C96122A00276605 /* Build configuration list for PBXNativeTarget "Tests" */ = { isa = XCConfigurationList; buildConfigurations = ( 53D229900C96122A00276605 /* Debug */, 53D229910C96122A00276605 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; BCC047190FB651CD00F9F2D3 /* Build configuration list for PBXAggregateTarget "Documentation" */ = { isa = XCConfigurationList; buildConfigurations = ( BCC047170FB651AF00F9F2D3 /* Debug */, BCC047180FB651AF00F9F2D3 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; FE2BBD950D8B0DC900184787 /* Build configuration list for PBXNativeTarget "libjson" */ = { isa = XCConfigurationList; buildConfigurations = ( FE2BBD840D8B0D3900184787 /* Debug */, FE2BBD850D8B0D3900184787 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; FE2BBDAF0D8B0EE100184787 /* Build configuration list for PBXNativeTarget "libjsontests" */ = { isa = XCConfigurationList; buildConfigurations = ( FE2BBDAD0D8B0EE100184787 /* Debug */, FE2BBDAE0D8B0EE100184787 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = 53D229730C9611FF00276605 /* Project object */; } SOPE/sope-json/SBJson/Tests-Info.plist0000644000000000000000000000115612242733417016455 0ustar rootroot CFBundleDevelopmentRegion English CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier com.yourcompany.Tests CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType BNDL CFBundleSignature ???? CFBundleVersion 1.0 SOPE/sope-json/SBJson/libjsontests-Info.plist0000644000000000000000000000115412242733417020074 0ustar rootroot CFBundleDevelopmentRegion English CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier com.yourcompany.libjsontests CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType BNDL CFBundleSignature ???? CFBundleVersion 1.0 SOPE/sope-json/SBJson/Readme.markdown0000644000000000000000000000144412242733417016346 0ustar rootrootJSON Framework ============== JSON is a light-weight data interchange format that's easy to read and write for humans and computers alike. This framework implements a strict JSON parser and generator in Objective-C. Features -------- * BSD license. * Easy-to-use API. * Strict parsing & generation. * Stack of error available in case of failure so you can easily figure out what is wrong. * Optional pretty-printing of JSON output. * Optionally sorted dictionary keys in JSON output. * Configurable recursion depth for parsing, for added security. Links ----- * The GitHub [project page][src]. * The online [API documentation][api]. * The new [website][web]. [api]: http://stig.github.com/json-framework/api [web]: http://stig.github.com/json-framework [src]: http://github.com/stig/json-framework SOPE/sope-json/SBJson/LICENSE0000644000000000000000000000271412242733417014413 0ustar rootrootCopyright (C) 2007-2010 Stig Brautaset. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. SOPE/sope-json/SBJson/Credits.markdown0000644000000000000000000000322012242733417016540 0ustar rootroot# Credits Without these people JSON Framework wouldn't be what it is today. Please let me know if I've mistakenly omitted anyone. ## Blake Seely Inspiration for early versions of this framwork came from Blake's BSJSONAdditions. ## Marc Lehmann Marc is the author of the excellent JSON::XS Perl module. The number validation routine in my framework is re-licensed from his module, with his permission. ## Jens Alfke, jens@mooseyard.com, http://mooseyard.com/Jens/ Patches that gave a speedup of 11 times for generation and 5 times for parsing of the long (about 12k) JSON string I was using for testing. ## Greg Bolsinga * Patch for dropping the dependency on AppKit, making this a Foundation framework. * Patch for building a static library, and instructions for creating a custom SDK suitable for the iPhone. ## Ben Rimmington Patch speeding writing up by about 100% and parsing by 10% for certain inputs. ##renerattur Patch to remove memory leak. ## dmaclach * Patch to be warning-free with -Wparanthesis. * Prompted me to fix some Clang static analysis errors. ## boredzo Patch to stop memory leak in -JSONValue and friends. ## Adium, http://adiumx.com Provided patch to fix crash when parsing facebook chat responses. ## Joerg Schwieder Patch to install instructions for use of static library. ## Mike Monaco Pointed out embarrasing mistake in logic to report errors in the category methods of 2.2.1. ## dewvinci & Tobias Höhmann Performance patch for integer numbers and strings without special characters. ## George MacKerron Reported bug in SBJsonWriter's handling of NaN, Infinity and -Infinity. ## jinksys Reported bug with header inclusion of framework. SOPE/sope-json/SBJson/Scripts/0000755000000000000000000000000012242733417015031 5ustar rootrootSOPE/sope-json/SBJson/Scripts/InstallDocumentation.sh0000644000000000000000000000353412242733417021532 0ustar rootroot#!/bin/sh # See also http://developer.apple.com/tools/creatingdocsetswithdoxygen.html set -x VERSION=$(agvtool mvers -terse1) DOXYFILE=$DERIVED_FILES_DIR/doxygen.config DOXYGEN=/Applications/Doxygen.app/Contents/Resources/doxygen DOCSET=$INSTALL_DIR/Docset rm -rf $DOCSET mkdir -p $DOCSET || exit 1 mkdir -p $DERIVED_FILES_DIR || exit 1 if ! test -x $DOXYGEN ; then echo "*** Install Doxygen to get documentation generated for you automatically ***" exit 1 fi # Create a doxygen configuration file with only the settings we care about $DOXYGEN -g - > $DOXYFILE cat <> $DOXYFILE PROJECT_NAME = $FULL_PRODUCT_NAME PROJECT_NUMBER = $VERSION OUTPUT_DIRECTORY = $DOCSET INPUT = $SOURCE_ROOT/Classes FILE_PATTERNS = *.h *.m HIDE_UNDOC_MEMBERS = YES HIDE_UNDOC_CLASSES = YES HIDE_UNDOC_RELATIONS = YES REPEAT_BRIEF = NO CASE_SENSE_NAMES = YES INLINE_INHERITED_MEMB = YES SHOW_FILES = NO SHOW_INCLUDE_FILES = NO GENERATE_LATEX = NO SEARCHENGINE = NO GENERATE_HTML = YES GENERATE_DOCSET = YES DOCSET_FEEDNAME = "$PROJECT.framework API Documentation" DOCSET_BUNDLE_ID = org.brautaset.$PROJECT EOF # Run doxygen on the updated config file. # doxygen creates a Makefile that does most of the heavy lifting. $DOXYGEN $DOXYFILE # make will invoke docsetutil. Take a look at the Makefile to see how this is done. make -C $DOCSET/html install # Construct a temporary applescript file to tell Xcode to load a docset. rm -f $TEMP_DIR/loadDocSet.scpt cat < $TEMP_DIR/loadDocSet.scpt tell application "Xcode" load documentation set with path "/Users/$USER/Library/Developer/Shared/Documentation/DocSets/org.brautaset.${PROJECT}.docset/" end tell EOF # Run the load-docset applescript command. osascript $TEMP_DIR/loadDocSet.scpt SOPE/sope-json/SBJson/Scripts/RefreshOnlineDocs.sh0000644000000000000000000000141312242733417020740 0ustar rootroot#!/bin/sh set -x DOCSET=$INSTALL_DIR/Docset/html VERSION=$(agvtool mvers -terse1 | perl -pe 's/(\d\.\d+)(\.\d+)*/$1/') apidir=$VERSION latest=api if ! test -f "$DOCSET/index.html" ; then echo "$dir does not contain index.html" exit 1 fi status=$(git status -s) if ! test -z $status ; then echo "Checkout has uncommitted changes" exit 1 fi tmp=$(basename $0) tmpdir=$(mktemp -d "/tmp/$tmp.XXXXXX") cp -R $DOCSET/ $tmpdir rm -rf $tmpdir/org.brautaset.JSON.docset rm -f $tmpdir/Makefile rm -f $tmpdir/*.xml rm -f $tmpdir/*.plist branch=$(git branch | awk '$1 == "*" { print $2 }' ) git checkout gh-pages rm -f $latest rm -rf $apidir mv $tmpdir $apidir ln -s $apidir $latest git add -A git commit -m "refresh api docs for v$VERSION" git checkout $branch SOPE/sope-json/SBJson/Tests/0000755000000000000000000000000012242733417014504 5ustar rootrootSOPE/sope-json/SBJson/Tests/ErrorTest.h0000644000000000000000000000305612242733417016612 0ustar rootroot/* Copyright (C) 2010 Stig Brautaset. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #import "AbstractTest.h" @interface ErrorTest : AbstractTest @end SOPE/sope-json/SBJson/Tests/WriterTest.h0000644000000000000000000000305012242733417016767 0ustar rootroot/* Copyright (C) 2010 Stig Brautaset. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #import "AbstractTest.h" @interface WriterTest : AbstractTest @end SOPE/sope-json/SBJson/Tests/ProxyTest.m0000644000000000000000000000572412242733417016653 0ustar rootroot/* Copyright (C) 2009-2010 Stig Brautaset. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #import "ProxyTest.h" #import @interface True : NSObject @end @implementation True - (id)proxyForJson { return [NSNumber numberWithBool:YES]; } @end @interface False : NSObject @end @implementation False - (id)proxyForJson { return [NSNumber numberWithBool:NO]; } @end @interface Bool : NSObject @end @implementation Bool - (id)proxyForJson { return [NSArray arrayWithObjects:[True new], [False new], nil]; } @end @implementation NSDate (Private) - (id)proxyForJson { return [NSArray arrayWithObject:[self description]]; } @end @implementation ProxyTest - (void)testUnsupportedWithoutProxy { STAssertNil([writer stringWithObject:[NSArray arrayWithObject:[NSObject new]]], nil); STAssertEquals([[writer.errorTrace objectAtIndex:0] code], (NSInteger)EUNSUPPORTED, nil); } - (void)testUnsupportedWithProxy { STAssertEqualObjects([writer stringWithObject:[NSArray arrayWithObject:[True new]]], @"[true]", nil); } - (void)testUnsupportedWithProxyWithoutWrapper { STAssertNil([writer stringWithObject:[True new]], nil); } - (void)testUnsupportedWithNestedProxy { STAssertEqualObjects([writer stringWithObject:[NSArray arrayWithObject:[Bool new]]], @"[[true,false]]", nil); } - (void)testUnsupportedWithProxyAsCategory { STAssertNotNil([writer stringWithObject:[NSArray arrayWithObject:[NSDate date]]], nil); } - (void)testUnsupportedWithProxyAsCategoryWithoutWrapper { STAssertNotNil([writer stringWithObject:[NSDate date]], nil); } @end SOPE/sope-json/SBJson/Tests/DataDrivenTest.m0000644000000000000000000001362512242733417017552 0ustar rootroot/* Copyright (C) 2007-2010 Stig Brautaset. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #import "DataDrivenTest.h" #import @implementation DataDrivenTest - (void)setUp { [super setUp]; writer.sortKeys = YES; prettyWriter = [SBJsonWriter new]; prettyWriter.humanReadable = YES; prettyWriter.sortKeys = YES; dir = @"Tests/Data"; files = [[NSFileManager defaultManager] enumeratorAtPath:dir]; } - (void)tearDown { [prettyWriter release]; [super tearDown]; } - (void)testTerse { NSString *file; while ((file = [files nextObject])) { if (![[file pathExtension] isEqualToString:@"json"]) continue; NSRange range = [file rangeOfString:@"fail"]; if (range.location != NSNotFound) continue; NSString *jsonPath = [dir stringByAppendingPathComponent:file]; NSString *jsonText = [NSString stringWithContentsOfFile:jsonPath encoding:NSUTF8StringEncoding error:nil]; STAssertNotNil(jsonText, @"Could not load %@", jsonPath); id parsed; STAssertNoThrow(parsed = [parser objectWithString:jsonText], jsonPath); STAssertNotNil(parsed, jsonPath); STAssertNil(parser.errorTrace, @"%@: %@", jsonPath, parser.errorTrace); NSString *written; STAssertNoThrow(written = [writer stringWithObject:parsed], jsonPath); STAssertNotNil(written, jsonPath); STAssertNil(writer.errorTrace, @"%@: %@", jsonPath, writer.errorTrace); NSString *tersePath = [jsonPath stringByAppendingPathExtension:@"terse"]; NSString *terseText = [NSString stringWithContentsOfFile:tersePath encoding:NSUTF8StringEncoding error:nil]; STAssertNotNil(terseText, @"Could not load %@", tersePath); // Chop off newline at end of string terseText = [terseText substringToIndex:[terseText length]-1]; STAssertEqualObjects(written, terseText, @"at %@", jsonPath); } } - (void)testPretty { NSString *file; while ((file = [files nextObject])) { if (![[file pathExtension] isEqualToString:@"json"]) continue; NSRange range = [file rangeOfString:@"fail"]; if (range.location != NSNotFound) continue; NSString *jsonPath = [dir stringByAppendingPathComponent:file]; NSString *jsonText = [NSString stringWithContentsOfFile:jsonPath encoding:NSUTF8StringEncoding error:nil]; STAssertNotNil(jsonText, @"Could not load %@", jsonPath); id parsed; STAssertNoThrow(parsed = [parser objectWithString:jsonText], jsonPath); STAssertNotNil(parsed, jsonPath); STAssertNil(parser.errorTrace, @"%@: %@", jsonPath, parser.errorTrace); NSString *written; STAssertNoThrow(written = [prettyWriter stringWithObject:parsed], jsonPath); STAssertNotNil(written, jsonPath); STAssertNil(prettyWriter.errorTrace, @"%@: %@", jsonPath, prettyWriter.errorTrace); NSString *tersePath = [jsonPath stringByAppendingPathExtension:@"pretty"]; NSString *terseText = [NSString stringWithContentsOfFile:tersePath encoding:NSUTF8StringEncoding error:nil]; STAssertNotNil(terseText, @"Could not load %@", tersePath); // Chop off newline at end of string terseText = [terseText substringToIndex:[terseText length]-1]; STAssertEqualObjects(written, terseText, @"at %@", jsonPath); } } - (void)testFail { parser.maxDepth = 19; NSString *file; while ((file = [files nextObject])) { if (![file hasPrefix:@"fail"]) continue; NSString *path = [dir stringByAppendingPathComponent:file]; NSString *json = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil]; STAssertNil([parser objectWithString:json], path); STAssertNotNil(parser.errorTrace, path); } } @end SOPE/sope-json/SBJson/Tests/AbstractTest.m0000644000000000000000000000332612242733417017271 0ustar rootroot/* Copyright (C) 2010 Stig Brautaset. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #import "AbstractTest.h" #import @implementation AbstractTest - (void)setUp { parser = [SBJsonParser new]; writer = [SBJsonWriter new]; } - (void)tearDown { [parser release]; [writer release]; } @end SOPE/sope-json/SBJson/Tests/MaxDepthTest.h0000644000000000000000000000306112242733417017227 0ustar rootroot/* Copyright (C) 2010 Stig Brautaset. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #import "AbstractTest.h" @interface MaxDepthTest : AbstractTest @end SOPE/sope-json/SBJson/Tests/AbstractTest.h0000644000000000000000000000324212242733417017261 0ustar rootroot/* Copyright (C) 2010 Stig Brautaset. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #import @class SBJsonParser; @class SBJsonWriter; @interface AbstractTest : SenTestCase { SBJsonParser * parser; SBJsonWriter * writer; } @end SOPE/sope-json/SBJson/Tests/ProxyTest.h0000644000000000000000000000305612242733417016642 0ustar rootroot/* Copyright (C) 2010 Stig Brautaset. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #import "AbstractTest.h" @interface ProxyTest : AbstractTest @end SOPE/sope-json/SBJson/Tests/WriterTest.m0000644000000000000000000000562412242733417017005 0ustar rootroot/* Copyright (C) 2010 Stig Brautaset. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #import "WriterTest.h" #import @implementation WriterTest - (void)testInfinity { STAssertEqualObjects(@"[0]", [writer stringWithObject:[NSArray arrayWithObject:[NSNumber numberWithDouble:0.0]]], nil); STAssertEqualObjects(@"[-0]", [writer stringWithObject:[NSArray arrayWithObject:[NSNumber numberWithDouble:-0.0]]], nil); STAssertEqualObjects(@"[0]", [writer stringWithObject:[NSArray arrayWithObject:[NSNumber numberWithFloat:0.0]]], nil); STAssertEqualObjects(@"[-0]", [writer stringWithObject:[NSArray arrayWithObject:[NSNumber numberWithFloat:-0.0]]], nil); STAssertEqualObjects(@"[0]", [writer stringWithObject:[NSArray arrayWithObject:[NSNumber numberWithInt:0]]], nil); STAssertEqualObjects(@"[0]", [writer stringWithObject:[NSArray arrayWithObject:[NSNumber numberWithInt:-0]]], nil); /** TODO: I cannot get these tests to pass for the libjsontests target. STAssertEqualObjects(@"[0]", [writer stringWithObject:[NSArray arrayWithObject:[NSDecimalNumber numberWithDouble:0]]], nil); STAssertEqualObjects(@"[0]", [writer stringWithObject:[NSArray arrayWithObject:[NSDecimalNumber numberWithDouble:-0]]], nil); STAssertEqualObjects(@"[0]", [writer stringWithObject:[NSArray arrayWithObject:[NSDecimalNumber numberWithFloat:0]]], nil); STAssertEqualObjects(@"[0]", [writer stringWithObject:[NSArray arrayWithObject:[NSDecimalNumber numberWithFloat:-0]]], nil); */ } @end SOPE/sope-json/SBJson/Tests/DataDrivenTest.h0000644000000000000000000000322112242733417017534 0ustar rootroot/* Copyright (C) 2007-2010 Stig Brautaset. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #import "AbstractTest.h" @interface DataDrivenTest : AbstractTest { SBJsonWriter *prettyWriter; NSString *dir; NSDirectoryEnumerator *files; } @end SOPE/sope-json/SBJson/Tests/ErrorTest.m0000644000000000000000000002477412242733417016631 0ustar rootroot/* Copyright (C) 2007-2010 Stig Brautaset. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #import "ErrorTest.h" #import #define assertErrorContains(e, s) \ STAssertTrue([[e localizedDescription] hasPrefix:s], @"%@", [e userInfo]) #define assertUnderlyingErrorContains(e, s) \ STAssertTrue([[[[e userInfo] objectForKey:NSUnderlyingErrorKey] localizedDescription] hasPrefix:s], @"%@", [e userInfo]) #define assertUnderlyingErrorContains2(e, s) \ STAssertTrue([[[[[[e userInfo] objectForKey:NSUnderlyingErrorKey] userInfo] objectForKey:NSUnderlyingErrorKey] localizedDescription] hasPrefix:s], @"%@", [e userInfo]) @implementation ErrorTest #pragma mark Generator - (void)testUnsupportedObject { NSError *error = nil; STAssertNil([writer stringWithObject:[NSData data] error:&error], nil); STAssertNotNil(error, nil); } - (void)testNonStringDictionaryKey { NSArray *keys = [NSArray arrayWithObjects:[NSNull null], [NSNumber numberWithInt:1], [NSArray array], [NSDictionary dictionary], nil]; for (int i = 0; i < [keys count]; i++) { NSError *error = nil; NSDictionary *object = [NSDictionary dictionaryWithObject:@"1" forKey:[keys objectAtIndex:i]]; STAssertNil([writer stringWithObject:object error:&error], nil); STAssertNotNil(error, nil); } } - (void)testScalar { NSArray *fragments = [NSArray arrayWithObjects:@"foo", @"", [NSNull null], [NSNumber numberWithInt:1], [NSNumber numberWithBool:YES], nil]; for (int i = 0; i < [fragments count]; i++) { NSString *fragment = [fragments objectAtIndex:i]; // We don't check the convenience category here, like we do for parsing, // because the category is explicitly on the NSArray and NSDictionary objects. // STAssertNil([fragment JSONRepresentation], nil); NSError *error = nil; STAssertNil([writer stringWithObject:fragment error:&error], @"%@", fragment); assertErrorContains(error, @"Not valid type for JSON"); } } - (void)testInfinity { NSArray *obj = [NSArray arrayWithObject:[NSNumber numberWithDouble:INFINITY]]; NSError *error = nil; STAssertNil([writer stringWithObject:obj error:&error], nil); assertUnderlyingErrorContains(error, @"Infinity is not a valid number in JSON"); } - (void)testNegativeInfinity { NSArray *obj = [NSArray arrayWithObject:[NSNumber numberWithDouble:-INFINITY]]; NSError *error = nil; STAssertNil([writer stringWithObject:obj error:&error], nil); assertUnderlyingErrorContains(error, @"Infinity is not a valid number in JSON"); } - (void)testNaN { NSArray *obj = [NSArray arrayWithObject:[NSDecimalNumber notANumber]]; NSError *error = nil; STAssertNil([writer stringWithObject:obj error:&error], nil); assertUnderlyingErrorContains(error, @"NaN is not a valid number in JSON"); } #pragma mark Scanner - (void)testArray { NSError *error; STAssertNil([parser objectWithString:@"[1,,2]" error:&error], nil); assertErrorContains(error, @"Expected value"); STAssertNil([parser objectWithString:@"[1,,]" error:&error], nil); assertErrorContains(error, @"Expected value"); STAssertNil([parser objectWithString:@"[,1]" error:&error], nil); assertErrorContains(error, @"Expected value"); STAssertNil([parser objectWithString:@"[1,]" error:&error], nil); assertErrorContains(error, @"Trailing comma disallowed"); STAssertNil([parser objectWithString:@"[1" error:&error], nil); assertErrorContains(error, @"End of input while parsing array"); STAssertNil([parser objectWithString:@"[[]" error:&error], nil); assertErrorContains(error, @"End of input while parsing array"); // See if seemingly-valid arrays have nasty elements STAssertNil([parser objectWithString:@"[+1]" error:&error], nil); assertErrorContains(error, @"Expected value"); assertUnderlyingErrorContains(error, @"Leading + disallowed"); } - (void)testObject { NSError *error; STAssertNil([parser objectWithString:@"{1" error:&error], nil); assertErrorContains(error, @"Object key string expected"); STAssertNil([parser objectWithString:@"{null" error:&error], nil); assertErrorContains(error, @"Object key string expected"); STAssertNil([parser objectWithString:@"{\"a\":1,,}" error:&error], nil); assertErrorContains(error, @"Object key string expected"); STAssertNil([parser objectWithString:@"{,\"a\":1}" error:&error], nil); assertErrorContains(error, @"Object key string expected"); STAssertNil([parser objectWithString:@"{\"a\"" error:&error], nil); assertErrorContains(error, @"Expected ':'"); STAssertNil([parser objectWithString:@"{\"a\":" error:&error], nil); assertErrorContains(error, @"Object value expected"); STAssertNil([parser objectWithString:@"{\"a\":," error:&error], nil); assertErrorContains(error, @"Object value expected"); STAssertNil([parser objectWithString:@"{\"a\":1,}" error:&error], nil); assertErrorContains(error, @"Trailing comma disallowed"); STAssertNil([parser objectWithString:@"{" error:&error], nil); assertErrorContains(error, @"End of input while parsing object"); STAssertNil([parser objectWithString:@"{\"a\":{}" error:&error], nil); assertErrorContains(error, @"End of input while parsing object"); } - (void)testNumber { NSError *error; STAssertNil([parser objectWithString:@"[-" error:&error], nil); assertUnderlyingErrorContains(error, @"No digits after initial minus"); STAssertNil([parser objectWithString:@"[+1" error:&error], nil); assertUnderlyingErrorContains(error, @"Leading + disallowed in number"); STAssertNil([parser objectWithString:@"[01" error:&error], nil); assertUnderlyingErrorContains(error, @"Leading 0 disallowed in number"); STAssertNil([parser objectWithString:@"[0." error:&error], nil); assertUnderlyingErrorContains(error, @"No digits after decimal point"); STAssertNil([parser objectWithString:@"[1e" error:&error], nil); assertUnderlyingErrorContains(error, @"No digits after exponent"); STAssertNil([parser objectWithString:@"[1e-" error:&error], nil); assertUnderlyingErrorContains(error, @"No digits after exponent"); STAssertNil([parser objectWithString:@"[1e+" error:&error], nil); assertUnderlyingErrorContains(error, @"No digits after exponent"); } - (void)testNull { NSError *error; STAssertNil([parser objectWithString:@"[nil" error:&error], nil); assertUnderlyingErrorContains(error, @"Expected 'null'"); } - (void)testBool { NSError *error; STAssertNil([parser objectWithString:@"[truth" error:&error], nil); assertUnderlyingErrorContains(error, @"Expected 'true'"); STAssertNil([parser objectWithString:@"[fake" error:&error], nil); assertUnderlyingErrorContains(error, @"Expected 'false'"); } - (void)testString { NSError *error; STAssertNil([parser objectWithString:@"" error:&error], nil); assertErrorContains(error, @"Unexpected end of string"); STAssertNil([parser objectWithString:@"" error:&error], nil); assertErrorContains(error, @"Unexpected end of string"); STAssertNil([parser objectWithString:@"[\"" error:&error], nil); assertUnderlyingErrorContains(error, @"Unescaped control character"); STAssertNil([parser objectWithString:@"[\"foo" error:&error], nil); assertUnderlyingErrorContains(error, @"Unescaped control character"); STAssertNil([parser objectWithString:@"[\"\\uD834foo\"" error:&error], nil); assertUnderlyingErrorContains(error, @"Broken unicode character"); assertUnderlyingErrorContains2(error, @"Missing low character"); STAssertNil([parser objectWithString:@"[\"\\uD834\\u001E\"" error:&error], nil); assertUnderlyingErrorContains(error, @"Broken unicode character"); assertUnderlyingErrorContains2(error, @"Invalid low surrogate"); STAssertNil([parser objectWithString:@"[\"\\uDD1Ef\"" error:&error], nil); assertUnderlyingErrorContains(error, @"Broken unicode character"); assertUnderlyingErrorContains2(error, @"Invalid high character"); for (NSUInteger i = 0; i < 0x20; i++) { NSString *str = [NSString stringWithFormat:@"\"[%C\"", i]; STAssertNil([parser objectWithString:str error:&error], nil); assertErrorContains(error, @"Unescaped control character"); } } - (void)testObjectGarbage { NSError *error; STAssertNil([parser objectWithString:@"['1'" error:&error], nil); assertUnderlyingErrorContains(error, @"Unrecognised leading character"); STAssertNil([parser objectWithString:@"['hello'" error:&error], nil); assertUnderlyingErrorContains(error, @"Unrecognised leading character"); STAssertNil([parser objectWithString:@"[**" error:&error], nil); assertUnderlyingErrorContains(error, @"Unrecognised leading character"); STAssertNil([parser objectWithString:nil error:&error], nil); assertErrorContains(error, @"Input was 'nil'"); } @end SOPE/sope-json/SBJson/Tests/Data/0000755000000000000000000000000012242733417015355 5ustar rootrootSOPE/sope-json/SBJson/Tests/Data/string-ctrl.json0000644000000000000000000000054512242733417020524 0ustar rootroot[ "\b", "\t", "\n", "\f", "\r", "\u0000", "\u0001", "\u0002", "\u0003", "\u0004", "\u0005", "\u0006", "\u0007", "\u0008", "\u0009", "\u000a", "\u000b", "\u000c", "\u000d", "\u000e", "\u000f", "\u0010", "\u0011", "\u0012", "\u0013", "\u0014", "\u0015", "\u0016", "\u0017", "\u0018", "\u0019", "\u001a", "\u001b", "\u001c", "\u001d", "\u001e", "\u001f", " " ]SOPE/sope-json/SBJson/Tests/Data/null.json.pretty0000644000000000000000000000002312242733417020543 0ustar rootroot[ null, null ] SOPE/sope-json/SBJson/Tests/Data/string-ctrl.json.terse0000644000000000000000000000045312242733417021643 0ustar rootroot["\b","\t","\n","\f","\r","\u0000","\u0001","\u0002","\u0003","\u0004","\u0005","\u0006","\u0007","\b","\t","\n","\u000b","\f","\r","\u000e","\u000f","\u0010","\u0011","\u0012","\u0013","\u0014","\u0015","\u0016","\u0017","\u0018","\u0019","\u001a","\u001b","\u001c","\u001d","\u001e","\u001f"," "] SOPE/sope-json/SBJson/Tests/Data/array.json.pretty0000644000000000000000000000022412242733417020712 0ustar rootroot[ [], [ "foo" ], [ "foo", [ "bar" ] ], [ "foo", [ "bar", [ "quux" ] ] ] ] SOPE/sope-json/SBJson/Tests/Data/string-ctrl.json.pretty0000644000000000000000000000063612242733417022053 0ustar rootroot[ "\b", "\t", "\n", "\f", "\r", "\u0000", "\u0001", "\u0002", "\u0003", "\u0004", "\u0005", "\u0006", "\u0007", "\b", "\t", "\n", "\u000b", "\f", "\r", "\u000e", "\u000f", "\u0010", "\u0011", "\u0012", "\u0013", "\u0014", "\u0015", "\u0016", "\u0017", "\u0018", "\u0019", "\u001a", "\u001b", "\u001c", "\u001d", "\u001e", "\u001f", " " ] SOPE/sope-json/SBJson/Tests/Data/string-unicode.json.pretty0000644000000000000000000000031412242733417022526 0ustar rootroot{ "42é42≥42" : "e-acute and greater-than-or-equal-to, and 42", "é" : "e-acute with upper-case hex", "é≥" : "e-acute and greater-than-or-equal-to", "턞" : "G-clef (UTF16 surrogate pair)" } SOPE/sope-json/SBJson/Tests/Data/json.org/0000755000000000000000000000000012242733417017114 5ustar rootrootSOPE/sope-json/SBJson/Tests/Data/json.org/README0000644000000000000000000000004412242733417017772 0ustar rootrootSource: http://json.org/example.htmlSOPE/sope-json/SBJson/Tests/Data/json.org/4.json.terse0000644000000000000000000000522712242733417021301 0ustar rootroot{"web-app":{"servlet":[{"init-param":{"cachePackageTagsRefresh":60,"cachePackageTagsStore":200,"cachePackageTagsTrack":200,"cachePagesDirtyRead":10,"cachePagesRefresh":10,"cachePagesStore":100,"cachePagesTrack":200,"cacheTemplatesRefresh":15,"cacheTemplatesStore":50,"cacheTemplatesTrack":100,"configGlossary:adminEmail":"ksm@pobox.com","configGlossary:installationAt":"Philadelphia, PA","configGlossary:poweredBy":"Cofax","configGlossary:poweredByIcon":"/images/cofax.gif","configGlossary:staticPath":"/content/static","dataStoreClass":"org.cofax.SqlDataStore","dataStoreConnUsageLimit":100,"dataStoreDriver":"com.microsoft.jdbc.sqlserver.SQLServerDriver","dataStoreInitConns":10,"dataStoreLogFile":"/usr/local/tomcat/logs/datastore.log","dataStoreLogLevel":"debug","dataStoreMaxConns":100,"dataStoreName":"cofax","dataStorePassword":"dataStoreTestQuery","dataStoreTestQuery":"SET NOCOUNT ON;select test='test';","dataStoreUrl":"jdbc:microsoft:sqlserver://LOCALHOST:1433;DatabaseName=goon","dataStoreUser":"sa","defaultFileTemplate":"articleTemplate.htm","defaultListTemplate":"listTemplate.htm","jspFileTemplate":"articleTemplate.jsp","jspListTemplate":"listTemplate.jsp","maxUrlLength":500,"redirectionClass":"org.cofax.SqlRedirection","searchEngineFileTemplate":"forSearchEngines.htm","searchEngineListTemplate":"forSearchEnginesList.htm","searchEngineRobotsDb":"WEB-INF/robots.db","templateLoaderClass":"org.cofax.FilesTemplateLoader","templateOverridePath":"","templatePath":"templates","templateProcessorClass":"org.cofax.WysiwygTemplate","useDataStore":true,"useJSP":false},"servlet-class":"org.cofax.cds.CDSServlet","servlet-name":"cofaxCDS"},{"init-param":{"mailHost":"mail1","mailHostOverride":"mail2"},"servlet-class":"org.cofax.cds.EmailServlet","servlet-name":"cofaxEmail"},{"servlet-class":"org.cofax.cds.AdminServlet","servlet-name":"cofaxAdmin"},{"servlet-class":"org.cofax.cds.FileServlet","servlet-name":"fileServlet"},{"init-param":{"adminGroupID":4,"betaServer":true,"dataLog":1,"dataLogLocation":"/usr/local/tomcat/logs/dataLog.log","dataLogMaxSize":"","fileTransferFolder":"/usr/local/tomcat/webapps/content/fileTransferFolder","log":1,"logLocation":"/usr/local/tomcat/logs/CofaxTools.log","logMaxSize":"","lookInContext":1,"removePageCache":"/content/admin/remove?cache=pages&id=","removeTemplateCache":"/content/admin/remove?cache=templates&id=","templatePath":"toolstemplates/"},"servlet-class":"org.cofax.cms.CofaxToolsServlet","servlet-name":"cofaxTools"}],"servlet-mapping":{"cofaxAdmin":"/admin/*","cofaxCDS":"/","cofaxEmail":"/cofaxutil/aemail/*","cofaxTools":"/tools/*","fileServlet":"/static/*"},"taglib":{"taglib-location":"/WEB-INF/tlds/cofax.tld","taglib-uri":"cofax.tld"}}} SOPE/sope-json/SBJson/Tests/Data/json.org/3.json0000644000000000000000000000113612242733417020152 0ustar rootroot{"widget": { "debug": "on", "window": { "title": "Sample Konfabulator Widget", "name": "main_window", "width": 500, "height": 500 }, "image": { "src": "Images/Sun.png", "name": "sun1", "hOffset": 250, "vOffset": 250, "alignment": "center" }, "text": { "data": "Click Here", "size": 36, "style": "bold", "name": "text1", "hOffset": 250, "vOffset": 100, "alignment": "center", "onMouseUp": "sun1.opacity = (sun1.opacity / 100) * 90;" } }} SOPE/sope-json/SBJson/Tests/Data/json.org/2.json.pretty0000644000000000000000000000055712242733417021505 0ustar rootroot{ "menu" : { "id" : "file", "popup" : { "menuitem" : [ { "onclick" : "CreateNewDoc()", "value" : "New" }, { "onclick" : "OpenDoc()", "value" : "Open" }, { "onclick" : "CloseDoc()", "value" : "Close" } ] }, "value" : "File" } } SOPE/sope-json/SBJson/Tests/Data/json.org/1.json0000644000000000000000000000130212242733417020143 0ustar rootroot{ "glossary": { "title": "example glossary", "GlossDiv": { "title": "S", "GlossList": { "GlossEntry": { "ID": "SGML", "SortAs": "SGML", "GlossTerm": "Standard Generalized Markup Language", "Acronym": "SGML", "Abbrev": "ISO 8879:1986", "GlossDef": { "para": "A meta-markup language, used to create markup languages such as DocBook.", "GlossSeeAlso": ["GML", "XML"] }, "GlossSee": "markup" } } } } } SOPE/sope-json/SBJson/Tests/Data/json.org/4.json.pretty0000644000000000000000000000733012242733417021503 0ustar rootroot{ "web-app" : { "servlet" : [ { "init-param" : { "cachePackageTagsRefresh" : 60, "cachePackageTagsStore" : 200, "cachePackageTagsTrack" : 200, "cachePagesDirtyRead" : 10, "cachePagesRefresh" : 10, "cachePagesStore" : 100, "cachePagesTrack" : 200, "cacheTemplatesRefresh" : 15, "cacheTemplatesStore" : 50, "cacheTemplatesTrack" : 100, "configGlossary:adminEmail" : "ksm@pobox.com", "configGlossary:installationAt" : "Philadelphia, PA", "configGlossary:poweredBy" : "Cofax", "configGlossary:poweredByIcon" : "/images/cofax.gif", "configGlossary:staticPath" : "/content/static", "dataStoreClass" : "org.cofax.SqlDataStore", "dataStoreConnUsageLimit" : 100, "dataStoreDriver" : "com.microsoft.jdbc.sqlserver.SQLServerDriver", "dataStoreInitConns" : 10, "dataStoreLogFile" : "/usr/local/tomcat/logs/datastore.log", "dataStoreLogLevel" : "debug", "dataStoreMaxConns" : 100, "dataStoreName" : "cofax", "dataStorePassword" : "dataStoreTestQuery", "dataStoreTestQuery" : "SET NOCOUNT ON;select test='test';", "dataStoreUrl" : "jdbc:microsoft:sqlserver://LOCALHOST:1433;DatabaseName=goon", "dataStoreUser" : "sa", "defaultFileTemplate" : "articleTemplate.htm", "defaultListTemplate" : "listTemplate.htm", "jspFileTemplate" : "articleTemplate.jsp", "jspListTemplate" : "listTemplate.jsp", "maxUrlLength" : 500, "redirectionClass" : "org.cofax.SqlRedirection", "searchEngineFileTemplate" : "forSearchEngines.htm", "searchEngineListTemplate" : "forSearchEnginesList.htm", "searchEngineRobotsDb" : "WEB-INF/robots.db", "templateLoaderClass" : "org.cofax.FilesTemplateLoader", "templateOverridePath" : "", "templatePath" : "templates", "templateProcessorClass" : "org.cofax.WysiwygTemplate", "useDataStore" : true, "useJSP" : false }, "servlet-class" : "org.cofax.cds.CDSServlet", "servlet-name" : "cofaxCDS" }, { "init-param" : { "mailHost" : "mail1", "mailHostOverride" : "mail2" }, "servlet-class" : "org.cofax.cds.EmailServlet", "servlet-name" : "cofaxEmail" }, { "servlet-class" : "org.cofax.cds.AdminServlet", "servlet-name" : "cofaxAdmin" }, { "servlet-class" : "org.cofax.cds.FileServlet", "servlet-name" : "fileServlet" }, { "init-param" : { "adminGroupID" : 4, "betaServer" : true, "dataLog" : 1, "dataLogLocation" : "/usr/local/tomcat/logs/dataLog.log", "dataLogMaxSize" : "", "fileTransferFolder" : "/usr/local/tomcat/webapps/content/fileTransferFolder", "log" : 1, "logLocation" : "/usr/local/tomcat/logs/CofaxTools.log", "logMaxSize" : "", "lookInContext" : 1, "removePageCache" : "/content/admin/remove?cache=pages&id=", "removeTemplateCache" : "/content/admin/remove?cache=templates&id=", "templatePath" : "toolstemplates/" }, "servlet-class" : "org.cofax.cms.CofaxToolsServlet", "servlet-name" : "cofaxTools" } ], "servlet-mapping" : { "cofaxAdmin" : "/admin/*", "cofaxCDS" : "/", "cofaxEmail" : "/cofaxutil/aemail/*", "cofaxTools" : "/tools/*", "fileServlet" : "/static/*" }, "taglib" : { "taglib-location" : "/WEB-INF/tlds/cofax.tld", "taglib-uri" : "cofax.tld" } } } SOPE/sope-json/SBJson/Tests/Data/json.org/4.json0000644000000000000000000000661312242733417020160 0ustar rootroot{"web-app": { "servlet": [ { "servlet-name": "cofaxCDS", "servlet-class": "org.cofax.cds.CDSServlet", "init-param": { "configGlossary:installationAt": "Philadelphia, PA", "configGlossary:adminEmail": "ksm@pobox.com", "configGlossary:poweredBy": "Cofax", "configGlossary:poweredByIcon": "/images/cofax.gif", "configGlossary:staticPath": "/content/static", "templateProcessorClass": "org.cofax.WysiwygTemplate", "templateLoaderClass": "org.cofax.FilesTemplateLoader", "templatePath": "templates", "templateOverridePath": "", "defaultListTemplate": "listTemplate.htm", "defaultFileTemplate": "articleTemplate.htm", "useJSP": false, "jspListTemplate": "listTemplate.jsp", "jspFileTemplate": "articleTemplate.jsp", "cachePackageTagsTrack": 200, "cachePackageTagsStore": 200, "cachePackageTagsRefresh": 60, "cacheTemplatesTrack": 100, "cacheTemplatesStore": 50, "cacheTemplatesRefresh": 15, "cachePagesTrack": 200, "cachePagesStore": 100, "cachePagesRefresh": 10, "cachePagesDirtyRead": 10, "searchEngineListTemplate": "forSearchEnginesList.htm", "searchEngineFileTemplate": "forSearchEngines.htm", "searchEngineRobotsDb": "WEB-INF/robots.db", "useDataStore": true, "dataStoreClass": "org.cofax.SqlDataStore", "redirectionClass": "org.cofax.SqlRedirection", "dataStoreName": "cofax", "dataStoreDriver": "com.microsoft.jdbc.sqlserver.SQLServerDriver", "dataStoreUrl": "jdbc:microsoft:sqlserver://LOCALHOST:1433;DatabaseName=goon", "dataStoreUser": "sa", "dataStorePassword": "dataStoreTestQuery", "dataStoreTestQuery": "SET NOCOUNT ON;select test='test';", "dataStoreLogFile": "/usr/local/tomcat/logs/datastore.log", "dataStoreInitConns": 10, "dataStoreMaxConns": 100, "dataStoreConnUsageLimit": 100, "dataStoreLogLevel": "debug", "maxUrlLength": 500}}, { "servlet-name": "cofaxEmail", "servlet-class": "org.cofax.cds.EmailServlet", "init-param": { "mailHost": "mail1", "mailHostOverride": "mail2"}}, { "servlet-name": "cofaxAdmin", "servlet-class": "org.cofax.cds.AdminServlet"}, { "servlet-name": "fileServlet", "servlet-class": "org.cofax.cds.FileServlet"}, { "servlet-name": "cofaxTools", "servlet-class": "org.cofax.cms.CofaxToolsServlet", "init-param": { "templatePath": "toolstemplates/", "log": 1, "logLocation": "/usr/local/tomcat/logs/CofaxTools.log", "logMaxSize": "", "dataLog": 1, "dataLogLocation": "/usr/local/tomcat/logs/dataLog.log", "dataLogMaxSize": "", "removePageCache": "/content/admin/remove?cache=pages&id=", "removeTemplateCache": "/content/admin/remove?cache=templates&id=", "fileTransferFolder": "/usr/local/tomcat/webapps/content/fileTransferFolder", "lookInContext": 1, "adminGroupID": 4, "betaServer": true}}], "servlet-mapping": { "cofaxCDS": "/", "cofaxEmail": "/cofaxutil/aemail/*", "cofaxAdmin": "/admin/*", "fileServlet": "/static/*", "cofaxTools": "/tools/*"}, "taglib": { "taglib-uri": "cofax.tld", "taglib-location": "/WEB-INF/tlds/cofax.tld"}}}SOPE/sope-json/SBJson/Tests/Data/json.org/1.json.pretty0000644000000000000000000000114112242733417021472 0ustar rootroot{ "glossary" : { "GlossDiv" : { "GlossList" : { "GlossEntry" : { "Abbrev" : "ISO 8879:1986", "Acronym" : "SGML", "GlossDef" : { "GlossSeeAlso" : [ "GML", "XML" ], "para" : "A meta-markup language, used to create markup languages such as DocBook." }, "GlossSee" : "markup", "GlossTerm" : "Standard Generalized Markup Language", "ID" : "SGML", "SortAs" : "SGML" } }, "title" : "S" }, "title" : "example glossary" } } SOPE/sope-json/SBJson/Tests/Data/json.org/3.json.terse0000644000000000000000000000060612242733417021274 0ustar rootroot{"widget":{"debug":"on","image":{"alignment":"center","hOffset":250,"name":"sun1","src":"Images/Sun.png","vOffset":250},"text":{"alignment":"center","data":"Click Here","hOffset":250,"name":"text1","onMouseUp":"sun1.opacity = (sun1.opacity / 100) * 90;","size":36,"style":"bold","vOffset":100},"window":{"height":500,"name":"main_window","title":"Sample Konfabulator Widget","width":500}}} SOPE/sope-json/SBJson/Tests/Data/json.org/5.json.terse0000644000000000000000000000114612242733417021276 0ustar rootroot{"menu":{"header":"SVG Viewer","items":[{"id":"Open"},{"id":"OpenNew","label":"Open New"},null,{"id":"ZoomIn","label":"Zoom In"},{"id":"ZoomOut","label":"Zoom Out"},{"id":"OriginalView","label":"Original View"},null,{"id":"Quality"},{"id":"Pause"},{"id":"Mute"},null,{"id":"Find","label":"Find..."},{"id":"FindAgain","label":"Find Again"},{"id":"Copy"},{"id":"CopyAgain","label":"Copy Again"},{"id":"CopySVG","label":"Copy SVG"},{"id":"ViewSVG","label":"View SVG"},{"id":"ViewSource","label":"View Source"},{"id":"SaveAs","label":"Save As"},null,{"id":"Help"},{"id":"About","label":"About Adobe CVG Viewer..."}]}} SOPE/sope-json/SBJson/Tests/Data/json.org/5.json0000644000000000000000000000155112242733417020155 0ustar rootroot{"menu": { "header": "SVG Viewer", "items": [ {"id": "Open"}, {"id": "OpenNew", "label": "Open New"}, null, {"id": "ZoomIn", "label": "Zoom In"}, {"id": "ZoomOut", "label": "Zoom Out"}, {"id": "OriginalView", "label": "Original View"}, null, {"id": "Quality"}, {"id": "Pause"}, {"id": "Mute"}, null, {"id": "Find", "label": "Find..."}, {"id": "FindAgain", "label": "Find Again"}, {"id": "Copy"}, {"id": "CopyAgain", "label": "Copy Again"}, {"id": "CopySVG", "label": "Copy SVG"}, {"id": "ViewSVG", "label": "View SVG"}, {"id": "ViewSource", "label": "View Source"}, {"id": "SaveAs", "label": "Save As"}, null, {"id": "Help"}, {"id": "About", "label": "About Adobe CVG Viewer..."} ] }} SOPE/sope-json/SBJson/Tests/Data/json.org/2.json0000644000000000000000000000036212242733417020151 0ustar rootroot{"menu": { "id": "file", "value": "File", "popup": { "menuitem": [ {"value": "New", "onclick": "CreateNewDoc()"}, {"value": "Open", "onclick": "OpenDoc()"}, {"value": "Close", "onclick": "CloseDoc()"} ] } }} SOPE/sope-json/SBJson/Tests/Data/json.org/2.json.terse0000644000000000000000000000027012242733417021270 0ustar rootroot{"menu":{"id":"file","popup":{"menuitem":[{"onclick":"CreateNewDoc()","value":"New"},{"onclick":"OpenDoc()","value":"Open"},{"onclick":"CloseDoc()","value":"Close"}]},"value":"File"}} SOPE/sope-json/SBJson/Tests/Data/json.org/3.json.pretty0000644000000000000000000000112312242733417021474 0ustar rootroot{ "widget" : { "debug" : "on", "image" : { "alignment" : "center", "hOffset" : 250, "name" : "sun1", "src" : "Images/Sun.png", "vOffset" : 250 }, "text" : { "alignment" : "center", "data" : "Click Here", "hOffset" : 250, "name" : "text1", "onMouseUp" : "sun1.opacity = (sun1.opacity / 100) * 90;", "size" : 36, "style" : "bold", "vOffset" : 100 }, "window" : { "height" : 500, "name" : "main_window", "title" : "Sample Konfabulator Widget", "width" : 500 } } } SOPE/sope-json/SBJson/Tests/Data/json.org/1.json.terse0000644000000000000000000000055112242733417021271 0ustar rootroot{"glossary":{"GlossDiv":{"GlossList":{"GlossEntry":{"Abbrev":"ISO 8879:1986","Acronym":"SGML","GlossDef":{"GlossSeeAlso":["GML","XML"],"para":"A meta-markup language, used to create markup languages such as DocBook."},"GlossSee":"markup","GlossTerm":"Standard Generalized Markup Language","ID":"SGML","SortAs":"SGML"}},"title":"S"},"title":"example glossary"}} SOPE/sope-json/SBJson/Tests/Data/json.org/5.json.pretty0000644000000000000000000000234412242733417021504 0ustar rootroot{ "menu" : { "header" : "SVG Viewer", "items" : [ { "id" : "Open" }, { "id" : "OpenNew", "label" : "Open New" }, null, { "id" : "ZoomIn", "label" : "Zoom In" }, { "id" : "ZoomOut", "label" : "Zoom Out" }, { "id" : "OriginalView", "label" : "Original View" }, null, { "id" : "Quality" }, { "id" : "Pause" }, { "id" : "Mute" }, null, { "id" : "Find", "label" : "Find..." }, { "id" : "FindAgain", "label" : "Find Again" }, { "id" : "Copy" }, { "id" : "CopyAgain", "label" : "Copy Again" }, { "id" : "CopySVG", "label" : "Copy SVG" }, { "id" : "ViewSVG", "label" : "View SVG" }, { "id" : "ViewSource", "label" : "View Source" }, { "id" : "SaveAs", "label" : "Save As" }, null, { "id" : "Help" }, { "id" : "About", "label" : "About Adobe CVG Viewer..." } ] } } SOPE/sope-json/SBJson/Tests/Data/number.json.pretty0000644000000000000000000000023212242733417021063 0ustar rootroot[ -333, -333000, -4, -5, -9999, 0.0001, 0, 10000, 1, 2.5, 4, 50, 66.6, 98877665544332211009988776655443322110, 99.99, 5 ] SOPE/sope-json/SBJson/Tests/Data/string.json.terse0000644000000000000000000000030712242733417020677 0ustar rootroot[""," spaces ","/","\\ \" \\ \"","foo\"","foo\"\"","foo\"\"bar","foo\"bar","foo\\","foo\\\\bar","foo\\bar","foobar","with internal spaces","/unescaped/slashes","/escaped/slashes","\\/test\\/path"] SOPE/sope-json/SBJson/Tests/Data/string-unicode.json.terse0000644000000000000000000000026712242733417022330 0ustar rootroot{"42é42≥42":"e-acute and greater-than-or-equal-to, and 42","é":"e-acute with upper-case hex","é≥":"e-acute and greater-than-or-equal-to","턞":"G-clef (UTF16 surrogate pair)"} SOPE/sope-json/SBJson/Tests/Data/format.json0000644000000000000000000000006712242733417017543 0ustar rootroot["one",2,{"foo":null,"quux":true,"bar":[1, 2, []]},{}] SOPE/sope-json/SBJson/Tests/Data/rfc4627/0000755000000000000000000000000012242733417016452 5ustar rootrootSOPE/sope-json/SBJson/Tests/Data/rfc4627/README0000644000000000000000000000006712242733417017335 0ustar rootrootSource: http://www.ietf.org/rfc/rfc4627.txt?number=4627SOPE/sope-json/SBJson/Tests/Data/rfc4627/b.json.terse0000644000000000000000000000042712242733417020712 0ustar rootroot[{"Address":"","City":"SAN FRANCISCO","Country":"US","Latitude":37.7668,"Longitude":-122.3959,"State":"CA","Zip":"94107","precision":"zip"},{"Address":"","City":"SUNNYVALE","Country":"US","Latitude":37.371991,"Longitude":-122.02602,"State":"CA","Zip":"94085","precision":"zip"}] SOPE/sope-json/SBJson/Tests/Data/rfc4627/b.json0000644000000000000000000000102312242733417017562 0ustar rootroot [ { "precision": "zip", "Latitude": 37.7668, "Longitude": -122.3959, "Address": "", "City": "SAN FRANCISCO", "State": "CA", "Zip": "94107", "Country": "US" }, { "precision": "zip", "Latitude": 37.371991, "Longitude": -122.026020, "Address": "", "City": "SUNNYVALE", "State": "CA", "Zip": "94085", "Country": "US" } ] SOPE/sope-json/SBJson/Tests/Data/rfc4627/a.json.pretty0000644000000000000000000000044312242733417021114 0ustar rootroot{ "Image" : { "Height" : 600, "IDs" : [ 116, 943, 234, 38793 ], "Thumbnail" : { "Height" : 125, "Url" : "http://www.example.com/image/481989943", "Width" : "100" }, "Title" : "View from 15th Floor", "Width" : 800 } } SOPE/sope-json/SBJson/Tests/Data/rfc4627/a.json0000644000000000000000000000051512242733417017566 0ustar rootroot { "Image": { "Width": 800, "Height": 600, "Title": "View from 15th Floor", "Thumbnail": { "Url": "http://www.example.com/image/481989943", "Height": 125, "Width": "100" }, "IDs": [116, 943, 234, 38793] } }SOPE/sope-json/SBJson/Tests/Data/rfc4627/a.json.terse0000644000000000000000000000026612242733417020712 0ustar rootroot{"Image":{"Height":600,"IDs":[116,943,234,38793],"Thumbnail":{"Height":125,"Url":"http://www.example.com/image/481989943","Width":"100"},"Title":"View from 15th Floor","Width":800}} SOPE/sope-json/SBJson/Tests/Data/rfc4627/b.json.pretty0000644000000000000000000000062412242733417021116 0ustar rootroot[ { "Address" : "", "City" : "SAN FRANCISCO", "Country" : "US", "Latitude" : 37.7668, "Longitude" : -122.3959, "State" : "CA", "Zip" : "94107", "precision" : "zip" }, { "Address" : "", "City" : "SUNNYVALE", "Country" : "US", "Latitude" : 37.371991, "Longitude" : -122.02602, "State" : "CA", "Zip" : "94085", "precision" : "zip" } ] SOPE/sope-json/SBJson/Tests/Data/array.json.terse0000644000000000000000000000006612242733417020511 0ustar rootroot[[],["foo"],["foo",["bar"]],["foo",["bar",["quux"]]]] SOPE/sope-json/SBJson/Tests/Data/string.json.pretty0000644000000000000000000000037012242733417021104 0ustar rootroot[ "", " spaces ", "/", "\\ \" \\ \"", "foo\"", "foo\"\"", "foo\"\"bar", "foo\"bar", "foo\\", "foo\\\\bar", "foo\\bar", "foobar", "with internal spaces", "/unescaped/slashes", "/escaped/slashes", "\\/test\\/path" ] SOPE/sope-json/SBJson/Tests/Data/bool.json0000644000000000000000000000001412242733417017176 0ustar rootroot[true,false]SOPE/sope-json/SBJson/Tests/Data/string.json0000644000000000000000000000033212242733417017554 0ustar rootroot[ "", " spaces ", "/", "\\ \" \\ \"", "foo\"", "foo\"\"", "foo\"\"bar", "foo\"bar", "foo\\", "foo\\\\bar", "foo\\bar", "foobar", "with internal spaces", "/unescaped/slashes", "\/escaped\/slashes", "\\/test\\/path" ] SOPE/sope-json/SBJson/Tests/Data/array.json0000644000000000000000000000007212242733417017365 0ustar rootroot[ [], ["foo"], ["foo",["bar"]], ["foo",["bar",["quux"]]] ]SOPE/sope-json/SBJson/Tests/Data/format.json.terse0000644000000000000000000000006512242733417020662 0ustar rootroot["one",2,{"bar":[1,2,[]],"foo":null,"quux":true},{}] SOPE/sope-json/SBJson/Tests/Data/bool.json.pretty0000644000000000000000000000002412242733417020525 0ustar rootroot[ true, false ] SOPE/sope-json/SBJson/Tests/Data/jsonchecker/0000755000000000000000000000000012242733417017653 5ustar rootrootSOPE/sope-json/SBJson/Tests/Data/jsonchecker/fail5.json0000644000000000000000000000003012242733417021537 0ustar rootroot["double extra comma",,]SOPE/sope-json/SBJson/Tests/Data/jsonchecker/README0000644000000000000000000000004512242733417020532 0ustar rootrootSource: http://json.org/JSON_checker/SOPE/sope-json/SBJson/Tests/Data/jsonchecker/pass3.json0000644000000000000000000000022412242733417021575 0ustar rootroot{ "JSON Test Pattern pass3": { "The outermost value": "must be an object or array.", "In this test": "It is an object." } } SOPE/sope-json/SBJson/Tests/Data/jsonchecker/fail13.json0000644000000000000000000000005312242733417021623 0ustar rootroot{"Numbers cannot have leading zeroes": 013}SOPE/sope-json/SBJson/Tests/Data/jsonchecker/pass1.json.terse0000644000000000000000000000202712242733417022717 0ustar rootroot["JSON Test Pattern pass1",{"object with 1 member":["array with 1 element"]},{},[],-42,true,false,null,{"":23456789012000000000000000000000000000000000000000000000000000000000000000000," s p a c e d ":[1,2,3,4,5,6,7],"# -- --> */":" ","/\\\"쫾몾ꮘﳞ볚\b\f\n\r\t`1~!@#$%^&*()_+-=[]{}|;:',./<>?":"A key can be any string","0123456789":"digit","ALPHA":"ABCDEFGHIJKLMNOPQRSTUVWYZ","E":12345678900000000000000000000000000,"address":"50 St. James Street","alpha":"abcdefghijklmnopqrstuvwyz","array":[],"backslash":"\\","comment":"// /* */" : " ", "/\\\"쫾몾ꮘﳞ볚\b\f\n\r\t`1~!@#$%^&*()_+-=[]{}|;:',./<>?" : "A key can be any string", "0123456789" : "digit", "ALPHA" : "ABCDEFGHIJKLMNOPQRSTUVWYZ", "E" : 12345678900000000000000000000000000, "address" : "50 St. James Street", "alpha" : "abcdefghijklmnopqrstuvwyz", "array" : [], "backslash" : "\\", "comment" : "// /* */": " ", " s p a c e d " :[1,2 , 3 , 4 , 5 , 6 ,7 ],"compact":[1,2,3,4,5,6,7], "jsontext": "{\"object with 1 member\":[\"array with 1 element\"]}", "quotes": "" \u0022 %22 0x22 034 "", "\/\\\"\uCAFE\uBABE\uAB98\uFCDE\ubcda\uef4A\b\f\n\r\t`1~!@#$%^&*()_+-=[]{}|;:',./<>?" : "A key can be any string" }, 0.5 ,98.6 , 99.44 , 1066, 1e1, 0.1e1, 1e-1, 1e00,2e+00,2e-00 ,"rosebud"]SOPE/sope-json/SBJson/Tests/Data/jsonchecker/pass3.json.pretty0000644000000000000000000000021312242733417023121 0ustar rootroot{ "JSON Test Pattern pass3" : { "In this test" : "It is an object.", "The outermost value" : "must be an object or array." } } SOPE/sope-json/SBJson/Tests/Data/jsonchecker/fail9.json0000644000000000000000000000002612242733417021550 0ustar rootroot{"Extra comma": true,}SOPE/sope-json/SBJson/Tests/Data/jsonchecker/fail16.json0000644000000000000000000000001012242733417021617 0ustar rootroot[\naked]SOPE/sope-json/SBJson/Tests/Data/jsonchecker/fail15.json0000644000000000000000000000004212242733417021623 0ustar rootroot["Illegal backslash escape: \x15"]SOPE/sope-json/SBJson/Tests/Data/jsonchecker/fail12.json0000644000000000000000000000003712242733417021624 0ustar rootroot{"Illegal invocation": alert()}SOPE/sope-json/SBJson/Tests/Data/string-unicode.json0000644000000000000000000000033312242733417021201 0ustar rootroot{ "\u00e9\u2265": "e-acute and greater-than-or-equal-to", "42\u00e942\u226542": "e-acute and greater-than-or-equal-to, and 42", "\u00E9": "e-acute with upper-case hex", "\uD834\uDD1E": "G-clef (UTF16 surrogate pair)" } SOPE/sope-json/SBJson/Tests/Data/bool.json.terse0000644000000000000000000000001512242733417020320 0ustar rootroot[true,false] SOPE/sope-json/SBJson/Tests/Data/number.json.terse0000644000000000000000000000015112242733417020656 0ustar rootroot[-333,-333000,-4,-5,-9999,0.0001,0,10000,1,2.5,4,50,66.6,98877665544332211009988776655443322110,99.99,5] SOPE/sope-json/SBJson/Tests/Data/null.json.terse0000644000000000000000000000001412242733417020336 0ustar rootroot[null,null] SOPE/sope-json/SBJson/Tests/Data/null.json0000644000000000000000000000001312242733417017214 0ustar rootroot[null,null]SOPE/sope-json/SBJson/Tests/Data/number.json0000644000000000000000000000020012242733417017530 0ustar rootroot[ -333e+0, -333e+3, -4, -5, -9999, 0.0001, 0, 10000, 1, 2.5, 4, 5e1, 666e-1, 98877665544332211009988776655443322110, 99.99, 5 ] SOPE/sope-json/SBJson/Tests/Data/format.json.pretty0000644000000000000000000000016412242733417021067 0ustar rootroot[ "one", 2, { "bar" : [ 1, 2, [] ], "foo" : null, "quux" : true }, {} ] SOPE/sope-json/SBJson/Tests/MaxDepthTest.m0000644000000000000000000000537212242733417017243 0ustar rootroot/* Copyright (C) 2009-2010 Stig Brautaset. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #import "MaxDepthTest.h" #import "JSON/JSON.h" @implementation MaxDepthTest - (void)setUp { [super setUp]; parser.maxDepth = writer.maxDepth = 2; } - (void)testParseDepthOk { STAssertNotNil([parser objectWithString:@"[[]]"], nil); } - (void)testParseTooDeep { STAssertNil([parser objectWithString:@"[[[]]]"], nil); STAssertEquals([[parser.errorTrace objectAtIndex:0] code], (NSInteger)EDEPTH, nil); } - (void)testWriteDepthOk { NSArray *a1 = [NSArray array]; NSArray *a2 = [NSArray arrayWithObject:a1]; STAssertNotNil([writer stringWithObject:a2], nil); } - (void)testWriteTooDeep { NSArray *a1 = [NSArray array]; NSArray *a2 = [NSArray arrayWithObject:a1]; NSArray *a3 = [NSArray arrayWithObject:a2]; STAssertNil([writer stringWithObject:a3], nil); STAssertEquals([[writer.errorTrace objectAtIndex:0] code], (NSInteger)EDEPTH, nil); } - (void)testWriteRecursion { // set a high limit writer.maxDepth = 100; // create a challenge! NSMutableArray *a1 = [NSMutableArray array]; NSMutableArray *a2 = [NSMutableArray arrayWithObject:a1]; [a1 addObject:a2]; STAssertNil([writer stringWithObject:a1], nil); STAssertEquals([[writer.errorTrace objectAtIndex:0] code], (NSInteger)EDEPTH, nil); } @end SOPE/sope-json/SBJson/Notes/0000755000000000000000000000000012242733417014472 5ustar rootrootSOPE/sope-json/SBJson/Notes/parser-benchmark.txt0000644000000000000000000000337012242733417020462 0ustar rootrootIn this first benchmark I decided to try speeding up the parser by speeding up -[NSScanner scanJSONValue:]. I used the same strings as JSON::XS uses for its benchmarking. The things I tried were: * Firstly, reordering the calls in -[NSScanner scanJSONValue:] to scan for more common (from my subjective point of view) types first. * Further, I wanted to test whether skipping white space before successively trying to match each JSON type would yield a speedup. * Finally, I looked at the next character in the string and did dispatched directly to the correct type. Decoded short/long JSON strings per second (higher is better): | original | reordered | +skip ws | +dispatch | ------+-----------+-----------+----------+-----------| Short | 7468.818 | 7817.630 | 6381.824 | 7626.370 | Long | 110.255 | 117.472 | 106.309 | 110.573 | For the test data I used reordering calls yields a 4.6 to 6.5 percent increase in performance. The new order is approximately the reverse of the original. (The old order was chosen because the right edge of the calls made a pleasant curve, so an improvement here is not unexpected.) The test data has little optional white space, so skipping white space actually turns out to be slower. (Particularly so for short strings.) The white-space skipping is necessary for the dispatching logic. With that added the speed is it back up to about the same as the original. But now the code is uglier and there's more of it. It's my assumption that the performance of parsing human-readable JSON will matter less than the performance of parsing JSON meant for machine consumption. Given this assumption it makes sense to skip the white space skipping and dispatch table, as they make the code more complex. SOPE/sope-json/SBJson/Notes/JensAlfkePerformanceNotes.txt0000644000000000000000000000775612242733417022307 0ustar rootrootA couple of emails accompanying the patches from Jens Alfke. From: Jens Alfke Date: 13 January 2008 01:01:10 GMT To: stig@brautaset.org Subject: Cocoa JSON optimizations Stig, Thanks for writing the JSON framework for Cocoa! > (Note that both our libraries puts up a really bad show compared to > all the Perl modules Marc measured. A bit embarrassing that...) I took a look at optimizing the generation of JSON. With a couple of tweaks I made it about 11x faster on the large test string from Yahoo. The patch (from SVN top-of-tree) is enclosed. The main problem was that the way the code was structured, with each level of recursion returning its result as a string, results in large numbers of temporary NSStrings being generated and appended to each other. A more optimal pattern for this is to instead pass an NSMutableString to each generator method, which it can append to. That way a single mutable string gets re-used. The next bottleneck was the way -[NSString JSONFragmentWithOptions:] iterates over every character in the string. Getting each character is slow, and appending the characters one at a time to the output is even slower. Fortunately this process is only necessary if the string has characters that need escaping, so I built a static NSCharacterSet of those characters, and then I test every string to see if it contains any of them. If not, it can simply be appended as-is. A lot of strings were still being escaped because they contained "/" characters. I looked at the JSON RFC, and it says that only control characters, double-quotes and backslashes need to be escaped, so I took out the special case for "/". That helped. Finally, I changed the array iterations in the NSArray and NSDictionary methods to use the new Leopard "for...in" syntax (but only if being compiled for Leopard.) That shaved a few percent off the time, since for...in uses a new, more efficient iteration mechanism. I didn't benchmark with any of the pretty-printing options turned on. The code for those could be optimized to reduce the number of string operations; but on the other hand, any client of the library wanting maximum performance is probably going to turn off pretty-printing anyway! If my enthusiasm persists, I might look at the JSON parsing code too, but no promises :) --Jens From: Jens Alfke Date: 13 January 2008 06:15:19 GMT To: stig@brautaset.org Subject: Re: Cocoa JSON optimizations Stig, As promised, I looked at the parser as well. This was trickier to optimize, but by throwing several tricks at it I got a nice 5x speedup. The main problem was just that NSScanner itself is really slow, for some reason. So part of what I did was just to call -scanString: fewer times. I wrote a faster -scanJSONChar: method that scans for a single character, since that's what most of the -scanString: calls were doing. I also changed the top-level scanning sequence so that -scanJSONValue gets the next non-whitespace character and then tests that to see which type of entity to scan. That avoids a bunch of repeated scans for a '{', a '[', a '"', etc. I re-ordered some of the logic in -scanJSONObject: to reduce the number of strings that get scanned for. I restructured -scanJSONString: to append substrings in chunks instead of character-by-character. I also used a lower-level string iterator from CFString that's faster than -characterAtIndex, as well as another CFString function to append unichars to a string. This was fun, actually! Kind of like solving a logic puzzle. I kept on running 'sample' and figuring there must be one more thing I could do to shave off more time... I think there's a bit more room, but it would involve rewriting the code to stop using NSScanner at all. Instead, a couple of fast scan functions based on CFStringInlineBuffer would do the job. I think this would also make the code clearer, since I've left it as a mishmash of NSScanner and direct string access. The source changes were extensive, so the entire file is probably clearer than a diff: --Jens SOPE/sope-json/SBJson/JSON-Info.plist0000644000000000000000000000124312242733417016121 0ustar rootroot CFBundleDevelopmentRegion English CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier org.brautaset.JSON CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType FMWK CFBundleShortVersionString 2.3.1 CFBundleSignature ???? CFBundleVersion 1.1.1 SOPE/ChangeLog0000644000000000000000000237553112242733417012121 0ustar rootrootcommit 3c5fddcf5e54795aa206206cef92b82de8283552 Author: Jean Raby Date: Mon Nov 18 21:40:39 2013 -0500 Rewrite sanitizeMailAddresses It should now be more robust and shouldn't crash when handling strange input. M sope-mime/NGMail/NGMailAddressParser.h M sope-mime/NGMail/NGMailAddressParser.m commit 12fb93ead66cb672e8d8db4c7767b47ae069bac1 Author: Jean Raby Date: Fri Nov 15 16:05:41 2013 -0500 Use is7bitSafe to avoid double encoding strings M sope-mime/NGImap4/NSString+Imap4.m commit 2e03d606f60f1cb003bc9788f393aeca8b9007bb Author: Ludovic Marcotte Date: Wed Nov 13 15:35:12 2013 -0500 Added attributes support M sope-appserver/NGObjWeb/WebDAV/SaxDAVHandler.m commit ea6d6c304faf21dbb5ab816c5888831a4e4e3ea8 Author: Ludovic Marcotte Date: Tue Nov 12 15:24:28 2013 -0500 Added new PROPFIND/PROPATCH for mails labels synchronization M sope-appserver/NGObjWeb/DAVPropMap.plist commit f12836f47932138c09d9f641111b1030fbe09203 Author: Francis Lachapelle Date: Thu Nov 7 14:40:03 2013 -0500 Update ChangeLog M ChangeLog commit 59e66e3a7ecdf06f849a5e581572b1c6bbc2710d Author: Jean Raby Date: Wed Nov 6 08:17:43 2013 -0500 Typo in error msg: cound -> could M sope-ldap/NGLdap/NGLdapAttribute.m commit 87b9400affc61f48e3dfe24ff56500875eb9312b Author: Ludovic Marcotte Date: Tue Nov 5 15:08:59 2013 -0500 Reverted patch from David Chisnall to bring back Lucid to a working state. M sope-appserver/NGObjWeb/Associations/WOKeyPathAssociation.m M sope-appserver/NGObjWeb/Associations/WOScriptAssociation.m M sope-appserver/NGObjWeb/Associations/WOValueAssociation.m M sope-appserver/NGObjWeb/DynamicElements/WOComponentReference.m M sope-appserver/NGObjWeb/DynamicElements/WOGenericElement.m M sope-appserver/NGObjWeb/DynamicElements/WOHyperlink.m M sope-appserver/NGObjWeb/NGHttp/NGHttpHeaderFieldParser.m M sope-appserver/NGObjWeb/NGHttp/NGHttpResponse.h M sope-appserver/NGObjWeb/NGHttp/NGUrlFormCoder.m M sope-appserver/NGObjWeb/NSObject+WO.m M sope-appserver/NGObjWeb/SoObjects/SoClassSecurityInfo.h M sope-appserver/NGObjWeb/SoObjects/SoClassSecurityInfo.m M sope-appserver/NGObjWeb/SoObjects/SoComponent.m M sope-appserver/NGObjWeb/SoObjects/SoDefaultRenderer.m M sope-appserver/NGObjWeb/Templates/WOComponentScriptPart.m M sope-appserver/NGObjWeb/Templates/WODParser.m M sope-appserver/NGObjWeb/Templates/WOHTMLParser.m M sope-appserver/NGObjWeb/Templates/WOTemplate.m M sope-appserver/NGObjWeb/Templates/WOxElemBuilder.m M sope-appserver/NGObjWeb/WOComponent+Sync.m M sope-appserver/NGObjWeb/WOComponent.m M sope-appserver/NGObjWeb/WOHTTPConnection.m M sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpAdaptor.m M sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpTransaction.m M sope-appserver/NGObjWeb/WOHttpAdaptor/WORequest+Adaptor.m M sope-appserver/NGObjWeb/WOMailDelivery.m M sope-appserver/NGObjWeb/WOResponse.m M sope-appserver/NGObjWeb/WOSessionStore.m M sope-appserver/NGObjWeb/WOSimpleHTTPParser.m M sope-appserver/NGObjWeb/WOStatisticsStore.m M sope-appserver/NGObjWeb/WebDAV/SaxDAVHandler.m M sope-appserver/NGObjWeb/WebDAV/SoDAVSQLParser.h M sope-appserver/NGObjWeb/WebDAV/SoDAVSQLParser.m M sope-appserver/NGObjWeb/WebDAV/SoObjectDataSource.m M sope-appserver/NGObjWeb/WebDAV/SoWebDAVRenderer.m M sope-appserver/NGObjWeb/WebDAV/SoWebDAVValue.m M sope-appserver/NGObjWeb/_WOStringTable.m M sope-appserver/NGObjWeb/common.h M sope-appserver/WEExtensions/JSStringTable.m M sope-appserver/WEExtensions/WEMonthOverview.m M sope-appserver/WEExtensions/WEResourceKey.m M sope-appserver/WEExtensions/WEResourceManager.m M sope-appserver/WEExtensions/WETableCalcMatrix.h M sope-appserver/WEExtensions/WETableCalcMatrix.m M sope-appserver/WEExtensions/WETableMatrix.m M sope-appserver/WEExtensions/WETableView/WETableView.m M sope-appserver/WOExtensions/WOTabPanel.m M sope-core/EOControl/EOFetchSpecification.m M sope-core/EOControl/EOGenericRecord.m M sope-core/EOControl/EOGlobalID.m M sope-core/EOControl/EOKeyComparisonQualifier.m M sope-core/EOControl/EOKeyGlobalID.m M sope-core/EOControl/EOKeyValueCoding.m M sope-core/EOControl/EOKeyValueQualifier.m M sope-core/EOControl/EONotQualifier.m M sope-core/EOControl/EONull.m M sope-core/EOControl/EOObserver.m M sope-core/EOControl/EOOrQualifier.m M sope-core/EOControl/EOQualifierParser.m M sope-core/EOControl/EOSQLParser.h M sope-core/EOControl/EOSQLParser.m M sope-core/EOControl/EOSortOrdering.m M sope-core/EOControl/EOValidation.m M sope-core/EOControl/NSArray+EOQualifier.m M sope-core/NGExtensions/EOExt.subproj/EOFetchSpecification+plist.m M sope-core/NGExtensions/EOExt.subproj/EOKeyMapDataSource.m M sope-core/NGExtensions/EOExt.subproj/EOQualifier+CtxEval.m M sope-core/NGExtensions/FdExt.subproj/NGPropertyListParser.m M sope-core/NGExtensions/FdExt.subproj/NSException+misc.m M sope-core/NGExtensions/FdExt.subproj/NSObject+Logs.m M sope-core/NGExtensions/FdExt.subproj/NSObject+Values.m M sope-core/NGExtensions/FdExt.subproj/NSProcessInfo+misc.m M sope-core/NGExtensions/FdExt.subproj/NSSet+enumerator.m M sope-core/NGExtensions/FdExt.subproj/NSString+Encoding.m M sope-core/NGExtensions/FdExt.subproj/NSString+Escaping.m M sope-core/NGExtensions/FdExt.subproj/NSString+Ext.m M sope-core/NGExtensions/FdExt.subproj/NSString+misc.m M sope-core/NGExtensions/NGBitSet.m M sope-core/NGExtensions/NGBundleManager.m M sope-core/NGExtensions/NGCalendarDateRange.m M sope-core/NGExtensions/NGDirectoryEnumerator.m M sope-core/NGExtensions/NGHashMap.m M sope-core/NGExtensions/NGLogging.subproj/NGLogEventDetailedFormatter.m M sope-core/NGExtensions/NGLogging.subproj/NGLoggerManager.m M sope-core/NGExtensions/NGResourceLocator.m M sope-core/NGExtensions/NGStack.m M sope-core/NGStreams/NGActiveSocket.m M sope-core/NGStreams/NGBufferedStream.m M sope-core/NGStreams/NGByteBuffer.m M sope-core/NGStreams/NGByteCountStream.m M sope-core/NGStreams/NGCTextStream.m M sope-core/NGStreams/NGConcreteStreamFileHandle.m M sope-core/NGStreams/NGLocalSocketAddress.m M sope-gdl1/GDLAccess/EOAdaptor.m M sope-gdl1/GDLAccess/EOAttribute.m M sope-gdl1/GDLAccess/EODatabase.m M sope-gdl1/GDLAccess/EODatabaseChannel.m M sope-gdl1/GDLAccess/EODatabaseContext.m M sope-gdl1/GDLAccess/EODatabaseFault.m M sope-gdl1/GDLAccess/EODatabaseFaultResolver.m M sope-gdl1/GDLAccess/EOEntity.m M sope-gdl1/GDLAccess/EOFExceptions.m M sope-gdl1/GDLAccess/EOFault.h M sope-gdl1/GDLAccess/EOFault.m M sope-gdl1/GDLAccess/EOModel.m M sope-gdl1/GDLAccess/EOObjectUniquer.m M sope-gdl1/GDLAccess/EOPrimaryKeyDictionary.m M sope-gdl1/GDLAccess/EORecordDictionary.m M sope-gdl1/GDLAccess/EORelationship.m M sope-gdl1/GDLAccess/EOSQLExpression.m M sope-gdl1/GDLAccess/EOSQLQualifier.m M sope-gdl1/GDLAccess/common.h M sope-gdl1/PostgreSQL/NSData+PGVal.m M sope-gdl1/PostgreSQL/NSString+PostgreSQL72.m M sope-gdl1/PostgreSQL/PostgreSQL72Channel.m M sope-gdl1/PostgreSQL/PostgreSQL72DataTypeMappingException.m M sope-mime/NGImap4/NGImap4Client.m M sope-mime/NGImap4/NGImap4Connection.m M sope-mime/NGImap4/NGImap4Context.m M sope-mime/NGImap4/NGImap4FileManager.m M sope-mime/NGImap4/NGImap4Folder.m M sope-mime/NGImap4/NGImap4FolderGlobalID.m M sope-mime/NGImap4/NGImap4Message.m M sope-mime/NGImap4/NGImap4ResponseParser.m M sope-mime/NGImap4/NGImap4ServerGlobalID.m M sope-mime/NGImap4/NGSieveClient.m M sope-mime/NGImap4/imCommon.h M sope-mime/NGMail/NGMailAddress.m M sope-mime/NGMail/NGMailAddressParser.m M sope-mime/NGMail/NGMimeMessage.m M sope-mime/NGMime/NGMimeBodyPart.m M sope-mime/NGMime/NGMimeJoinedData.m M sope-mime/NGMime/NGMimePartGenerator.h M sope-mime/NGMime/NGMimePartGenerator.m M sope-mime/NGMime/NGMimePartParser.m M sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m M sope-xml/DOM/DOMElement.m M sope-xml/DOM/DOMNode.m M sope-xml/DOM/DOMQueryPathExpression.m M sope-xml/DOM/DOMSaxHandler.m M sope-xml/STXSaxDriver/ExtraSTX/StructuredText.m M sope-xml/STXSaxDriver/Model/StructuredTextBodyElement.m M sope-xml/STXSaxDriver/Model/StructuredTextHeader.m M sope-xml/STXSaxDriver/STXSaxDriver.m M sope-xml/SaxObjC/SaxAttributeList.m M sope-xml/SaxObjC/SaxAttributes.m M sope-xml/SaxObjC/SaxContentHandler.h M sope-xml/SaxObjC/SaxDefaultHandler.m M sope-xml/SaxObjC/SaxObjectDecoder.m M sope-xml/SaxObjC/SaxXMLFilter.m M sope-xml/SaxObjC/SaxXMLReaderFactory.m M sope-xml/XmlRpc/NSNotification+XmlRpcCoding.m M sope-xml/XmlRpc/XmlRpcDecoder.m M sope-xml/XmlRpc/XmlRpcEncoder.m M sope-xml/XmlRpc/XmlRpcMethodCall.m M sope-xml/XmlRpc/XmlRpcSaxHandler.m commit 25b7c45834da4b50f1ac56b367e3eeb1ea4cd623 Author: sogo Date: Tue Nov 5 14:42:59 2013 -0500 Reverted fix. M sope-appserver/NGObjWeb/common.h M sope-gdl1/GDLAccess/common.h commit 39eb541020f13dbb1710f6068c8bc5adbbe0ff2b Author: Ludovic Marcotte Date: Tue Nov 5 14:16:15 2013 -0500 Fix for Lucid M sope-appserver/NGObjWeb/common.h M sope-gdl1/GDLAccess/common.h commit f7d864030c3985ff40c622cd745cca33dbc4a5a9 Author: Ludovic Marcotte Date: Mon Oct 28 15:28:50 2013 -0400 Removed uber-brain-damaged code. M sope-mime/NGImap4/NGImap4ResponseParser.m commit 03369a2963654b2e3f50facef394a0c44bd83f33 Author: Ludovic Marcotte Date: Thu Oct 24 20:58:56 2013 -0400 Potential fix for OS X 10.9 M sope-appserver/NGObjWeb/WEClientCapabilities.m commit 663174ffee0f3680eda328a6510e48ee8a34d62d Author: Ludovic Marcotte Date: Fri Oct 18 13:48:43 2013 -0400 Applied huge patch (slightly modified) from David Chisnall These fixes are for the FreeBSD/OpenBSD port. M sope-appserver/NGObjWeb/Associations/WOKeyPathAssociation.m M sope-appserver/NGObjWeb/Associations/WOScriptAssociation.m M sope-appserver/NGObjWeb/Associations/WOValueAssociation.m M sope-appserver/NGObjWeb/DynamicElements/WOComponentReference.m M sope-appserver/NGObjWeb/DynamicElements/WOGenericElement.m M sope-appserver/NGObjWeb/DynamicElements/WOHyperlink.m M sope-appserver/NGObjWeb/NGHttp/NGHttpHeaderFieldParser.m M sope-appserver/NGObjWeb/NGHttp/NGHttpResponse.h M sope-appserver/NGObjWeb/NGHttp/NGUrlFormCoder.m M sope-appserver/NGObjWeb/NSObject+WO.m M sope-appserver/NGObjWeb/SoObjects/SoClassSecurityInfo.h M sope-appserver/NGObjWeb/SoObjects/SoClassSecurityInfo.m M sope-appserver/NGObjWeb/SoObjects/SoComponent.m M sope-appserver/NGObjWeb/SoObjects/SoDefaultRenderer.m M sope-appserver/NGObjWeb/Templates/WOComponentScriptPart.m M sope-appserver/NGObjWeb/Templates/WODParser.m M sope-appserver/NGObjWeb/Templates/WOHTMLParser.m M sope-appserver/NGObjWeb/Templates/WOTemplate.m M sope-appserver/NGObjWeb/Templates/WOxElemBuilder.m M sope-appserver/NGObjWeb/WOComponent+Sync.m M sope-appserver/NGObjWeb/WOComponent.m M sope-appserver/NGObjWeb/WOHTTPConnection.m M sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpAdaptor.m M sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpTransaction.m M sope-appserver/NGObjWeb/WOHttpAdaptor/WORequest+Adaptor.m M sope-appserver/NGObjWeb/WOMailDelivery.m M sope-appserver/NGObjWeb/WOResponse.m M sope-appserver/NGObjWeb/WOSessionStore.m M sope-appserver/NGObjWeb/WOSimpleHTTPParser.m M sope-appserver/NGObjWeb/WOStatisticsStore.m M sope-appserver/NGObjWeb/WebDAV/SaxDAVHandler.m M sope-appserver/NGObjWeb/WebDAV/SoDAVSQLParser.h M sope-appserver/NGObjWeb/WebDAV/SoDAVSQLParser.m M sope-appserver/NGObjWeb/WebDAV/SoObjectDataSource.m M sope-appserver/NGObjWeb/WebDAV/SoWebDAVRenderer.m M sope-appserver/NGObjWeb/WebDAV/SoWebDAVValue.m M sope-appserver/NGObjWeb/_WOStringTable.m M sope-appserver/NGObjWeb/common.h M sope-appserver/WEExtensions/JSStringTable.m M sope-appserver/WEExtensions/WEMonthOverview.m M sope-appserver/WEExtensions/WEResourceKey.m M sope-appserver/WEExtensions/WEResourceManager.m M sope-appserver/WEExtensions/WETableCalcMatrix.h M sope-appserver/WEExtensions/WETableCalcMatrix.m M sope-appserver/WEExtensions/WETableMatrix.m M sope-appserver/WEExtensions/WETableView/WETableView.m M sope-appserver/WOExtensions/WOTabPanel.m M sope-core/EOControl/EOFetchSpecification.m M sope-core/EOControl/EOGenericRecord.m M sope-core/EOControl/EOGlobalID.m M sope-core/EOControl/EOKeyComparisonQualifier.m M sope-core/EOControl/EOKeyGlobalID.m M sope-core/EOControl/EOKeyValueCoding.m M sope-core/EOControl/EOKeyValueQualifier.m M sope-core/EOControl/EONotQualifier.m M sope-core/EOControl/EONull.m M sope-core/EOControl/EOObserver.m M sope-core/EOControl/EOOrQualifier.m M sope-core/EOControl/EOQualifierParser.m M sope-core/EOControl/EOSQLParser.h M sope-core/EOControl/EOSQLParser.m M sope-core/EOControl/EOSortOrdering.m M sope-core/EOControl/EOValidation.m M sope-core/EOControl/NSArray+EOQualifier.m M sope-core/NGExtensions/EOExt.subproj/EOFetchSpecification+plist.m M sope-core/NGExtensions/EOExt.subproj/EOKeyMapDataSource.m M sope-core/NGExtensions/EOExt.subproj/EOQualifier+CtxEval.m M sope-core/NGExtensions/FdExt.subproj/NGPropertyListParser.m M sope-core/NGExtensions/FdExt.subproj/NSException+misc.m M sope-core/NGExtensions/FdExt.subproj/NSObject+Logs.m M sope-core/NGExtensions/FdExt.subproj/NSObject+Values.m M sope-core/NGExtensions/FdExt.subproj/NSProcessInfo+misc.m M sope-core/NGExtensions/FdExt.subproj/NSSet+enumerator.m M sope-core/NGExtensions/FdExt.subproj/NSString+Encoding.m M sope-core/NGExtensions/FdExt.subproj/NSString+Escaping.m M sope-core/NGExtensions/FdExt.subproj/NSString+Ext.m M sope-core/NGExtensions/FdExt.subproj/NSString+misc.m M sope-core/NGExtensions/NGBitSet.m M sope-core/NGExtensions/NGBundleManager.m M sope-core/NGExtensions/NGCalendarDateRange.m M sope-core/NGExtensions/NGDirectoryEnumerator.m M sope-core/NGExtensions/NGHashMap.m M sope-core/NGExtensions/NGLogging.subproj/NGLogEventDetailedFormatter.m M sope-core/NGExtensions/NGLogging.subproj/NGLoggerManager.m M sope-core/NGExtensions/NGResourceLocator.m M sope-core/NGExtensions/NGStack.m M sope-core/NGStreams/NGActiveSocket.m M sope-core/NGStreams/NGBufferedStream.m M sope-core/NGStreams/NGByteBuffer.m M sope-core/NGStreams/NGByteCountStream.m M sope-core/NGStreams/NGCTextStream.m M sope-core/NGStreams/NGConcreteStreamFileHandle.m M sope-core/NGStreams/NGLocalSocketAddress.m M sope-gdl1/GDLAccess/EOAdaptor.m M sope-gdl1/GDLAccess/EOAttribute.m M sope-gdl1/GDLAccess/EODatabase.m M sope-gdl1/GDLAccess/EODatabaseChannel.m M sope-gdl1/GDLAccess/EODatabaseContext.m M sope-gdl1/GDLAccess/EODatabaseFault.m M sope-gdl1/GDLAccess/EODatabaseFaultResolver.m M sope-gdl1/GDLAccess/EOEntity.m M sope-gdl1/GDLAccess/EOFExceptions.m M sope-gdl1/GDLAccess/EOFault.h M sope-gdl1/GDLAccess/EOFault.m M sope-gdl1/GDLAccess/EOModel.m M sope-gdl1/GDLAccess/EOObjectUniquer.m M sope-gdl1/GDLAccess/EOPrimaryKeyDictionary.m M sope-gdl1/GDLAccess/EORecordDictionary.m M sope-gdl1/GDLAccess/EORelationship.m M sope-gdl1/GDLAccess/EOSQLExpression.m M sope-gdl1/GDLAccess/EOSQLQualifier.m M sope-gdl1/GDLAccess/common.h M sope-gdl1/PostgreSQL/NSData+PGVal.m M sope-gdl1/PostgreSQL/NSString+PostgreSQL72.m M sope-gdl1/PostgreSQL/PostgreSQL72Channel.m M sope-gdl1/PostgreSQL/PostgreSQL72DataTypeMappingException.m M sope-mime/NGImap4/NGImap4Client.m M sope-mime/NGImap4/NGImap4Connection.m M sope-mime/NGImap4/NGImap4Context.m M sope-mime/NGImap4/NGImap4FileManager.m M sope-mime/NGImap4/NGImap4Folder.m M sope-mime/NGImap4/NGImap4FolderGlobalID.m M sope-mime/NGImap4/NGImap4Message.m M sope-mime/NGImap4/NGImap4ResponseParser.m M sope-mime/NGImap4/NGImap4ServerGlobalID.m M sope-mime/NGImap4/NGSieveClient.m M sope-mime/NGImap4/imCommon.h M sope-mime/NGMail/NGMailAddress.m M sope-mime/NGMail/NGMailAddressParser.m M sope-mime/NGMail/NGMimeMessage.m M sope-mime/NGMime/NGMimeBodyPart.m M sope-mime/NGMime/NGMimeJoinedData.m M sope-mime/NGMime/NGMimePartGenerator.h M sope-mime/NGMime/NGMimePartGenerator.m M sope-mime/NGMime/NGMimePartParser.m M sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m M sope-xml/DOM/DOMElement.m M sope-xml/DOM/DOMNode.m M sope-xml/DOM/DOMQueryPathExpression.m M sope-xml/DOM/DOMSaxHandler.m M sope-xml/STXSaxDriver/ExtraSTX/StructuredText.m M sope-xml/STXSaxDriver/Model/StructuredTextBodyElement.m M sope-xml/STXSaxDriver/Model/StructuredTextHeader.m M sope-xml/STXSaxDriver/STXSaxDriver.m M sope-xml/SaxObjC/SaxAttributeList.m M sope-xml/SaxObjC/SaxAttributes.m M sope-xml/SaxObjC/SaxContentHandler.h M sope-xml/SaxObjC/SaxDefaultHandler.m M sope-xml/SaxObjC/SaxObjectDecoder.m M sope-xml/SaxObjC/SaxXMLFilter.m M sope-xml/SaxObjC/SaxXMLReaderFactory.m M sope-xml/XmlRpc/NSNotification+XmlRpcCoding.m M sope-xml/XmlRpc/XmlRpcDecoder.m M sope-xml/XmlRpc/XmlRpcEncoder.m M sope-xml/XmlRpc/XmlRpcMethodCall.m M sope-xml/XmlRpc/XmlRpcSaxHandler.m commit e89bfaef8041f2e56b880432285d237d4d5e9ab9 Author: Ludovic Marcotte Date: Fri Sep 27 10:34:47 2013 -0400 Added 2Do client. See #2114 for more details. M sope-appserver/NGObjWeb/WEClientCapabilities.m commit 7bb4c77e937336a1e3409ff436aab176f048d036 Author: Ludovic Marcotte Date: Thu Sep 26 14:47:01 2013 -0400 Fix for bug #2412 M sope-appserver/NGObjWeb/Languages.plist commit 2c46765fcf11844fffa95a976b577554917ad35b Author: Ludovic Marcotte Date: Wed Sep 25 14:30:51 2013 -0400 Fix for bug #2319 M sope-gdl1/MySQL/MySQL4Channel.m commit dd21a117bb5dea064b58b949e6e88bdd4e9848ae Author: Ludovic Marcotte Date: Wed Sep 25 10:05:46 2013 -0400 Avoid double-encoding 7bit-safe folders M sope-mime/NGImap4/NGImap4Client.m M sope-mime/NGImap4/NSString+Imap4.h M sope-mime/NGImap4/NSString+Imap4.m commit 223e0ae569b9ad4eae3d5ac5a43209feff99b3dd Author: Ludovic Marcotte Date: Tue Sep 24 15:58:11 2013 -0400 Fix for bug #2318 M sope-mime/NGImap4/NGImap4Client.m M sope-mime/NGImap4/NGImap4Connection.m commit aa26f89ded0672fda8f3a11f0492fd938bdbdd9b Author: Jean Raby Date: Thu Sep 12 09:30:24 2013 -0400 Add gitignore. No obj/ directory A .gitignore commit 8540c3ae63923298ca29aa269a1bbdb9c996646e Author: Jean Raby Date: Tue Sep 10 12:03:55 2013 -0400 use initWithBytes to handle credentials That behavior matches what stringByDecodingBase64 does, but this code should probably be rewritten to use it instead on rolling its own version. M sope-appserver/NGObjWeb/NGHttp/NGHttpHeaderFields.m commit 5ee6f6fdd9ac63a51e6619e880d625a6f6fa83e1 Author: Jean Raby Date: Tue Sep 10 11:58:35 2013 -0400 Use initWithBytes instead of initWithBytesNocopy For some strange reason, the dest pointer gets mangled by gnustep when the init fails with encoding:NSUTF8StringEncoding. Use initWithBytes and free the pointer manually instead. This avoids a double free crash when handling latin1 encoded creds M sope-core/NGExtensions/NGBase64Coding.m commit de26af91c8df6b37f7db44ddb127174ce6e72840 Author: Jean Raby Date: Tue Sep 10 11:54:36 2013 -0400 len must be signed Avoids wrapping if data doesn't contain a ':' This avoids an out of memory exception when receiving malformed auth data M sope-appserver/NGObjWeb/NGHttp/NGHttpHeaderFields.m commit eac41b9cde81e8b4dfa0869b58e84a211d996e3d Author: Jean Raby Date: Fri Sep 6 13:41:29 2013 -0400 Avoid high CPU usage when all child procs are busy M sope-appserver/NGObjWeb/WOWatchDogApplicationMain.m commit 82f23a317665157c6ef36a6f9c191f4421caf36b Author: Jean Raby Date: Wed Aug 28 17:05:31 2013 -0400 Implement ldap password change for ActiveDirectory Also works against Samba4. Unfortunately, we don't get detailed error messages from AD. On samba4, debug has to be turned quite high to see anything. The LDAP connection *must* use TLS/SSL, otherwise it won't work. See these links for details: http://support.microsoft.com/kb/269190 http://msdn.microsoft.com/en-us/library/cc223248.aspx M sope-ldap/NGLdap/NGLdapConnection.h M sope-ldap/NGLdap/NGLdapConnection.m commit 3dcc9b1459bd8a3ab626f918dea5576defb86eea Author: Jean Raby Date: Wed Aug 28 09:33:59 2013 -0400 Fix format. Avoid crash on pidfile creation error. reported by hannes_at_erven.at M sope-appserver/NGObjWeb/WOWatchDogApplicationMain.m commit dccbbf0ab71f2f8bbb8fbe7966f9b66da18f1c4c Author: Jean Raby Date: Wed Aug 28 09:24:15 2013 -0400 whitespace tabkill M sope-appserver/NGObjWeb/WOWatchDogApplicationMain.m commit 7ea253d7a468040adfc1b244dbc83c7546c1728b Author: Jean Raby Date: Tue Aug 27 16:34:01 2013 -0400 implement isADCompatible add utility functions along the way M sope-ldap/NGLdap/NGLdapConnection.h M sope-ldap/NGLdap/NGLdapConnection.m commit ab997ddd2ea7c1525e80d65e4038582a1a60484d Author: Jean Raby Date: Tue Aug 27 15:25:18 2013 -0400 whitespace tabkill M sope-ldap/NGLdap/NGLdapConnection.m commit 724726e1e8a11ff9950d9b304a8d0aa83ee6edef Author: Jean Raby Date: Tue Aug 27 13:49:28 2013 -0400 Enable debug only if ImapDebugEnabled is enabled It would probably be better to replace ImapDebugEnabled by something like MailDebugEnabled. But this is certainly better than always having debug output M sope-mime/NGMail/NGSmtpClient.m commit 13d7780e406e866ed56155c61b33c45e3c099424 Author: Jean Raby Date: Thu Aug 15 08:49:26 2013 -0400 Local pool to avoid keeping many opened LDAP fd M sope-appserver/NGObjWeb/WebDAV/SoObjectDataSource.m commit fa31f618ff0c593b05f4fd91a4d149da4573e901 Author: Jean Raby Date: Fri Aug 9 21:19:44 2013 -0400 fixup NGLdapConnection logging for searches M sope-ldap/NGLdap/NGLdapConnection.m commit 9f98c590e397b642d8a4c69c3f4789de6f7027dd Author: Francis Lachapelle Date: Sat Jul 20 15:02:26 2013 -0400 Update ChangeLog M ChangeLog commit 5030353177728764e3c417392dab085a61190483 Author: Ludovic Marcotte Date: Fri Jul 19 16:19:40 2013 -0400 Avoid throwing log info for the ID untagged response M sope-mime/NGImap4/NGImap4ResponseParser.m commit 7311d726e005ae8fd2802d07a17761ba03984892 Author: Francis Lachapelle Date: Fri Jul 19 13:51:30 2013 -0400 Update ChangeLog M ChangeLog commit 8a214de88bcfaa838157b9c2a3c7246131e019f2 Author: Ludovic Marcotte Date: Fri Jul 19 10:10:31 2013 -0400 Reverted patch M sope-appserver/NGObjWeb/Associations/WOKeyPathAssociation.m M sope-appserver/NGObjWeb/DynamicElements/WOComponentContent.m M sope-appserver/NGObjWeb/DynamicElements/WOComponentReference.m M sope-appserver/NGObjWeb/NSObject+WO.m M sope-appserver/NGObjWeb/SoObjects/SoSelectorInvocation.m M sope-appserver/NGObjWeb/WOChildComponentReference.m M sope-appserver/NGObjWeb/WORunLoop.m M sope-appserver/NGObjWeb/WOSession.m M sope-appserver/NGObjWeb/common.h M sope-core/EOControl/EOKeyComparisonQualifier.m M sope-core/EOControl/EOKeyValueCoding.m M sope-core/EOControl/EOKeyValueQualifier.m M sope-core/EOControl/EOSortOrdering.m M sope-core/EOControl/EOValidation.m M sope-core/EOControl/common.h M sope-core/EOCoreData/EOKeyComparisonQualifier+CoreData.m M sope-core/EOCoreData/EOKeyValueQualifier+CoreData.m M sope-core/EOCoreData/EOQualifier+CoreData.m M sope-core/EOCoreData/EOSortOrdering+CoreData.m M sope-core/EOCoreData/common.h M sope-core/NGExtensions/EOExt.subproj/EOQualifier+CtxEval.m M sope-core/NGStreams/NGStreamCoder.m M sope-gdl1/GDLAccess/EOAdaptorDataSource.m M sope-gdl1/GDLAccess/EOKeyComparisonQualifier+SQL.m M sope-gdl1/GDLAccess/EOKeyValueQualifier+SQL.m M sope-gdl1/GDLAccess/EOSQLExpression.m M sope-gdl1/GDLAccess/common.h M sope-ldap/NGLdap/EOQualifier+LDAP.m M sope-mime/NGImap4/EOQualifier+IMAPAdditions.m M sope-mime/NGImap4/EOSortOrdering+IMAPAdditions.m M sope-mime/NGImap4/NGImap4Folder.m M sope-mime/NGImap4/imCommon.h M sope-mime/NGMime/common.h commit d93b3d55d889219a5b0e0b8af9fcf2d2ba3d2967 Author: Ludovic Marcotte Date: Thu Jul 18 11:02:06 2013 -0400 Applied patch from bug #2234 M sope-appserver/NGObjWeb/Associations/WOKeyPathAssociation.m M sope-appserver/NGObjWeb/DynamicElements/WOComponentContent.m M sope-appserver/NGObjWeb/DynamicElements/WOComponentReference.m M sope-appserver/NGObjWeb/NSObject+WO.m M sope-appserver/NGObjWeb/SoObjects/SoSelectorInvocation.m M sope-appserver/NGObjWeb/WOChildComponentReference.m M sope-appserver/NGObjWeb/WORunLoop.m M sope-appserver/NGObjWeb/WOSession.m M sope-appserver/NGObjWeb/common.h M sope-core/EOControl/EOKeyComparisonQualifier.m M sope-core/EOControl/EOKeyValueCoding.m M sope-core/EOControl/EOKeyValueQualifier.m M sope-core/EOControl/EOSortOrdering.m M sope-core/EOControl/EOValidation.m M sope-core/EOControl/common.h M sope-core/EOCoreData/EOKeyComparisonQualifier+CoreData.m M sope-core/EOCoreData/EOKeyValueQualifier+CoreData.m M sope-core/EOCoreData/EOQualifier+CoreData.m M sope-core/EOCoreData/EOSortOrdering+CoreData.m M sope-core/EOCoreData/common.h M sope-core/NGExtensions/EOExt.subproj/EOQualifier+CtxEval.m M sope-core/NGStreams/NGStreamCoder.m M sope-gdl1/GDLAccess/EOAdaptorDataSource.m M sope-gdl1/GDLAccess/EOKeyComparisonQualifier+SQL.m M sope-gdl1/GDLAccess/EOKeyValueQualifier+SQL.m M sope-gdl1/GDLAccess/EOSQLExpression.m M sope-gdl1/GDLAccess/common.h M sope-ldap/NGLdap/EOQualifier+LDAP.m M sope-mime/NGImap4/EOQualifier+IMAPAdditions.m M sope-mime/NGImap4/EOSortOrdering+IMAPAdditions.m M sope-mime/NGImap4/NGImap4Folder.m M sope-mime/NGImap4/imCommon.h M sope-mime/NGMime/common.h commit ede754c45999a35304d4bcba6ec427b9b445983d Author: Ludovic Marcotte Date: Fri Jun 21 12:47:08 2013 -0400 Update ChangeLog M ChangeLog commit d30c986f9d2cefc764ae420cc3f2509adc0fea33 Author: Jean Raby Date: Thu Jun 20 00:45:01 2013 -0400 Multiple fixes to logging subsystem * Defaults.plist: don't hardcode the loglevel for WOHttpTransactionLoggerConfig, use default * Templates/WOxElemBuilder.m: don't setLogLevel on the defaultLogger * WOApplication.m: don't setLogLevel on the defaultLogger * WOHttpAdaptor/WORequestParser.m: don't setLogLevel on the defaultLogger * NSObject+Logs.m (debugWithFormat:arguments:): check current logLevel value before calling [NGLogger logLevel:message:] This squelches debug message at lower log levels * NGLogger.m (_logLevelForString): fix the check and return the defaultLogLevel instead of hardcoding INFO M sope-appserver/NGObjWeb/ChangeLog M sope-appserver/NGObjWeb/Defaults.plist M sope-appserver/NGObjWeb/Templates/WOxElemBuilder.m M sope-appserver/NGObjWeb/WOApplication.m M sope-appserver/NGObjWeb/WOHttpAdaptor/WORequestParser.m M sope-core/NGExtensions/ChangeLog M sope-core/NGExtensions/FdExt.subproj/NSObject+Logs.m M sope-core/NGExtensions/NGLogging.subproj/ChangeLog M sope-core/NGExtensions/NGLogging.subproj/NGLogger.m commit d6331e074c376bddc20280b22c246b5032acff57 Author: Jean Raby Date: Wed Jun 12 06:46:52 2013 -0400 log ssl error M sope-core/NGStreams/NGActiveSSLSocket.m commit f958f49542fb11a4fc82ebc71172e04d395bc811 Author: Francis Lachapelle Date: Thu Apr 11 13:00:45 2013 -0400 Update ChangeLog M ChangeLog commit 24588cf7e401c287878abbc2ca605d4ee3431415 Author: Jean Raby Date: Tue Apr 2 21:03:14 2013 -0400 handle sieve capabilities after starttls Fixes #2132 M sope-mime/NGImap4/NGSieveClient.m commit b45dbb52984cc5dd62c5a5e589f164dbbc26309f Author: Jean Raby Date: Tue Feb 5 14:07:44 2013 -0500 Use standard proxy headers if remotehost isn't set The code will now use 'x-forward' or 'x-forwarded-for' header if x-webobjects-remote-host is not set. Allows for more useful logging (Fixes #2229) M sope-appserver/NGObjWeb/ChangeLog M sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpTransaction.m commit 995b534ca83b8a06c89e9d9cff620de1f949b522 Author: Francis Lachapelle Date: Mon Feb 4 14:26:40 2013 -0500 Update ChangeLog M ChangeLog commit 2d2ed180fe154318a3f5dd64b01765ef4d174e48 Author: Jean Raby Date: Thu Jan 31 13:27:51 2013 -0500 Remove useless [NSString stringWithString] M sope-ldap/NGLdap/NSString+DN.m commit 82342978d28f6621d2d8a91053be8d56f96946e9 Author: Jean Raby Date: Thu Jan 31 12:31:25 2013 -0500 Use dnComponents where appropriate Namely in lastDnComponent and stringByDeletingLastDNComponent M sope-ldap/NGLdap/NSString+DN.m commit 7a8cb886103dc9b4569151ae185b9e3bc2e95b4e Author: Jean Raby Date: Thu Jan 31 12:10:09 2013 -0500 Rework dnComponents to use non deprecated ldap api Use ldap_{str2dn,rdn2str} to build properly encoded/escaped DN components M sope-ldap/NGLdap/NSString+DN.m commit 9f494524f0686bb828bf541ff9a8e2b833861ece Author: Jean Raby Date: Wed Jan 30 22:21:22 2013 -0500 revert previous fix for #2152 ldap_explode_dn breaks utf8 and AD complains pretty loudly... M sope-ldap/NGLdap/NSString+DN.m commit 917e35950e1e7ffeb996d9317653640184527bac Author: Francis Lachapelle Date: Wed Jan 30 08:56:46 2013 -0500 Update ChangeLog M ChangeLog commit 16deb50d8d8d803163cb8088883ce5da2d66ede0 Author: Ludovic Marcotte Date: Mon Jan 28 13:40:42 2013 -0500 Fix for bug #2200. M sope-core/NGExtensions/FdExt.subproj/NSString+URLEscaping.m commit 2166006e47416c736efedfc0a5d1b93b5dec8474 Author: Francis Lachapelle Date: Thu Jan 24 19:16:07 2013 -0500 Update ChangeLog M ChangeLog commit bf8a01faee50ac0209051fa1870ca338dc112904 Author: Ludovic Marcotte Date: Wed Jan 23 09:39:30 2013 -0500 Fixed a crash when malformed base64 data was passed during DAV plain auth. M sope-appserver/NGObjWeb/NGHttp/NGHttpHeaderFields.m M sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpTransaction.m commit 9c3999fadcf3b5e2de9dfbf21756eaa4b7d41e54 Author: Francis Lachapelle Date: Mon Jan 14 14:24:43 2013 -0500 Fix SMTP AUTH with long login Fixes #2126 M sope-mime/NGMail/NGSmtpClient.m commit 52d80264db6e5d4d8aedd50f3bb76d015b8394d6 Author: Ludovic Marcotte Date: Fri Jan 11 11:50:11 2013 -0500 Fixed memleak in patch from #2152 + formatting changes. M sope-ldap/NGLdap/NSString+DN.m commit 134db61df78edbd367c8b740513802c5fcb25571 Author: Adam Tkac Date: Wed Dec 19 21:08:05 2012 +0100 NSString+DN.m:dnComponents method failed to parse DNs which contain commas NSString+DN.m:dnComponents failed to parse for example following DN: dn: CN=Tkac\, Adam,OU=ITZ,DC=geodis,DC=cz The DN was splitted into "CN=Tkac\", "Adam", "OU=ITZ", "DC=geodis", "DC=cz" which is apparently wrong. Now the DN is splitted correctly into "CN=Tkac\, Adam", "OU=ITZ", "DC=geodis", "DC=cz" Signed-off-by: Adam Tkac Signed-off-by: Ludovic Marcotte M sope-ldap/NGLdap/NSString+DN.m commit 888a2595a60f0e24a81b066651c26c5f14761fce Author: Ludovic Marcotte Date: Wed Jan 9 13:04:36 2013 -0500 Fix for bug #2161 M sope-mime/NGMail/NGSmtpClient.m commit b4062373339a2a675d86d8578c5c2dc2627bbcb0 Author: Ludovic Marcotte Date: Wed Jan 9 12:43:42 2013 -0500 Applied patch from bug #2154. M sope-gdl1/GDLAccess/EOArrayProxy.m commit efccb03d148c64e10b51dbe2e40be5d08bf1b1c8 Author: Ludovic Marcotte Date: Wed Jan 9 11:29:48 2013 -0500 Added missing #include - bug #2141. M sope-core/NGStreams/NGActiveSocket.m commit 8c29d3b6d2c2d27a421c1109b6d582951fbff36d Author: Jean Raby Date: Thu Dec 20 10:39:52 2012 -0500 Add support for LDAP URLs and tweak exception code handle is now a LDAP* _reinit: use ldap_initialize if provided with a ldap url _exceptionForErrorCode: replace handrolled solution with ldap_err2str startTLS: raise an exception if ldap_start_tls_s fails Callers should be updated to do something useful with this exception. M sope-ldap/NGLdap/ChangeLog M sope-ldap/NGLdap/NGLdapConnection.h M sope-ldap/NGLdap/NGLdapConnection.m commit 557954949330fd63f03e418ac1e08d73407f836d Author: Francis Lachapelle Date: Thu Dec 6 10:55:34 2012 -0500 Update ChangeLog M ChangeLog commit 180ee5442d3245265a993de4c565271bc6c5c142 Author: Ludovic Marcotte Date: Mon Dec 3 16:27:45 2012 -0500 Fix for bug #2126 M sope-mime/NGMail/NGSmtpClient.m M sope-mime/NGMail/NGSmtpReplyCodes.h commit bc62cc45f0c4978f4454a8ccf0887b1f01f6e32c Author: Ludovic Marcotte Date: Fri Nov 30 10:07:34 2012 -0500 Added ways to obtain Sieve's server capabilities. This fixes bug #1391. M sope-mime/NGImap4/NGSieveClient.h M sope-mime/NGImap4/NGSieveClient.m commit fc4c41a74c7cdbcee1cfd7d797bd1b1aa9f29815 Author: Jean Raby Date: Thu Nov 15 11:53:04 2012 -0500 defaultAppenderClassName: NGLogStderrAppender Change NGLogAppender fallback appender to NGLogStderrAppender M sope-core/NGExtensions/NGExtensions/NGLogAppender.h M sope-core/NGExtensions/NGLogging.subproj/NGLogAppender.m commit a18bb288f890db5747911bf2c74382e59583fde4 Author: Ludovic Marcotte Date: Tue Nov 13 08:34:29 2012 -0500 Removed premature IMAP optmization, causing attachments corruption. This patch would "corrupt" some attachment when viewing them, or saving them to the local filesystem. Files would be truncated, or exceed in bytes, rendering them useless. M sope-core/NGStreams/NGByteBuffer.m M sope-core/NGStreams/NGStreams/NGByteBuffer.h M sope-mime/NGImap4/NGImap4ResponseParser.m commit 9de080f29a9f965ac46db911d15305654bf3602f Author: Ludovic Marcotte Date: Tue Nov 13 08:30:08 2012 -0500 Removed useless and buggy optimization. This optimization would break heavily localization support in SOGo. This patch might be reviewed later, but for now, we remove it. M sope-core/NGExtensions/NGBundleManager.m commit baef7f83a658ca22bc056cc2a5f1c816079f0768 Author: Wolfgang Sourdeau Date: Wed Nov 7 10:14:03 2012 -0500 Use the output of "gnustep-config --base-libs" to determine which libs our libraries must be linked against M configure M sope-appserver/NGObjWeb/GNUmakefile.preamble M sope-appserver/WEExtensions/GNUmakefile.preamble M sope-appserver/WOExtensions/GNUmakefile.preamble M sope-core/EOControl/GNUmakefile.preamble M sope-core/NGExtensions/GNUmakefile.preamble M sope-core/NGStreams/GNUmakefile.preamble M sope-gdl1/GDLAccess/GNUmakefile.preamble M sope-ldap/NGLdap/GNUmakefile.preamble M sope-mime/GNUmakefile.preamble M sope-xml/DOM/GNUmakefile.preamble M sope-xml/SaxObjC/GNUmakefile.preamble M sope-xml/XmlRpc/GNUmakefile.preamble commit 29800475e0cc61e2667d0a05f2438337e45be3e6 Author: Wolfgang Sourdeau Date: Tue Nov 6 13:49:23 2012 -0500 Remove carriage returns from base64 blob M sope-mime/NGImap4/NGImap4Client.m commit 0caecc6ff0cf3148881824dbd307e5bbb47079be Author: Wolfgang Sourdeau Date: Tue Nov 6 13:48:54 2012 -0500 Added -compress and -compressWithLevel: to compress NSData as headerless zlib streams M sope-core/NGExtensions/FdExt.subproj/NSData+gzip.m M sope-core/NGExtensions/NGExtensions/NSData+gzip.h commit e1996a96a76025270596b11c782db33061e3cdd0 Author: Wolfgang Sourdeau Date: Mon Nov 5 13:58:57 2012 -0500 Added a safeguard for infinite loops occuring when a parser instance request the same buffer position too many times (53 times max) M sope-core/NGStreams/NGByteBuffer.m M sope-core/NGStreams/NGStreams/NGByteBuffer.h commit 39fb8d8e4a49ed99909b0e6f7439c043cc428884 Author: Wolfgang Sourdeau Date: Mon Nov 5 10:29:09 2012 -0500 added support for the IMAP AUTHENTICATE command M sope-mime/NGImap4/NGImap4Client.h M sope-mime/NGImap4/NGImap4Client.m M sope-mime/NGImap4/NGImap4ConnectionManager.m commit 88657808dc1a08a4607d5702434fcb1cca451131 Author: Wolfgang Sourdeau Date: Tue Oct 30 09:40:06 2012 -0400 moved -[SoComponent componentBundle] into "WOComponent" class M sope-appserver/NGObjWeb/NGObjWeb/WOComponent.h M sope-appserver/NGObjWeb/SoObjects/SoComponent.h M sope-appserver/NGObjWeb/SoObjects/SoComponent.m M sope-appserver/NGObjWeb/WOComponent.m commit c471578a7e7186ad3e2bef4d8dd5ef6b0fb140fe Author: Wolfgang Sourdeau Date: Tue Oct 30 08:52:50 2012 -0400 initialize last_pos to 0 M sope-mime/NGImap4/NGImap4ResponseParser.m commit cfcc1bd1886b216a26f6aaf56293f3b363bf1c98 Author: Wolfgang Sourdeau Date: Tue Oct 30 08:47:53 2012 -0400 make use of WOResponse_AddBytesLen to avoid calls to strlen for known lengths M sope-appserver/NGObjWeb/DynamicElements/WOGenericContainer.m M sope-appserver/NGObjWeb/DynamicElements/WOImage.m commit 397fd115a02d53acc3d606a7267428a346fa694d Author: Wolfgang Sourdeau Date: Tue Oct 30 08:46:34 2012 -0400 allocated the "content" ivar during init, and expose the IMPL of appendContentBytes:length: via the addBytesLen function pointer M sope-appserver/NGObjWeb/NGObjWeb/WOMessage.h M sope-appserver/NGObjWeb/WOMessage.m M sope-appserver/NGObjWeb/WOResponse+private.h commit c85c649b7f502bfac4d1b93ac59026c4060fb3ae Author: Wolfgang Sourdeau Date: Tue Oct 30 08:43:38 2012 -0400 cache the component bundle M sope-appserver/NGObjWeb/SoObjects/SoComponent.h commit e8bea4c638e7dc7a23d82dc2e7364cbd5260fd74 Author: Wolfgang Sourdeau Date: Tue Oct 30 08:43:00 2012 -0400 Removed useless pointer validity check, at it is already performed in the underlying methods M sope-appserver/NGObjWeb/WOResponse+private.h commit 2a9f409eb7b35a383ff9af762147cb4fb626475d Author: Wolfgang Sourdeau Date: Tue Oct 30 08:40:34 2012 -0400 cache the component bundle M sope-appserver/NGObjWeb/SoObjects/SoComponent.m commit 6471303994298c6a45efcdf80d5b72e280e80d90 Author: Wolfgang Sourdeau Date: Tue Oct 30 08:38:47 2012 -0400 -[NGActiveSocket disableNagle:]: new method to disable the nagle algorithm M sope-core/NGStreams/NGActiveSocket.m M sope-core/NGStreams/NGStreams/NGActiveSocket.h commit c6124589e87a99300f5c1eb9fcdc951f7f8fe637 Author: Wolfgang Sourdeau Date: Mon Oct 29 16:44:59 2012 -0400 .mtn-ignore D .mtn-ignore commit 9d892351127e8a1a86bb014b313c61b1c30e28ae Author: Wolfgang Sourdeau Date: Fri Oct 26 17:34:36 2012 -0400 style M sope-core/NGExtensions/NGBundleManager.m commit befdab9b605c148c7054245272d2aa1a8253e383 Author: Wolfgang Sourdeau Date: Fri Oct 26 17:33:48 2012 -0400 use "," as separator for languages M sope-core/NGExtensions/NGBundleManager.m commit 79cd48cd6d503b8880aab918e8fc65e289c984fb Author: Wolfgang Sourdeau Date: Fri Oct 26 17:28:51 2012 -0400 Fixed deduction of lookup dir when _directory is NULL M sope-core/NGExtensions/NGBundleManager.m commit b72e9146e7644496703661313814f83e1ec9ec3c Author: Wolfgang Sourdeau Date: Fri Oct 26 16:20:23 2012 -0400 -pathForResource:ofType:inDirectory:languages: made faster by caching results M sope-core/NGExtensions/NGBundleManager.m commit 000158cc9442eb4d3c168c9e6dc11c8d6465561e Author: Wolfgang Sourdeau Date: Thu Oct 25 22:18:09 2012 -0400 Accelerated basic page loading by caching the list of browser languages M sope-appserver/NGObjWeb/NGObjWeb/WORequest.h M sope-appserver/NGObjWeb/WORequest.m commit 441b5159d34361e9f614c6a5d9b6907afca75639 Author: Wolfgang Sourdeau Date: Thu Oct 25 09:31:11 2012 -0400 "last_pos" should be > 1 in order to be taken into account and "new_pos" could be 0 when the first character of the buffer is "\r" M sope-mime/NGImap4/NGImap4ResponseParser.m commit a0702f6b0dea3fcd9d70af41fc09d83386a5ae92 Author: Wolfgang Sourdeau Date: Wed Oct 24 15:00:15 2012 -0400 style M ChangeLog commit 67812062daa25a8f52fff897b2c49b9c5554623c Author: Wolfgang Sourdeau Date: Tue Oct 23 17:25:00 2012 -0400 Replaced ChangeLog with the one generated from git M ChangeLog A ChangeLog.old commit 00f3a7573a1888f62f6d8a189dfa6ede470b2b3e Author: Wolfgang Sourdeau Date: Tue Oct 23 08:03:11 2012 -0400 added support for gnutls (thanks to Jeroen Dekkers) and enabled the choice between gnutls and ssl from the configure script M configure M sope-core/NGStreams/GNUmakefile.preamble M sope-core/NGStreams/NGActiveSSLSocket.m M sope-core/NGStreams/NGStreams/NGActiveSSLSocket.h commit b362d140300b9a52cb9b892637fdc1312a29b940 Author: Wolfgang Sourdeau Date: Tue Oct 23 08:02:18 2012 -0400 do not link NGLdap against libssl M sope-ldap/NGLdap/GNUmakefile.preamble commit ec2bb6802f1d5c2a5ac032bd89c3fa3488b613d2 Author: Wolfgang Sourdeau Date: Mon Oct 22 13:04:03 2012 -0400 relink WOExtensions.wox against libWOExtensions and libWEExtensions M sope-appserver/WOExtensions/GNUmakefile.preamble commit e2d4127aa1f9eaaffc451185a262bd7895ee376a Author: Wolfgang Sourdeau Date: Sun Oct 21 00:25:24 2012 -0400 Fixed most build warnings M sope-appserver/NGObjWeb/DynamicElements/WOComponentReference.m M sope-appserver/NGObjWeb/DynamicElements/WOxTalElemBuilder.m M sope-appserver/NGObjWeb/NGHttp/NGHttpMessageParser.m M sope-appserver/NGObjWeb/OWResourceManager.m M sope-appserver/NGObjWeb/SoObjects/SoCookieAuthenticator.m M sope-appserver/NGObjWeb/SoObjects/SoHTTPAuthenticator.m M sope-appserver/NGObjWeb/SoObjects/SoObjCClass.m M sope-appserver/NGObjWeb/SoObjects/SoObject+Traversal.m M sope-appserver/NGObjWeb/SoObjects/SoProductRegistry.m M sope-appserver/NGObjWeb/SoObjects/SoUser.m M sope-appserver/NGObjWeb/Templates/WOApplication+Builders.m M sope-appserver/NGObjWeb/Templates/WOxElemBuilder.m M sope-appserver/NGObjWeb/WEClientCapabilities.m M sope-appserver/NGObjWeb/WOComponentDefinition.m M sope-appserver/NGObjWeb/WOCoreApplication+Bundle.m M sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpAdaptor.m M sope-appserver/NGObjWeb/WOResourceManager.m M sope-appserver/NGObjWeb/WOSession.m M sope-appserver/NGObjWeb/WOWatchDogApplicationMain.m M sope-appserver/NGObjWeb/WebDAV/SoDAVSQLParser.m M sope-appserver/NGObjWeb/WebDAV/SoObjectWebDAVDispatcher.m M sope-appserver/NGObjWeb/wod.m M sope-appserver/WEExtensions/WEBrowser.m M sope-appserver/WEExtensions/WECalendarField.m M sope-appserver/WEExtensions/WEMonthOverview.m M sope-appserver/WEExtensions/WEPageView.m M sope-appserver/WEExtensions/WEStringTableManager.m M sope-appserver/WEExtensions/WETabItem.m M sope-appserver/WEExtensions/WETableMatrix.m M sope-appserver/WEExtensions/WEWeekOverview.m M sope-appserver/WOExtensions/WOCollapsibleComponentContent.m M sope-core/EOControl/EOKeyValueArchiver.m M sope-core/EOControl/EOSQLParser.m M sope-core/NGExtensions/FdExt.subproj/NSString+Encoding.m M sope-core/NGExtensions/NGBundleManager.m M sope-core/NGExtensions/NGCalendarDateRange.m M sope-core/NGStreams/NGByteBuffer.m M sope-core/NGStreams/NGDatagramSocket.m M sope-core/NGStreams/NGLockingStream.m M sope-core/NGStreams/NGStreams/NGByteBuffer.h M sope-gdl1/GDLAccess/EOAdaptorDataSource.m M sope-gdl1/GDLAccess/EOEntity.m M sope-gdl1/GDLAccess/EOSQLExpression.m M sope-gdl1/GDLAccess/EOSQLQualifier.m M sope-gdl1/GDLAccess/connect-EOAdaptor.m M sope-gdl1/GDLAccess/load-EOAdaptor.m M sope-gdl1/PostgreSQL/PostgreSQL72Channel.m M sope-ldap/NGLdap/NGLdapConnection.m M sope-ldap/NGLdap/NGLdapSearchResultEnumerator.m M sope-mime/NGImap4/NGImap4FileManager.m M sope-mime/NGImap4/NGImap4Folder.m M sope-mime/NGImap4/NSString+Imap4.m M sope-mime/NGMail/NGPop3Client.m M sope-mime/NGMime/NGMimeType.m M sope-xml/DOM/DOMPYXOutputter.m M sope-xml/DOM/DOMQueryPathExpression.m M sope-xml/DOM/DOMSaxBuilder.m M sope-xml/STXSaxDriver/ExtraSTX/StructuredText.m M sope-xml/SaxObjC/SaxObjectModel.m M sope-xml/XmlRpc/NSMutableString+XmlRpcDecoder.m M sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.m commit a1534205525a16b6c482e99ac46a4801d0573e28 Author: Wolfgang Sourdeau Date: Sat Oct 20 21:09:04 2012 -0400 assign uUri only when needed M sope-appserver/NGObjWeb/DynamicElements/WOBody.m commit 8b711dbb879bbe5909be3d578c5e259dbec49cd0 Author: Wolfgang Sourdeau Date: Sat Oct 20 21:07:02 2012 -0400 declare and increment "depth" only in debug mode M sope-appserver/NGObjWeb/DynamicElements/WOCompoundElement.m commit c31b6334a18b756dbe3e2fb4a52eb8a9a2f68e00 Author: Wolfgang Sourdeau Date: Sat Oct 20 21:05:28 2012 -0400 make "count" return an "NSUInteger" rather than an "unsigned int" as in the original method signature (thanks to Sebastian Reitenbach) M sope-gdl1/GDLAccess/EOPrimaryKeyDictionary.m commit 28cfbd2a3940447322a91e11147e9f77a6fbe45f Author: Wolfgang Sourdeau Date: Fri Oct 19 17:29:09 2012 -0400 Unit tested and fixed _removeCRLF due to certain characters missing M sope-mime/NGImap4/NGImap4ResponseParser.m commit c8101a145047739d32096804f1e315a0825f4a37 Author: Jeroen Dekkers Date: Thu Oct 18 20:27:01 2012 +0200 Remove disabling of optimization for exception handlers that was added ages ago and not needed anymore M sope-appserver/NGObjWeb/DynamicElements/GNUmakefile.preamble M sope-xml/DOM/GNUmakefile.preamble M sope-xml/SaxObjC/GNUmakefile.preamble M sope-xml/XmlRpc/GNUmakefile.preamble commit c24dfc32880eedc3fde90f1f3f4f5b7e6d90e3b5 Author: Jeroen Dekkers Date: Thu Oct 18 20:26:47 2012 +0200 Specify all necessary libraries when linking M sope-appserver/NGObjWeb/GNUmakefile.preamble M sope-appserver/WEExtensions/GNUmakefile.preamble M sope-appserver/WOExtensions/GNUmakefile.preamble M sope-core/EOControl/GNUmakefile.preamble M sope-core/NGExtensions/GNUmakefile.preamble M sope-core/NGStreams/GNUmakefile.preamble M sope-gdl1/GDLAccess/GNUmakefile.preamble M sope-gdl1/MySQL/GNUmakefile.preamble M sope-ldap/NGLdap/GNUmakefile.preamble M sope-mime/GNUmakefile.preamble M sope-xml/DOM/GNUmakefile.preamble M sope-xml/SaxObjC/GNUmakefile.preamble M sope-xml/XmlRpc/GNUmakefile.preamble commit c6266891e2c4338957ef5134e450ce9a986f97e2 Author: Jeroen Dekkers Date: Thu Oct 18 20:26:29 2012 +0200 Fix building on arm and alpha M sope-gdl1/GDLAccess/EOSQLQualifier.m M sope-gdl1/GDLAccess/FoundationExt/PrintfFormatScanner.m commit 9876233a34fa023fd31730855009004b0898edc2 Author: Jeroen Dekkers Date: Thu Oct 18 20:26:19 2012 +0200 Close all file descriptors on daemon start M sope-appserver/NGObjWeb/WOWatchDogApplicationMain.m commit 0a9ab5200fa541a506626185e5478381d613f0e3 Author: Wolfgang Sourdeau Date: Thu Oct 18 10:36:29 2012 -0400 removed (apparently) useless +version method from classes, due to problems with the ObjC2 runtime on OpenBSD (thanks to Sebastian Reitenbach) M sope-appserver/NGObjWeb/Associations/WOAssociation.m M sope-appserver/NGObjWeb/Associations/WOKeyPathAssociation.m M sope-appserver/NGObjWeb/Associations/WOKeyPathAssociationSystemKVC.m M sope-appserver/NGObjWeb/Associations/WOLabelAssociation.m M sope-appserver/NGObjWeb/Associations/WOResourceURLAssociation.m M sope-appserver/NGObjWeb/Associations/WOScriptAssociation.m M sope-appserver/NGObjWeb/Associations/WOValueAssociation.m M sope-appserver/NGObjWeb/DynamicElements/WOActionURL.m M sope-appserver/NGObjWeb/DynamicElements/WOBrowser.m M sope-appserver/NGObjWeb/DynamicElements/WOForm.m M sope-appserver/NGObjWeb/DynamicElements/WOFrame.m M sope-appserver/NGObjWeb/DynamicElements/WOHTMLDynamicElement.m M sope-appserver/NGObjWeb/DynamicElements/WOHyperlink.m M sope-appserver/NGObjWeb/DynamicElements/WOIFrame.m M sope-appserver/NGObjWeb/DynamicElements/WOImageButton.m M sope-appserver/NGObjWeb/DynamicElements/WOInput.m M sope-appserver/NGObjWeb/DynamicElements/WOPopUpButton.m M sope-appserver/NGObjWeb/DynamicElements/WORepetition.m M sope-appserver/NGObjWeb/DynamicElements/WOString.m M sope-appserver/NGObjWeb/DynamicElements/WOSubmitButton.m M sope-appserver/NGObjWeb/DynamicElements/_WOComplexHyperlink.m M sope-appserver/NGObjWeb/DynamicElements/_WOSimpleActionHyperlink.m M sope-appserver/NGObjWeb/NGHttp/NGHttpBodyParser.m M sope-appserver/NGObjWeb/NGHttp/NGHttpMessageParser.m M sope-appserver/NGObjWeb/OWResourceManager.m M sope-appserver/NGObjWeb/OWViewRequestHandler.m M sope-appserver/NGObjWeb/SoObjects/SoComponent.m M sope-appserver/NGObjWeb/SoObjects/SoControlPanel.m M sope-appserver/NGObjWeb/SoObjects/SoCookieAuthenticator.m M sope-appserver/NGObjWeb/SoObjects/SoHTTPAuthenticator.m M sope-appserver/NGObjWeb/SoObjects/SoLookupAssociation.m M sope-appserver/NGObjWeb/SoObjects/SoObjectRequestHandler.m M sope-appserver/NGObjWeb/SoObjects/SoSubContext.m M sope-appserver/NGObjWeb/Templates/WOTemplate.m M sope-appserver/NGObjWeb/Templates/WOTemplateBuilder.m M sope-appserver/NGObjWeb/Templates/WOWrapperTemplateBuilder.m M sope-appserver/NGObjWeb/Templates/WOxElemBuilder.m M sope-appserver/NGObjWeb/Templates/WOxTemplateBuilder.m M sope-appserver/NGObjWeb/WOAdaptor.m M sope-appserver/NGObjWeb/WOApplication.m M sope-appserver/NGObjWeb/WOChildComponentReference.m M sope-appserver/NGObjWeb/WOComponent.m M sope-appserver/NGObjWeb/WOComponentDefinition.m M sope-appserver/NGObjWeb/WOComponentFault.m M sope-appserver/NGObjWeb/WOComponentRequestHandler.m M sope-appserver/NGObjWeb/WOContext.m M sope-appserver/NGObjWeb/WOCoreApplication.m M sope-appserver/NGObjWeb/WODirectAction.m M sope-appserver/NGObjWeb/WODirectActionRequestHandler.m M sope-appserver/NGObjWeb/WODynamicElement.m M sope-appserver/NGObjWeb/WOElement.m M sope-appserver/NGObjWeb/WOFileSessionStore.m M sope-appserver/NGObjWeb/WOHTTPConnection.m M sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpAdaptor.m M sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpTransaction.m M sope-appserver/NGObjWeb/WOMailDelivery.m M sope-appserver/NGObjWeb/WOMessage.m M sope-appserver/NGObjWeb/WOPageRequestHandler.m M sope-appserver/NGObjWeb/WOProxyRequestHandler.m M sope-appserver/NGObjWeb/WORequest.m M sope-appserver/NGObjWeb/WORequestHandler.m M sope-appserver/NGObjWeb/WOResourceManager.m M sope-appserver/NGObjWeb/WOResourceRequestHandler.m M sope-appserver/NGObjWeb/WOResponse.m M sope-appserver/NGObjWeb/WOServerSessionStore.m M sope-appserver/NGObjWeb/WOSession.m M sope-appserver/NGObjWeb/WOSessionStore.m M sope-appserver/NGObjWeb/WOSimpleHTTPParser.m M sope-appserver/NGObjWeb/WOStatisticsStore.m M sope-appserver/WEExtensions/WECalendarField.m M sope-appserver/WEExtensions/WEDragContainer.m M sope-appserver/WEExtensions/WEDropContainer.m M sope-appserver/WEExtensions/WEEpozEditor.m M sope-appserver/WEExtensions/WEPageLink.m M sope-appserver/WEExtensions/WEPageView.m M sope-appserver/WEExtensions/WEResourceManager.m M sope-appserver/WEExtensions/WETabItem.m M sope-appserver/WEExtensions/WETabView.m M sope-appserver/WEExtensions/WETableCalcMatrix.m M sope-appserver/WEExtensions/WETableView/WETableData.m M sope-appserver/WEExtensions/WETableView/WETableView.m M sope-appserver/WEExtensions/bundle-info.plist M sope-appserver/WOExtensions/JSAlertPanel.m M sope-appserver/WOExtensions/JSConfirmPanel.m M sope-appserver/WOExtensions/JSImageFlyover.m M sope-appserver/WOExtensions/JSModalWindow.m M sope-appserver/WOExtensions/JSTextFlyover.m M sope-appserver/WOExtensions/JSValidatedField.m M sope-appserver/WOExtensions/bundle-info.plist M sope-core/EOControl/EODataSource.m M sope-core/NGExtensions/NGBundleManager.m M sope-core/NGExtensions/NGCustomFileManager.m M sope-core/NGExtensions/NGFileManager.m M sope-core/NGStreams/NGByteBuffer.m M sope-core/NGStreams/NGCTextStream.m M sope-core/NGStreams/NGDataStream.m M sope-core/NGStreams/NGInternetSocketDomain.m M sope-core/NGStreams/NGSocket.m M sope-core/NGStreams/NGTextStream.m M sope-gdl1/GDLAccess/EOAdaptorDataSource.m M sope-gdl1/GDLAccess/EOModel.m M sope-gdl1/GDLAccess/EOSQLExpression.m M sope-ldap/NGLdap/NGLdapFileManager.m M sope-mime/NGImap4/NGImap4Client.m M sope-mime/NGImap4/NGImap4FileManager.m M sope-mime/NGImap4/NGImap4Message.m M sope-mime/NGMail/NGMBoxReader.m M sope-mime/NGMail/NGMailAddress.m M sope-mime/NGMail/NGMailAddressList.m M sope-mime/NGMail/NGMailAddressParser.m M sope-mime/NGMail/NGMimeMessage.m M sope-mime/NGMail/NGMimeMessageBodyGenerator.m M sope-mime/NGMail/NGMimeMessageGenerator.m M sope-mime/NGMail/NGMimeMessageMultipartBodyGenerator.m M sope-mime/NGMail/NGMimeMessageParser.m M sope-mime/NGMail/NGMimeMessageRfc822BodyGenerator.m M sope-mime/NGMail/NGMimeMessageTextBodyGenerator.m M sope-mime/NGMail/NGPop3Client.m M sope-mime/NGMail/NGPop3Support.m M sope-mime/NGMail/NGSmtpClient.m M sope-mime/NGMail/NGSmtpSupport.m M sope-mime/NGMime/NGMimeAddressHeaderFieldGenerator.m M sope-mime/NGMime/NGMimeBodyGenerator.m M sope-mime/NGMime/NGMimeBodyParser.m M sope-mime/NGMime/NGMimeBodyPart.m M sope-mime/NGMime/NGMimeBodyPartParser.m M sope-mime/NGMime/NGMimeContentDispositionHeaderFieldGenerator.m M sope-mime/NGMime/NGMimeContentDispositionHeaderFieldParser.m M sope-mime/NGMime/NGMimeContentLengthHeaderFieldGenerator.m M sope-mime/NGMime/NGMimeContentLengthHeaderFieldParser.m M sope-mime/NGMime/NGMimeContentTypeHeaderFieldGenerator.m M sope-mime/NGMime/NGMimeContentTypeHeaderFieldParser.m M sope-mime/NGMime/NGMimeExceptions.m M sope-mime/NGMime/NGMimeHeaderFieldGenerator.m M sope-mime/NGMime/NGMimeHeaderFieldGeneratorSet.m M sope-mime/NGMime/NGMimeHeaderFieldParser.m M sope-mime/NGMime/NGMimeHeaderFieldParserSet.m M sope-mime/NGMime/NGMimeHeaderFields.m M sope-mime/NGMime/NGMimeMultipartBody.m M sope-mime/NGMime/NGMimeMultipartBodyGenerator.m M sope-mime/NGMime/NGMimeMultipartBodyParser.m M sope-mime/NGMime/NGMimePartGenerator.m M sope-mime/NGMime/NGMimePartParser.m M sope-mime/NGMime/NGMimeRFC822DateHeaderFieldGenerator.m M sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m M sope-mime/NGMime/NGMimeRfc822BodyGenerator.m M sope-mime/NGMime/NGMimeStringHeaderFieldGenerator.m M sope-mime/NGMime/NGMimeStringHeaderFieldParser.m M sope-mime/NGMime/NGMimeTextBodyGenerator.m M sope-mime/NGMime/NGMimeType.m commit adf53e59381e79a19f3bf17f949042e996785783 Author: Wolfgang Sourdeau Date: Thu Oct 18 01:16:11 2012 -0400 [NSData length] returns an NSUInteger (thanks to Sebastian Reitenbach) M sope-mime/NGMime/NGMimeFileData.m commit 9d54e0af27bcc2a3aa9e81eea082e2f035a64af0 Author: Wolfgang Sourdeau Date: Thu Oct 18 01:14:15 2012 -0400 we do not need to specify the objc runtime library on Windows as GNUstep Make would take care of that M sope-core/EOControl/GNUmakefile.preamble M sope-core/EOCoreData/GNUmakefile.preamble M sope-core/NGExtensions/GNUmakefile.preamble M sope-core/NGStreams/GNUmakefile.preamble M sope-ldap/NGLdap/GNUmakefile.preamble M sope-mime/GNUmakefile.preamble M sope-xml/DOM/GNUmakefile.preamble M sope-xml/SaxObjC/GNUmakefile.preamble M sope-xml/libxmlSAXDriver/GNUmakefile.preamble M sope-xml/pyxSAXDriver/GNUmakefile.preamble commit f102c6f03ea7079c090d3e56324773229e5cc3e2 Author: Wolfgang Sourdeau Date: Thu Oct 18 01:08:24 2012 -0400 we do not need to specify the objc runtime library as GNUstep Make takes care of that (thanks to Sebastian Reitenbach) M sope-core/NGExtensions/GNUmakefile.preamble commit cef70e79dbe144a5aa92a65bc899e98b549931ec Author: Wolfgang Sourdeau Date: Wed Oct 17 16:16:16 2012 -0400 Removed debugging left overs M sope-core/NGStreams/NGByteBuffer.m commit 7849bd84936bd6d5cd27b8c67a612c821266b2c1 Author: Wolfgang Sourdeau Date: Wed Oct 17 16:08:46 2012 -0400 Unified the handling of CRLF chars in a new "_removeCRLF" function and optimized it by making use of the libc functions instead of reading the buffers on our own M sope-mime/NGImap4/NGImap4ResponseParser.m commit 9a52d98eac736a0135867e6ecdc8d5186fd9cdf9 Author: Wolfgang Sourdeau Date: Wed Oct 17 16:07:36 2012 -0400 Further optimized the code by avoiding copying bytes to the local buffer when reading sufficiently large chunks and by restoring the IMPL hack M sope-core/NGStreams/NGByteBuffer.m M sope-core/NGStreams/NGStreams/NGByteBuffer.h commit b26b6cc1a532bec1a9352912c7a60f10019bb8d8 Author: Wolfgang Sourdeau Date: Tue Oct 16 16:55:51 2012 -0400 Added support for SMTP PLAIN authentication M sope-mime/NGMail/NGSmtpClient.h M sope-mime/NGMail/NGSmtpClient.m M sope-mime/NGMail/NGSmtpReplyCodes.h commit b13300034e733d7a8ce9aae15a786232b16c1e06 Author: Wolfgang Sourdeau Date: Tue Oct 16 13:44:29 2012 -0400 further improved things a little bit by reorganizing code and using registers for certain vars M sope-core/NGStreams/NGByteBuffer.m commit 5251d09e60da80406c9b2d3eed7bf4cce12c44ca Author: Wolfgang Sourdeau Date: Mon Oct 15 23:15:02 2012 -0400 the "flags" never really existed M sope-core/NGStreams/NGByteBuffer.m commit 345b50cf4e98d43b2b06ad77d76e640b475c0ec7 Author: Wolfgang Sourdeau Date: Mon Oct 15 23:10:51 2012 -0400 NGByteBuffer: improved the speed and memory usage of the byte handling processes by making use of references rather than arrays of flags M sope-core/NGStreams/NGByteBuffer.m M sope-core/NGStreams/NGStreams/NGByteBuffer.h commit 1b72be5e25cae788713952620a57033dbf99a384 Author: Wolfgang Sourdeau Date: Mon Oct 15 11:06:24 2012 -0400 NGHashMap: populating root->next directly is useless, since last->next is always updated and last = root when starting the list M sope-core/NGExtensions/NGHashMap.m commit dfceefcb141c1b31b26eea19ca07d3916d663315 Author: Wolfgang Sourdeau Date: Mon Oct 15 11:00:25 2012 -0400 NGHashMap: we now populate the internal linked lists in O(1) rather than in O(n), which is a serious improvement with large numbers of elements M sope-core/NGExtensions/NGHashMap.m commit f708c211edb6ef0e30e8d30506dd514b423bc7c4 Author: Wolfgang Sourdeau Date: Mon Oct 15 09:47:59 2012 -0400 Removed some redundant invocations of _la M sope-mime/NGImap4/NGImap4ResponseParser.m commit 720d188cdbc5139cc44f2cbc72e9c8d7066aa632 Author: Wolfgang Sourdeau Date: Mon Oct 15 09:45:11 2012 -0400 further optimised code by explicitly avoiding reads from RAM M sope-mime/NGImap4/NGImap4ResponseParser.m commit 060292b2e9d322e63c9b5a36f7d7c322fc62c917 Author: Wolfgang Sourdeau Date: Mon Oct 15 08:21:15 2012 -0400 removed useless voodoo M sope-core/NGStreams/NGByteBuffer.m commit 7a5c79db87a9548859c6f29e1a39ed084457fcd5 Author: Wolfgang Sourdeau Date: Mon Oct 15 08:17:53 2012 -0400 fixed invocation of calloc M sope-core/NGStreams/NGByteBuffer.m commit c1c4d20afbdcd78fd540b8d66edbdae015ad159a Author: Wolfgang Sourdeau Date: Mon Oct 15 08:17:31 2012 -0400 Removed useless hack regarding method IMPS, since the cost of the relevant ifs was more than those of the method invocations M sope-core/NGStreams/NGByteBuffer.m M sope-core/NGStreams/NGStreams/NGByteBuffer.h commit f97d700ea869feb04b57413cb62adf791ee1520b Author: Wolfgang Sourdeau Date: Mon Oct 15 08:10:31 2012 -0400 replaced malloc + memset with calloc M sope-core/NGStreams/NGByteBuffer.m commit 0e2b14a21b84fa0c7cff5ef850478d2b8e151c3b Author: Wolfgang Sourdeau Date: Fri Oct 12 12:39:11 2012 -0400 Fixed computing of time delta from struct timeval M sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpTransaction.m commit 627fba59ece590d11359480e820110f558a159bd Author: Wolfgang Sourdeau Date: Fri Oct 12 12:29:46 2012 -0400 Fixed a memory leak by releasing the allocated delegate object after it was assigned M sope-mime/NGMail/NGMimeMessageParser.m commit 4b1e35374269c31fc6c2e9aa8b0b67f077abc77d Author: Wolfgang Sourdeau Date: Fri Oct 12 12:29:16 2012 -0400 Retain and release the delegate when assigned M sope-mime/NGMime/NGMimePartParser.m commit 4b6e29680af2541f16a74ce9d9561b6fc801accc Author: Wolfgang Sourdeau Date: Fri Oct 12 12:18:01 2012 -0400 Sped up parsing by allocating only one buffer and attaching it to the returned NSData M sope-mime/NGImap4/NGImap4ResponseParser.m commit 53cc0bac72849c2c09937da45388f1406110c98b Author: Wolfgang Sourdeau Date: Fri Oct 12 12:16:43 2012 -0400 Sped up parsing by removing the need to allocate memory and reparse the same bytes more than once M sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m commit 9fc05456c222a7fb8a5d1b01662de7519c83f0fd Author: Wolfgang Sourdeau Date: Wed Oct 10 09:16:31 2012 -0400 include inttypes.h for PRIx64 M sope-core/NGExtensions/FdExt.subproj/NSObject+Values.m commit 50de54323a0b7ad45b617a8dd36dc270c7e66d81 Author: Wolfgang Sourdeau Date: Tue Oct 9 14:13:20 2012 -0400 +[NSString stringWithUnsignedLongLong:]: new constructor method that returns a hex-formatted representation of a 8 bytes unsigned integer M sope-core/NGExtensions/FdExt.subproj/NSObject+Values.m M sope-core/NGExtensions/NGExtensions/NSObject+Values.h commit 84ff74b1d757bb8cf0a0d217dbeb15fb54829ff1 Author: Wolfgang Sourdeau Date: Sun Oct 7 00:18:28 2012 -0400 avoid useless invocation to -copy M sope-mime/NGImap4/NGImap4ResponseNormalizer.m commit 45339ab1da6d8c87f17c113392fbc455cead6dee Author: Wolfgang Sourdeau Date: Sat Oct 6 14:20:30 2012 -0400 We accept NSNull as the resulting class of a json string M sope-json/SBJson/Classes/SBJsonParser.m commit 435f8e0daf1412d30d785dce87446c7347716205 Author: Wolfgang Sourdeau Date: Fri Oct 5 18:51:32 2012 -0400 enabled the fetching of multiple body parts at once, by avoiding renaming those to "body" in the response M sope-mime/NGImap4/NGImap4Connection.m M sope-mime/NGImap4/NGImap4Folder.m M sope-mime/NGImap4/NGImap4ResponseNormalizer.m commit a852d7c636e3ea463e492ddf73d1ea61124909c1 Author: Wolfgang Sourdeau Date: Fri Oct 5 15:26:51 2012 -0400 added handling of NIL responses for body parts M sope-mime/NGImap4/NGImap4ResponseParser.m commit 21e85bbc577eb287e06c687e2403c8e6b1bf1efc Author: Wolfgang Sourdeau Date: Tue Oct 2 15:59:41 2012 -0400 Implemented -[NSString unsignedLongLongValue] M sope-core/NGExtensions/FdExt.subproj/NSObject+Values.m commit 13d256bae2eeca5673b4f23dfcfbc387eb66eade Author: Wolfgang Sourdeau Date: Tue Oct 2 15:59:07 2012 -0400 Removed useless and costly implementation of -[NSMutableString stringValue] M sope-core/NGExtensions/FdExt.subproj/NSObject+Values.m commit 3a21618d2f4a995688c03344fc70d5b528259a4d Author: Ludovic Marcotte Date: Thu Sep 20 10:30:16 2012 -0400 Fixed bugs #1890 and #1905. M sope-appserver/NGObjWeb/SoObjects/SoDefaultRenderer.m M sope-gdl1/GDLAccess/FoundationExt/PrintfFormatScanner.m commit 84bf8c22034163ad0608cb3af347bb6f00120c21 Author: Francis Lachapelle Date: Mon Sep 10 17:09:42 2012 +0000 See sope-appserver/NGObjWeb/ChangeLog Monotone-Parent: bb3fdad58223adb3b5db5802b078e46cc0dd076a Monotone-Revision: cc3d4a024fbe9c9c2602de7f061655ffb2d3c786 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2012-09-10T17:09:42 Monotone-Branch: ca.inverse.sope M sope-appserver/NGObjWeb/ChangeLog M sope-appserver/NGObjWeb/NGHttp+WO.m commit c9fffeaa0f47bfea166fe1871f9f377545493be8 Author: Ludovic Marcotte Date: Thu Sep 6 08:48:49 2012 +0000 See ChangeLog Monotone-Parent: 2f23e55e9d7b67297faba428abc1e017f8ec6072 Monotone-Revision: c766aa285f3a2511e4e728b4aa87faa112521be5 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2012-09-06T08:48:49 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-mime/NGImap4/NGImap4Connection.h M sope-mime/NGImap4/NGImap4Connection.m commit 3244f2cb9ffc8dae4ab6b6315beab75840044d29 Author: Francis Lachapelle Date: Tue Sep 4 17:04:58 2012 +0000 See sope-appserver/NGObjWeb/ChangeLog Monotone-Parent: 2f23e55e9d7b67297faba428abc1e017f8ec6072 Monotone-Revision: 2242b23407828ca15b735ac862aadc4b3f143dd2 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2012-09-04T17:04:58 Monotone-Branch: ca.inverse.sope M sope-appserver/NGObjWeb/ChangeLog M sope-appserver/NGObjWeb/WEClientCapabilities.m commit 5788d59d8f9789a7cf1e158bed2f73e481c5dd4a Author: Ludovic Marcotte Date: Tue Sep 4 10:25:11 2012 +0000 Fix for bug #1966 Monotone-Parent: a548133128c8f057cf55481568691064bdebd5f8 Monotone-Revision: 2f23e55e9d7b67297faba428abc1e017f8ec6072 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2012-09-04T10:25:11 Monotone-Branch: ca.inverse.sope M sope-mime/NGMail/NGMailAddressParser.m commit b56cb0f3537da4b5cc9dba5bbd484907f6c41797 Author: Ludovic Marcotte Date: Tue Aug 28 08:26:28 2012 +0000 Fix for bug #1927 Monotone-Parent: 511791fc5bfb5cf1f56266a5c55753aa26f958b8 Monotone-Revision: a548133128c8f057cf55481568691064bdebd5f8 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2012-08-28T08:26:28 Monotone-Branch: ca.inverse.sope M sope-gdl1/GDLAccess/EOExpressionArray.m commit e1db3457a04e4aaba3350b334a9f6480fefbbd9f Author: Francis Lachapelle Date: Mon Aug 27 15:50:44 2012 +0000 See sope-mime/NGMail/ChangeLog Monotone-Parent: 57e49d338571c56854b554ebf9d7922693920b42 Monotone-Revision: 511791fc5bfb5cf1f56266a5c55753aa26f958b8 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2012-08-27T15:50:44 Monotone-Branch: ca.inverse.sope M sope-mime/NGMail/ChangeLog M sope-mime/NGMail/NGMailAddressParser.h M sope-mime/NGMail/NGMailAddressParser.m commit a48f32e1a239cd168ee97510f059441286500caa Author: Wolfgang Sourdeau Date: Wed Aug 8 17:19:00 2012 +0000 Monotone-Parent: cbd094f7768d84e8bef25c09fa754d85717b26fa Monotone-Revision: 3240b1c8d9bdee4e51d428685d65be78bfb185bf Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-08-08T17:19:00 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-appserver/NGObjWeb/NGObjWeb/WOCoreApplication.h M sope-appserver/NGObjWeb/WOCoreApplication.m commit 4ac6ad4aa9667f423bf71f5971ac7d1a3b829381 Author: Jean Raby Date: Thu Aug 2 18:45:21 2012 +0000 Mode packaging stuff to its own directory Add the rhel spec file Monotone-Parent: 9fcf97eb10d5be9ee65cc8ce8bf5651e02b25534 Monotone-Revision: 8cb1826d1f3de08c525682d9ed4355e568ec3727 Monotone-Author: jraby@inverse.ca Monotone-Date: 2012-08-02T18:45:21 Monotone-Branch: ca.inverse.sope D debian/500mod_ngobjweb.info D debian/changelog D debian/compat D debian/control.in D debian/copyright D debian/libapache-mod-ngobjweb.dirs D debian/libapache-mod-ngobjweb.install D debian/libapache-mod-ngobjweb.postinst D debian/libapache-mod-ngobjweb.postrm D debian/libapache-mod-ngobjweb.prerm D debian/libapache2-mod-ngobjweb.dirs D debian/libapache2-mod-ngobjweb.install D debian/libapache2-mod-ngobjweb.postinst D debian/libapache2-mod-ngobjweb.prerm D debian/libsbjson2.3-dev.install D debian/libsbjson2.3.install D debian/libsope-appserver_SOPEVER_-dev.install D debian/libsope-appserver_SOPEVER_.install D debian/libsope-core_SOPEVER_-dev.install D debian/libsope-core_SOPEVER_.install D debian/libsope-gdl1-_SOPEVER_-dev.install D debian/libsope-gdl1-_SOPEVER_.install D debian/libsope-ldap_SOPEVER_-dev.install D debian/libsope-ldap_SOPEVER_.install D debian/libsope-mime_SOPEVER_-dev.install D debian/libsope-mime_SOPEVER_.install D debian/libsope-xml_SOPEVER_-dev.install D debian/libsope-xml_SOPEVER_.install D debian/ngobjweb.load D debian/rules D debian/sope_SOPEVER_-appserver.install D debian/sope_SOPEVER_-appserver.links D debian/sope_SOPEVER_-gdl1-mysql.install D debian/sope_SOPEVER_-gdl1-postgresql.install D debian/sope_SOPEVER_-libxmlsaxdriver.install D debian/sope_SOPEVER_-stxsaxdriver.install A packaging/debian/500mod_ngobjweb.info A packaging/debian/changelog A packaging/debian/compat A packaging/debian/control.in A packaging/debian/copyright A packaging/debian/libapache-mod-ngobjweb.dirs A packaging/debian/libapache-mod-ngobjweb.install A packaging/debian/libapache-mod-ngobjweb.postinst A packaging/debian/libapache-mod-ngobjweb.postrm A packaging/debian/libapache-mod-ngobjweb.prerm A packaging/debian/libapache2-mod-ngobjweb.dirs A packaging/debian/libapache2-mod-ngobjweb.install A packaging/debian/libapache2-mod-ngobjweb.postinst A packaging/debian/libapache2-mod-ngobjweb.prerm A packaging/debian/libsbjson2.3-dev.install A packaging/debian/libsbjson2.3.install A packaging/debian/libsope-appserver_SOPEVER_-dev.install A packaging/debian/libsope-appserver_SOPEVER_.install A packaging/debian/libsope-core_SOPEVER_-dev.install A packaging/debian/libsope-core_SOPEVER_.install A packaging/debian/libsope-gdl1-_SOPEVER_-dev.install A packaging/debian/libsope-gdl1-_SOPEVER_.install A packaging/debian/libsope-ldap_SOPEVER_-dev.install A packaging/debian/libsope-ldap_SOPEVER_.install A packaging/debian/libsope-mime_SOPEVER_-dev.install A packaging/debian/libsope-mime_SOPEVER_.install A packaging/debian/libsope-xml_SOPEVER_-dev.install A packaging/debian/libsope-xml_SOPEVER_.install A packaging/debian/ngobjweb.load A packaging/debian/rules A packaging/debian/sope_SOPEVER_-appserver.install A packaging/debian/sope_SOPEVER_-appserver.links A packaging/debian/sope_SOPEVER_-gdl1-mysql.install A packaging/debian/sope_SOPEVER_-gdl1-postgresql.install A packaging/debian/sope_SOPEVER_-libxmlsaxdriver.install A packaging/debian/sope_SOPEVER_-stxsaxdriver.install A packaging/rhel/sope.spec commit 15c5f44267d15f04ed7547b30d468732a61b9d94 Author: Ludovic Marcotte Date: Mon Jul 23 13:34:24 2012 +0000 Added fix for bug #1593 Monotone-Parent: cbd094f7768d84e8bef25c09fa754d85717b26fa Monotone-Revision: 9fcf97eb10d5be9ee65cc8ce8bf5651e02b25534 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2012-07-23T13:34:24 Monotone-Branch: ca.inverse.sope M sope-xml/DOM/DOMElement.m commit 79b17e06904812fde2de74addfc0251479b96532 Author: Wolfgang Sourdeau Date: Tue Jul 10 15:58:47 2012 +0000 Monotone-Parent: bac2c81bb9b48922cfe4173bcbb8c041ec4631ef Monotone-Revision: cbd094f7768d84e8bef25c09fa754d85717b26fa Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-07-10T15:58:47 Monotone-Branch: ca.inverse.sope M sope-appserver/NGObjWeb/DAVPropMap.plist commit 0336dc79b837c929204e6c48b989573de86f6547 Author: Jean Raby Date: Thu May 31 15:35:55 2012 +0000 include inttypes.h for PRIuPTR macro. Causes a warning on lucid 64bit only but the data should be fine. Monotone-Parent: 2ae372cb89130a900713d9526275ebb1b1d31223 Monotone-Revision: bac2c81bb9b48922cfe4173bcbb8c041ec4631ef Monotone-Author: jraby@inverse.ca Monotone-Date: 2012-05-31T15:35:55 Monotone-Branch: ca.inverse.sope Monotone-Tag: SOPE_v1.3.16 M sope-appserver/NGObjWeb/NGHttp/common.h commit 3dfb4d2652c48356ff1ac41f67280428f32eb128 Author: Ludovic Marcotte Date: Thu May 31 12:33:27 2012 +0000 Moved code from SOGo to SOPE regarding lowercasing attribute names Monotone-Parent: 0971b8d4c54bb6e36c9ddbc585d5ba9ddd05df9a Monotone-Revision: 2ae372cb89130a900713d9526275ebb1b1d31223 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2012-05-31T12:33:27 Monotone-Branch: ca.inverse.sope M sope-ldap/NGLdap/NGLdapAttribute.h M sope-ldap/NGLdap/NGLdapAttribute.m M sope-ldap/NGLdap/NGLdapEntry.h M sope-ldap/NGLdap/NGLdapEntry.m commit 09bc5746a9aaae977b3fd48943693d0350a8472d Author: Ludovic Marcotte Date: Tue May 29 19:01:32 2012 +0000 Patch applied from bug #1594 Monotone-Parent: a53e8be2320aec0d1cd6ec52e82fba427afc9735 Monotone-Revision: 0971b8d4c54bb6e36c9ddbc585d5ba9ddd05df9a Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2012-05-29T19:01:32 Monotone-Branch: ca.inverse.sope M sope-appserver/NGObjWeb/Associations/WOKeyPathAssociation.m commit cbeeaa0d0e8cbe6ebe632bb114298d7be35d27dd Author: Ludovic Marcotte Date: Tue May 29 18:56:25 2012 +0000 Patch applied from bug #1664 Monotone-Parent: 494c1e08ea03a172bc351c9989850a6f746fd2d6 Monotone-Revision: a53e8be2320aec0d1cd6ec52e82fba427afc9735 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2012-05-29T18:56:25 Monotone-Branch: ca.inverse.sope M sope-appserver/NGObjWeb/NGHttp/NGHttpHeaderFields.m M sope-appserver/WOExtensions/WOTabPanel.m M sope-core/NGExtensions/NGCalendarDateRange.m M sope-core/NGExtensions/NGExtensions/NGCalendarDateRange.h M sope-gdl1/PostgreSQL/PGResultSet.m M sope-gdl1/PostgreSQL/PostgreSQL72Channel.m M sope-xml/DOM/DOMNodeWithChildren.m M sope-xml/STXSaxDriver/ExtraSTX/StructuredText.h M sope-xml/STXSaxDriver/ExtraSTX/StructuredText.m M sope-xml/SaxObjC/SaxAttributeList.m M sope-xml/SaxObjC/SaxAttributes.m M sope-xml/XmlRpc/NSObject+XmlRpc.h M sope-xml/XmlRpc/NSObject+XmlRpc.m M sope-xml/XmlRpc/XmlRpcDecoder.m M sope-xml/XmlRpc/XmlRpcSaxHandler.m commit 3ee99c0c66d032e0bc336d8879920aec958f0cc5 Author: Ludovic Marcotte Date: Tue May 29 18:50:07 2012 +0000 Applied patch from bug #1817 Monotone-Parent: 8ebc4980bb476d82acbad15b70df3600932b35f2 Monotone-Revision: 494c1e08ea03a172bc351c9989850a6f746fd2d6 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2012-05-29T18:50:07 Monotone-Branch: ca.inverse.sope M sope-core/NGStreams/NGInternetSocketAddress.m commit 9d612ce4ad96bfc19e1d7a3356fc6e875cf8f319 Author: Ludovic Marcotte Date: Tue May 29 18:48:00 2012 +0000 Applied patch from bug #1820 Monotone-Parent: 8d5039967f59c97fd8c653e702602f80dba08abf Monotone-Revision: 8ebc4980bb476d82acbad15b70df3600932b35f2 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2012-05-29T18:48:00 Monotone-Branch: ca.inverse.sope M sope-gdl1/GDLAccess/FoundationExt/PrintfFormatScanner.m commit 72d701377b372e799419dab1484c1ea40a1364cf Author: Wolfgang Sourdeau Date: Thu May 24 14:26:45 2012 +0000 Monotone-Parent: 6f6c97530e1ca62307245ec25b6fab1b9399f99d Monotone-Revision: b2721d7f18528c981a921065d3272cca1a9070e8 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-05-24T14:26:45 Monotone-Branch: ca.inverse.sope M sope-appserver/WEExtensions/ChangeLog M sope-appserver/WEExtensions/WEResourceManager.m commit 1bc7557ec270d532039dc8ee6fb3fce8a06ea684 Author: Ludovic Marcotte Date: Thu May 10 17:50:26 2012 +0000 Applied patch for bug #1800 and #1801 Monotone-Parent: 0681181778150eed5fe08a39588d7884861cdbf2 Monotone-Revision: 251de628e771ed3930ca566995fad547dbce20df Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2012-05-10T17:50:26 Monotone-Branch: ca.inverse.sope Monotone-Tag: SOPE_v1.3.15 M sope-appserver/NGObjWeb/NGObjWeb/WODisplayGroup.h M sope-appserver/NGObjWeb/WODisplayGroup.m M sope-gdl1/GDLAccess/EOExpressionArray.h M sope-gdl1/GDLAccess/EOExpressionArray.m commit b38271f048543669e67c8dbaf3169f760be71a1c Author: Ludovic Marcotte Date: Wed May 9 11:53:35 2012 +0000 Added patch from bug #1763 Monotone-Parent: 6f6c97530e1ca62307245ec25b6fab1b9399f99d Monotone-Revision: 0681181778150eed5fe08a39588d7884861cdbf2 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2012-05-09T11:53:35 Monotone-Branch: ca.inverse.sope M sope-appserver/NGObjWeb/Associations/WOKeyPathAssociation.m M sope-appserver/NGObjWeb/DynamicElements/WOComponentContent.m M sope-appserver/NGObjWeb/DynamicElements/WOComponentReference.m M sope-appserver/NGObjWeb/DynamicElements/WOCompoundElement.m M sope-appserver/NGObjWeb/NSObject+WO.m M sope-appserver/NGObjWeb/SoObjects/SoObjCClass.m M sope-appserver/NGObjWeb/SoObjects/SoSelectorInvocation.m M sope-appserver/NGObjWeb/WOApplication.m M sope-appserver/NGObjWeb/WOComponent+Sync.m M sope-appserver/NGObjWeb/WODirectActionRequestHandler.m M sope-appserver/NGObjWeb/WOSession.m M sope-appserver/NGObjWeb/common.h M sope-core/EOControl/EOKeyValueCoding.m M sope-core/EOControl/EOValidation.m M sope-core/EOControl/common.h M sope-core/NGExtensions/EOExt.subproj/EOQualifier+CtxEval.m M sope-core/NGExtensions/FdExt.subproj/NSNull+misc.m M sope-core/NGExtensions/NGBundleManager.m M sope-core/NGExtensions/NGExtensions/NGMemoryAllocation.h M sope-core/NGExtensions/common.h M sope-core/NGStreams/common.h M sope-gdl1/GDLAccess/EODatabaseFault.m M sope-gdl1/GDLAccess/EOFault.m M sope-gdl1/GDLAccess/EOFaultHandler.m M sope-gdl1/GDLAccess/EOKeyComparisonQualifier+SQL.m M sope-gdl1/GDLAccess/EORecordDictionary.m M sope-gdl1/GDLAccess/common.h M sope-ldap/NGLdap/EOQualifier+LDAP.m M sope-mime/NGImap4/imCommon.h commit 70ac7ef7648066dbf2a00d0747770893c06e8b2e Author: Ludovic Marcotte Date: Wed May 9 10:51:29 2012 +0000 See ChangeLog Monotone-Parent: 87432dfeaa5feaee87a4ed6d05a7bb339c095278 Monotone-Revision: 6f6c97530e1ca62307245ec25b6fab1b9399f99d Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2012-05-09T10:51:29 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-core/NGStreams/NGCTextStream.m M sope-core/NGStreams/NGStreams/NGCTextStream.h M sope-mime/NGImap4/NGImap4Client.m commit 98cfa0f39afa27cb789b0553986f68e0edf5f242 Author: Ludovic Marcotte Date: Wed May 9 08:54:14 2012 +0000 Applied fix for bug #1794 Monotone-Parent: 3726e7db829b5ee868cdc21f61798d973f1482d4 Monotone-Revision: 87432dfeaa5feaee87a4ed6d05a7bb339c095278 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2012-05-09T08:54:14 Monotone-Branch: ca.inverse.sope M sope-xml/SaxObjC/SaxAttributes.m commit 9d51c0f6d61dc1407188ea412a070b3aebf031bc Author: Wolfgang Sourdeau Date: Tue May 1 20:34:36 2012 +0000 Monotone-Parent: c7b7f5124aeab9453c93d95272e1bf91e7ac3172 Monotone-Revision: 3b3113f816e2ec37b42a5fd5982d60e172e2def7 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-05-01T20:34:36 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-mime/NGImap4/NGImap4Client.m M sope-mime/NGMime/GNUmakefile A sope-mime/NGMime/NSData+RFC822.h A sope-mime/NGMime/NSData+RFC822.m commit fb2950954e0a0db42ec487e2cf09fcad3b00f2fd Author: Jean Raby Date: Fri Apr 27 19:56:49 2012 +0000 sope_SOPEVER_-gdl1-mysql now 'Suggests' mysql-server instead of 'Recommends'. There is usually no need to pull in mysql when doing a sogo install. Monotone-Parent: 3df3e03bbcdc91d12dcaf95b5eaa7df343f47247 Monotone-Revision: ac5a630f621998ce587f8395d1e6e7221b923eec Monotone-Author: jraby@inverse.ca Monotone-Date: 2012-04-27T19:56:49 Monotone-Branch: ca.inverse.sope M debian/control.in commit 91065b5b520e34b32561c8edbb184d91e6022024 Author: Wolfgang Sourdeau Date: Thu Apr 19 14:22:22 2012 +0000 Monotone-Parent: 835c4a5fbbe9bb44019a84dd66c1469483739afc Monotone-Revision: c7b7f5124aeab9453c93d95272e1bf91e7ac3172 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-04-19T14:22:22 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-gdl1/PostgreSQL/PGConnection.m commit 783348da068ccbadfb3673f371259751c29f4741 Author: Wolfgang Sourdeau Date: Fri Apr 13 15:15:43 2012 +0000 Monotone-Parent: 000e03baf62d699266017ea7e9681fbbfe262382 Monotone-Revision: 835c4a5fbbe9bb44019a84dd66c1469483739afc Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-04-13T15:15:43 Monotone-Branch: ca.inverse.sope M sope-appserver/NGObjWeb/DAVPropMap.plist commit ff65b06d8a84722598125422744f40839cf37068 Author: Ludovic Marcotte Date: Mon Apr 2 18:24:18 2012 +0000 Fixed licensing Monotone-Parent: 91277a54bc09d99eb7c022687bc24ac4529c81d3 Monotone-Revision: 000e03baf62d699266017ea7e9681fbbfe262382 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2012-04-02T18:24:18 Monotone-Branch: ca.inverse.sope M sope-gdl1/Oracle8/err.h M sope-gdl1/Oracle8/err.m commit 49028ebd0ecf9b2ad5a36d9086f9e0c8ca47b3a8 Author: Wolfgang Sourdeau Date: Tue Mar 27 15:01:51 2012 +0000 Monotone-Parent: 2adb5ade334600e109b08ab00325c5c87d89b847 Monotone-Revision: 91277a54bc09d99eb7c022687bc24ac4529c81d3 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-03-27T15:01:51 Monotone-Branch: ca.inverse.sope M sope-appserver/NGObjWeb/DAVPropMap.plist commit 99208fa5fb368de9b5138c893f34e727a2ffea13 Author: Ludovic Marcotte Date: Fri Mar 23 18:44:43 2012 +0000 See ChangeLog Monotone-Parent: 37e6e15919108b7a757e4fecda053baaadd2093b Monotone-Revision: 2adb5ade334600e109b08ab00325c5c87d89b847 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2012-03-23T18:44:43 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-gdl1/GDLAccess/FoundationExt/PrintfFormatScanner.m commit efe7c7cae4ce1daf4c5d98205baf81353075cb11 Author: Ludovic Marcotte Date: Fri Mar 23 18:39:20 2012 +0000 See ChangeLog Monotone-Parent: c60cd0952994b1cdcab7aebd637a1fa8e01da711 Monotone-Revision: 37e6e15919108b7a757e4fecda053baaadd2093b Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2012-03-23T18:39:20 Monotone-Branch: ca.inverse.sope M ChangeLog M configure commit f3f8dcd9a1022089d9f12f64be13cc74d11b65c7 Author: Ludovic Marcotte Date: Fri Mar 23 18:36:28 2012 +0000 See ChangeLog Monotone-Parent: df0ef67a4bf2065b385d60810d28973f0fb0c981 Monotone-Revision: c60cd0952994b1cdcab7aebd637a1fa8e01da711 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2012-03-23T18:36:28 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-core/NGExtensions/NGLogging.subproj/NGLogSyslogAppender.m commit e9d93bc54b0b3c95bcc2162752c15510ac07101c Author: Francis Lachapelle Date: Fri Mar 23 13:38:55 2012 +0000 Updated languages codes mapping. Monotone-Parent: b96d6417b4c71dc3e69b12860fd024d3ad7d9489 Monotone-Revision: df0ef67a4bf2065b385d60810d28973f0fb0c981 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2012-03-23T13:38:55 Monotone-Branch: ca.inverse.sope M sope-appserver/NGObjWeb/Languages.plist commit d1a2c2b5c0bd454a61f40a672b5d820d2a5726c7 Author: Ludovic Marcotte Date: Thu Mar 22 16:40:27 2012 +0000 picky change Monotone-Parent: 005db4256b2ff313f82c36ae9eb52a4d8c4ab67e Monotone-Revision: b96d6417b4c71dc3e69b12860fd024d3ad7d9489 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2012-03-22T16:40:27 Monotone-Branch: ca.inverse.sope M sope-appserver/NGObjWeb/WOCoreApplication.m commit 9727b4b8096f8d8dbeb9f8897653dfe3e9a0a739 Author: Ludovic Marcotte Date: Thu Mar 22 16:21:46 2012 +0000 See ChangeLog Monotone-Parent: 3d7d6d0fe580b2bd77cafeb5765f6fcacac9f273 Monotone-Revision: 005db4256b2ff313f82c36ae9eb52a4d8c4ab67e Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2012-03-22T16:21:46 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-appserver/NGObjWeb/GNUmakefile D sope-appserver/NGObjWeb/UnixSignalHandler.h D sope-appserver/NGObjWeb/UnixSignalHandler.m M sope-appserver/NGObjWeb/WOCoreApplication.m M sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpAdaptor.m M sope-appserver/NGObjWeb/WOWatchDogApplicationMain.m M sope-appserver/NGObjWeb/common.h commit 808de0feccfd53f9d0d94a384c4987b26a8ff981 Author: Wolfgang Sourdeau Date: Mon Mar 19 20:55:30 2012 +0000 Monotone-Parent: b86f910c6075f5e82e49d37bc6e4611271e89968 Monotone-Revision: 3d7d6d0fe580b2bd77cafeb5765f6fcacac9f273 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-03-19T20:55:30 Monotone-Branch: ca.inverse.sope M sope-appserver/NGObjWeb/DAVPropMap.plist commit e96752ad03dd6a93eccc0394bfd9d98f2a1c3e48 Author: Wolfgang Sourdeau Date: Wed Feb 29 15:51:27 2012 +0000 Monotone-Parent: e9206f8459a263ff918e0b8facd433aa6c1b0b4e Monotone-Revision: b86f910c6075f5e82e49d37bc6e4611271e89968 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-02-29T15:51:27 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-mime/NGImap4/NGImap4Client.m commit a318192fa5342bfc9cbd630bfd5544d83dc40afc Author: Wolfgang Sourdeau Date: Tue Feb 28 18:47:28 2012 +0000 Monotone-Parent: 0d4659c4c17f20f0b96d853bed2a6a1fb66557f7 Monotone-Revision: e9206f8459a263ff918e0b8facd433aa6c1b0b4e Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-02-28T18:47:28 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-mime/NGImap4/NGImap4Client.m commit 73be1ec0bb98a509a78af3ca04bc01a7ff9a0bef Author: Wolfgang Sourdeau Date: Mon Feb 27 18:42:48 2012 +0000 Monotone-Parent: b093683a4868512e114edae88b9e95957764b4c6 Monotone-Revision: 0d4659c4c17f20f0b96d853bed2a6a1fb66557f7 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-02-27T18:42:48 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-mime/NGImap4/NGImap4Client.h M sope-mime/NGImap4/NGImap4Client.m M sope-mime/NGImap4/NGImap4Connection.h M sope-mime/NGImap4/NGImap4Connection.m commit e9d1d02f053d11022b00e0bc75db7f412aeb0f6f Author: Wolfgang Sourdeau Date: Wed Feb 22 14:51:37 2012 +0000 Monotone-Parent: 743613f1ea4d6d8c2e4c011a7664c652df8ef33e Monotone-Revision: b093683a4868512e114edae88b9e95957764b4c6 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-02-22T14:51:37 Monotone-Branch: ca.inverse.sope M sope-appserver/NGObjWeb/DAVPropMap.plist commit 7f0e8fd88c94e276c55612d632ce00fd5ed6abde Author: Wolfgang Sourdeau Date: Thu Feb 16 20:35:05 2012 +0000 Monotone-Parent: d45d39a4d591839ed7a4c50453f1d262f8360359 Monotone-Revision: 743613f1ea4d6d8c2e4c011a7664c652df8ef33e Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-02-16T20:35:05 Monotone-Branch: ca.inverse.sope M sope-gdl1/Oracle8/OracleAdaptor.m commit 9a14ec90970f361304a404614fb6ee98939309cd Author: Wolfgang Sourdeau Date: Thu Feb 16 20:28:32 2012 +0000 Monotone-Parent: 1b121c0c9891fb09844f64de7ec01bd95dcd0893 Monotone-Revision: d45d39a4d591839ed7a4c50453f1d262f8360359 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-02-16T20:28:32 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-gdl1/Oracle8/OracleAdaptor.m M sope-gdl1/Oracle8/OracleValues.m commit 12bee6a954dbefb1a79b545f31c593c2f3448109 Author: Wolfgang Sourdeau Date: Thu Feb 16 19:46:14 2012 +0000 Monotone-Parent: 8c2e4c4dc578c74711ed9d90287f0dfd342f4361 Monotone-Revision: 1b121c0c9891fb09844f64de7ec01bd95dcd0893 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-02-16T19:46:14 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-gdl1/Oracle8/OracleValues.m commit 193ff8b511c361c98c69138fb0f283766dfe3c55 Author: Wolfgang Sourdeau Date: Thu Feb 16 03:28:52 2012 +0000 Monotone-Parent: 1499106c726073d801b4d554b1d51eea158e6b18 Monotone-Revision: 8c2e4c4dc578c74711ed9d90287f0dfd342f4361 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-02-16T03:28:52 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-gdl1/PostgreSQL/NSString+PGVal.m M sope-gdl1/PostgreSQL/PGConnection.m commit 88343e5fd4ad36d3904e6c32e4511c689f1a1e72 Author: Ludovic Marcotte Date: Thu Feb 16 01:23:55 2012 +0000 Improved error handling regarding nil values Monotone-Parent: 737bf4b51a51e3e9813a77e8dda9d8306b668994 Monotone-Revision: 1499106c726073d801b4d554b1d51eea158e6b18 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2012-02-16T01:23:55 Monotone-Branch: ca.inverse.sope M sope-ldap/NGLdap/NGLdapAttribute.m commit 58192cfa93917d3eae576479221eb7ffe0173276 Author: Wolfgang Sourdeau Date: Tue Feb 14 16:34:19 2012 +0000 Monotone-Parent: 0451f94f3496a81d0149daf53e3987a6d42cb925 Monotone-Revision: 737bf4b51a51e3e9813a77e8dda9d8306b668994 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-02-14T16:34:19 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-gdl1/Oracle8/OracleValues.m commit 7c676d134ba168bf43587acb823dda54780dc640 Author: Wolfgang Sourdeau Date: Tue Feb 14 03:04:34 2012 +0000 Monotone-Parent: b168d3a8503d6652d6985fd328cfed12e5c8df6c Monotone-Revision: 0451f94f3496a81d0149daf53e3987a6d42cb925 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-02-14T03:04:34 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-mime/NGImap4/NGImap4ResponseParser.m commit 856b6be3523026783a22046846ed1f42d462af74 Author: Wolfgang Sourdeau Date: Mon Feb 6 15:20:44 2012 +0000 Monotone-Parent: 8b8a037e689b9c65a616a4a148591f98cfe5572c Monotone-Revision: 7c135ae304db6f9f5c070c6db456434525ee4ee9 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-02-06T15:20:44 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-appserver/NGObjWeb/WebDAV/SoObjectDataSource.m commit 1e6523651d59df1d52a68a5d20ae048e894dbac9 Author: Wolfgang Sourdeau Date: Mon Feb 6 13:54:00 2012 +0000 Monotone-Parent: 37cf8f46768823a23cf158ff7c9a57589c964ed7 Monotone-Revision: 8b8a037e689b9c65a616a4a148591f98cfe5572c Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-02-06T13:54:00 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-ldap/NGLdap/NSString+DN.h M sope-ldap/NGLdap/NSString+DN.m commit 8d98bf54c634d18017b843c34269047af438bfd4 Author: Francis Lachapelle Date: Fri Feb 3 19:10:23 2012 +0000 Patch from ticket #1592. Monotone-Parent: 37cf8f46768823a23cf158ff7c9a57589c964ed7 Monotone-Revision: 9f83d6a503f32e3c1f6fe8a0ddb9d6094660782e Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2012-02-03T19:10:23 Monotone-Branch: ca.inverse.sope M sope-mime/NGImap4/NGImap4ServerRoot.h M sope-mime/NGImap4/NGImap4ServerRoot.m commit 457256daec2e859121ee06c4bc16578f832b05bf Author: Francis Lachapelle Date: Tue Jan 31 21:23:55 2012 +0000 Monotone-Parent: 02c927b3e08f384d6aba9f08952af4c2b3b60aa0 Monotone-Revision: 37cf8f46768823a23cf158ff7c9a57589c964ed7 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2012-01-31T21:23:55 Monotone-Branch: ca.inverse.sope M sope-mime/NGImap4/NGImap4ResponseParser.m commit 1f537e05787845631aeb6032118bc5a63125233b Author: Francis Lachapelle Date: Tue Jan 31 21:20:57 2012 +0000 See sope-appserver/NGObjWeb/ChangeLog. Monotone-Parent: d20a1575636e50a8c6671ffb3c1efe2b463225e7 Monotone-Revision: 02c927b3e08f384d6aba9f08952af4c2b3b60aa0 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2012-01-31T21:20:57 Monotone-Branch: ca.inverse.sope M sope-appserver/NGObjWeb/ChangeLog M sope-appserver/NGObjWeb/Languages.plist M sope-appserver/NGObjWeb/WORequest.m commit d2cb4987049aacda4c4276ec6387aba371e7fb1b Author: Ludovic Marcotte Date: Tue Jan 31 16:02:38 2012 +0000 Fixed typo Monotone-Parent: 05cd5cf046d6d8cb0c454c34d1693fb8fe70d850 Monotone-Revision: d20a1575636e50a8c6671ffb3c1efe2b463225e7 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2012-01-31T16:02:38 Monotone-Branch: ca.inverse.sope M sope-mime/NGImap4/NGImap4ResponseParser.m commit 79e177355873656f3bbe668b1dd3f4208b04ace7 Author: Ludovic Marcotte Date: Tue Jan 31 15:58:50 2012 +0000 See ChangeLog Monotone-Parent: 27a98e0cc01cdb0350ef1b49fe1bf8380a5b0741 Monotone-Revision: 05cd5cf046d6d8cb0c454c34d1693fb8fe70d850 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2012-01-31T15:58:50 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-mime/NGImap4/NGImap4ResponseParser.m commit 7e3f4a6f0a0d61aae85521757000ac1a627aaa16 Author: Ludovic Marcotte Date: Thu Jan 12 20:00:56 2012 +0000 Added "iOS" for iPhone/iPad client strings Monotone-Parent: 3ff7813d47cda2243c4744d290ca09054df18fac Monotone-Revision: 27a98e0cc01cdb0350ef1b49fe1bf8380a5b0741 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2012-01-12T20:00:56 Monotone-Branch: ca.inverse.sope M sope-appserver/NGObjWeb/WEClientCapabilities.m commit ffd9886b2ec9078350fab8eec8a93f749bde2947 Author: Wolfgang Sourdeau Date: Tue Jan 10 17:32:49 2012 +0000 Monotone-Parent: 103e4fff058ad63f11219ee11f6805117d740246 Monotone-Revision: 3ff7813d47cda2243c4744d290ca09054df18fac Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-01-10T17:32:49 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-mime/NGMail/NGMailAddressParser.m commit 704bff7ea4d0b69269e312fd2f4d89ccd276a7c4 Author: Wolfgang Sourdeau Date: Fri Dec 30 23:21:37 2011 +0000 Monotone-Parent: 6d0d1c8725a3df86208f3b2c55f4f9bd6087a565 Monotone-Revision: e619f846465044643ada44d0598cc9723923280c Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-12-30T23:21:37 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-ldap/NGLdap/NGLdapAttribute.m M sope-ldap/NGLdap/NGLdapConnection.m M sope-ldap/NGLdap/NGLdapEntry.m commit 41f828798e5a757a3788ee8aa50f65dfa964ead2 Author: Ludovic Marcotte Date: Fri Dec 30 17:22:26 2011 +0000 Fix for bug #1382 Monotone-Parent: 00e41d1f78647ab913b68bad93535f9554a94aaf Monotone-Revision: a2112c6513358c1ff28c2f936a00c3fe72723427 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2011-12-30T17:22:26 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-mime/NGImap4/NGImap4Client.m M sope-mime/NGImap4/NSString+Imap4.h M sope-mime/NGImap4/NSString+Imap4.m commit fe7d311673d7fdd6e24829bdb08969bc8e73b18e Author: Ludovic Marcotte Date: Fri Dec 30 14:08:43 2011 +0000 Fix for bug #1423 Monotone-Parent: 6d0d1c8725a3df86208f3b2c55f4f9bd6087a565 Monotone-Revision: 00e41d1f78647ab913b68bad93535f9554a94aaf Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2011-12-30T14:08:43 Monotone-Branch: ca.inverse.sope M sope-mime/NGMail/NGSendMail.m commit ab768d4f53f9c93c258a4862a4909c9e30812b21 Author: Wolfgang Sourdeau Date: Mon Dec 19 16:39:36 2011 +0000 Monotone-Parent: 6f04c3ff404864219b0b380125d03a078468b946 Monotone-Revision: 8a88e3aacf55dc11b0afaf09bb87f917fe217816 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-12-19T16:39:36 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-ldap/NGLdap/NGLdapSearchResultEnumerator.m commit 33491e1046e79e8986b05577d31243227ddada89 Author: Ludovic Marcotte Date: Thu Dec 15 19:38:04 2011 +0000 See ChangeLog Monotone-Parent: 6f04c3ff404864219b0b380125d03a078468b946 Monotone-Revision: b9939561d21749b9c1be9b4002f4fc926dddde8a Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2011-12-15T19:38:04 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-mime/NGImap4/NGImap4Client.m M sope-mime/NGImap4/NGSieveClient.h M sope-mime/NGImap4/NGSieveClient.m commit d0dc6777fccec98687acfd07f17000c9a19ead06 Author: Francis Lachapelle Date: Thu Dec 8 18:41:35 2011 +0000 Fixed typo in language name for "nb" (NorwegianBokmaal => NorwegianBokmal). Monotone-Parent: 1f44a0d5895a6e34af5e973ae98a48b118eb7cd8 Monotone-Revision: 6f04c3ff404864219b0b380125d03a078468b946 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2011-12-08T18:41:35 Monotone-Branch: ca.inverse.sope Monotone-Tag: SOPE_v1.3.11 M sope-appserver/NGObjWeb/Languages.plist commit 7806ad12eece5cb579e8275d007f7cb830e2ac08 Author: Ludovic Marcotte Date: Wed Dec 7 19:01:13 2011 +0000 Applied fix for bug #1404 Monotone-Parent: 7ebce8df2ddbe7d6cbc534f7c1e7d64ebbc73a72 Monotone-Revision: 1f44a0d5895a6e34af5e973ae98a48b118eb7cd8 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2011-12-07T19:01:13 Monotone-Branch: ca.inverse.sope M sope-appserver/NGObjWeb/DynamicElements/WORepetition.m commit f025e396a2cf30125af09a1e00e6fd9ddad77b69 Author: Wolfgang Sourdeau Date: Tue Dec 6 20:28:36 2011 +0000 Monotone-Parent: 3df3e03bbcdc91d12dcaf95b5eaa7df343f47247 Monotone-Revision: 747d54047e7fe372edb0003f61bcce0af406b5fc Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-12-06T20:28:36 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-gdl1/PostgreSQL/PGConnection.m commit bc211d673e24d2ded166e17648e35db26e57d024 Author: Wolfgang Sourdeau Date: Fri Dec 2 04:15:02 2011 +0000 Monotone-Parent: 07249ff8fa4fe3c361d567ae5d0a3fd19dd903e2 Monotone-Revision: 20b836ff044516dbe78f1bf17d245894fd51db7f Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-12-02T04:15:02 Monotone-Branch: ca.inverse.sope M sope-appserver/NGObjWeb/WebDAV/SoObjectWebDAVDispatcher.m commit be1cbce1aa65cec2ba70b5771414fc706136f0f8 Author: Francis Lachapelle Date: Fri Dec 2 03:41:12 2011 +0000 Updated sope-gdl1/Oracle8 for Instant Client v11. Monotone-Parent: 3df3e03bbcdc91d12dcaf95b5eaa7df343f47247 Monotone-Revision: 519a452ff4fa7dd1be752deffd406a5d640e7d55 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2011-12-02T03:41:12 Monotone-Branch: ca.inverse.sope M sope-gdl1/Oracle8/GNUmakefile commit e1d05c9e63236964ba9c2d805de3dbbc9d32ccf1 Author: Ludovic Marcotte Date: Thu Dec 1 12:31:55 2011 +0000 Reverted small change from #1459 Monotone-Parent: 07249ff8fa4fe3c361d567ae5d0a3fd19dd903e2 Monotone-Revision: 83b22fc0d4440f6251f95af50193800d7b85eb02 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2011-12-01T12:31:55 Monotone-Branch: ca.inverse.sope M sope-core/EOControl/EOSortOrdering.m commit 42c4f075756c0b0047f772d9fbf608564876bb58 Author: Wolfgang Sourdeau Date: Tue Nov 29 19:25:59 2011 +0000 Monotone-Parent: 68b5fa4a9ba7533267ab3a5001df82cb7ed3acae Monotone-Revision: 07249ff8fa4fe3c361d567ae5d0a3fd19dd903e2 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-11-29T19:25:59 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-appserver/NGObjWeb/WebDAV/SoWebDAVRenderer.m commit 6fb71b306377a8ec56d3441374b589c2baf9eddf Author: Wolfgang Sourdeau Date: Tue Nov 29 19:22:40 2011 +0000 Monotone-Parent: 79874d054cbffd7190a1843fc605c697623d604e Monotone-Revision: 68b5fa4a9ba7533267ab3a5001df82cb7ed3acae Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-11-29T19:22:40 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-appserver/NGObjWeb/WOMessage.m M sope-appserver/NGObjWeb/WOResponse.m commit ff68ef6493f8a7becb23fffe87b733e1bb4eb100 Author: Wolfgang Sourdeau Date: Fri Nov 25 18:41:45 2011 +0000 Monotone-Parent: 402c3e3428f597cf9f2eb5de354304ec49553d22 Monotone-Revision: 4a593664f738279a07d51c8d0d4bb4c56d6fb494 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-11-25T18:41:45 Monotone-Branch: ca.inverse.sope M sope-appserver/NGObjWeb/WebDAV/SoWebDAVRenderer.m commit 8dfb0c5c1392ed18902302152f3018479d0714c7 Author: Wolfgang Sourdeau Date: Fri Nov 25 18:41:14 2011 +0000 Monotone-Parent: 700636fe0e3238b6c058593cbd9699c7a6f75574 Monotone-Revision: 402c3e3428f597cf9f2eb5de354304ec49553d22 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-11-25T18:41:14 Monotone-Branch: ca.inverse.sope M sope-appserver/NGObjWeb/DAVPropMap.plist commit 65ac8833a2f7696b0ead0b961be0d821d3f3866f Author: Wolfgang Sourdeau Date: Fri Nov 25 18:40:56 2011 +0000 Monotone-Parent: 03aa7b4131b9f2025a93f90aa4f5450a648fe953 Monotone-Revision: 700636fe0e3238b6c058593cbd9699c7a6f75574 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-11-25T18:40:56 Monotone-Branch: ca.inverse.sope M sope-appserver/NGObjWeb/WEClientCapabilities.m commit b48079b917445f271cfb882ac9054efdc97219dc Author: Wolfgang Sourdeau Date: Fri Nov 25 18:38:52 2011 +0000 Monotone-Parent: 30bc7bb2ebafa0449d0fe2c650c67ab2a0b3ef51 Monotone-Revision: 03aa7b4131b9f2025a93f90aa4f5450a648fe953 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-11-25T18:38:52 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpTransaction.m commit e0fe39a9b26338eb86d77d81b395d4bc9d4d0e15 Author: Wolfgang Sourdeau Date: Fri Nov 25 18:35:59 2011 +0000 Monotone-Parent: c3f26456a00a1ece8e3112ff71a237bd0d629d89 Monotone-Revision: 30bc7bb2ebafa0449d0fe2c650c67ab2a0b3ef51 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-11-25T18:35:59 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpTransaction.m commit af0edf01f6c0a45b9ed6e51a53ecb4547bfdf71d Author: Ludovic Marcotte Date: Thu Nov 24 20:12:43 2011 +0000 Added patch from #1459 Monotone-Parent: c3f26456a00a1ece8e3112ff71a237bd0d629d89 Monotone-Revision: 381381042f096b28e466ae3abec7189eacb5fab4 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2011-11-24T20:12:43 Monotone-Branch: ca.inverse.sope M sope-core/EOControl/EOSortOrdering.h M sope-core/EOControl/EOSortOrdering.m commit deb0e1f77ffd4e67a792c138035ca91f28033dd5 Author: Ludovic Marcotte Date: Mon Nov 21 14:07:16 2011 +0000 Added more recognized Apple DAV clients Monotone-Parent: 4cad0c80b603eddecb4f5bf70097952c3edc9527 Monotone-Revision: c3f26456a00a1ece8e3112ff71a237bd0d629d89 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2011-11-21T14:07:16 Monotone-Branch: ca.inverse.sope M sope-appserver/NGObjWeb/WEClientCapabilities.m commit a2c7154d753e7f3b585d303dabb87aa284c23d89 Author: Ludovic Marcotte Date: Thu Nov 17 12:43:35 2011 +0000 Fix for bug #1483 Monotone-Parent: d48f86f9609dac535dc37b591151381ac34b8227 Monotone-Revision: 4cad0c80b603eddecb4f5bf70097952c3edc9527 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2011-11-17T12:43:35 Monotone-Branch: ca.inverse.sope M sope-appserver/NGObjWeb/WebDAV/SoWebDAVRenderer.m commit 7399bb2a54cbd58b12b7e1f8f2635c96c16c3418 Author: Ludovic Marcotte Date: Wed Nov 16 17:50:29 2011 +0000 removed useless variable Monotone-Parent: 132e678e4871e3ade7f5e2fcb1449258ea986762 Monotone-Revision: d48f86f9609dac535dc37b591151381ac34b8227 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2011-11-16T17:50:29 Monotone-Branch: ca.inverse.sope M sope-core/EOControl/EOQualifierParser.m commit 71cf67c16f5201e8b3db462621752df6f970bafe Author: Ludovic Marcotte Date: Wed Nov 16 17:38:23 2011 +0000 Fix for bug #1412 Monotone-Parent: 77fbf2ff8bd28e88111c38f0575e8bc609e7b80f Monotone-Revision: 132e678e4871e3ade7f5e2fcb1449258ea986762 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2011-11-16T17:38:23 Monotone-Branch: ca.inverse.sope M sope-core/EOControl/EOQualifierParser.m commit e3a63fbaf1acab93a9742aa8a164a8857e1d745d Author: Wolfgang Sourdeau Date: Tue Nov 15 16:30:13 2011 +0000 Monotone-Parent: f7eb0b1330fb1f2572ac355c8b56284f424ae649 Monotone-Revision: 77fbf2ff8bd28e88111c38f0575e8bc609e7b80f Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-11-15T16:30:13 Monotone-Branch: ca.inverse.sope M sope-gdl1/Oracle8/OracleValues.m commit 668fd348c132f1d094c2c870fcc6f5023f2475f7 Author: Francis Lachapelle Date: Tue Nov 15 04:42:38 2011 +0000 Defined static variables. Monotone-Parent: 7f0b1a3ccff6cd51736b9d355a48d5d8bcd4222e Monotone-Revision: f7eb0b1330fb1f2572ac355c8b56284f424ae649 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2011-11-15T04:42:38 Monotone-Branch: ca.inverse.sope M sope-gdl1/MySQL/NSNumber+MySQL4Val.m M sope-gdl1/Oracle8/OracleValues.m M sope-gdl1/PostgreSQL/NSNumber+ExprValue.m M sope-gdl1/PostgreSQL/NSNumber+PGVal.m commit 435bfc909bc7c8e0e99abb1c6694afbf7fb081c1 Author: Francis Lachapelle Date: Mon Nov 14 20:01:21 2011 +0000 See sope-gdl1/Oracle8/ChangeLog Monotone-Parent: ee2063e40a66a64fcefe940a83ca7291aa1075d2 Monotone-Revision: 7f0b1a3ccff6cd51736b9d355a48d5d8bcd4222e Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2011-11-14T20:01:21 Monotone-Branch: ca.inverse.sope M sope-gdl1/Oracle8/ChangeLog M sope-gdl1/Oracle8/OracleValues.m commit c41a16e2970150c0c14b10a65f8a16bb88926f54 Author: Wolfgang Sourdeau Date: Thu Nov 10 22:24:47 2011 +0000 Monotone-Parent: 251b4565fb618249a9be38b2f6e86da9f39d8945 Monotone-Revision: ea53e0f7ff4913544446eb78e0e93e6dff8b05c3 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-11-10T22:24:47 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-gdl1/PostgreSQL/NSString+PGVal.m commit 92f786448a6f994733c2632d2f5c255d98ef495c Author: Ludovic Marcotte Date: Wed Nov 9 17:28:54 2011 +0000 Improved debugging output for OCILogon() failed calls Monotone-Parent: 251b4565fb618249a9be38b2f6e86da9f39d8945 Monotone-Revision: 93ba88226d8461d87cf69e143446db6a92064de7 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2011-11-09T17:28:54 Monotone-Branch: ca.inverse.sope M sope-gdl1/Oracle8/OracleAdaptorChannel.m commit 56a3ce62a824867829cc485b48dfe6b9b03d84b1 Author: Francis Lachapelle Date: Wed Nov 2 18:46:40 2011 +0000 See sope-gdl1/MySQL/ChangeLog. Monotone-Parent: 6eaf4a45ce4e94507a541be4594b94f2adc500a6 Monotone-Revision: 251b4565fb618249a9be38b2f6e86da9f39d8945 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2011-11-02T18:46:40 Monotone-Branch: ca.inverse.sope M sope-gdl1/MySQL/ChangeLog M sope-gdl1/MySQL/NSNumber+MySQL4Val.m commit 7c9ad217687ca2580af160812986c2e3daefc309 Author: Wolfgang Sourdeau Date: Mon Oct 31 19:24:03 2011 +0000 Monotone-Parent: 7f482a94282fc309c473e2046177a55354b1ce29 Monotone-Revision: 6eaf4a45ce4e94507a541be4594b94f2adc500a6 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-10-31T19:24:03 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-mime/NGImap4/NGImap4Connection.h M sope-mime/NGImap4/NGImap4Connection.m commit eefd3bfdde1f7bac21f3498f28299ee187383d94 Author: Wolfgang Sourdeau Date: Fri Oct 28 15:11:29 2011 +0000 Monotone-Parent: 4fa3570308238a3dfc1aaaecb57201c299a030ff Monotone-Revision: 7f482a94282fc309c473e2046177a55354b1ce29 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-10-28T15:11:29 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-mime/NGMime/NGMimeMultipartBody.m commit a6fad367db9e2a53092ec957408313af379dc969 Author: Wolfgang Sourdeau Date: Wed Oct 26 19:06:29 2011 +0000 Monotone-Parent: 5d63eebbb466666b63354840ace25d1befac9208 Monotone-Revision: f546e89d450a6ab2501134f06f4318847f35ab19 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-10-26T19:06:29 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-mime/NGMail/NGMimeMessage.m commit a8eb7681fb403bc145679dfac36bc380796a034a Author: Ludovic Marcotte Date: Wed Oct 19 09:19:22 2011 +0000 Disabled port comparision which could lead to issues based on certain URLs and it's very unlikely to cause any problems Monotone-Parent: 9dfff4b07c62ccec2c894fa0bb07d26001c7e7c0 Monotone-Revision: 68fd87de889636481862e5eb3091f34d1bbe24d8 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2011-10-19T09:19:22 Monotone-Branch: ca.inverse.sope M sope-appserver/NGObjWeb/WebDAV/SoObjectWebDAVDispatcher.m commit 96d053f6360023788f87616f25bd23bcfd746e6e Author: Wolfgang Sourdeau Date: Tue Oct 18 20:09:19 2011 +0000 Monotone-Parent: 06b0931e9f15b5f1c7da6d46a77161fa1355430b Monotone-Revision: 5d63eebbb466666b63354840ace25d1befac9208 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-10-18T20:09:19 Monotone-Branch: ca.inverse.sope M sope-gdl1/Oracle8/GNUmakefile commit 9dbe83834205cfdb8457630db8ef1794c1b68cd1 Author: Wolfgang Sourdeau Date: Tue Oct 18 19:58:47 2011 +0000 Monotone-Parent: 5ca9f40c9dd55f23cb91650a8c1e7643a82109ba Monotone-Revision: 06b0931e9f15b5f1c7da6d46a77161fa1355430b Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-10-18T19:58:47 Monotone-Branch: ca.inverse.sope M sope-gdl1/Oracle8/GNUmakefile commit 48b37d233fe76780628782682a60130c9b70b5b3 Author: Ludovic Marcotte Date: Tue Oct 18 12:31:03 2011 +0000 Fix for bug #1096 Monotone-Parent: af90264fc2b3a40aaf122d30a9d5f8c2eb889f0a Monotone-Revision: 9dfff4b07c62ccec2c894fa0bb07d26001c7e7c0 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2011-10-18T12:31:03 Monotone-Branch: ca.inverse.sope M sope-appserver/NGObjWeb/WebDAV/SoObjectWebDAVDispatcher.m commit 676ca070237a5b80d71518897835ad6ff90aba0c Author: Wolfgang Sourdeau Date: Mon Oct 17 21:42:06 2011 +0000 Monotone-Parent: 9dfff4b07c62ccec2c894fa0bb07d26001c7e7c0 Monotone-Revision: 5ca9f40c9dd55f23cb91650a8c1e7643a82109ba Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-10-17T21:42:06 Monotone-Branch: ca.inverse.sope M sope-gdl1/Oracle8/GNUmakefile commit c2ce349c539ba1f564a90ca3f0829c2c5c447f43 Author: Francis Lachapelle Date: Mon Oct 17 21:01:04 2011 +0000 See sope-mime/NGImap4/ChangeLog. Monotone-Parent: 56660a68caec60b50ae46fce95372af35713a183 Monotone-Revision: af90264fc2b3a40aaf122d30a9d5f8c2eb889f0a Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2011-10-17T21:01:04 Monotone-Branch: ca.inverse.sope M sope-mime/NGImap4/ChangeLog M sope-mime/NGImap4/NGImap4Connection.m commit ba8ef7b3eedd3bbe64b92a89bed0317197dff961 Author: Francis Lachapelle Date: Mon Oct 17 19:47:04 2011 +0000 See Changelog. Monotone-Parent: db3e36b4a57015b6741490de2d7a027515484d89 Monotone-Revision: 56660a68caec60b50ae46fce95372af35713a183 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2011-10-17T19:47:04 Monotone-Branch: ca.inverse.sope M sope-appserver/NGObjWeb/ChangeLog M sope-appserver/NGObjWeb/WebDAV/SoObjectWebDAVDispatcher.m commit 829e1aea60c0e7456814fee9fb926f2bc15a2815 Author: Ludovic Marcotte Date: Mon Oct 17 17:14:20 2011 +0000 Fix for bug #1457 Monotone-Parent: b0432fdb98b2862ae32a89856985a7f182a91efc Monotone-Revision: db3e36b4a57015b6741490de2d7a027515484d89 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2011-10-17T17:14:20 Monotone-Branch: ca.inverse.sope M sope-appserver/NGObjWeb/WEClientCapabilities.m commit f9e2487c7f4716bf8ec5495c054e2f8152c25f4e Author: Ludovic Marcotte Date: Wed Oct 5 12:36:40 2011 +0000 Added fix for bug #1400 Monotone-Parent: 1ae4b707df5b49bc1f28f570464f1da33b5590e0 Monotone-Revision: b0432fdb98b2862ae32a89856985a7f182a91efc Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2011-10-05T12:36:40 Monotone-Branch: ca.inverse.sope M sope-core/NGExtensions/FdExt.subproj/GNUmakefile A sope-core/NGExtensions/FdExt.subproj/NSDictionary+KVC.m A sope-core/NGExtensions/NGExtensions/NSDictionary+KVC.h commit 5f7e56b152d0367643087f4b10352fbe77427870 Author: Ludovic Marcotte Date: Wed Oct 5 12:31:58 2011 +0000 Integrated fix for bug #1405 Monotone-Parent: 60ea81ded2b82c6979e398398fba9a7e84fa9af9 Monotone-Revision: 1ae4b707df5b49bc1f28f570464f1da33b5590e0 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2011-10-05T12:31:58 Monotone-Branch: ca.inverse.sope M sope-appserver/NGObjWeb/NGHttp/NGHttpHeaderFieldParser.m commit ab700558c984d5eaa758c73571c62a04e1d5b2f5 Author: Wolfgang Sourdeau Date: Wed Sep 21 19:22:39 2011 +0000 Monotone-Parent: 7dcdbaf73eb188a1796364219f04d5bd4a6bfc09 Monotone-Revision: 60ea81ded2b82c6979e398398fba9a7e84fa9af9 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-09-21T19:22:39 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-mime/NGImap4/NGImap4Connection.h commit e5ffa57eeb05bcf53a9462ee3ad99271f54d5fc5 Author: Ludovic Marcotte Date: Sun Sep 4 19:45:45 2011 +0000 See ChangeLog Monotone-Parent: 24b6d297354ecd5c33b18536da6e0c90803f2d66 Monotone-Revision: 7dcdbaf73eb188a1796364219f04d5bd4a6bfc09 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2011-09-04T19:45:45 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-core/NGStreams/NGActiveSocket.m commit 3a83cf8f6da07a27fb9b3041d2d41386c2a00e0f Author: Wolfgang Sourdeau Date: Mon Aug 8 20:10:58 2011 +0000 Monotone-Parent: fec7b1b9d6da6f601fadc8edd7838a747aa8cbe0 Monotone-Revision: 24b6d297354ecd5c33b18536da6e0c90803f2d66 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-08-08T20:10:58 Monotone-Branch: ca.inverse.sope M sope-appserver/NGObjWeb/Defaults.plist commit 7e1fb36a9d4aabc7ffaf2dd190e053dd25fb7075 Author: Ludovic Marcotte Date: Fri Jul 29 18:44:40 2011 +0000 Reversed TLS patch Monotone-Parent: eaf02799a023c3816b1d9a413261687c66eff53a Monotone-Revision: fec7b1b9d6da6f601fadc8edd7838a747aa8cbe0 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2011-07-29T18:44:40 Monotone-Branch: ca.inverse.sope M configure M sope-core/NGStreams/GNUmakefile.preamble M sope-core/NGStreams/NGActiveSSLSocket.m M sope-core/NGStreams/NGStreams/NGActiveSSLSocket.h M sope-ldap/NGLdap/GNUmakefile.preamble commit bf5b91c957104db1247a28bd87fd9a0dba70bf86 Author: Ludovic Marcotte Date: Fri Jul 29 14:00:15 2011 +0000 Small fix to the Debian build files Monotone-Parent: 1267797e46d28285c9251ef695a8f7d832529994 Monotone-Revision: eaf02799a023c3816b1d9a413261687c66eff53a Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2011-07-29T14:00:15 Monotone-Branch: ca.inverse.sope M debian/sope_SOPEVER_-appserver.install commit 56fae50fc44c76c22218a28dd210b8b969f564e5 Author: Ludovic Marcotte Date: Fri Jul 29 13:50:53 2011 +0000 See ChangeLog Monotone-Parent: 2d3145b74b1ff457bedd55fa567dd40099d6a1a4 Monotone-Revision: 1267797e46d28285c9251ef695a8f7d832529994 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2011-07-29T13:50:53 Monotone-Branch: ca.inverse.sope M ChangeLog M configure M sope-core/NGStreams/GNUmakefile.preamble M sope-core/NGStreams/NGActiveSSLSocket.m M sope-core/NGStreams/NGStreams/NGActiveSSLSocket.h M sope-ldap/NGLdap/GNUmakefile.preamble commit 6494ebc248482d06991935beb408965773ba3376 Author: Ludovic Marcotte Date: Fri Jul 29 12:31:59 2011 +0000 small fix for gcc < 4.6 runtimes Monotone-Parent: b6554a998b960d3439f7045272e63f6d40d61709 Monotone-Revision: 5d510eb100bf3a974c06666bd281ab0c0d58c839 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2011-07-29T12:31:59 Monotone-Branch: ca.inverse.sope M sope-appserver/NGObjWeb/WODirectActionRequestHandler.m commit cd071b6f561bf25c67f06d3cade128e416976985 Author: Wolfgang Sourdeau Date: Fri Jul 29 02:14:52 2011 +0000 Monotone-Parent: ea7055a115673a92b88f8a6a30d580af1260bced Monotone-Revision: b0a2eb792be5b9615a3f71755613a91984d9d965 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-07-29T02:14:52 Monotone-Branch: ca.inverse.sope M sope-mime/NGImap4/ChangeLog M sope-mime/NGImap4/NGImap4Client.h M sope-mime/NGImap4/NGImap4Client.m M sope-mime/NGImap4/NGImap4ResponseNormalizer.m M sope-mime/NGImap4/NGImap4ResponseParser.m commit a41d5c2c9c114e67f7ffb083d233fcb3eb74d13b Author: Ludovic Marcotte Date: Thu Jul 28 20:35:23 2011 +0000 small fix for gcc < 4.6 runtimes Monotone-Parent: ea25201c008b15a227db7f2a74ca849924736651 Monotone-Revision: b6554a998b960d3439f7045272e63f6d40d61709 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2011-07-28T20:35:23 Monotone-Branch: ca.inverse.sope M sope-appserver/NGObjWeb/SoObjects/SoObjCClass.m commit 66e3fb3257f13570f7f6a881c02c2ab681c1c97b Author: Ludovic Marcotte Date: Thu Jul 28 20:10:14 2011 +0000 small fix for gcc < 4.6 runtimes Monotone-Parent: e4a317e41a77a206510300675052d75281aea77a Monotone-Revision: 68b7e7a0a76fc6f7178d0b38e814596820fda192 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2011-07-28T20:10:14 Monotone-Branch: ca.inverse.sope M sope-appserver/NGObjWeb/Associations/WOKeyPathAssociation.m commit 503d426116648d3093d04f21d15673b9cc4a5960 Author: Ludovic Marcotte Date: Thu Jul 28 14:52:45 2011 +0000 added missing semi-colon Monotone-Parent: 4db270e71b371d36efb23b0f11ae53d939812cc8 Monotone-Revision: e4a317e41a77a206510300675052d75281aea77a Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2011-07-28T14:52:45 Monotone-Branch: ca.inverse.sope M sope-appserver/NGObjWeb/SoObjects/SoObjCClass.m commit 662880730d5a326a353a6fc2de6f3ee562936d23 Author: Wolfgang Sourdeau Date: Thu Jul 28 14:51:02 2011 +0000 Monotone-Parent: 7c32ca09c9f85377e338da353b1eba1c2a194f5a Monotone-Revision: ea7055a115673a92b88f8a6a30d580af1260bced Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-07-28T14:51:02 Monotone-Branch: ca.inverse.sope M sope-mime/NGImap4/NGImap4Connection.h commit 169bf73f19d0f1569a422630d9ede4e8790dacc8 Author: Ludovic Marcotte Date: Thu Jul 28 14:19:46 2011 +0000 Updated Debian packaging Monotone-Parent: 70119bf7d87b438040fe83185770175d612d4aec Monotone-Revision: 4db270e71b371d36efb23b0f11ae53d939812cc8 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2011-07-28T14:19:46 Monotone-Branch: ca.inverse.sope M debian/libsope-appserver_SOPEVER_-dev.install M debian/libsope-appserver_SOPEVER_.install commit 9688301b0d444ad4104015a4849894e49911b038 Author: Wolfgang Sourdeau Date: Thu Jul 28 00:56:42 2011 +0000 Monotone-Parent: b55c3d5a2d3c3107e576e9f623b23f17454a9a63 Monotone-Revision: 430ec2c2501a94576fabbee3fdf471188078af63 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-07-28T00:56:42 Monotone-Branch: ca.inverse.sope M sope-mime/NGImap4/ChangeLog M sope-mime/NGImap4/NGImap4ResponseParser.m commit 7145d424b581895a8b7ec26236d42fa5d12567cc Author: Ludovic Marcotte Date: Wed Jul 27 14:38:34 2011 +0000 See ChangeLog Monotone-Parent: b55c3d5a2d3c3107e576e9f623b23f17454a9a63 Monotone-Revision: 70119bf7d87b438040fe83185770175d612d4aec Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2011-07-27T14:38:34 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-appserver/GNUmakefile M sope-appserver/NGObjWeb/Associations/WOKeyPathAssociation.m M sope-appserver/NGObjWeb/DynamicElements/WOComponentContent.m M sope-appserver/NGObjWeb/DynamicElements/WOCompoundElement.m M sope-appserver/NGObjWeb/DynamicElements/decommon.h M sope-appserver/NGObjWeb/NSObject+WO.m M sope-appserver/NGObjWeb/SoObjects/GNUmakefile M sope-appserver/NGObjWeb/SoObjects/SoObjCClass.m D sope-appserver/NGObjWeb/SoObjects/SoObjectXmlRpcDispatcher.h D sope-appserver/NGObjWeb/SoObjects/SoObjectXmlRpcDispatcher.m M sope-appserver/NGObjWeb/SoObjects/SoSelectorInvocation.m M sope-appserver/NGObjWeb/WOApplication.m M sope-appserver/NGObjWeb/WOComponent+Sync.m M sope-appserver/NGObjWeb/WODirectActionRequestHandler.m M sope-appserver/NGObjWeb/WOSession.m M sope-appserver/NGObjWeb/common.h D sope-appserver/NGXmlRpc/ChangeLog D sope-appserver/NGXmlRpc/EOFetchSpecification+XmlRpcCoding.m D sope-appserver/NGXmlRpc/EOKeyGlobalID+XmlRpcCoding.m D sope-appserver/NGXmlRpc/EONull+XmlRpcCoding.m D sope-appserver/NGXmlRpc/EOQualifier+XmlRpcCoding.m D sope-appserver/NGXmlRpc/EOSortOrdering+XmlRpcCoding.m D sope-appserver/NGXmlRpc/GNUmakefile D sope-appserver/NGXmlRpc/GNUmakefile.preamble D sope-appserver/NGXmlRpc/NGAsyncResultProxy.h D sope-appserver/NGXmlRpc/NGAsyncResultProxy.m D sope-appserver/NGXmlRpc/NGXmlRpc-Info.plist D sope-appserver/NGXmlRpc/NGXmlRpc.h D sope-appserver/NGXmlRpc/NGXmlRpcAction+Registry.m D sope-appserver/NGXmlRpc/NGXmlRpcAction.h D sope-appserver/NGXmlRpc/NGXmlRpcAction.m D sope-appserver/NGXmlRpc/NGXmlRpcClient.h D sope-appserver/NGXmlRpc/NGXmlRpcClient.m D sope-appserver/NGXmlRpc/NGXmlRpcInvocation.h D sope-appserver/NGXmlRpc/NGXmlRpcInvocation.m D sope-appserver/NGXmlRpc/NGXmlRpcMethodSignature.h D sope-appserver/NGXmlRpc/NGXmlRpcMethodSignature.m D sope-appserver/NGXmlRpc/NGXmlRpcRequestHandler.h D sope-appserver/NGXmlRpc/NGXmlRpcRequestHandler.m D sope-appserver/NGXmlRpc/NSObject+Reflection.h D sope-appserver/NGXmlRpc/NSObject+Reflection.m D sope-appserver/NGXmlRpc/Version D sope-appserver/NGXmlRpc/WODirectAction+XmlRpc.h D sope-appserver/NGXmlRpc/WODirectAction+XmlRpc.m D sope-appserver/NGXmlRpc/WODirectAction+XmlRpcIntrospection.h D sope-appserver/NGXmlRpc/WODirectAction+XmlRpcIntrospection.m D sope-appserver/NGXmlRpc/WOMessage+XmlRpcCoding.m D sope-appserver/NGXmlRpc/WORequest+XmlRpcCoding.m D sope-appserver/NGXmlRpc/WOResponse+XmlRpcCoding.m D sope-appserver/NGXmlRpc/XmlRpcMethodCall+WO.h D sope-appserver/NGXmlRpc/XmlRpcMethodCall+WO.m D sope-appserver/NGXmlRpc/XmlRpcMethodResponse+WO.h D sope-appserver/NGXmlRpc/XmlRpcMethodResponse+WO.m D sope-appserver/NGXmlRpc/common.h D sope-appserver/NGXmlRpc/fhs.make D sope-appserver/PROJECTLEAD D sope-appserver/SoOFS/ChangeLog D sope-appserver/SoOFS/GNUmakefile D sope-appserver/SoOFS/GNUmakefile.preamble D sope-appserver/SoOFS/OFSBaseObject.h D sope-appserver/SoOFS/OFSBaseObject.m D sope-appserver/SoOFS/OFSChangeLog.h D sope-appserver/SoOFS/OFSChangeLog.m D sope-appserver/SoOFS/OFSFactoryContext.h D sope-appserver/SoOFS/OFSFactoryContext.m D sope-appserver/SoOFS/OFSFactoryRegistry.h D sope-appserver/SoOFS/OFSFactoryRegistry.m D sope-appserver/SoOFS/OFSFile.h D sope-appserver/SoOFS/OFSFile.m D sope-appserver/SoOFS/OFSFileRenderer.h D sope-appserver/SoOFS/OFSFileRenderer.m D sope-appserver/SoOFS/OFSFolder+SoDAV.m D sope-appserver/SoOFS/OFSFolder.h D sope-appserver/SoOFS/OFSFolder.m D sope-appserver/SoOFS/OFSFolderClassDescription.h D sope-appserver/SoOFS/OFSFolderClassDescription.m D sope-appserver/SoOFS/OFSFolderDataSource.h D sope-appserver/SoOFS/OFSFolderDataSource.m D sope-appserver/SoOFS/OFSHttpPasswd.h D sope-appserver/SoOFS/OFSHttpPasswd.m D sope-appserver/SoOFS/OFSImage.h D sope-appserver/SoOFS/OFSImage.m D sope-appserver/SoOFS/OFSPropertyListObject.h D sope-appserver/SoOFS/OFSPropertyListObject.m D sope-appserver/SoOFS/OFSResourceManager.h D sope-appserver/SoOFS/OFSResourceManager.m D sope-appserver/SoOFS/OFSWebDocument.h D sope-appserver/SoOFS/OFSWebDocument.m D sope-appserver/SoOFS/OFSWebMethod.h D sope-appserver/SoOFS/OFSWebMethod.m D sope-appserver/SoOFS/OFSWebMethodRenderer.h D sope-appserver/SoOFS/OFSWebMethodRenderer.m D sope-appserver/SoOFS/OFSWebTemplate.h D sope-appserver/SoOFS/OFSWebTemplate.m D sope-appserver/SoOFS/README D sope-appserver/SoOFS/SoOFS-Info.plist D sope-appserver/SoOFS/SoOFS-SXP-Info.plist D sope-appserver/SoOFS/SoOFS.h D sope-appserver/SoOFS/SoOFSProduct.m D sope-appserver/SoOFS/TODO D sope-appserver/SoOFS/Version D sope-appserver/SoOFS/common.h D sope-appserver/SoOFS/fhs.make D sope-appserver/SoOFS/product.plist D sope-appserver/SoOFS/sope.8 D sope-appserver/SoOFS/sope.m D sope-appserver/WEPrototype/COPYING D sope-appserver/WEPrototype/COPYRIGHT D sope-appserver/WEPrototype/ChangeLog D sope-appserver/WEPrototype/GNUmakefile D sope-appserver/WEPrototype/GNUmakefile.postamble D sope-appserver/WEPrototype/GNUmakefile.preamble D sope-appserver/WEPrototype/README D sope-appserver/WEPrototype/Version D sope-appserver/WEPrototype/WELiveLink.m D sope-appserver/WEPrototype/WEPrototype-Info.plist D sope-appserver/WEPrototype/WEPrototypeBundle.m D sope-appserver/WEPrototype/WEPrototypeElemBuilder.m D sope-appserver/WEPrototype/WEPrototypeScript.api D sope-appserver/WEPrototype/WEPrototypeScript.h D sope-appserver/WEPrototype/WEPrototypeScript.jsm D sope-appserver/WEPrototype/WEPrototypeScript.m D sope-appserver/WEPrototype/WEPrototypeScriptAction.m D sope-appserver/WEPrototype/bundle-info.plist D sope-appserver/WEPrototype/common.h D sope-appserver/WEPrototype/doc/GNUmakefile D sope-appserver/WEPrototype/doc/WEPrototypeScript.3 D sope-appserver/WEPrototype/fhs.make D sope-appserver/WEPrototype/js2m.sh D sope-appserver/WEPrototype/prototype/AUTHORS D sope-appserver/WEPrototype/prototype/LICENSE D sope-appserver/WEPrototype/prototype/README D sope-appserver/WEPrototype/prototype/THANKS D sope-appserver/WEPrototype/prototype/prototype.js D sope-appserver/WEPrototype/scriptaculous/CHANGELOG D sope-appserver/WEPrototype/scriptaculous/MIT-LICENSE D sope-appserver/WEPrototype/scriptaculous/README D sope-appserver/WEPrototype/scriptaculous/controls.js D sope-appserver/WEPrototype/scriptaculous/dragdrop.js D sope-appserver/WEPrototype/scriptaculous/effects.js D sope-appserver/WOXML/COPYING D sope-appserver/WOXML/COPYRIGHT D sope-appserver/WOXML/ChangeLog D sope-appserver/WOXML/GNUmakefile D sope-appserver/WOXML/GNUmakefile.preamble D sope-appserver/WOXML/README D sope-appserver/WOXML/Version D sope-appserver/WOXML/WOXML-Info.plist D sope-appserver/WOXML/WOXML.h D sope-appserver/WOXML/WOXMLDecoder.h D sope-appserver/WOXML/WOXMLDecoder.m D sope-appserver/WOXML/WOXMLMapDecoder.h D sope-appserver/WOXML/WOXMLMapDecoder.m D sope-appserver/WOXML/WOXMLMappingEntity.h D sope-appserver/WOXML/WOXMLMappingEntity.m D sope-appserver/WOXML/WOXMLMappingModel.h D sope-appserver/WOXML/WOXMLMappingModel.m D sope-appserver/WOXML/WOXMLMappingProperty.h D sope-appserver/WOXML/WOXMLMappingProperty.m D sope-appserver/WOXML/WOXMLSaxModelHandler.h D sope-appserver/WOXML/WOXMLSaxModelHandler.m D sope-appserver/WOXML/common.h D sope-appserver/WOXML/fhs.make M sope-core/EOControl/EOKeyValueCoding.m M sope-core/EOControl/EOValidation.m M sope-core/NGExtensions/EOExt.subproj/EOQualifier+CtxEval.m M sope-core/NGExtensions/FdExt.subproj/NSNull+misc.m M sope-core/NGExtensions/GNUmakefile M sope-core/NGExtensions/NGBundleManager.m M sope-core/NGExtensions/NGExtensions/NGMemoryAllocation.h D sope-core/NGExtensions/NGExtensions/NGObjCRuntime.h D sope-core/NGExtensions/NGObjCRuntime.m M sope-core/NGExtensions/common.h M sope-core/NGStreams/NGConcreteStreamFileHandle.m M sope-core/NGStreams/common.h D sope-core/PROJECTLEAD M sope-gdl1/GDLAccess/EODatabaseFault.m M sope-gdl1/GDLAccess/EOFault.m M sope-gdl1/GDLAccess/EOFaultHandler.m M sope-gdl1/GDLAccess/EORecordDictionary.m M sope-gdl1/MySQL/NSString+MySQL4.m M sope-gdl1/MySQL/common.h M sope-gdl1/PostgreSQL/NSString+PostgreSQL72.m M sope-gdl1/PostgreSQL/common.h D sope-xml/PROJECTLEAD commit 1a502e262a05bce50538f99ee626c179e707031a Author: Wolfgang Sourdeau Date: Tue Jul 26 02:51:46 2011 +0000 Monotone-Parent: 2c7398a3fedf8786bfbd6a9d65d4cbf771d599b2 Monotone-Revision: b55c3d5a2d3c3107e576e9f623b23f17454a9a63 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-07-26T02:51:46 Monotone-Branch: ca.inverse.sope Monotone-Tag: SOPE_v1.3.8b M sope-mime/NGImap4/ChangeLog M sope-mime/NGImap4/NGImap4Connection.h M sope-mime/NGImap4/NGImap4Connection.m commit a0484e3c3456776c7f45f9bcc669f2856f353a7c Author: Wolfgang Sourdeau Date: Tue Jul 26 02:49:56 2011 +0000 Monotone-Parent: ea412d4d84178decdc9510ea1712b48fd8ce0a93 Monotone-Revision: 2c7398a3fedf8786bfbd6a9d65d4cbf771d599b2 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-07-26T02:49:56 Monotone-Branch: ca.inverse.sope M sope-mime/NGImap4/ChangeLog commit a2094dca2fbaee51d85473cb3caa9908224ce495 Author: Wolfgang Sourdeau Date: Tue Jul 26 02:49:38 2011 +0000 Monotone-Parent: 00512840a3566cfba839d23a0c5f59a7bc8662b9 Monotone-Revision: ea412d4d84178decdc9510ea1712b48fd8ce0a93 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-07-26T02:49:38 Monotone-Branch: ca.inverse.sope M sope-mime/NGImap4/EOQualifier+IMAPAdditions.m M sope-mime/NGImap4/EOSortOrdering+IMAPAdditions.m M sope-mime/NGImap4/NGImap4ResponseNormalizer.m M sope-mime/NGImap4/NGImap4ResponseParser.m commit 384642a03dbf6e89a029ea4f5fed43dd3870a116 Author: Wolfgang Sourdeau Date: Mon Jul 25 14:50:53 2011 +0000 Monotone-Parent: e83ede65860f4b5861aecfd393b724488b35f524 Monotone-Revision: 00512840a3566cfba839d23a0c5f59a7bc8662b9 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-07-25T14:50:53 Monotone-Branch: ca.inverse.sope M sope-mime/NGImap4/ChangeLog M sope-mime/NGImap4/NGImap4Client.h M sope-mime/NGImap4/NGImap4Client.m commit 26abca4f783bca1d04f685024ed4d3687ade508f Author: Francis Lachapelle Date: Fri Jul 15 18:01:38 2011 +0000 See ChangeLog. Monotone-Parent: bb2b434f5b8424fa1b0cb475825a0114ca97c65a Monotone-Revision: e83ede65860f4b5861aecfd393b724488b35f524 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2011-07-15T18:01:38 Monotone-Branch: ca.inverse.sope Monotone-Tag: SOPE_v1.3.8a Monotone-Tag: v1.3.8a M ChangeLog M sope-appserver/NGObjWeb/NGHttp/NGUrlFormCoder.m commit 8ba1434c2a7fba441446e2a946a72852fd132f5d Author: Ludovic Marcotte Date: Wed Jul 6 19:37:37 2011 +0000 See ChangeLog Monotone-Parent: 1709d5be2faef98c81803044c45b8869d94b5083 Monotone-Revision: bb2b434f5b8424fa1b0cb475825a0114ca97c65a Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2011-07-06T19:37:37 Monotone-Branch: ca.inverse.sope Monotone-Tag: SOPE_v1.3.8 M ChangeLog M sope-mime/NGImap4/NGImap4ResponseParser.m commit f63e4fe149804d08e91678474e008fc2c502a9bf Author: Ludovic Marcotte Date: Tue Jul 5 16:43:26 2011 +0000 See ChangeLog Monotone-Parent: d7a9be812fd5948a1a2ffc3ca8fae9e68db604b4 Monotone-Revision: 1709d5be2faef98c81803044c45b8869d94b5083 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2011-07-05T16:43:26 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-mime/NGImap4/NGImap4ResponseParser.m commit 684ad7698d385d6aceac41d821168de9a987c569 Author: Ludovic Marcotte Date: Wed Jun 29 17:40:32 2011 +0000 See ChangeLog Monotone-Parent: 555863e57ce13da9beb5913a24acef71207b4ced Monotone-Revision: d7a9be812fd5948a1a2ffc3ca8fae9e68db604b4 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2011-06-29T17:40:32 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-mime/NGImap4/NGSieveClient.h M sope-mime/NGImap4/NGSieveClient.m commit b2d4aa2b7e2222c9cc6ace6d67de2a07fd3dbea4 Author: Ludovic Marcotte Date: Fri Jun 17 12:16:06 2011 +0000 Fix for bug #921 Monotone-Parent: 6a31d2853009c2655df905811252120fe1564f8e Monotone-Revision: 555863e57ce13da9beb5913a24acef71207b4ced Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2011-06-17T12:16:06 Monotone-Branch: ca.inverse.sope M sope-gdl1/GDLAccess/EOSQLQualifier.m commit 3884148b9e2e0c22c65aa30e1c02a88b97b684b3 Author: Ludovic Marcotte Date: Thu Jun 16 15:40:18 2011 +0000 Fix for bug #1262 Monotone-Parent: c209a0a647b14e436b77bc38e0b7b04cc2213d0d Monotone-Revision: 6a31d2853009c2655df905811252120fe1564f8e Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2011-06-16T15:40:18 Monotone-Branch: ca.inverse.sope M sope-appserver/NGObjWeb/UnixSignalHandler.h commit bba48aff7608928d88f7e786f326772cd115b4dd Author: Ludovic Marcotte Date: Thu Jun 16 15:31:59 2011 +0000 Fix for bug #1023 Monotone-Parent: 856965845eee02997e104f46f22a199238f9ed24 Monotone-Revision: c209a0a647b14e436b77bc38e0b7b04cc2213d0d Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2011-06-16T15:31:59 Monotone-Branch: ca.inverse.sope M sope-core/NGExtensions/FdExt.subproj/NSString+Encoding.m commit 02f21a2758ae968cffd2bbf074c1e1b9de4db29b Author: Ludovic Marcotte Date: Thu Jun 16 15:29:17 2011 +0000 Fix for bug #1166 Monotone-Parent: b904302ec7f7663496c7a17492fc8767c1a1b674 Monotone-Revision: 856965845eee02997e104f46f22a199238f9ed24 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2011-06-16T15:29:17 Monotone-Branch: ca.inverse.sope M sope-appserver/NGObjWeb/WOHTTPURLHandle.m commit bb8bdef230156855f38d0e4a7b260c01754bd299 Author: Francis Lachapelle Date: Wed Jun 1 17:45:25 2011 +0000 See ChangeLog. Monotone-Parent: 343b294ae6b349f6c17c2820edfb834d701eee22 Monotone-Revision: b904302ec7f7663496c7a17492fc8767c1a1b674 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2011-06-01T17:45:25 Monotone-Branch: ca.inverse.sope M sope-mime/NGImap4/ChangeLog M sope-mime/NGImap4/NGImap4Client.h M sope-mime/NGImap4/NGImap4Client.m M sope-mime/NGImap4/NGImap4Connection.h M sope-mime/NGImap4/NGImap4Connection.m M sope-mime/NGImap4/NGImap4ResponseParser.m commit c7833207aca18cdf2d83f781018c058fd03583c2 Author: Ludovic Marcotte Date: Tue May 10 19:25:18 2011 +0000 Update for bug #1022 Monotone-Parent: 66f477f73a8ce773bdb62cd6184905f4336f420e Monotone-Revision: 343b294ae6b349f6c17c2820edfb834d701eee22 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2011-05-10T19:25:18 Monotone-Branch: ca.inverse.sope M sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m commit 714aa4241fd10cbd60ea7e21eb869c9db5127cf1 Author: Ludovic Marcotte Date: Mon May 9 20:24:23 2011 +0000 Fix for bug #1288 Monotone-Parent: c5a8d5d7bd08d2c13646aa67cda95ba544c90841 Monotone-Revision: 66f477f73a8ce773bdb62cd6184905f4336f420e Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2011-05-09T20:24:23 Monotone-Branch: ca.inverse.sope M sope-mime/NGMime/GNUmakefile.preamble M sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m commit 0bc6fab8b6091d3eaa24dffbdb86098d89a32789 Author: Ludovic Marcotte Date: Mon May 9 20:12:31 2011 +0000 Fix for bug #1022 Monotone-Parent: de0e01465948db32e2abafb9422ea9eab4948235 Monotone-Revision: 14f63ed87619d66efaa6e55b50904ff1eb910d3d Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2011-05-09T20:12:31 Monotone-Branch: ca.inverse.sope M sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m commit 653a736035694bbccf4fb9855cfd3a287af0af1b Author: Wolfgang Sourdeau Date: Fri Apr 8 15:35:07 2011 +0000 Monotone-Parent: de0e01465948db32e2abafb9422ea9eab4948235 Monotone-Revision: c9723068f0534907bfebec9248331816410a6e25 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-04-08T15:35:07 Monotone-Branch: ca.inverse.sope Monotone-Tag: SOPE_v1.3.6 Monotone-Tag: SOPE_v1.3.7 M ChangeLog M sope-core/NGExtensions/FdExt.subproj/NSString+URLEscaping.m commit 41f0b1b613d0e901fdb8722692d5f1742848a357 Author: Wolfgang Sourdeau Date: Tue Apr 5 16:56:25 2011 +0000 Monotone-Parent: f0054fdcd971986140d813255d32d9d7baf552ca Monotone-Revision: de0e01465948db32e2abafb9422ea9eab4948235 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-04-05T16:56:25 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-mime/NGImap4/NGImap4Connection.m commit 16117a421714adf4439a3b3a87bec19428161df3 Author: Wolfgang Sourdeau Date: Mon Apr 4 15:56:11 2011 +0000 Monotone-Parent: 79068e9caaeaad9627b644cf8fa45afd52ee03e5 Monotone-Revision: f0054fdcd971986140d813255d32d9d7baf552ca Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-04-04T15:56:11 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpAdaptor.m commit 553e6a335f9656e026a263af5432c1a35dd90c7c Author: Wolfgang Sourdeau Date: Fri Apr 1 12:48:33 2011 +0000 Monotone-Parent: 73abf806067a4542d59d36756891867840b5ecab Monotone-Revision: 79068e9caaeaad9627b644cf8fa45afd52ee03e5 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-04-01T12:48:33 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-appserver/NGObjWeb/Defaults.plist M sope-appserver/NGObjWeb/WOWatchDogApplicationMain.m commit 9ae83b3cdbe8cb13738296b1c0570c3b750a42e8 Author: Wolfgang Sourdeau Date: Wed Mar 30 19:57:28 2011 +0000 Monotone-Parent: a3d4e55651cc3665bc700bca6ff9fe90cfdd5a85 Monotone-Revision: 73abf806067a4542d59d36756891867840b5ecab Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-03-30T19:57:28 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-appserver/NGObjWeb/NGObjWeb/WOCoreApplication.h M sope-appserver/NGObjWeb/WOWatchDogApplicationMain.m commit 8288d939edfc80037f4cf6c9ab8950dd8db20468 Author: Wolfgang Sourdeau Date: Wed Mar 30 19:46:56 2011 +0000 Monotone-Parent: 559ec44990593b5f87e22dac3a519a11311555ad Monotone-Revision: a3d4e55651cc3665bc700bca6ff9fe90cfdd5a85 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-03-30T19:46:56 Monotone-Branch: ca.inverse.sope M configure commit 0e412e2d1c0c2870e96afeaba4377c83aea03458 Author: Wolfgang Sourdeau Date: Wed Mar 30 18:24:20 2011 +0000 Monotone-Parent: 01aca3f61dbe0541db88ea9497a114cb2e10f039 Monotone-Revision: 559ec44990593b5f87e22dac3a519a11311555ad Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-03-30T18:24:20 Monotone-Branch: ca.inverse.sope M configure commit c2a23f75290e7527a4121090a45c5dde08c873d1 Author: Wolfgang Sourdeau Date: Wed Mar 30 18:22:24 2011 +0000 Monotone-Parent: a7ef4a2a412b093da5f4be5031b48b0fea104491 Monotone-Revision: 01aca3f61dbe0541db88ea9497a114cb2e10f039 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-03-30T18:22:24 Monotone-Branch: ca.inverse.sope M sope-core/NGExtensions/common.h M sope-core/NGStreams/common.h commit f738a592e5640c253ed7ab5300eb435fcd8d9edb Author: Wolfgang Sourdeau Date: Wed Mar 30 18:17:31 2011 +0000 Monotone-Parent: 437f725698fa559d8db1633148ccfca185ff0f67 Monotone-Revision: a7ef4a2a412b093da5f4be5031b48b0fea104491 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-03-30T18:17:31 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-core/NGStreams/GNUmakefile.postamble M sope-core/NGStreams/GNUmakefile.preamble M sope-core/NGStreams/config.guess M sope-core/NGStreams/config.sub M sope-core/NGStreams/configure M sope-core/NGStreams/configure.in D sope-core/NGStreams/macosx/config.h commit 93b15d5541acb769ab756ad2526011f7e2ea45c8 Author: Wolfgang Sourdeau Date: Wed Mar 30 16:08:43 2011 +0000 Monotone-Parent: b1d6b4263ac7881f719f51573baa184fb221568d Monotone-Revision: 437f725698fa559d8db1633148ccfca185ff0f67 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-03-30T16:08:43 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-mime/NGImap4/NGImap4ResponseParser.m commit d6d73721890361a845c9ce5025f1a06b372813a8 Author: Wolfgang Sourdeau Date: Wed Mar 30 01:03:54 2011 +0000 Monotone-Parent: 20015d753662591857d581e96ca36f36e2d82f3b Monotone-Revision: b1d6b4263ac7881f719f51573baa184fb221568d Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-03-30T01:03:54 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-appserver/NGObjWeb/WOWatchDogApplicationMain.m commit 6b56d8c6b8acdea748771b16dfca0a44e2823bb0 Author: Wolfgang Sourdeau Date: Tue Mar 29 18:12:25 2011 +0000 Monotone-Parent: b3f9e634153544d13a2e5a5d59482d88c332f1fd Monotone-Revision: 20015d753662591857d581e96ca36f36e2d82f3b Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-03-29T18:12:25 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-appserver/NGObjWeb/Defaults.plist M sope-appserver/NGObjWeb/WOWatchDogApplicationMain.m commit d42a6e94a0ff67d3f91f4d3a2d877e10d838eaa0 Author: Wolfgang Sourdeau Date: Tue Mar 29 15:17:10 2011 +0000 Monotone-Parent: 88f115c9599e7844a2240f799cf327c853502ecd Monotone-Revision: b3f9e634153544d13a2e5a5d59482d88c332f1fd Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-03-29T15:17:10 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-appserver/NGObjWeb/DynamicElements/WOString.m commit 647f6b9ae624b88dab35ef5a4c2341b631dff665 Author: Wolfgang Sourdeau Date: Thu Mar 24 12:40:49 2011 +0000 Monotone-Parent: 4736ea07b321358abcd258e898336df8431e007e Monotone-Revision: 88f115c9599e7844a2240f799cf327c853502ecd Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-03-24T12:40:49 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-mime/NGImap4/NGImap4ResponseParser.m commit b978c9d407376cee90ba5f471178df09afcd3781 Author: Wolfgang Sourdeau Date: Thu Mar 24 12:37:57 2011 +0000 Monotone-Parent: ca2389fe3a5aa07e0ca7ba4a1ba3fa40f71cd2a4 Monotone-Revision: 4736ea07b321358abcd258e898336df8431e007e Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-03-24T12:37:57 Monotone-Branch: ca.inverse.sope M ChangeLog commit 146f78b136e1b0328d3bac77e757037790f08477 Author: Wolfgang Sourdeau Date: Thu Mar 24 12:33:27 2011 +0000 Monotone-Parent: fd32da338e2fa757740eefbb0b8ae78ab559340b Monotone-Revision: ca2389fe3a5aa07e0ca7ba4a1ba3fa40f71cd2a4 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-03-24T12:33:27 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-mime/NGMime/NGMimeType.m commit fd09a090395eeda807ba755bc3627af4e78fa41c Author: Wolfgang Sourdeau Date: Thu Mar 17 20:55:52 2011 +0000 Monotone-Parent: 25bd2f1c11c2ef6913a3c40e82f336887e03c87d Monotone-Revision: fd32da338e2fa757740eefbb0b8ae78ab559340b Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-03-17T20:55:52 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-mime/NGImap4/NGImap4ResponseParser.m commit bdf879b73396a7ac75433bdc16e5e523bf022981 Author: Wolfgang Sourdeau Date: Thu Mar 17 16:30:21 2011 +0000 Monotone-Parent: 85d5149fb219351986ce5e95b7693c73716ed059 Monotone-Revision: 25bd2f1c11c2ef6913a3c40e82f336887e03c87d Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-03-17T16:30:21 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-core/NGExtensions/NGQuotedPrintableCoding.m commit 6fa3714683b45a38574416862743f25736891a55 Author: Wolfgang Sourdeau Date: Thu Mar 17 15:54:42 2011 +0000 Monotone-Parent: 5ab60248b61360626ad013bbb715f62fd3e2d040 Monotone-Revision: 85d5149fb219351986ce5e95b7693c73716ed059 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-03-17T15:54:42 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-mime/NGImap4/NGImap4Connection.m commit feda6bb1171217892df408d62ce7f0694817ddc0 Author: Wolfgang Sourdeau Date: Thu Mar 17 15:52:02 2011 +0000 Monotone-Parent: 8001919a0b262e34b1e7bd97508ca3df1cca9bba Monotone-Revision: 5ab60248b61360626ad013bbb715f62fd3e2d040 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-03-17T15:52:02 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-appserver/NGObjWeb/WOWatchDogApplicationMain.m commit a3b17b5286e846bac63344ae23f76e526d7c14be Author: Wolfgang Sourdeau Date: Thu Feb 24 20:12:39 2011 +0000 Monotone-Parent: be9dc5b7e13dac03faa057a060653af6008d1906 Monotone-Revision: 8001919a0b262e34b1e7bd97508ca3df1cca9bba Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-02-24T20:12:39 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-mime/NGImap4/NGImap4Connection.m commit df4854ca7772275e82b385be9e5e2da0af55cbe0 Author: Ludovic Marcotte Date: Wed Feb 23 23:02:01 2011 +0000 See ChangeLog Monotone-Parent: b605553eb6d92d6d091473a50c3148ef02fc28f7 Monotone-Revision: be9dc5b7e13dac03faa057a060653af6008d1906 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2011-02-23T23:02:01 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-mime/NGMail/NGSendMail.m M sope-mime/NGMail/NGSmtpClient.m commit 50ca9d24b414f76fd228827f46721bd4aef25e87 Author: Ludovic Marcotte Date: Wed Jan 5 22:51:20 2011 +0000 See ChangeLog Monotone-Parent: cea3fd5edf797a3a5aa3b5fcb0ec00b98278842e Monotone-Revision: b605553eb6d92d6d091473a50c3148ef02fc28f7 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2011-01-05T22:51:20 Monotone-Branch: ca.inverse.sope Monotone-Tag: SOPE_v1.3.5 M ChangeLog M sope-core/NGExtensions/NGQuotedPrintableCoding.m commit 37d13f107c141c606b7b8456b9509ebf3dd64b9f Author: Wolfgang Sourdeau Date: Thu Dec 30 13:44:19 2010 +0000 Monotone-Parent: 5f2dcb8f53919cb1fd811816afb8b818465a3dd6 Monotone-Revision: cea3fd5edf797a3a5aa3b5fcb0ec00b98278842e Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-12-30T13:44:19 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-mime/NGImap4/EOQualifier+IMAPAdditions.m commit eab9adf9b41f9e60c086cf566d41e84548dbd819 Author: Ludovic Marcotte Date: Fri Dec 17 20:53:50 2010 +0000 See ChangeLog Monotone-Parent: b43cf692b49827fd3bdb7aa4623f4fc3874501ae Monotone-Revision: 5f2dcb8f53919cb1fd811816afb8b818465a3dd6 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2010-12-17T20:53:50 Monotone-Branch: ca.inverse.sope M ChangeLog D sope-gdl1/COPYING.LIB D sope-gdl1/README-OSX.txt M sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m commit 4050c48d3a71cdae5caf2d188ea910fea523d784 Author: Ludovic Marcotte Date: Tue Dec 7 18:20:13 2010 +0000 dropped useless files Monotone-Parent: bb7c51374ca0618bbfd3191a3294b1493037591f Monotone-Revision: aed2ceec003a06eb64daf071977780a99ca08427 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2010-12-07T18:20:13 Monotone-Branch: ca.inverse.sope D sope-xml/SaxObjC/shared_debug_obj/libSaxObjC.so.4.7 D sope-xml/SaxObjC/shared_debug_obj/libSaxObjC.so.4.7.66 commit 68c6e337a6279a8c29990cd782431932532f9e0d Author: Wolfgang Sourdeau Date: Tue Nov 23 14:53:15 2010 +0000 Monotone-Parent: bb7c51374ca0618bbfd3191a3294b1493037591f Monotone-Revision: bfd9b7b1adcb089d78763ecf4fc517d39c63be4c Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-11-23T14:53:15 Monotone-Branch: ca.inverse.sope M sope-appserver/mod_ngobjweb/ChangeLog M sope-appserver/mod_ngobjweb/GNUmakefile M sope-appserver/mod_ngobjweb/handler.c M sope-appserver/mod_ngobjweb/scanhttp.c commit 770ef37d852347cd13aa09e9c4f9010e08991b67 Author: Ludovic Marcotte Date: Wed Nov 10 19:58:51 2010 +0000 See ChangeLog Monotone-Parent: a84d89083c5074c42f4091869e33b834834865dc Monotone-Revision: bb7c51374ca0618bbfd3191a3294b1493037591f Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2010-11-10T19:58:51 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-mime/NGImap4/NGImap4Client.h M sope-mime/NGImap4/NGImap4Client.m commit 1eba452ac6a2271ff4656eac3ae343b697b26c0a Author: Ludovic Marcotte Date: Tue Nov 2 17:47:04 2010 +0000 See ChangeLog Monotone-Parent: 334ce1ea6611e00728006a3a82bb74de2055da15 Monotone-Revision: a84d89083c5074c42f4091869e33b834834865dc Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2010-11-02T17:47:04 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-mime/NGMime/NGMimeHeaderFieldGeneratorSet.m commit a1f0836d5dba42ae46400e49e136798636798514 Author: Wolfgang Sourdeau Date: Tue Nov 2 16:32:52 2010 +0000 Monotone-Parent: 2f703e3271e286df3c00152e0464fcc084fea315 Monotone-Revision: 334ce1ea6611e00728006a3a82bb74de2055da15 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-11-02T16:32:52 Monotone-Branch: ca.inverse.sope M debian/control.in commit 698bd036d24c37a52d9956e28d6d0e08d1dc5389 Author: Wolfgang Sourdeau Date: Tue Nov 2 16:21:38 2010 +0000 Monotone-Parent: bcdbce4a172e6393f7c9dd505a7c830ebe7d5569 Monotone-Revision: 2f703e3271e286df3c00152e0464fcc084fea315 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-11-02T16:21:38 Monotone-Branch: ca.inverse.sope M debian/changelog M debian/control.in A debian/libsbjson2.3-dev.install A debian/libsbjson2.3.install commit a03c50d4e992196ddde97ecd8cca90f5849bbed0 Author: Wolfgang Sourdeau Date: Tue Nov 2 12:53:34 2010 +0000 Monotone-Parent: 937d1a127047e0aa38e45f657f460515dc66d5c4 Monotone-Revision: bcdbce4a172e6393f7c9dd505a7c830ebe7d5569 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-11-02T12:53:34 Monotone-Branch: ca.inverse.sope M GNUmakefile commit a3513b5dd46480b1463eb46baf9f530c75c6ec00 Author: Wolfgang Sourdeau Date: Mon Nov 1 17:57:27 2010 +0000 Monotone-Parent: 8d6bd0910d4139547fff02487e39a40d0dc07698 Monotone-Revision: 937d1a127047e0aa38e45f657f460515dc66d5c4 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-11-01T17:57:27 Monotone-Branch: ca.inverse.sope M sope-json/SBJson/Classes/GNUmakefile commit 83c3961e6bbb28ba71715b0c0c2804934f1101f1 Author: Wolfgang Sourdeau Date: Mon Nov 1 12:39:37 2010 +0000 Monotone-Parent: aeb7aa8954f5273458e8c551c8c4fd15817976ac Monotone-Revision: 8d6bd0910d4139547fff02487e39a40d0dc07698 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-11-01T12:39:37 Monotone-Branch: ca.inverse.sope M ChangeLog A sope-json/GNUmakefile A sope-json/SBJson/Changes.markdown A sope-json/SBJson/Classes/GNUmakefile A sope-json/SBJson/Classes/JSON.h A sope-json/SBJson/Classes/NSObject+SBJSON.h A sope-json/SBJson/Classes/NSObject+SBJSON.m A sope-json/SBJson/Classes/NSString+SBJSON.h A sope-json/SBJson/Classes/NSString+SBJSON.m A sope-json/SBJson/Classes/SBJson.h A sope-json/SBJson/Classes/SBJsonBase.h A sope-json/SBJson/Classes/SBJsonBase.m A sope-json/SBJson/Classes/SBJsonParser.h A sope-json/SBJson/Classes/SBJsonParser.m A sope-json/SBJson/Classes/SBJsonWriter.h A sope-json/SBJson/Classes/SBJsonWriter.m A sope-json/SBJson/Credits.markdown A sope-json/SBJson/GNUmakefile A sope-json/SBJson/Installation.markdown A sope-json/SBJson/JSON-Info.plist A sope-json/SBJson/JSON.xcodeproj/project.pbxproj A sope-json/SBJson/LICENSE A sope-json/SBJson/Notes/JensAlfkePerformanceNotes.txt A sope-json/SBJson/Notes/parser-benchmark.txt A sope-json/SBJson/Readme.markdown A sope-json/SBJson/Scripts/InstallDocumentation.sh A sope-json/SBJson/Scripts/RefreshOnlineDocs.sh A sope-json/SBJson/Tests-Info.plist A sope-json/SBJson/Tests/AbstractTest.h A sope-json/SBJson/Tests/AbstractTest.m A sope-json/SBJson/Tests/Data/array.json A sope-json/SBJson/Tests/Data/array.json.pretty A sope-json/SBJson/Tests/Data/array.json.terse A sope-json/SBJson/Tests/Data/bool.json A sope-json/SBJson/Tests/Data/bool.json.pretty A sope-json/SBJson/Tests/Data/bool.json.terse A sope-json/SBJson/Tests/Data/format.json A sope-json/SBJson/Tests/Data/format.json.pretty A sope-json/SBJson/Tests/Data/format.json.terse A sope-json/SBJson/Tests/Data/json.org/1.json A sope-json/SBJson/Tests/Data/json.org/1.json.pretty A sope-json/SBJson/Tests/Data/json.org/1.json.terse A sope-json/SBJson/Tests/Data/json.org/2.json A sope-json/SBJson/Tests/Data/json.org/2.json.pretty A sope-json/SBJson/Tests/Data/json.org/2.json.terse A sope-json/SBJson/Tests/Data/json.org/3.json A sope-json/SBJson/Tests/Data/json.org/3.json.pretty A sope-json/SBJson/Tests/Data/json.org/3.json.terse A sope-json/SBJson/Tests/Data/json.org/4.json A sope-json/SBJson/Tests/Data/json.org/4.json.pretty A sope-json/SBJson/Tests/Data/json.org/4.json.terse A sope-json/SBJson/Tests/Data/json.org/5.json A sope-json/SBJson/Tests/Data/json.org/5.json.pretty A sope-json/SBJson/Tests/Data/json.org/5.json.terse A sope-json/SBJson/Tests/Data/json.org/README A sope-json/SBJson/Tests/Data/jsonchecker/README A sope-json/SBJson/Tests/Data/jsonchecker/fail1.json A sope-json/SBJson/Tests/Data/jsonchecker/fail10.json A sope-json/SBJson/Tests/Data/jsonchecker/fail11.json A sope-json/SBJson/Tests/Data/jsonchecker/fail12.json A sope-json/SBJson/Tests/Data/jsonchecker/fail13.json A sope-json/SBJson/Tests/Data/jsonchecker/fail14.json A sope-json/SBJson/Tests/Data/jsonchecker/fail15.json A sope-json/SBJson/Tests/Data/jsonchecker/fail16.json A sope-json/SBJson/Tests/Data/jsonchecker/fail17.json A sope-json/SBJson/Tests/Data/jsonchecker/fail18.json A sope-json/SBJson/Tests/Data/jsonchecker/fail19.json A sope-json/SBJson/Tests/Data/jsonchecker/fail2.json A sope-json/SBJson/Tests/Data/jsonchecker/fail20.json A sope-json/SBJson/Tests/Data/jsonchecker/fail21.json A sope-json/SBJson/Tests/Data/jsonchecker/fail22.json A sope-json/SBJson/Tests/Data/jsonchecker/fail23.json A sope-json/SBJson/Tests/Data/jsonchecker/fail24.json A sope-json/SBJson/Tests/Data/jsonchecker/fail25.json A sope-json/SBJson/Tests/Data/jsonchecker/fail26.json A sope-json/SBJson/Tests/Data/jsonchecker/fail27.json A sope-json/SBJson/Tests/Data/jsonchecker/fail28.json A sope-json/SBJson/Tests/Data/jsonchecker/fail29.json A sope-json/SBJson/Tests/Data/jsonchecker/fail3.json A sope-json/SBJson/Tests/Data/jsonchecker/fail30.json A sope-json/SBJson/Tests/Data/jsonchecker/fail31.json A sope-json/SBJson/Tests/Data/jsonchecker/fail32.json A sope-json/SBJson/Tests/Data/jsonchecker/fail33.json A sope-json/SBJson/Tests/Data/jsonchecker/fail4.json A sope-json/SBJson/Tests/Data/jsonchecker/fail5.json A sope-json/SBJson/Tests/Data/jsonchecker/fail6.json A sope-json/SBJson/Tests/Data/jsonchecker/fail7.json A sope-json/SBJson/Tests/Data/jsonchecker/fail8.json A sope-json/SBJson/Tests/Data/jsonchecker/fail9.json A sope-json/SBJson/Tests/Data/jsonchecker/pass1.json A sope-json/SBJson/Tests/Data/jsonchecker/pass1.json.pretty A sope-json/SBJson/Tests/Data/jsonchecker/pass1.json.terse A sope-json/SBJson/Tests/Data/jsonchecker/pass2.json A sope-json/SBJson/Tests/Data/jsonchecker/pass2.json.pretty A sope-json/SBJson/Tests/Data/jsonchecker/pass2.json.terse A sope-json/SBJson/Tests/Data/jsonchecker/pass3.json A sope-json/SBJson/Tests/Data/jsonchecker/pass3.json.pretty A sope-json/SBJson/Tests/Data/jsonchecker/pass3.json.terse A sope-json/SBJson/Tests/Data/null.json A sope-json/SBJson/Tests/Data/null.json.pretty A sope-json/SBJson/Tests/Data/null.json.terse A sope-json/SBJson/Tests/Data/number.json A sope-json/SBJson/Tests/Data/number.json.pretty A sope-json/SBJson/Tests/Data/number.json.terse A sope-json/SBJson/Tests/Data/rfc4627/README A sope-json/SBJson/Tests/Data/rfc4627/a.json A sope-json/SBJson/Tests/Data/rfc4627/a.json.pretty A sope-json/SBJson/Tests/Data/rfc4627/a.json.terse A sope-json/SBJson/Tests/Data/rfc4627/b.json A sope-json/SBJson/Tests/Data/rfc4627/b.json.pretty A sope-json/SBJson/Tests/Data/rfc4627/b.json.terse A sope-json/SBJson/Tests/Data/string-ctrl.json A sope-json/SBJson/Tests/Data/string-ctrl.json.pretty A sope-json/SBJson/Tests/Data/string-ctrl.json.terse A sope-json/SBJson/Tests/Data/string-unicode.json A sope-json/SBJson/Tests/Data/string-unicode.json.pretty A sope-json/SBJson/Tests/Data/string-unicode.json.terse A sope-json/SBJson/Tests/Data/string.json A sope-json/SBJson/Tests/Data/string.json.pretty A sope-json/SBJson/Tests/Data/string.json.terse A sope-json/SBJson/Tests/DataDrivenTest.h A sope-json/SBJson/Tests/DataDrivenTest.m A sope-json/SBJson/Tests/ErrorTest.h A sope-json/SBJson/Tests/ErrorTest.m A sope-json/SBJson/Tests/MaxDepthTest.h A sope-json/SBJson/Tests/MaxDepthTest.m A sope-json/SBJson/Tests/ProxyTest.h A sope-json/SBJson/Tests/ProxyTest.m A sope-json/SBJson/Tests/WriterTest.h A sope-json/SBJson/Tests/WriterTest.m A sope-json/SBJson/libjsontests-Info.plist commit e4e0c5c97aaa22bc1901084118695932dcb7efce Author: Wolfgang Sourdeau Date: Wed Oct 27 14:18:29 2010 +0000 Monotone-Parent: 91eabdd47423fe94cc55b7326c9ae63c58d32702 Monotone-Revision: aeb7aa8954f5273458e8c551c8c4fd15817976ac Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-10-27T14:18:29 Monotone-Branch: ca.inverse.sope M sope-appserver/NGObjWeb/DAVPropMap.plist commit 82e6126f38ce022b58c218d31a5257242f278109 Author: Wolfgang Sourdeau Date: Tue Oct 26 20:26:21 2010 +0000 Monotone-Parent: 86da7ae8ad59e676427e5a4304365260cc29ce6f Monotone-Revision: 91eabdd47423fe94cc55b7326c9ae63c58d32702 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-10-26T20:26:21 Monotone-Branch: ca.inverse.sope M sope-appserver/NGObjWeb/DAVPropMap.plist commit 5fd20e24dff94747a2c94ae0ce86db9dcb1deca7 Author: Wolfgang Sourdeau Date: Mon Oct 25 18:54:50 2010 +0000 Monotone-Parent: 6bc74c53f02feea223e751b09d8e4cdd2a11956f Monotone-Revision: 86da7ae8ad59e676427e5a4304365260cc29ce6f Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-10-25T18:54:50 Monotone-Branch: ca.inverse.sope M sope-appserver/NGObjWeb/DAVPropMap.plist commit 6ae23f0e2610e0c9b838adae9970a876ec464829 Author: Ludovic Marcotte Date: Sat Oct 16 18:30:21 2010 +0000 Fix for http://sogo.nu/bugs/view.php?id=909 Monotone-Parent: a6d2805974fa3520dc43149ae8dbd7dc72f4c575 Monotone-Revision: 6bc74c53f02feea223e751b09d8e4cdd2a11956f Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2010-10-16T18:30:21 Monotone-Branch: ca.inverse.sope M sope-appserver/NGObjWeb/WebDAV/SoWebDAVRenderer.m commit 477b732face154405a46295d6a2ba253449dea90 Author: Ludovic Marcotte Date: Fri Oct 8 21:10:37 2010 +0000 Removed NSLog call Monotone-Parent: c97680ec76b8116f6a89a6fbfdd96aafe8765a7f Monotone-Revision: a6d2805974fa3520dc43149ae8dbd7dc72f4c575 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2010-10-08T21:10:37 Monotone-Branch: ca.inverse.sope M sope-mime/NGImap4/NGImap4ResponseParser.m commit 531de96712b26ae0c3e969a8b71372384a4a13e4 Author: Ludovic Marcotte Date: Fri Oct 8 21:05:23 2010 +0000 See ChangeLog Monotone-Parent: 294283259afe17fbd3d6a8fcecdd0e385910a860 Monotone-Revision: c97680ec76b8116f6a89a6fbfdd96aafe8765a7f Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2010-10-08T21:05:23 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-mime/NGImap4/NGImap4Client.m M sope-mime/NGImap4/NGImap4ResponseParser.m commit 27960ac2ca829a01cf9a96d648dc5d222cb3c437 Author: Wolfgang Sourdeau Date: Fri Oct 8 18:55:32 2010 +0000 Monotone-Parent: a9f6a3eeb31f56abac8a740944b6e599fadbe07a Monotone-Revision: 294283259afe17fbd3d6a8fcecdd0e385910a860 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-10-08T18:55:32 Monotone-Branch: ca.inverse.sope M sope-core/NGExtensions/ChangeLog M sope-core/NGExtensions/NGBase64Coding.m commit 61900d88aa9f090293131c4f5729772d57565c99 Author: Wolfgang Sourdeau Date: Fri Oct 8 18:53:12 2010 +0000 Monotone-Parent: 792a3018d7226385d38a75e26074c3791e366d06 Monotone-Revision: a9f6a3eeb31f56abac8a740944b6e599fadbe07a Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-10-08T18:53:12 Monotone-Branch: ca.inverse.sope M sope-appserver/NGObjWeb/ChangeLog commit 150784587a0c38d9770f563070dd45320f9d14f7 Author: Wolfgang Sourdeau Date: Fri Oct 8 18:53:10 2010 +0000 Monotone-Parent: cfeef63d98e65ee048144929e2932e4e6687d1f6 Monotone-Revision: 792a3018d7226385d38a75e26074c3791e366d06 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-10-08T18:53:10 Monotone-Branch: ca.inverse.sope M sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpAdaptor.m commit 387be873412cdc1d23c050d0bb4a7759a5d92f33 Author: Wolfgang Sourdeau Date: Fri Oct 8 15:47:48 2010 +0000 Monotone-Parent: 8aacbd3a97490b69f50cef2fdce059e1d0013158 Monotone-Revision: cfeef63d98e65ee048144929e2932e4e6687d1f6 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-10-08T15:47:48 Monotone-Branch: ca.inverse.sope M sope-appserver/NGObjWeb/ChangeLog M sope-appserver/NGObjWeb/WOWatchDogApplicationMain.m commit 8b5f7ab191645daa1e7dd46d441db9e5c15b9ec8 Author: Wolfgang Sourdeau Date: Fri Oct 8 15:27:43 2010 +0000 Monotone-Parent: c07a069b354f3262396ed734c9aabcd59296b2ec Monotone-Revision: 8aacbd3a97490b69f50cef2fdce059e1d0013158 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-10-08T15:27:43 Monotone-Branch: ca.inverse.sope M sope-appserver/NGObjWeb/ChangeLog M sope-appserver/NGObjWeb/WOWatchDogApplicationMain.m commit 09f3b4ae246179543ea74afac2056e7b8b549718 Author: Wolfgang Sourdeau Date: Thu Oct 7 21:38:31 2010 +0000 Monotone-Parent: ecdc440e8896df29068dbbc60a0e0d38a89a791f Monotone-Revision: c07a069b354f3262396ed734c9aabcd59296b2ec Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-10-07T21:38:31 Monotone-Branch: ca.inverse.sope M sope-gdl1/MySQL/ChangeLog M sope-gdl1/MySQL/EOAttribute+MySQL4.m M sope-gdl1/MySQL/MySQL4Channel.m M sope-gdl1/MySQL/MySQL4Values.h M sope-gdl1/MySQL/MySQL4Values.m M sope-gdl1/MySQL/NSCalendarDate+MySQL4Val.m M sope-gdl1/MySQL/NSData+MySQL4Val.m M sope-gdl1/MySQL/NSNumber+MySQL4Val.m M sope-gdl1/MySQL/NSString+MySQL4Val.m commit c47383fd7043054b30ad38a9c8d85eb7e3ae0cd6 Author: Wolfgang Sourdeau Date: Thu Oct 7 14:56:48 2010 +0000 Monotone-Parent: 26c1f473aed204ed7db16619362066097b7890c1 Monotone-Revision: ecdc440e8896df29068dbbc60a0e0d38a89a791f Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-10-07T14:56:48 Monotone-Branch: ca.inverse.sope M sope-core/NGExtensions/ChangeLog M sope-core/NGExtensions/NGBase64Coding.m commit 26a53212af980592d92737b1ebc37d4b37baa41e Author: Wolfgang Sourdeau Date: Wed Oct 6 13:43:55 2010 +0000 Monotone-Parent: b7801a267e4f3c45af85e3377460ed0a1913af3c Monotone-Revision: 26c1f473aed204ed7db16619362066097b7890c1 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-10-06T13:43:55 Monotone-Branch: ca.inverse.sope M sope-appserver/WEPrototype/ChangeLog M sope-appserver/WEPrototype/WEPrototypeScript.jsm M sope-appserver/WEPrototype/js2m.sh commit 5e716648e0017021f9774a2c8e278db7db7b817e Author: Ludovic Marcotte Date: Thu Sep 23 19:04:39 2010 +0000 See ChangeLog Monotone-Parent: 6ee5af6a8c9a5173c9ea7d067f18d3ff0ec7f517 Monotone-Revision: 8de1194a868d53b789ec161d51455b4f3422f842 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2010-09-23T19:04:39 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-mime/NGImap4/NGImap4Client.m M sope-mime/NGImap4/NGImap4ResponseParser.m commit 5520a998fa682be127bd9b018d97c2a104d82d87 Author: Wolfgang Sourdeau Date: Thu Sep 9 18:54:22 2010 +0000 Monotone-Parent: bd09cb71bd5ec0ee149eebb943ee370f60e92077 Monotone-Revision: 371157b0acf7f2b57302e0790502ad9c713b06f8 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-09-09T18:54:22 Monotone-Branch: ca.inverse.sope M debian/control.in commit a25221e59224aa24ee09254c8322715e162466b0 Author: Wolfgang Sourdeau Date: Thu Sep 9 18:18:41 2010 +0000 Monotone-Parent: bbe6eb5c262eb73c0019badb62306cf755562cf7 Monotone-Revision: bd09cb71bd5ec0ee149eebb943ee370f60e92077 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-09-09T18:18:41 Monotone-Branch: ca.inverse.sope M debian/control.in commit 9bb9edab12e1d0d8af9adccfde6d10bbcfa00a5c Author: Wolfgang Sourdeau Date: Thu Sep 9 18:10:06 2010 +0000 Monotone-Parent: aeed4c1c468a84535626e699b64b7b8ab061d9d4 Monotone-Revision: bbe6eb5c262eb73c0019badb62306cf755562cf7 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-09-09T18:10:06 Monotone-Branch: ca.inverse.sope M debian/control.in commit 09582d841d0f9e1be962426827bef51a1120f19a Author: Wolfgang Sourdeau Date: Thu Sep 9 18:08:00 2010 +0000 Monotone-Parent: 3f72264cf3d5ab2a73a520e5e00990a04f78a887 Monotone-Revision: aeed4c1c468a84535626e699b64b7b8ab061d9d4 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-09-09T18:08:00 Monotone-Branch: ca.inverse.sope M debian/control.in commit cca239a692ad591e9907cd053feb0b7ad71f6c7e Author: Wolfgang Sourdeau Date: Thu Sep 9 17:58:43 2010 +0000 Monotone-Parent: cba99de33a61403dfeaad1225e9f99d6cc0c741a Monotone-Revision: 3f72264cf3d5ab2a73a520e5e00990a04f78a887 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-09-09T17:58:43 Monotone-Branch: ca.inverse.sope M debian/control.in commit b63b51a3a461bf4ff4cb7f3dd51e76faab5ee0fd Author: Wolfgang Sourdeau Date: Thu Sep 9 17:50:36 2010 +0000 Monotone-Parent: 19ba34cf34d05a18a7b7385b55a3a08a8bcec86d Monotone-Revision: cba99de33a61403dfeaad1225e9f99d6cc0c741a Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-09-09T17:50:36 Monotone-Branch: ca.inverse.sope M debian/rules commit 96589a4008eb53eb0735b47bd98a735a27a9658b Author: Wolfgang Sourdeau Date: Thu Sep 9 16:38:36 2010 +0000 Monotone-Parent: 00782817e3dc9451815dbcddf447d3c7b7233ff4 Monotone-Revision: 19ba34cf34d05a18a7b7385b55a3a08a8bcec86d Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-09-09T16:38:36 Monotone-Branch: ca.inverse.sope M debian/rules commit ad617928b883e3a9d9821add55f31640855ba628 Author: Wolfgang Sourdeau Date: Thu Sep 9 16:32:47 2010 +0000 Monotone-Parent: df78dc203bea03c959967aa6f06ce9d89220f7db Monotone-Revision: 00782817e3dc9451815dbcddf447d3c7b7233ff4 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-09-09T16:32:47 Monotone-Branch: ca.inverse.sope M debian/control.in M debian/rules commit 48f5560fab0aa44a9ac5c02fd5b7f6c161ffac2e Author: Wolfgang Sourdeau Date: Thu Sep 9 16:20:24 2010 +0000 Monotone-Parent: b849ed6fb2c4ce408354f53689bbbfaab425865e Monotone-Revision: df78dc203bea03c959967aa6f06ce9d89220f7db Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-09-09T16:20:24 Monotone-Branch: ca.inverse.sope M sope-core/NGExtensions/NGExtensions/NGExtensions.h commit f0b2bcf836ba644d5dee4db9e540ffbfbc370ea7 Author: Wolfgang Sourdeau Date: Thu Sep 9 16:17:58 2010 +0000 Monotone-Parent: 6ee5af6a8c9a5173c9ea7d067f18d3ff0ec7f517 Monotone-Revision: b849ed6fb2c4ce408354f53689bbbfaab425865e Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-09-09T16:17:58 Monotone-Branch: ca.inverse.sope M debian/control.in M debian/rules commit 2f2bad6b8a9fd39ba933595f6b096ff7b61f8db8 Author: Ludovic Marcotte Date: Thu Sep 2 16:46:39 2010 +0000 Fixed the handling of TLS/SSL sockets Monotone-Parent: 4cdfac2b03944c4ddb408b6d5e6618620cdf334f Monotone-Revision: 6ee5af6a8c9a5173c9ea7d067f18d3ff0ec7f517 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2010-09-02T16:46:39 Monotone-Branch: ca.inverse.sope M sope-mime/NGImap4/NGImap4Client.m commit 0da62fc784d07c4cc8bd55b60abf0a70199c0df6 Author: Wolfgang Sourdeau Date: Mon Aug 30 21:42:26 2010 +0000 Monotone-Parent: da1af898a9c7e2aa99b063087444d269a67e52c5 Monotone-Revision: 4cdfac2b03944c4ddb408b6d5e6618620cdf334f Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-08-30T21:42:26 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m commit 59ebab56a7ee87aede7f73cef5f79b6716212c06 Author: Wolfgang Sourdeau Date: Mon Aug 30 21:33:12 2010 +0000 Monotone-Parent: 28432890c8b58fb691446255ed8333c70d9135c1 Monotone-Revision: da1af898a9c7e2aa99b063087444d269a67e52c5 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-08-30T21:33:12 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-appserver/NGObjWeb/Associations/WOKeyPathAssociation.m commit 4786fdd365e628c9985b244634f0a83ebb313c15 Author: Wolfgang Sourdeau Date: Mon Aug 30 19:42:29 2010 +0000 compatibility with gsmake 2.2 Monotone-Parent: 68da0e360669d9370d0d64e6216124fa814549a9 Monotone-Revision: 28432890c8b58fb691446255ed8333c70d9135c1 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-08-30T19:42:29 Monotone-Branch: ca.inverse.sope M sope-appserver/NGObjWeb/wobundle-gs.make commit 29b45bc6c107d346b5adde2dcc16a5fcbf1ef273 Author: Wolfgang Sourdeau Date: Mon Aug 30 19:42:03 2010 +0000 Monotone-Parent: f051bedf15bee8178f44e8de5fa444e19f546ceb Monotone-Revision: 68da0e360669d9370d0d64e6216124fa814549a9 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-08-30T19:42:03 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-appserver/NGObjWeb/DynamicElements/_WOStaticHTMLElement.h M sope-appserver/NGObjWeb/DynamicElements/_WOStaticHTMLElement.m M sope-appserver/NGObjWeb/NGHttp+WO.m M sope-appserver/NGObjWeb/SoObjects/SoObjectMethodDispatcher.m M sope-appserver/NGObjWeb/SoObjects/SoProductLoader.m M sope-appserver/NGObjWeb/Templates/WOWrapperTemplateBuilder.m M sope-appserver/NGObjWeb/WOResponse.m M sope-appserver/NGObjWeb/WOStatisticsStore.m M sope-appserver/NGObjWeb/WOWatchDogApplicationMain.m M sope-appserver/NGObjWeb/WebDAV/SoWebDAVRenderer.m M sope-appserver/WEExtensions/WEPageView.m M sope-appserver/WEExtensions/WETableMatrix.m M sope-core/EOControl/EOKeyGlobalID.m M sope-core/EOControl/EOQualifier.h M sope-core/EOControl/EOQualifier.m M sope-core/NGExtensions/FdExt.subproj/GNUmakefile M sope-core/NGExtensions/FdExt.subproj/NSRunLoop+FileObjects.m M sope-core/NGExtensions/GNUmakefile M sope-core/NGExtensions/NGBitSet.m M sope-core/NGExtensions/NGBundleManager.m M sope-core/NGExtensions/NGExtensions.m M sope-core/NGExtensions/NGExtensions/NGBitSet.h M sope-core/NGExtensions/NGExtensions/NGHashMap.h M sope-core/NGExtensions/NGExtensions/NGStack.h M sope-core/NGExtensions/NGExtensions/NSRunLoop+FileObjects.h M sope-core/NGExtensions/NGHashMap.m M sope-core/NGExtensions/NGObjCRuntime.m M sope-core/NGExtensions/NGStack.m M sope-core/NGStreams/NGInternetSocketAddress.m M sope-gdl1/GDLAccess/EOExpressionArray.h M sope-gdl1/GDLAccess/EOExpressionArray.m M sope-gdl1/GDLAccess/EOFault.h M sope-gdl1/GDLAccess/EOFault.m M sope-gdl1/GDLAccess/EOFaultHandler.m M sope-gdl1/GDLAccess/EOObjectUniquer.m M sope-gdl1/GDLAccess/EOPrimaryKeyDictionary.h M sope-gdl1/GDLAccess/EOPrimaryKeyDictionary.m M sope-gdl1/GDLAccess/EORecordDictionary.h M sope-gdl1/GDLAccess/EORecordDictionary.m M sope-ldap/NGLdap/NGLdapConnection.m M sope-mime/NGMime/NGMimeContentDispositionHeaderFieldGenerator.m M sope-mime/NGMime/NGMimeFileData.h M sope-mime/NGMime/NGMimeFileData.m M sope-mime/NGMime/NGMimeJoinedData.m M sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m M sope-mime/NGMime/NGMimeUtilities.h M sope-xml/DOM/DOMCharacterData.m M sope-xml/DOM/DOMElement.m M sope-xml/DOM/DOMProtocols.h M sope-xml/DOM/DOMSaxHandler.m M sope-xml/DOM/DOMText.m M sope-xml/SaxObjC/SaxAttributeList.h M sope-xml/SaxObjC/SaxAttributeList.m M sope-xml/SaxObjC/SaxAttributes.h M sope-xml/SaxObjC/SaxAttributes.m M sope-xml/SaxObjC/SaxLocator.h M sope-xml/SaxObjC/SaxLocator.m M sope-xml/libxmlSAXDriver/TableCallbacks.m M sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.m commit 32dcb5adc794744b8e06b78488a7dd69a8f787ba Author: Wolfgang Sourdeau Date: Mon Aug 30 19:40:45 2010 +0000 Monotone-Parent: 54ff7ccf3d23faf6055a1fbbc7875a6dc05c520c Monotone-Revision: f051bedf15bee8178f44e8de5fa444e19f546ceb Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-08-30T19:40:45 Monotone-Branch: ca.inverse.sope M ChangeLog D sope-core/NGExtensions/FdExt.subproj/NSMethodSignature+misc.m D sope-core/NGExtensions/NGExtensions/NSMethodSignature+misc.h commit 8daed75a440e82e38b5f333a525d944a9f66e297 Author: Wolfgang Sourdeau Date: Thu Aug 26 18:10:11 2010 +0000 Monotone-Parent: e5f1c55e889e2363fcf85a8fbf7aab58432582b6 Monotone-Revision: 54ff7ccf3d23faf6055a1fbbc7875a6dc05c520c Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-08-26T18:10:11 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-core/NGExtensions/NGBundleManager.m commit 095321dc62218741a16e8fe5039de4145e9c875e Author: Wolfgang Sourdeau Date: Thu Aug 26 17:31:10 2010 +0000 Monotone-Parent: 6ee86ff736cb2d6ef7ce2f48b0d7fcf19209b9cd Monotone-Revision: e5f1c55e889e2363fcf85a8fbf7aab58432582b6 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-08-26T17:31:10 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-appserver/NGObjWeb/Defaults.plist M sope-appserver/NGObjWeb/GNUmakefile D sope-appserver/NGObjWeb/SNSConnection.h D sope-appserver/NGObjWeb/SNSConnection.m M sope-appserver/NGObjWeb/WOApplication.m M sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpAdaptor.m commit 93a23b323fb04aac42cc4443a4581db00d8abb7b Author: Wolfgang Sourdeau Date: Thu Aug 26 15:14:14 2010 +0000 Monotone-Parent: 6d465c81fc81595eebe12fc578e477d8a61fb238 Monotone-Revision: 6ee86ff736cb2d6ef7ce2f48b0d7fcf19209b9cd Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-08-26T15:14:14 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-mime/NGMime/NGMimeAddressHeaderFieldGenerator.m M sope-mime/NGMime/NGMimeHeaderFieldGenerator.m commit 7890bbf776aead18ccefe77e72570d56f03ce067 Author: Ludovic Marcotte Date: Tue Aug 24 13:25:30 2010 +0000 See ChangeLog Monotone-Parent: 9b94c673fd500fdd0104adf5a1b1b08b38d3e02d Monotone-Revision: 6d465c81fc81595eebe12fc578e477d8a61fb238 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2010-08-24T13:25:30 Monotone-Branch: ca.inverse.sope M ChangeLog M sope-core/NGStreams/NGActiveSSLSocket.m M sope-core/NGStreams/NGSocket.m M sope-core/NGStreams/NGStreams/NGActiveSSLSocket.h M sope-core/NGStreams/NGStreams/NGSocket.h M sope-mime/NGImap4/NGImap4Client.h M sope-mime/NGImap4/NGImap4Client.m commit a7626d434273c8f4f840e305aea79b85d08ab21f Author: Wolfgang Sourdeau Date: Mon Aug 23 20:43:27 2010 +0000 Monotone-Parent: d1f82032dbb2a2aaab3d0f3e534b46c621fa36b5 Monotone-Revision: 9b94c673fd500fdd0104adf5a1b1b08b38d3e02d Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-08-23T20:43:27 Monotone-Branch: ca.inverse.sope M sope-mime/NGMail/ChangeLog M sope-mime/NGMail/NGSmtpClient.m commit 0debe5f406830933d075fc3530f692997881814d Author: Wolfgang Sourdeau Date: Fri Aug 20 16:04:54 2010 +0000 Monotone-Parent: afc17800c31351dd9ce5882bb243bda5d4e64faa Monotone-Revision: d1f82032dbb2a2aaab3d0f3e534b46c621fa36b5 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-08-20T16:04:54 Monotone-Branch: ca.inverse.sope M debian/rules commit ba5c62e43a84dc8106a4a68c31a6167f5e4b8a53 Author: Wolfgang Sourdeau Date: Fri Aug 20 16:02:10 2010 +0000 Monotone-Parent: 709a5756f7d013d76c65c087e66733b8c38ad998 Monotone-Revision: afc17800c31351dd9ce5882bb243bda5d4e64faa Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-08-20T16:02:10 Monotone-Branch: ca.inverse.sope M debian/rules commit c710782c5d8eea05794e445b11fecc3b4304ef20 Author: Wolfgang Sourdeau Date: Thu Aug 19 14:03:28 2010 +0000 Monotone-Parent: c5baca432370687a033d269e639ab01b8a5e96ac Monotone-Revision: 709a5756f7d013d76c65c087e66733b8c38ad998 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-08-19T14:03:28 Monotone-Branch: ca.inverse.sope M configure commit cbb04c6718cd29930085a30aea36ee4a305ab8e7 Author: Wolfgang Sourdeau Date: Thu Aug 19 14:02:04 2010 +0000 Monotone-Parent: 8abcd902bb2f04604d400242a447793aa6efaeb4 Monotone-Revision: c5baca432370687a033d269e639ab01b8a5e96ac Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-08-19T14:02:04 Monotone-Branch: ca.inverse.sope A debian/sope_SOPEVER_-gdl1-mysql.install commit 6fd5639b483a3e9c36a26c61dc73e8cb2390c959 Author: Ludovic Marcotte Date: Fri Aug 13 01:45:10 2010 +0000 Small fix to not trim the last character Monotone-Parent: d972f733e89b1d906db6f7e5840444e4d98e4197 Monotone-Revision: 8abcd902bb2f04604d400242a447793aa6efaeb4 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2010-08-13T01:45:10 Monotone-Branch: ca.inverse.sope M sope-mime/NGMail/NGSendMail.m commit 30859f6821e43a0fa161f649401dba9c50ec5ff2 Author: Ludovic Marcotte Date: Thu Aug 12 14:10:37 2010 +0000 Dropped the versitsaxdriver debian package Monotone-Parent: d9f32b7cb590d58e883d4e60a9713ef35d290f5d Monotone-Revision: d972f733e89b1d906db6f7e5840444e4d98e4197 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2010-08-12T14:10:37 Monotone-Branch: ca.inverse.sope M debian/control.in D debian/sope_SOPEVER_-versitsaxdriver.install commit 9fb4120d8926f2b54dc16a5a0728d9009085bcde Author: Ludovic Marcotte Date: Thu Aug 12 14:04:11 2010 +0000 Dropped the libsope-ical stuff. Monotone-Parent: 80b3287a25725a1ca76cccc57e4826bd2b95e15c Monotone-Revision: d9f32b7cb590d58e883d4e60a9713ef35d290f5d Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2010-08-12T14:04:11 Monotone-Branch: ca.inverse.sope M debian/control.in D debian/libsope-ical_SOPEVER_-dev.install D debian/libsope-ical_SOPEVER_.install M debian/rules commit 05f55cd6d564c2bb063d7356b70be202a7de3895 Author: Ludovic Marcotte Date: Thu Aug 12 12:51:59 2010 +0000 See ChangeLog Monotone-Parent: 348e50b9d8d1562398b61e02f9e2764c6e11ab0c Monotone-Revision: 80b3287a25725a1ca76cccc57e4826bd2b95e15c Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2010-08-12T12:51:59 Monotone-Branch: ca.inverse.sope M ChangeLog D debian/control M debian/control.in D debian/sope-tools.install D debian/sope-tools.links commit 22b03ede0136928aec1f6b37a042a692ca371afb Author: Ludovic Marcotte Date: Wed Aug 11 19:48:09 2010 +0000 See ChangeLog Monotone-Parent: 533a8567bdff250c185e8f60cb31bfe5da83612a Monotone-Revision: 348e50b9d8d1562398b61e02f9e2764c6e11ab0c Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2010-08-11T19:48:09 Monotone-Branch: ca.inverse.sope M sope-mime/NGMail/ChangeLog M sope-mime/NGMail/NGSendMail.m M sope-mime/NGMail/NGSmtpClient.m commit 7186931d9d28aff1bc52f456d0dd4ce4cdfca262 Author: Wolfgang Sourdeau Date: Wed Aug 11 19:12:52 2010 +0000 Monotone-Parent: 2af34caac3920829ba0ce43c7af902d546cde1aa Monotone-Revision: 533a8567bdff250c185e8f60cb31bfe5da83612a Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-08-11T19:12:52 Monotone-Branch: ca.inverse.sope M sope-core/NGExtensions/ChangeLog M sope-core/NGExtensions/NGBase64Coding.m commit 4ba1e40c43be3b6bae002ec03f022a41cd8cff36 Author: Wolfgang Sourdeau Date: Wed Aug 11 19:11:55 2010 +0000 Monotone-Parent: e325a2033a38fcea56e5f431fc77a79acc1c735e Monotone-Revision: 2af34caac3920829ba0ce43c7af902d546cde1aa Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-08-11T19:11:55 Monotone-Branch: ca.inverse.sope M sope-appserver/NGObjWeb/DAVPropMap.plist commit 55b44e715da32cb0d77d9f40e3f2995053b29a24 Author: Wolfgang Sourdeau Date: Mon Aug 9 15:14:52 2010 +0000 Monotone-Parent: 1bba55dfdf8fa1cb242b99fb0a3ba28456c223b8 Monotone-Revision: e325a2033a38fcea56e5f431fc77a79acc1c735e Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-08-09T15:14:52 Monotone-Branch: ca.inverse.sope M sope-mime/NGImap4/ChangeLog M sope-mime/NGImap4/NGImap4Client.m commit c6a09187d8623e815e89c23f47dae3efd7f44e44 Author: Ludovic Marcotte Date: Tue Aug 3 19:11:37 2010 +0000 Updated .mtn-ignore Monotone-Parent: 5f7c8897d62e6017bcb8eaf4c0bfb6a78c439856 Monotone-Revision: 37d9bd63a410572817861c3595f91d0017af98ee Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2010-08-03T19:11:37 Monotone-Branch: ca.inverse.sope M .mtn-ignore commit 4636fe807c81505ed061dfbb2d64132d385eaf37 Author: Ludovic Marcotte Date: Tue Aug 3 19:08:33 2010 +0000 Added .mtn-ignore Monotone-Parent: 09af9941cdd02bc812882a357d02e20a334ea3ed Monotone-Revision: 5f7c8897d62e6017bcb8eaf4c0bfb6a78c439856 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2010-08-03T19:08:33 Monotone-Branch: ca.inverse.sope A .mtn-ignore commit 095d9691e32dd8d5cf16d8756b938bc4cc134dc9 Author: Ludovic Marcotte Date: Mon Aug 2 14:18:24 2010 +0000 Dropped the FrontBase2 GDL adaptor. Monotone-Parent: 7ae648e99b2ae1a437b3b23933c9fd60c6f92b77 Monotone-Revision: 09af9941cdd02bc812882a357d02e20a334ea3ed Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2010-08-02T14:18:24 Monotone-Branch: ca.inverse.sope D sope-gdl1/FrontBase2/COPYING.LIB D sope-gdl1/FrontBase2/ChangeLog D sope-gdl1/FrontBase2/EOAttribute+FB.h D sope-gdl1/FrontBase2/EOAttribute+FB.m D sope-gdl1/FrontBase2/English.lproj/InfoPlist.strings D sope-gdl1/FrontBase2/FBAdaptor+Types.m D sope-gdl1/FrontBase2/FBBlobHandle.h D sope-gdl1/FrontBase2/FBBlobHandle.m D sope-gdl1/FrontBase2/FBChannel+Model.h D sope-gdl1/FrontBase2/FBChannel+Model.m D sope-gdl1/FrontBase2/FBChannel.h D sope-gdl1/FrontBase2/FBChannel.m D sope-gdl1/FrontBase2/FBContext.h D sope-gdl1/FrontBase2/FBContext.m D sope-gdl1/FrontBase2/FBException.h D sope-gdl1/FrontBase2/FBException.m D sope-gdl1/FrontBase2/FBHeaders.h D sope-gdl1/FrontBase2/FBSQLExpression.h D sope-gdl1/FrontBase2/FBSQLExpression.m D sope-gdl1/FrontBase2/FBValues.h D sope-gdl1/FrontBase2/FBValues.m D sope-gdl1/FrontBase2/FrontBase2Adaptor.h D sope-gdl1/FrontBase2/FrontBase2Adaptor.m D sope-gdl1/FrontBase2/GNUmakefile D sope-gdl1/FrontBase2/GNUmakefile.preamble D sope-gdl1/FrontBase2/Info.plist D sope-gdl1/FrontBase2/NSString+FB.h D sope-gdl1/FrontBase2/NSString+FB.m D sope-gdl1/FrontBase2/README D sope-gdl1/FrontBase2/Version D sope-gdl1/FrontBase2/cancompile.sh D sope-gdl1/FrontBase2/common.h D sope-gdl1/FrontBase2/condict.plist D sope-gdl1/FrontBase2/fbtest.m D sope-gdl1/FrontBase2/fbtest.py D sope-gdl1/FrontBase2/test.eomodel commit 9ec012bbcd42f5773888708776db87fd21143125 Author: Wolfgang Sourdeau Date: Fri Jul 30 17:40:54 2010 +0000 Monotone-Parent: 7c7e2db643b28b0d79a640fd738d7913ba3f686d Monotone-Revision: dcf8fb4dfcb4357ea70aa1937ff29fa8d45819b1 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-07-30T17:40:54 Monotone-Branch: ca.inverse.sope D debian/patches/00list D debian/patches/sope-gsmake2.diff D debian/patches/sope-patchset-r1660.diff M debian/rules commit 67ff5272596e5befa0c1ec42719ff18528a1463c Author: Wolfgang Sourdeau Date: Fri Jul 30 17:24:50 2010 +0000 Monotone-Parent: 7ae648e99b2ae1a437b3b23933c9fd60c6f92b77 Monotone-Revision: 7c7e2db643b28b0d79a640fd738d7913ba3f686d Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-07-30T17:24:50 Monotone-Branch: ca.inverse.sope D sope-core/NGStreams/powerpc/linux-gnu/config.h D sope-core/NGStreams/ppc/linux-gnu/config.h commit 92de5888a66e79fbf537d8617a9c5f586843d41a Author: Ludovic Marcotte Date: Thu Jul 29 18:58:48 2010 +0000 Cleaned more stuff. Monotone-Parent: 5a11c3789ee188a9f196ebf8d7a3998dae7996b5 Monotone-Revision: 7ae648e99b2ae1a437b3b23933c9fd60c6f92b77 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2010-07-29T18:58:48 Monotone-Branch: ca.inverse.sope D build-stamp D controlfiles-stamp D debian/files D debian/libsope-appserver4.9-dev.debhelper.log D debian/libsope-appserver4.9-dev.install D debian/libsope-appserver4.9-dev/DEBIAN/control D debian/libsope-appserver4.9-dev/DEBIAN/md5sums D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGHttp/NGHttp.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGHttp/NGHttpBodyParser.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGHttp/NGHttpCookie.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGHttp/NGHttpDecls.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGHttp/NGHttpHeaderFieldParser.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGHttp/NGHttpHeaderFields.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGHttp/NGHttpMessage.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGHttp/NGHttpMessageParser.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGHttp/NGHttpRequest.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGHttp/NGHttpResponse.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGHttp/NGUrlFormCoder.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/EOFetchSpecification+SoDAV.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/NGObjWeb.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/NGObjWebDecls.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/NSException+HTTP.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/NSString+JavaScriptEscaping.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/OWResourceManager.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/OWResponder.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/OWViewRequestHandler.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SaxDAVHandler.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoActionInvocation.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoApplication.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoClass.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoClassRegistry.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoClassSecurityInfo.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoComponent.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoControlPanel.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoCookieAuthenticator.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoDAV.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoDAVLockManager.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoDAVSQLParser.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoDefaultRenderer.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoHTTPAuthenticator.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoLookupAssociation.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoObjCClass.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoObject+SoDAV.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoObject.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoObjectDataSource.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoObjectMethodDispatcher.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoObjectRequestHandler.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoObjectResultEntry.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoObjectWebDAVDispatcher.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoObjects.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoPageInvocation.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoPermissions.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoProduct.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoProductClassInfo.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoProductLoader.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoProductRegistry.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoProductResourceManager.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoSecurityException.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoSecurityManager.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoSelectorInvocation.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoSubContext.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoSubscription.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoSubscriptionManager.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoTemplateRenderer.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoUser.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoWebDAVRenderer.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoWebDAVValue.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WEClientCapabilities.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOActionResults.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOActionURL.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOAdaptor.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOApplication.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOAssociation.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOComponent.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOComponentDefinition.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOComponentScript.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOContext+SoObjects.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOContext.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOCookie.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOCoreApplication.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WODirectAction.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WODisplayGroup.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WODynamicElement.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOElement.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOElementTrackingContext.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOHTMLDynamicElement.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOHTTPConnection.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOMailDelivery.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOMessage.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOPageGenerationContext.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOProxyRequestHandler.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WORequest+So.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WORequest.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WORequestHandler.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOResourceManager.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOResponse.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOSession.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOSessionStore.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOStatisticsStore.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOTemplate.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOTemplateBuilder.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOxElemBuilder.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGXmlRpc/NGAsyncResultProxy.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGXmlRpc/NGXmlRpc.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGXmlRpc/NGXmlRpcAction.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGXmlRpc/NGXmlRpcClient.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGXmlRpc/NGXmlRpcInvocation.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGXmlRpc/NGXmlRpcMethodSignature.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGXmlRpc/NGXmlRpcRequestHandler.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGXmlRpc/NSObject+Reflection.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGXmlRpc/WODirectAction+XmlRpc.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGXmlRpc/WODirectAction+XmlRpcIntrospection.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGXmlRpc/XmlRpcMethodCall+WO.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGXmlRpc/XmlRpcMethodResponse+WO.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/SoOFS/OFSBaseObject.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/SoOFS/OFSChangeLog.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/SoOFS/OFSFactoryContext.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/SoOFS/OFSFactoryRegistry.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/SoOFS/OFSFile.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/SoOFS/OFSFileRenderer.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/SoOFS/OFSFolder.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/SoOFS/OFSFolderDataSource.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/SoOFS/OFSHttpPasswd.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/SoOFS/OFSImage.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/SoOFS/OFSPropertyListObject.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/SoOFS/OFSResourceManager.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/SoOFS/OFSWebDocument.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/SoOFS/OFSWebMethod.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/SoOFS/OFSWebMethodRenderer.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/SoOFS/OFSWebTemplate.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/SoOFS/SoOFS.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/WEExtensions/WEContextConditional.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/WEExtensions/WEResourceManager.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/WOExtensions/WOExtensions.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/WOExtensions/WORedirect.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/WOXML/WOXML.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/WOXML/WOXMLDecoder.h D debian/libsope-appserver4.9-dev/usr/include/GNUstep/WOXML/WOXMLMappingModel.h D debian/libsope-appserver4.9-dev/usr/share/doc/libsope-appserver4.9-dev/changelog.Debian.gz D debian/libsope-appserver4.9-dev/usr/share/doc/libsope-appserver4.9-dev/copyright D debian/libsope-appserver4.9.debhelper.log D debian/libsope-appserver4.9.install D debian/libsope-appserver4.9.postinst.debhelper D debian/libsope-appserver4.9.postrm.debhelper D debian/libsope-appserver4.9.substvars D debian/libsope-appserver4.9/DEBIAN/control D debian/libsope-appserver4.9/DEBIAN/md5sums D debian/libsope-appserver4.9/DEBIAN/postinst D debian/libsope-appserver4.9/DEBIAN/postrm D debian/libsope-appserver4.9/DEBIAN/shlibs D debian/libsope-appserver4.9/usr/lib/libNGObjWeb.so.4.9 D debian/libsope-appserver4.9/usr/lib/libNGObjWeb.so.4.9.37 D debian/libsope-appserver4.9/usr/lib/libNGXmlRpc.so.4.9 D debian/libsope-appserver4.9/usr/lib/libNGXmlRpc.so.4.9.17 D debian/libsope-appserver4.9/usr/lib/libSoOFS.so.4.9 D debian/libsope-appserver4.9/usr/lib/libSoOFS.so.4.9.25 D debian/libsope-appserver4.9/usr/lib/libWEExtensions.so.4.9 D debian/libsope-appserver4.9/usr/lib/libWEExtensions.so.4.9.94 D debian/libsope-appserver4.9/usr/lib/libWEPrototype.so.4.9 D debian/libsope-appserver4.9/usr/lib/libWEPrototype.so.4.9.9 D debian/libsope-appserver4.9/usr/lib/libWOExtensions.so.4.9 D debian/libsope-appserver4.9/usr/lib/libWOExtensions.so.4.9.31 D debian/libsope-appserver4.9/usr/lib/libWOXML.so.4.9 D debian/libsope-appserver4.9/usr/lib/libWOXML.so.4.9.9 D debian/libsope-appserver4.9/usr/share/doc/libsope-appserver4.9/changelog.Debian.gz D debian/libsope-appserver4.9/usr/share/doc/libsope-appserver4.9/copyright D debian/libsope-core4.9-dev.debhelper.log D debian/libsope-core4.9-dev.install D debian/libsope-core4.9-dev/DEBIAN/control D debian/libsope-core4.9-dev/DEBIAN/md5sums D debian/libsope-core4.9-dev/usr/include/GNUstep/EOControl/EOArrayDataSource.h D debian/libsope-core4.9-dev/usr/include/GNUstep/EOControl/EOClassDescription.h D debian/libsope-core4.9-dev/usr/include/GNUstep/EOControl/EOControl.h D debian/libsope-core4.9-dev/usr/include/GNUstep/EOControl/EOControlDecls.h D debian/libsope-core4.9-dev/usr/include/GNUstep/EOControl/EODataSource.h D debian/libsope-core4.9-dev/usr/include/GNUstep/EOControl/EODetailDataSource.h D debian/libsope-core4.9-dev/usr/include/GNUstep/EOControl/EOFetchSpecification.h D debian/libsope-core4.9-dev/usr/include/GNUstep/EOControl/EOGenericRecord.h D debian/libsope-core4.9-dev/usr/include/GNUstep/EOControl/EOGlobalID.h D debian/libsope-core4.9-dev/usr/include/GNUstep/EOControl/EOKeyGlobalID.h D debian/libsope-core4.9-dev/usr/include/GNUstep/EOControl/EOKeyValueArchiver.h D debian/libsope-core4.9-dev/usr/include/GNUstep/EOControl/EOKeyValueCoding.h D debian/libsope-core4.9-dev/usr/include/GNUstep/EOControl/EONull.h D debian/libsope-core4.9-dev/usr/include/GNUstep/EOControl/EOObserver.h D debian/libsope-core4.9-dev/usr/include/GNUstep/EOControl/EOQualifier.h D debian/libsope-core4.9-dev/usr/include/GNUstep/EOControl/EOSQLParser.h D debian/libsope-core4.9-dev/usr/include/GNUstep/EOControl/EOSortOrdering.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/AutoDefines.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/DOMNode+EOQualifier.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/EOCacheDataSource.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/EOCompoundDataSource.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/EODataSource+NGExtensions.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/EOFetchSpecification+plist.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/EOFilterDataSource.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/EOGrouping.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/EOGroupingSet.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/EOKeyGrouping.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/EOKeyMapDataSource.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/EOQualifier+CtxEval.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/EOQualifier+plist.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/EOQualifierGrouping.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/EOSortOrdering+plist.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/EOTrueQualifier.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/IndexFunc.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGBase64Coding.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGBaseTypes.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGBitSet.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGBundleManager.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGCalendarDateRange.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGCharBuffers.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGCustomFileManager.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGDirectoryEnumerator.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGExtensions.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGExtensionsDecls.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGFileFolderInfoDataSource.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGFileManager.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGFileManagerURL.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGHashMap.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGLogAppender.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGLogEvent.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGLogEventFormatter.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGLogFileHandleAppender.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGLogLevel.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGLogSyslogAppender.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGLogger.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGLoggerManager.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGLogging.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGMemoryAllocation.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGMerging.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGObjCRuntime.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGObjectMacros.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGPropertyListParser.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGQuotedPrintableCoding.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGResourceLocator.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGRule.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGRuleAssignment.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGRuleContext.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGRuleEngine.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGRuleModel.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGStack.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NSArray+enumerator.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NSAutoreleasePool+misc.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NSBundle+misc.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NSCalendarDate+misc.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NSData+gzip.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NSData+misc.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NSDictionary+misc.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NSEnumerator+misc.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NSException+misc.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NSFileManager+Extensions.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NSMethodSignature+misc.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NSNull+misc.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NSObject+Logs.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NSObject+Values.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NSProcessInfo+misc.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NSRunLoop+FileObjects.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NSSet+enumerator.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NSString+Encoding.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NSString+Escaping.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NSString+Ext.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NSString+Formatting.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NSString+German.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NSString+misc.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NSURL+misc.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGActiveSocket.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGBase64Stream.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGBufferedStream.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGByteBuffer.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGByteCountStream.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGCTextStream.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGCharBuffer.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGConcreteStreamFileHandle.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGDataStream.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGDatagramPacket.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGDatagramSocket.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGDescriptorFunctions.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGFileStream.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGFilterStream.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGFilterTextStream.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGGZipStream.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGInternetSocketAddress.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGInternetSocketDomain.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGLocalSocketAddress.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGLocalSocketDomain.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGLockingStream.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGNet.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGNetDecls.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGNetUtilities.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGPassiveSocket.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGSocket.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGSocketExceptions.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGSocketProtocols.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGStream.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGStreamExceptions.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGStreamPipe.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGStreamProtocols.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGStreams.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGStreamsDecls.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGStringTextStream.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGTerminalSupport.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGTextStream.h D debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGTextStreamProtocols.h D debian/libsope-core4.9-dev/usr/share/doc/libsope-core4.9-dev/changelog.Debian.gz D debian/libsope-core4.9-dev/usr/share/doc/libsope-core4.9-dev/copyright D debian/libsope-core4.9.debhelper.log D debian/libsope-core4.9.install D debian/libsope-core4.9.postinst.debhelper D debian/libsope-core4.9.postrm.debhelper D debian/libsope-core4.9.substvars D debian/libsope-core4.9/DEBIAN/control D debian/libsope-core4.9/DEBIAN/md5sums D debian/libsope-core4.9/DEBIAN/postinst D debian/libsope-core4.9/DEBIAN/postrm D debian/libsope-core4.9/DEBIAN/shlibs D debian/libsope-core4.9/usr/lib/libEOControl.so.4.9 D debian/libsope-core4.9/usr/lib/libEOControl.so.4.9.74 D debian/libsope-core4.9/usr/lib/libNGExtensions.so.4.9 D debian/libsope-core4.9/usr/lib/libNGExtensions.so.4.9.203 D debian/libsope-core4.9/usr/lib/libNGStreams.so.4.9 D debian/libsope-core4.9/usr/lib/libNGStreams.so.4.9.57 D debian/libsope-core4.9/usr/share/doc/libsope-core4.9/changelog.Debian.gz D debian/libsope-core4.9/usr/share/doc/libsope-core4.9/copyright D debian/libsope-gdl1-4.9-dev.debhelper.log D debian/libsope-gdl1-4.9-dev.install D debian/libsope-gdl1-4.9-dev/DEBIAN/control D debian/libsope-gdl1-4.9-dev/DEBIAN/md5sums D debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOAdaptor.h D debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOAdaptorChannel+Attributes.h D debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOAdaptorChannel.h D debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOAdaptorContext.h D debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOAdaptorDataSource.h D debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOAdaptorGlobalID.h D debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOAdaptorOperation.h D debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOArrayProxy.h D debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOAttribute.h D debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOAttributeOrdering.h D debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOCustomValues.h D debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EODatabase.h D debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EODatabaseChannel.h D debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EODatabaseContext.h D debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EODatabaseFault.h D debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EODatabaseFaultResolver.h D debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EODelegateResponse.h D debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOEntity+Factory.h D debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOEntity.h D debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOExpressionArray.h D debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOFExceptions.h D debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOFault.h D debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOFaultHandler.h D debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOGenericRecord.h D debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOJoinTypes.h D debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOKeySortOrdering.h D debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOModel.h D debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOModelGroup.h D debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EONull.h D debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOObjectUniquer.h D debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOPrimaryKeyDictionary.h D debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOQuotedExpression.h D debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EORecordDictionary.h D debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EORelationship.h D debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOSQLExpression.h D debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOSQLQualifier.h D debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/GDLAccess.h D debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/NSObject+EONullInit.h D debian/libsope-gdl1-4.9-dev/usr/share/doc/libsope-gdl1-4.9-dev/changelog.Debian.gz D debian/libsope-gdl1-4.9-dev/usr/share/doc/libsope-gdl1-4.9-dev/copyright D debian/libsope-gdl1-4.9.debhelper.log D debian/libsope-gdl1-4.9.install D debian/libsope-gdl1-4.9.postinst.debhelper D debian/libsope-gdl1-4.9.postrm.debhelper D debian/libsope-gdl1-4.9.substvars D debian/libsope-gdl1-4.9/DEBIAN/control D debian/libsope-gdl1-4.9/DEBIAN/md5sums D debian/libsope-gdl1-4.9/DEBIAN/postinst D debian/libsope-gdl1-4.9/DEBIAN/postrm D debian/libsope-gdl1-4.9/DEBIAN/shlibs D debian/libsope-gdl1-4.9/usr/lib/libGDLAccess.so.4.9 D debian/libsope-gdl1-4.9/usr/lib/libGDLAccess.so.4.9.63 D debian/libsope-gdl1-4.9/usr/share/doc/libsope-gdl1-4.9/changelog.Debian.gz D debian/libsope-gdl1-4.9/usr/share/doc/libsope-gdl1-4.9/copyright D debian/libsope-ical4.9-dev.debhelper.log D debian/libsope-ical4.9-dev.install D debian/libsope-ical4.9-dev/DEBIAN/control D debian/libsope-ical4.9-dev/DEBIAN/md5sums D debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/NGVCard.h D debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/NGVCardAddress.h D debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/NGVCardName.h D debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/NGVCardOrg.h D debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/NGVCardPhone.h D debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/NGVCardSaxHandler.h D debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/NGVCardSimpleValue.h D debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/NGVCardStrArrayValue.h D debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/NGVCardValue.h D debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/NGiCal.h D debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/NSCalendarDate+ICal.h D debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/iCalAlarm.h D debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/iCalAttachment.h D debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/iCalCalendar.h D debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/iCalDataSource.h D debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/iCalDuration.h D debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/iCalEntityObject.h D debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/iCalEvent.h D debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/iCalEventChanges.h D debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/iCalFreeBusy.h D debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/iCalJournal.h D debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/iCalObject.h D debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/iCalPerson.h D debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/iCalRecurrenceCalculator.h D debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/iCalRecurrenceRule.h D debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/iCalRenderer.h D debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/iCalRepeatableEntityObject.h D debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/iCalToDo.h D debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/iCalTrigger.h D debian/libsope-ical4.9-dev/usr/share/doc/libsope-ical4.9-dev/changelog.Debian.gz D debian/libsope-ical4.9-dev/usr/share/doc/libsope-ical4.9-dev/copyright D debian/libsope-ical4.9.debhelper.log D debian/libsope-ical4.9.install D debian/libsope-ical4.9.postinst.debhelper D debian/libsope-ical4.9.postrm.debhelper D debian/libsope-ical4.9.substvars D debian/libsope-ical4.9/DEBIAN/control D debian/libsope-ical4.9/DEBIAN/md5sums D debian/libsope-ical4.9/DEBIAN/postinst D debian/libsope-ical4.9/DEBIAN/postrm D debian/libsope-ical4.9/DEBIAN/shlibs D debian/libsope-ical4.9/usr/lib/libNGiCal.so.4.9 D debian/libsope-ical4.9/usr/lib/libNGiCal.so.4.9.84 D debian/libsope-ical4.9/usr/share/doc/libsope-ical4.9/changelog.Debian.gz D debian/libsope-ical4.9/usr/share/doc/libsope-ical4.9/copyright D debian/libsope-ldap4.9-dev.debhelper.log D debian/libsope-ldap4.9-dev.install D debian/libsope-ldap4.9-dev/DEBIAN/control D debian/libsope-ldap4.9-dev/DEBIAN/md5sums D debian/libsope-ldap4.9-dev/usr/include/GNUstep/NGLdap/EOQualifier+LDAP.h D debian/libsope-ldap4.9-dev/usr/include/GNUstep/NGLdap/NGLdap.h D debian/libsope-ldap4.9-dev/usr/include/GNUstep/NGLdap/NGLdapAttribute.h D debian/libsope-ldap4.9-dev/usr/include/GNUstep/NGLdap/NGLdapConnection.h D debian/libsope-ldap4.9-dev/usr/include/GNUstep/NGLdap/NGLdapDataSource.h D debian/libsope-ldap4.9-dev/usr/include/GNUstep/NGLdap/NGLdapEntry.h D debian/libsope-ldap4.9-dev/usr/include/GNUstep/NGLdap/NGLdapFileManager.h D debian/libsope-ldap4.9-dev/usr/include/GNUstep/NGLdap/NGLdapGlobalID.h D debian/libsope-ldap4.9-dev/usr/include/GNUstep/NGLdap/NGLdapModification.h D debian/libsope-ldap4.9-dev/usr/include/GNUstep/NGLdap/NGLdapSearchResultEnumerator.h D debian/libsope-ldap4.9-dev/usr/include/GNUstep/NGLdap/NGLdapURL.h D debian/libsope-ldap4.9-dev/usr/include/GNUstep/NGLdap/NSString+DN.h D debian/libsope-ldap4.9-dev/usr/share/doc/libsope-ldap4.9-dev/changelog.Debian.gz D debian/libsope-ldap4.9-dev/usr/share/doc/libsope-ldap4.9-dev/copyright D debian/libsope-ldap4.9.debhelper.log D debian/libsope-ldap4.9.install D debian/libsope-ldap4.9.postinst.debhelper D debian/libsope-ldap4.9.postrm.debhelper D debian/libsope-ldap4.9.substvars D debian/libsope-ldap4.9/DEBIAN/control D debian/libsope-ldap4.9/DEBIAN/md5sums D debian/libsope-ldap4.9/DEBIAN/postinst D debian/libsope-ldap4.9/DEBIAN/postrm D debian/libsope-ldap4.9/DEBIAN/shlibs D debian/libsope-ldap4.9/usr/lib/libNGLdap.so.4.9 D debian/libsope-ldap4.9/usr/lib/libNGLdap.so.4.9.35 D debian/libsope-ldap4.9/usr/share/doc/libsope-ldap4.9/changelog.Debian.gz D debian/libsope-ldap4.9/usr/share/doc/libsope-ldap4.9/copyright D debian/libsope-mime4.9-dev.debhelper.log D debian/libsope-mime4.9-dev.install D debian/libsope-mime4.9-dev/DEBIAN/control D debian/libsope-mime4.9-dev/DEBIAN/md5sums D debian/libsope-mime4.9-dev/usr/include/GNUstep/NGImap4/NGImap4.h D debian/libsope-mime4.9-dev/usr/include/GNUstep/NGImap4/NGImap4Client.h D debian/libsope-mime4.9-dev/usr/include/GNUstep/NGImap4/NGImap4Connection.h D debian/libsope-mime4.9-dev/usr/include/GNUstep/NGImap4/NGImap4ConnectionManager.h D debian/libsope-mime4.9-dev/usr/include/GNUstep/NGImap4/NGImap4Context.h D debian/libsope-mime4.9-dev/usr/include/GNUstep/NGImap4/NGImap4DataSource.h D debian/libsope-mime4.9-dev/usr/include/GNUstep/NGImap4/NGImap4Envelope.h D debian/libsope-mime4.9-dev/usr/include/GNUstep/NGImap4/NGImap4EnvelopeAddress.h D debian/libsope-mime4.9-dev/usr/include/GNUstep/NGImap4/NGImap4FileManager.h D debian/libsope-mime4.9-dev/usr/include/GNUstep/NGImap4/NGImap4Folder.h D debian/libsope-mime4.9-dev/usr/include/GNUstep/NGImap4/NGImap4MailboxInfo.h D debian/libsope-mime4.9-dev/usr/include/GNUstep/NGImap4/NGImap4Message.h D debian/libsope-mime4.9-dev/usr/include/GNUstep/NGImap4/NGImap4ResponseParser.h D debian/libsope-mime4.9-dev/usr/include/GNUstep/NGImap4/NGImap4ServerRoot.h D debian/libsope-mime4.9-dev/usr/include/GNUstep/NGImap4/NGImap4Support.h D debian/libsope-mime4.9-dev/usr/include/GNUstep/NGImap4/NGSieveClient.h D debian/libsope-mime4.9-dev/usr/include/GNUstep/NGImap4/NSString+Imap4.h D debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMail/NGMBoxReader.h D debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMail/NGMail.h D debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMail/NGMailAddress.h D debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMail/NGMailAddressList.h D debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMail/NGMailAddressParser.h D debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMail/NGMailDecls.h D debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMail/NGMimeMessage.h D debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMail/NGMimeMessageGenerator.h D debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMail/NGMimeMessageParser.h D debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMail/NGPop3Client.h D debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMail/NGPop3Support.h D debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMail/NGSendMail.h D debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMail/NGSmtpClient.h D debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMail/NGSmtpSupport.h D debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMime/NGConcreteMimeType.h D debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMime/NGMime.h D debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMime/NGMimeBodyGenerator.h D debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMime/NGMimeBodyParser.h D debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMime/NGMimeBodyPart.h D debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMime/NGMimeBodyPartParser.h D debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMime/NGMimeDecls.h D debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMime/NGMimeExceptions.h D debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMime/NGMimeFileData.h D debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMime/NGMimeGeneratorProtocols.h D debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMime/NGMimeHeaderFieldGenerator.h D debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMime/NGMimeHeaderFieldParser.h D debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMime/NGMimeHeaderFields.h D debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMime/NGMimeJoinedData.h D debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMime/NGMimeMultipartBody.h D debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMime/NGMimePartGenerator.h D debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMime/NGMimePartParser.h D debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMime/NGMimeType.h D debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMime/NGMimeUtilities.h D debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMime/NGPart.h D debian/libsope-mime4.9-dev/usr/share/doc/libsope-mime4.9-dev/changelog.Debian.gz D debian/libsope-mime4.9-dev/usr/share/doc/libsope-mime4.9-dev/copyright D debian/libsope-mime4.9.debhelper.log D debian/libsope-mime4.9.install D debian/libsope-mime4.9.postinst.debhelper D debian/libsope-mime4.9.postrm.debhelper D debian/libsope-mime4.9.substvars D debian/libsope-mime4.9/DEBIAN/control D debian/libsope-mime4.9/DEBIAN/md5sums D debian/libsope-mime4.9/DEBIAN/postinst D debian/libsope-mime4.9/DEBIAN/postrm D debian/libsope-mime4.9/DEBIAN/shlibs D debian/libsope-mime4.9/usr/lib/libNGMime.so.4.9 D debian/libsope-mime4.9/usr/lib/libNGMime.so.4.9.3 D debian/libsope-mime4.9/usr/share/doc/libsope-mime4.9/changelog.Debian.gz D debian/libsope-mime4.9/usr/share/doc/libsope-mime4.9/copyright D debian/libsope-xml4.9-dev.debhelper.log D debian/libsope-xml4.9-dev.install D debian/libsope-xml4.9-dev/DEBIAN/control D debian/libsope-xml4.9-dev/DEBIAN/md5sums D debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOM.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMAttribute.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMBuilder.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMBuilderFactory.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMCDATASection.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMCharacterData.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMComment.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMDocument.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMDocumentFragment.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMDocumentType.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMElement.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMEntity.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMEntityReference.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMImplementation.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMNamedNodeMap.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMNode+Enum.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMNode+QueryPath.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMNode.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMNodeWalker.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMNotation.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMPYXOutputter.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMProcessingInstruction.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMProtocols.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMQueryPathExpression.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMSaxBuilder.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMSaxHandler.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMText.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMXMLOutputter.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/EDOM.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/SaxObjC/SaxAttributeList.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/SaxObjC/SaxAttributes.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/SaxObjC/SaxContentHandler.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/SaxObjC/SaxDTDHandler.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/SaxObjC/SaxDeclHandler.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/SaxObjC/SaxDefaultHandler.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/SaxObjC/SaxDocumentHandler.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/SaxObjC/SaxEntityResolver.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/SaxObjC/SaxErrorHandler.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/SaxObjC/SaxException.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/SaxObjC/SaxHandlerBase.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/SaxObjC/SaxLexicalHandler.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/SaxObjC/SaxLocator.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/SaxObjC/SaxMethodCallHandler.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/SaxObjC/SaxNamespaceSupport.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/SaxObjC/SaxObjC.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/SaxObjC/SaxObjectDecoder.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/SaxObjC/SaxObjectModel.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/SaxObjC/SaxXMLFilter.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/SaxObjC/SaxXMLReader.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/SaxObjC/SaxXMLReaderFactory.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/SaxObjC/XMLNamespaces.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/XmlRpc/NSObject+XmlRpc.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/XmlRpc/XmlRpc.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/XmlRpc/XmlRpcCoder.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/XmlRpc/XmlRpcMethodCall.h D debian/libsope-xml4.9-dev/usr/include/GNUstep/XmlRpc/XmlRpcMethodResponse.h D debian/libsope-xml4.9-dev/usr/share/doc/libsope-xml4.9-dev/changelog.Debian.gz D debian/libsope-xml4.9-dev/usr/share/doc/libsope-xml4.9-dev/copyright D debian/libsope-xml4.9.debhelper.log D debian/libsope-xml4.9.install D debian/libsope-xml4.9.postinst.debhelper D debian/libsope-xml4.9.postrm.debhelper D debian/libsope-xml4.9.substvars D debian/libsope-xml4.9/DEBIAN/control D debian/libsope-xml4.9/DEBIAN/md5sums D debian/libsope-xml4.9/DEBIAN/postinst D debian/libsope-xml4.9/DEBIAN/postrm D debian/libsope-xml4.9/DEBIAN/shlibs D debian/libsope-xml4.9/usr/lib/libDOM.so.4.9 D debian/libsope-xml4.9/usr/lib/libDOM.so.4.9.24 D debian/libsope-xml4.9/usr/lib/libSaxObjC.so.4.9 D debian/libsope-xml4.9/usr/lib/libSaxObjC.so.4.9.66 D debian/libsope-xml4.9/usr/lib/libXmlRpc.so.4.9 D debian/libsope-xml4.9/usr/lib/libXmlRpc.so.4.9.31 D debian/libsope-xml4.9/usr/share/doc/libsope-xml4.9/changelog.Debian.gz D debian/libsope-xml4.9/usr/share/doc/libsope-xml4.9/copyright D debian/libsope4.9-dev.debhelper.log D debian/libsope4.9-dev/DEBIAN/control D debian/libsope4.9-dev/DEBIAN/md5sums D debian/libsope4.9-dev/usr/share/doc/libsope4.9-dev/changelog.Debian.gz D debian/libsope4.9-dev/usr/share/doc/libsope4.9-dev/copyright D debian/sope-tools.debhelper.log D debian/sope-tools.substvars D debian/sope-tools/DEBIAN/control D debian/sope-tools/DEBIAN/md5sums D debian/sope-tools/usr/bin/connect-EOAdaptor D debian/sope-tools/usr/bin/domxml D debian/sope-tools/usr/bin/ldap2dsml D debian/sope-tools/usr/bin/ldapchkpwd D debian/sope-tools/usr/bin/ldapls D debian/sope-tools/usr/bin/load-EOAdaptor D debian/sope-tools/usr/bin/rss2plist1 D debian/sope-tools/usr/bin/rss2plist2 D debian/sope-tools/usr/bin/rssparse D debian/sope-tools/usr/bin/saxxml D debian/sope-tools/usr/bin/testqp D debian/sope-tools/usr/bin/wod D debian/sope-tools/usr/bin/xmln D debian/sope-tools/usr/bin/xmlrpc_call D debian/sope-tools/usr/share/doc/sope-tools/changelog.Debian.gz D debian/sope-tools/usr/share/doc/sope-tools/copyright D debian/sope4.9-appserver.debhelper.log D debian/sope4.9-appserver.install D debian/sope4.9-appserver.links D debian/sope4.9-appserver.substvars D debian/sope4.9-appserver/DEBIAN/control D debian/sope4.9-appserver/DEBIAN/md5sums D debian/sope4.9-appserver/usr/sbin/sope-4.9 D debian/sope4.9-appserver/usr/share/doc/sope4.9-appserver/changelog.Debian.gz D debian/sope4.9-appserver/usr/share/doc/sope4.9-appserver/copyright D debian/sope4.9-gdl1-postgresql.debhelper.log D debian/sope4.9-gdl1-postgresql.install D debian/sope4.9-gdl1-postgresql/DEBIAN/control D debian/sope4.9-gdl1-postgresql/DEBIAN/md5sums D debian/sope4.9-gdl1-postgresql/usr/share/doc/sope4.9-gdl1-postgresql/changelog.Debian.gz D debian/sope4.9-gdl1-postgresql/usr/share/doc/sope4.9-gdl1-postgresql/copyright D debian/sope4.9-libxmlsaxdriver.debhelper.log D debian/sope4.9-libxmlsaxdriver.install D debian/sope4.9-libxmlsaxdriver/DEBIAN/control D debian/sope4.9-libxmlsaxdriver/DEBIAN/md5sums D debian/sope4.9-libxmlsaxdriver/usr/share/doc/sope4.9-libxmlsaxdriver/changelog.Debian.gz D debian/sope4.9-libxmlsaxdriver/usr/share/doc/sope4.9-libxmlsaxdriver/copyright D debian/sope4.9-stxsaxdriver.debhelper.log D debian/sope4.9-stxsaxdriver.install D debian/sope4.9-stxsaxdriver/DEBIAN/control D debian/sope4.9-stxsaxdriver/DEBIAN/md5sums D debian/sope4.9-stxsaxdriver/usr/share/doc/sope4.9-stxsaxdriver/changelog.Debian.gz D debian/sope4.9-stxsaxdriver/usr/share/doc/sope4.9-stxsaxdriver/copyright D debian/sope4.9-versitsaxdriver.debhelper.log D debian/sope4.9-versitsaxdriver.install D debian/sope4.9-versitsaxdriver/DEBIAN/control D debian/sope4.9-versitsaxdriver/DEBIAN/md5sums D debian/sope4.9-versitsaxdriver/usr/share/doc/sope4.9-versitsaxdriver/changelog.Debian.gz D debian/sope4.9-versitsaxdriver/usr/share/doc/sope4.9-versitsaxdriver/copyright D debian/tmp/usr/bin/connect-EOAdaptor D debian/tmp/usr/bin/domxml D debian/tmp/usr/bin/ldap2dsml D debian/tmp/usr/bin/ldapchkpwd D debian/tmp/usr/bin/ldapls D debian/tmp/usr/bin/load-EOAdaptor D debian/tmp/usr/bin/rss2plist1 D debian/tmp/usr/bin/rss2plist2 D debian/tmp/usr/bin/rssparse D debian/tmp/usr/bin/saxxml D debian/tmp/usr/bin/testqp D debian/tmp/usr/bin/wod D debian/tmp/usr/bin/xmln D debian/tmp/usr/bin/xmlrpc_call D debian/tmp/usr/include/GNUstep/DOM/DOM.h D debian/tmp/usr/include/GNUstep/DOM/DOMAttribute.h D debian/tmp/usr/include/GNUstep/DOM/DOMBuilder.h D debian/tmp/usr/include/GNUstep/DOM/DOMBuilderFactory.h D debian/tmp/usr/include/GNUstep/DOM/DOMCDATASection.h D debian/tmp/usr/include/GNUstep/DOM/DOMCharacterData.h D debian/tmp/usr/include/GNUstep/DOM/DOMComment.h D debian/tmp/usr/include/GNUstep/DOM/DOMDocument.h D debian/tmp/usr/include/GNUstep/DOM/DOMDocumentFragment.h D debian/tmp/usr/include/GNUstep/DOM/DOMDocumentType.h D debian/tmp/usr/include/GNUstep/DOM/DOMElement.h D debian/tmp/usr/include/GNUstep/DOM/DOMEntity.h D debian/tmp/usr/include/GNUstep/DOM/DOMEntityReference.h D debian/tmp/usr/include/GNUstep/DOM/DOMImplementation.h D debian/tmp/usr/include/GNUstep/DOM/DOMNamedNodeMap.h D debian/tmp/usr/include/GNUstep/DOM/DOMNode+Enum.h D debian/tmp/usr/include/GNUstep/DOM/DOMNode+QueryPath.h D debian/tmp/usr/include/GNUstep/DOM/DOMNode.h D debian/tmp/usr/include/GNUstep/DOM/DOMNodeWalker.h D debian/tmp/usr/include/GNUstep/DOM/DOMNotation.h D debian/tmp/usr/include/GNUstep/DOM/DOMPYXOutputter.h D debian/tmp/usr/include/GNUstep/DOM/DOMProcessingInstruction.h D debian/tmp/usr/include/GNUstep/DOM/DOMProtocols.h D debian/tmp/usr/include/GNUstep/DOM/DOMQueryPathExpression.h D debian/tmp/usr/include/GNUstep/DOM/DOMSaxBuilder.h D debian/tmp/usr/include/GNUstep/DOM/DOMSaxHandler.h D debian/tmp/usr/include/GNUstep/DOM/DOMText.h D debian/tmp/usr/include/GNUstep/DOM/DOMXMLOutputter.h D debian/tmp/usr/include/GNUstep/DOM/EDOM.h D debian/tmp/usr/include/GNUstep/EOControl/EOArrayDataSource.h D debian/tmp/usr/include/GNUstep/EOControl/EOClassDescription.h D debian/tmp/usr/include/GNUstep/EOControl/EOControl.h D debian/tmp/usr/include/GNUstep/EOControl/EOControlDecls.h D debian/tmp/usr/include/GNUstep/EOControl/EODataSource.h D debian/tmp/usr/include/GNUstep/EOControl/EODetailDataSource.h D debian/tmp/usr/include/GNUstep/EOControl/EOFetchSpecification.h D debian/tmp/usr/include/GNUstep/EOControl/EOGenericRecord.h D debian/tmp/usr/include/GNUstep/EOControl/EOGlobalID.h D debian/tmp/usr/include/GNUstep/EOControl/EOKeyGlobalID.h D debian/tmp/usr/include/GNUstep/EOControl/EOKeyValueArchiver.h D debian/tmp/usr/include/GNUstep/EOControl/EOKeyValueCoding.h D debian/tmp/usr/include/GNUstep/EOControl/EONull.h D debian/tmp/usr/include/GNUstep/EOControl/EOObserver.h D debian/tmp/usr/include/GNUstep/EOControl/EOQualifier.h D debian/tmp/usr/include/GNUstep/EOControl/EOSQLParser.h D debian/tmp/usr/include/GNUstep/EOControl/EOSortOrdering.h D debian/tmp/usr/include/GNUstep/GDLAccess/EOAdaptor.h D debian/tmp/usr/include/GNUstep/GDLAccess/EOAdaptorChannel+Attributes.h D debian/tmp/usr/include/GNUstep/GDLAccess/EOAdaptorChannel.h D debian/tmp/usr/include/GNUstep/GDLAccess/EOAdaptorContext.h D debian/tmp/usr/include/GNUstep/GDLAccess/EOAdaptorDataSource.h D debian/tmp/usr/include/GNUstep/GDLAccess/EOAdaptorGlobalID.h D debian/tmp/usr/include/GNUstep/GDLAccess/EOAdaptorOperation.h D debian/tmp/usr/include/GNUstep/GDLAccess/EOArrayProxy.h D debian/tmp/usr/include/GNUstep/GDLAccess/EOAttribute.h D debian/tmp/usr/include/GNUstep/GDLAccess/EOAttributeOrdering.h D debian/tmp/usr/include/GNUstep/GDLAccess/EOCustomValues.h D debian/tmp/usr/include/GNUstep/GDLAccess/EODatabase.h D debian/tmp/usr/include/GNUstep/GDLAccess/EODatabaseChannel.h D debian/tmp/usr/include/GNUstep/GDLAccess/EODatabaseContext.h D debian/tmp/usr/include/GNUstep/GDLAccess/EODatabaseFault.h D debian/tmp/usr/include/GNUstep/GDLAccess/EODatabaseFaultResolver.h D debian/tmp/usr/include/GNUstep/GDLAccess/EODelegateResponse.h D debian/tmp/usr/include/GNUstep/GDLAccess/EOEntity+Factory.h D debian/tmp/usr/include/GNUstep/GDLAccess/EOEntity.h D debian/tmp/usr/include/GNUstep/GDLAccess/EOExpressionArray.h D debian/tmp/usr/include/GNUstep/GDLAccess/EOFExceptions.h D debian/tmp/usr/include/GNUstep/GDLAccess/EOFault.h D debian/tmp/usr/include/GNUstep/GDLAccess/EOFaultHandler.h D debian/tmp/usr/include/GNUstep/GDLAccess/EOGenericRecord.h D debian/tmp/usr/include/GNUstep/GDLAccess/EOJoinTypes.h D debian/tmp/usr/include/GNUstep/GDLAccess/EOKeySortOrdering.h D debian/tmp/usr/include/GNUstep/GDLAccess/EOModel.h D debian/tmp/usr/include/GNUstep/GDLAccess/EOModelGroup.h D debian/tmp/usr/include/GNUstep/GDLAccess/EONull.h D debian/tmp/usr/include/GNUstep/GDLAccess/EOObjectUniquer.h D debian/tmp/usr/include/GNUstep/GDLAccess/EOPrimaryKeyDictionary.h D debian/tmp/usr/include/GNUstep/GDLAccess/EOQuotedExpression.h D debian/tmp/usr/include/GNUstep/GDLAccess/EORecordDictionary.h D debian/tmp/usr/include/GNUstep/GDLAccess/EORelationship.h D debian/tmp/usr/include/GNUstep/GDLAccess/EOSQLExpression.h D debian/tmp/usr/include/GNUstep/GDLAccess/EOSQLQualifier.h D debian/tmp/usr/include/GNUstep/GDLAccess/GDLAccess.h D debian/tmp/usr/include/GNUstep/GDLAccess/NSObject+EONullInit.h D debian/tmp/usr/include/GNUstep/NGExtensions/AutoDefines.h D debian/tmp/usr/include/GNUstep/NGExtensions/DOMNode+EOQualifier.h D debian/tmp/usr/include/GNUstep/NGExtensions/EOCacheDataSource.h D debian/tmp/usr/include/GNUstep/NGExtensions/EOCompoundDataSource.h D debian/tmp/usr/include/GNUstep/NGExtensions/EODataSource+NGExtensions.h D debian/tmp/usr/include/GNUstep/NGExtensions/EOFetchSpecification+plist.h D debian/tmp/usr/include/GNUstep/NGExtensions/EOFilterDataSource.h D debian/tmp/usr/include/GNUstep/NGExtensions/EOGrouping.h D debian/tmp/usr/include/GNUstep/NGExtensions/EOGroupingSet.h D debian/tmp/usr/include/GNUstep/NGExtensions/EOKeyGrouping.h D debian/tmp/usr/include/GNUstep/NGExtensions/EOKeyMapDataSource.h D debian/tmp/usr/include/GNUstep/NGExtensions/EOQualifier+CtxEval.h D debian/tmp/usr/include/GNUstep/NGExtensions/EOQualifier+plist.h D debian/tmp/usr/include/GNUstep/NGExtensions/EOQualifierGrouping.h D debian/tmp/usr/include/GNUstep/NGExtensions/EOSortOrdering+plist.h D debian/tmp/usr/include/GNUstep/NGExtensions/EOTrueQualifier.h D debian/tmp/usr/include/GNUstep/NGExtensions/IndexFunc.h D debian/tmp/usr/include/GNUstep/NGExtensions/NGBase64Coding.h D debian/tmp/usr/include/GNUstep/NGExtensions/NGBaseTypes.h D debian/tmp/usr/include/GNUstep/NGExtensions/NGBitSet.h D debian/tmp/usr/include/GNUstep/NGExtensions/NGBundleManager.h D debian/tmp/usr/include/GNUstep/NGExtensions/NGCalendarDateRange.h D debian/tmp/usr/include/GNUstep/NGExtensions/NGCharBuffers.h D debian/tmp/usr/include/GNUstep/NGExtensions/NGCustomFileManager.h D debian/tmp/usr/include/GNUstep/NGExtensions/NGDirectoryEnumerator.h D debian/tmp/usr/include/GNUstep/NGExtensions/NGExtensions.h D debian/tmp/usr/include/GNUstep/NGExtensions/NGExtensionsDecls.h D debian/tmp/usr/include/GNUstep/NGExtensions/NGFileFolderInfoDataSource.h D debian/tmp/usr/include/GNUstep/NGExtensions/NGFileManager.h D debian/tmp/usr/include/GNUstep/NGExtensions/NGFileManagerURL.h D debian/tmp/usr/include/GNUstep/NGExtensions/NGHashMap.h D debian/tmp/usr/include/GNUstep/NGExtensions/NGLogAppender.h D debian/tmp/usr/include/GNUstep/NGExtensions/NGLogEvent.h D debian/tmp/usr/include/GNUstep/NGExtensions/NGLogEventFormatter.h D debian/tmp/usr/include/GNUstep/NGExtensions/NGLogFileHandleAppender.h D debian/tmp/usr/include/GNUstep/NGExtensions/NGLogLevel.h D debian/tmp/usr/include/GNUstep/NGExtensions/NGLogSyslogAppender.h D debian/tmp/usr/include/GNUstep/NGExtensions/NGLogger.h D debian/tmp/usr/include/GNUstep/NGExtensions/NGLoggerManager.h D debian/tmp/usr/include/GNUstep/NGExtensions/NGLogging.h D debian/tmp/usr/include/GNUstep/NGExtensions/NGMemoryAllocation.h D debian/tmp/usr/include/GNUstep/NGExtensions/NGMerging.h D debian/tmp/usr/include/GNUstep/NGExtensions/NGObjCRuntime.h D debian/tmp/usr/include/GNUstep/NGExtensions/NGObjectMacros.h D debian/tmp/usr/include/GNUstep/NGExtensions/NGPropertyListParser.h D debian/tmp/usr/include/GNUstep/NGExtensions/NGQuotedPrintableCoding.h D debian/tmp/usr/include/GNUstep/NGExtensions/NGResourceLocator.h D debian/tmp/usr/include/GNUstep/NGExtensions/NGRule.h D debian/tmp/usr/include/GNUstep/NGExtensions/NGRuleAssignment.h D debian/tmp/usr/include/GNUstep/NGExtensions/NGRuleContext.h D debian/tmp/usr/include/GNUstep/NGExtensions/NGRuleEngine.h D debian/tmp/usr/include/GNUstep/NGExtensions/NGRuleModel.h D debian/tmp/usr/include/GNUstep/NGExtensions/NGStack.h D debian/tmp/usr/include/GNUstep/NGExtensions/NSArray+enumerator.h D debian/tmp/usr/include/GNUstep/NGExtensions/NSAutoreleasePool+misc.h D debian/tmp/usr/include/GNUstep/NGExtensions/NSBundle+misc.h D debian/tmp/usr/include/GNUstep/NGExtensions/NSCalendarDate+misc.h D debian/tmp/usr/include/GNUstep/NGExtensions/NSData+gzip.h D debian/tmp/usr/include/GNUstep/NGExtensions/NSData+misc.h D debian/tmp/usr/include/GNUstep/NGExtensions/NSDictionary+misc.h D debian/tmp/usr/include/GNUstep/NGExtensions/NSEnumerator+misc.h D debian/tmp/usr/include/GNUstep/NGExtensions/NSException+misc.h D debian/tmp/usr/include/GNUstep/NGExtensions/NSFileManager+Extensions.h D debian/tmp/usr/include/GNUstep/NGExtensions/NSMethodSignature+misc.h D debian/tmp/usr/include/GNUstep/NGExtensions/NSNull+misc.h D debian/tmp/usr/include/GNUstep/NGExtensions/NSObject+Logs.h D debian/tmp/usr/include/GNUstep/NGExtensions/NSObject+Values.h D debian/tmp/usr/include/GNUstep/NGExtensions/NSProcessInfo+misc.h D debian/tmp/usr/include/GNUstep/NGExtensions/NSRunLoop+FileObjects.h D debian/tmp/usr/include/GNUstep/NGExtensions/NSSet+enumerator.h D debian/tmp/usr/include/GNUstep/NGExtensions/NSString+Encoding.h D debian/tmp/usr/include/GNUstep/NGExtensions/NSString+Escaping.h D debian/tmp/usr/include/GNUstep/NGExtensions/NSString+Ext.h D debian/tmp/usr/include/GNUstep/NGExtensions/NSString+Formatting.h D debian/tmp/usr/include/GNUstep/NGExtensions/NSString+German.h D debian/tmp/usr/include/GNUstep/NGExtensions/NSString+misc.h D debian/tmp/usr/include/GNUstep/NGExtensions/NSURL+misc.h D debian/tmp/usr/include/GNUstep/NGHttp/NGHttp.h D debian/tmp/usr/include/GNUstep/NGHttp/NGHttpBodyParser.h D debian/tmp/usr/include/GNUstep/NGHttp/NGHttpCookie.h D debian/tmp/usr/include/GNUstep/NGHttp/NGHttpDecls.h D debian/tmp/usr/include/GNUstep/NGHttp/NGHttpHeaderFieldParser.h D debian/tmp/usr/include/GNUstep/NGHttp/NGHttpHeaderFields.h D debian/tmp/usr/include/GNUstep/NGHttp/NGHttpMessage.h D debian/tmp/usr/include/GNUstep/NGHttp/NGHttpMessageParser.h D debian/tmp/usr/include/GNUstep/NGHttp/NGHttpRequest.h D debian/tmp/usr/include/GNUstep/NGHttp/NGHttpResponse.h D debian/tmp/usr/include/GNUstep/NGHttp/NGUrlFormCoder.h D debian/tmp/usr/include/GNUstep/NGImap4/NGImap4.h D debian/tmp/usr/include/GNUstep/NGImap4/NGImap4Client.h D debian/tmp/usr/include/GNUstep/NGImap4/NGImap4Connection.h D debian/tmp/usr/include/GNUstep/NGImap4/NGImap4ConnectionManager.h D debian/tmp/usr/include/GNUstep/NGImap4/NGImap4Context.h D debian/tmp/usr/include/GNUstep/NGImap4/NGImap4DataSource.h D debian/tmp/usr/include/GNUstep/NGImap4/NGImap4Envelope.h D debian/tmp/usr/include/GNUstep/NGImap4/NGImap4EnvelopeAddress.h D debian/tmp/usr/include/GNUstep/NGImap4/NGImap4FileManager.h D debian/tmp/usr/include/GNUstep/NGImap4/NGImap4Folder.h D debian/tmp/usr/include/GNUstep/NGImap4/NGImap4MailboxInfo.h D debian/tmp/usr/include/GNUstep/NGImap4/NGImap4Message.h D debian/tmp/usr/include/GNUstep/NGImap4/NGImap4ResponseParser.h D debian/tmp/usr/include/GNUstep/NGImap4/NGImap4ServerRoot.h D debian/tmp/usr/include/GNUstep/NGImap4/NGImap4Support.h D debian/tmp/usr/include/GNUstep/NGImap4/NGSieveClient.h D debian/tmp/usr/include/GNUstep/NGImap4/NSString+Imap4.h D debian/tmp/usr/include/GNUstep/NGLdap/EOQualifier+LDAP.h D debian/tmp/usr/include/GNUstep/NGLdap/NGLdap.h D debian/tmp/usr/include/GNUstep/NGLdap/NGLdapAttribute.h D debian/tmp/usr/include/GNUstep/NGLdap/NGLdapConnection.h D debian/tmp/usr/include/GNUstep/NGLdap/NGLdapDataSource.h D debian/tmp/usr/include/GNUstep/NGLdap/NGLdapEntry.h D debian/tmp/usr/include/GNUstep/NGLdap/NGLdapFileManager.h D debian/tmp/usr/include/GNUstep/NGLdap/NGLdapGlobalID.h D debian/tmp/usr/include/GNUstep/NGLdap/NGLdapModification.h D debian/tmp/usr/include/GNUstep/NGLdap/NGLdapSearchResultEnumerator.h D debian/tmp/usr/include/GNUstep/NGLdap/NGLdapURL.h D debian/tmp/usr/include/GNUstep/NGLdap/NSString+DN.h D debian/tmp/usr/include/GNUstep/NGMail/NGMBoxReader.h D debian/tmp/usr/include/GNUstep/NGMail/NGMail.h D debian/tmp/usr/include/GNUstep/NGMail/NGMailAddress.h D debian/tmp/usr/include/GNUstep/NGMail/NGMailAddressList.h D debian/tmp/usr/include/GNUstep/NGMail/NGMailAddressParser.h D debian/tmp/usr/include/GNUstep/NGMail/NGMailDecls.h D debian/tmp/usr/include/GNUstep/NGMail/NGMimeMessage.h D debian/tmp/usr/include/GNUstep/NGMail/NGMimeMessageGenerator.h D debian/tmp/usr/include/GNUstep/NGMail/NGMimeMessageParser.h D debian/tmp/usr/include/GNUstep/NGMail/NGPop3Client.h D debian/tmp/usr/include/GNUstep/NGMail/NGPop3Support.h D debian/tmp/usr/include/GNUstep/NGMail/NGSendMail.h D debian/tmp/usr/include/GNUstep/NGMail/NGSmtpClient.h D debian/tmp/usr/include/GNUstep/NGMail/NGSmtpSupport.h D debian/tmp/usr/include/GNUstep/NGMime/NGConcreteMimeType.h D debian/tmp/usr/include/GNUstep/NGMime/NGMime.h D debian/tmp/usr/include/GNUstep/NGMime/NGMimeBodyGenerator.h D debian/tmp/usr/include/GNUstep/NGMime/NGMimeBodyParser.h D debian/tmp/usr/include/GNUstep/NGMime/NGMimeBodyPart.h D debian/tmp/usr/include/GNUstep/NGMime/NGMimeBodyPartParser.h D debian/tmp/usr/include/GNUstep/NGMime/NGMimeDecls.h D debian/tmp/usr/include/GNUstep/NGMime/NGMimeExceptions.h D debian/tmp/usr/include/GNUstep/NGMime/NGMimeFileData.h D debian/tmp/usr/include/GNUstep/NGMime/NGMimeGeneratorProtocols.h D debian/tmp/usr/include/GNUstep/NGMime/NGMimeHeaderFieldGenerator.h D debian/tmp/usr/include/GNUstep/NGMime/NGMimeHeaderFieldParser.h D debian/tmp/usr/include/GNUstep/NGMime/NGMimeHeaderFields.h D debian/tmp/usr/include/GNUstep/NGMime/NGMimeJoinedData.h D debian/tmp/usr/include/GNUstep/NGMime/NGMimeMultipartBody.h D debian/tmp/usr/include/GNUstep/NGMime/NGMimePartGenerator.h D debian/tmp/usr/include/GNUstep/NGMime/NGMimePartParser.h D debian/tmp/usr/include/GNUstep/NGMime/NGMimeType.h D debian/tmp/usr/include/GNUstep/NGMime/NGMimeUtilities.h D debian/tmp/usr/include/GNUstep/NGMime/NGPart.h D debian/tmp/usr/include/GNUstep/NGObjWeb/EOFetchSpecification+SoDAV.h D debian/tmp/usr/include/GNUstep/NGObjWeb/NGObjWeb.h D debian/tmp/usr/include/GNUstep/NGObjWeb/NGObjWebDecls.h D debian/tmp/usr/include/GNUstep/NGObjWeb/NSException+HTTP.h D debian/tmp/usr/include/GNUstep/NGObjWeb/NSString+JavaScriptEscaping.h D debian/tmp/usr/include/GNUstep/NGObjWeb/OWResourceManager.h D debian/tmp/usr/include/GNUstep/NGObjWeb/OWResponder.h D debian/tmp/usr/include/GNUstep/NGObjWeb/OWViewRequestHandler.h D debian/tmp/usr/include/GNUstep/NGObjWeb/SaxDAVHandler.h D debian/tmp/usr/include/GNUstep/NGObjWeb/SoActionInvocation.h D debian/tmp/usr/include/GNUstep/NGObjWeb/SoApplication.h D debian/tmp/usr/include/GNUstep/NGObjWeb/SoClass.h D debian/tmp/usr/include/GNUstep/NGObjWeb/SoClassRegistry.h D debian/tmp/usr/include/GNUstep/NGObjWeb/SoClassSecurityInfo.h D debian/tmp/usr/include/GNUstep/NGObjWeb/SoComponent.h D debian/tmp/usr/include/GNUstep/NGObjWeb/SoControlPanel.h D debian/tmp/usr/include/GNUstep/NGObjWeb/SoCookieAuthenticator.h D debian/tmp/usr/include/GNUstep/NGObjWeb/SoDAV.h D debian/tmp/usr/include/GNUstep/NGObjWeb/SoDAVLockManager.h D debian/tmp/usr/include/GNUstep/NGObjWeb/SoDAVSQLParser.h D debian/tmp/usr/include/GNUstep/NGObjWeb/SoDefaultRenderer.h D debian/tmp/usr/include/GNUstep/NGObjWeb/SoHTTPAuthenticator.h D debian/tmp/usr/include/GNUstep/NGObjWeb/SoLookupAssociation.h D debian/tmp/usr/include/GNUstep/NGObjWeb/SoObjCClass.h D debian/tmp/usr/include/GNUstep/NGObjWeb/SoObject+SoDAV.h D debian/tmp/usr/include/GNUstep/NGObjWeb/SoObject.h D debian/tmp/usr/include/GNUstep/NGObjWeb/SoObjectDataSource.h D debian/tmp/usr/include/GNUstep/NGObjWeb/SoObjectMethodDispatcher.h D debian/tmp/usr/include/GNUstep/NGObjWeb/SoObjectRequestHandler.h D debian/tmp/usr/include/GNUstep/NGObjWeb/SoObjectResultEntry.h D debian/tmp/usr/include/GNUstep/NGObjWeb/SoObjectWebDAVDispatcher.h D debian/tmp/usr/include/GNUstep/NGObjWeb/SoObjects.h D debian/tmp/usr/include/GNUstep/NGObjWeb/SoPageInvocation.h D debian/tmp/usr/include/GNUstep/NGObjWeb/SoPermissions.h D debian/tmp/usr/include/GNUstep/NGObjWeb/SoProduct.h D debian/tmp/usr/include/GNUstep/NGObjWeb/SoProductClassInfo.h D debian/tmp/usr/include/GNUstep/NGObjWeb/SoProductLoader.h D debian/tmp/usr/include/GNUstep/NGObjWeb/SoProductRegistry.h D debian/tmp/usr/include/GNUstep/NGObjWeb/SoProductResourceManager.h D debian/tmp/usr/include/GNUstep/NGObjWeb/SoSecurityException.h D debian/tmp/usr/include/GNUstep/NGObjWeb/SoSecurityManager.h D debian/tmp/usr/include/GNUstep/NGObjWeb/SoSelectorInvocation.h D debian/tmp/usr/include/GNUstep/NGObjWeb/SoSubContext.h D debian/tmp/usr/include/GNUstep/NGObjWeb/SoSubscription.h D debian/tmp/usr/include/GNUstep/NGObjWeb/SoSubscriptionManager.h D debian/tmp/usr/include/GNUstep/NGObjWeb/SoTemplateRenderer.h D debian/tmp/usr/include/GNUstep/NGObjWeb/SoUser.h D debian/tmp/usr/include/GNUstep/NGObjWeb/SoWebDAVRenderer.h D debian/tmp/usr/include/GNUstep/NGObjWeb/SoWebDAVValue.h D debian/tmp/usr/include/GNUstep/NGObjWeb/WEClientCapabilities.h D debian/tmp/usr/include/GNUstep/NGObjWeb/WOActionResults.h D debian/tmp/usr/include/GNUstep/NGObjWeb/WOActionURL.h D debian/tmp/usr/include/GNUstep/NGObjWeb/WOAdaptor.h D debian/tmp/usr/include/GNUstep/NGObjWeb/WOApplication.h D debian/tmp/usr/include/GNUstep/NGObjWeb/WOAssociation.h D debian/tmp/usr/include/GNUstep/NGObjWeb/WOComponent.h D debian/tmp/usr/include/GNUstep/NGObjWeb/WOComponentDefinition.h D debian/tmp/usr/include/GNUstep/NGObjWeb/WOComponentScript.h D debian/tmp/usr/include/GNUstep/NGObjWeb/WOContext+SoObjects.h D debian/tmp/usr/include/GNUstep/NGObjWeb/WOContext.h D debian/tmp/usr/include/GNUstep/NGObjWeb/WOCookie.h D debian/tmp/usr/include/GNUstep/NGObjWeb/WOCoreApplication.h D debian/tmp/usr/include/GNUstep/NGObjWeb/WODirectAction.h D debian/tmp/usr/include/GNUstep/NGObjWeb/WODisplayGroup.h D debian/tmp/usr/include/GNUstep/NGObjWeb/WODynamicElement.h D debian/tmp/usr/include/GNUstep/NGObjWeb/WOElement.h D debian/tmp/usr/include/GNUstep/NGObjWeb/WOElementTrackingContext.h D debian/tmp/usr/include/GNUstep/NGObjWeb/WOHTMLDynamicElement.h D debian/tmp/usr/include/GNUstep/NGObjWeb/WOHTTPConnection.h D debian/tmp/usr/include/GNUstep/NGObjWeb/WOMailDelivery.h D debian/tmp/usr/include/GNUstep/NGObjWeb/WOMessage.h D debian/tmp/usr/include/GNUstep/NGObjWeb/WOPageGenerationContext.h D debian/tmp/usr/include/GNUstep/NGObjWeb/WOProxyRequestHandler.h D debian/tmp/usr/include/GNUstep/NGObjWeb/WORequest+So.h D debian/tmp/usr/include/GNUstep/NGObjWeb/WORequest.h D debian/tmp/usr/include/GNUstep/NGObjWeb/WORequestHandler.h D debian/tmp/usr/include/GNUstep/NGObjWeb/WOResourceManager.h D debian/tmp/usr/include/GNUstep/NGObjWeb/WOResponse.h D debian/tmp/usr/include/GNUstep/NGObjWeb/WOSession.h D debian/tmp/usr/include/GNUstep/NGObjWeb/WOSessionStore.h D debian/tmp/usr/include/GNUstep/NGObjWeb/WOStatisticsStore.h D debian/tmp/usr/include/GNUstep/NGObjWeb/WOTemplate.h D debian/tmp/usr/include/GNUstep/NGObjWeb/WOTemplateBuilder.h D debian/tmp/usr/include/GNUstep/NGObjWeb/WOxElemBuilder.h D debian/tmp/usr/include/GNUstep/NGStreams/NGActiveSocket.h D debian/tmp/usr/include/GNUstep/NGStreams/NGBase64Stream.h D debian/tmp/usr/include/GNUstep/NGStreams/NGBufferedStream.h D debian/tmp/usr/include/GNUstep/NGStreams/NGByteBuffer.h D debian/tmp/usr/include/GNUstep/NGStreams/NGByteCountStream.h D debian/tmp/usr/include/GNUstep/NGStreams/NGCTextStream.h D debian/tmp/usr/include/GNUstep/NGStreams/NGCharBuffer.h D debian/tmp/usr/include/GNUstep/NGStreams/NGConcreteStreamFileHandle.h D debian/tmp/usr/include/GNUstep/NGStreams/NGDataStream.h D debian/tmp/usr/include/GNUstep/NGStreams/NGDatagramPacket.h D debian/tmp/usr/include/GNUstep/NGStreams/NGDatagramSocket.h D debian/tmp/usr/include/GNUstep/NGStreams/NGDescriptorFunctions.h D debian/tmp/usr/include/GNUstep/NGStreams/NGFileStream.h D debian/tmp/usr/include/GNUstep/NGStreams/NGFilterStream.h D debian/tmp/usr/include/GNUstep/NGStreams/NGFilterTextStream.h D debian/tmp/usr/include/GNUstep/NGStreams/NGGZipStream.h D debian/tmp/usr/include/GNUstep/NGStreams/NGInternetSocketAddress.h D debian/tmp/usr/include/GNUstep/NGStreams/NGInternetSocketDomain.h D debian/tmp/usr/include/GNUstep/NGStreams/NGLocalSocketAddress.h D debian/tmp/usr/include/GNUstep/NGStreams/NGLocalSocketDomain.h D debian/tmp/usr/include/GNUstep/NGStreams/NGLockingStream.h D debian/tmp/usr/include/GNUstep/NGStreams/NGNet.h D debian/tmp/usr/include/GNUstep/NGStreams/NGNetDecls.h D debian/tmp/usr/include/GNUstep/NGStreams/NGNetUtilities.h D debian/tmp/usr/include/GNUstep/NGStreams/NGPassiveSocket.h D debian/tmp/usr/include/GNUstep/NGStreams/NGSocket.h D debian/tmp/usr/include/GNUstep/NGStreams/NGSocketExceptions.h D debian/tmp/usr/include/GNUstep/NGStreams/NGSocketProtocols.h D debian/tmp/usr/include/GNUstep/NGStreams/NGStream.h D debian/tmp/usr/include/GNUstep/NGStreams/NGStreamExceptions.h D debian/tmp/usr/include/GNUstep/NGStreams/NGStreamPipe.h D debian/tmp/usr/include/GNUstep/NGStreams/NGStreamProtocols.h D debian/tmp/usr/include/GNUstep/NGStreams/NGStreams.h D debian/tmp/usr/include/GNUstep/NGStreams/NGStreamsDecls.h D debian/tmp/usr/include/GNUstep/NGStreams/NGStringTextStream.h D debian/tmp/usr/include/GNUstep/NGStreams/NGTerminalSupport.h D debian/tmp/usr/include/GNUstep/NGStreams/NGTextStream.h D debian/tmp/usr/include/GNUstep/NGStreams/NGTextStreamProtocols.h D debian/tmp/usr/include/GNUstep/NGXmlRpc/NGAsyncResultProxy.h D debian/tmp/usr/include/GNUstep/NGXmlRpc/NGXmlRpc.h D debian/tmp/usr/include/GNUstep/NGXmlRpc/NGXmlRpcAction.h D debian/tmp/usr/include/GNUstep/NGXmlRpc/NGXmlRpcClient.h D debian/tmp/usr/include/GNUstep/NGXmlRpc/NGXmlRpcInvocation.h D debian/tmp/usr/include/GNUstep/NGXmlRpc/NGXmlRpcMethodSignature.h D debian/tmp/usr/include/GNUstep/NGXmlRpc/NGXmlRpcRequestHandler.h D debian/tmp/usr/include/GNUstep/NGXmlRpc/NSObject+Reflection.h D debian/tmp/usr/include/GNUstep/NGXmlRpc/WODirectAction+XmlRpc.h D debian/tmp/usr/include/GNUstep/NGXmlRpc/WODirectAction+XmlRpcIntrospection.h D debian/tmp/usr/include/GNUstep/NGXmlRpc/XmlRpcMethodCall+WO.h D debian/tmp/usr/include/GNUstep/NGXmlRpc/XmlRpcMethodResponse+WO.h D debian/tmp/usr/include/GNUstep/NGiCal/NGVCard.h D debian/tmp/usr/include/GNUstep/NGiCal/NGVCardAddress.h D debian/tmp/usr/include/GNUstep/NGiCal/NGVCardName.h D debian/tmp/usr/include/GNUstep/NGiCal/NGVCardOrg.h D debian/tmp/usr/include/GNUstep/NGiCal/NGVCardPhone.h D debian/tmp/usr/include/GNUstep/NGiCal/NGVCardSaxHandler.h D debian/tmp/usr/include/GNUstep/NGiCal/NGVCardSimpleValue.h D debian/tmp/usr/include/GNUstep/NGiCal/NGVCardStrArrayValue.h D debian/tmp/usr/include/GNUstep/NGiCal/NGVCardValue.h D debian/tmp/usr/include/GNUstep/NGiCal/NGiCal.h D debian/tmp/usr/include/GNUstep/NGiCal/NSCalendarDate+ICal.h D debian/tmp/usr/include/GNUstep/NGiCal/iCalAlarm.h D debian/tmp/usr/include/GNUstep/NGiCal/iCalAttachment.h D debian/tmp/usr/include/GNUstep/NGiCal/iCalCalendar.h D debian/tmp/usr/include/GNUstep/NGiCal/iCalDataSource.h D debian/tmp/usr/include/GNUstep/NGiCal/iCalDuration.h D debian/tmp/usr/include/GNUstep/NGiCal/iCalEntityObject.h D debian/tmp/usr/include/GNUstep/NGiCal/iCalEvent.h D debian/tmp/usr/include/GNUstep/NGiCal/iCalEventChanges.h D debian/tmp/usr/include/GNUstep/NGiCal/iCalFreeBusy.h D debian/tmp/usr/include/GNUstep/NGiCal/iCalJournal.h D debian/tmp/usr/include/GNUstep/NGiCal/iCalObject.h D debian/tmp/usr/include/GNUstep/NGiCal/iCalPerson.h D debian/tmp/usr/include/GNUstep/NGiCal/iCalRecurrenceCalculator.h D debian/tmp/usr/include/GNUstep/NGiCal/iCalRecurrenceRule.h D debian/tmp/usr/include/GNUstep/NGiCal/iCalRenderer.h D debian/tmp/usr/include/GNUstep/NGiCal/iCalRepeatableEntityObject.h D debian/tmp/usr/include/GNUstep/NGiCal/iCalToDo.h D debian/tmp/usr/include/GNUstep/NGiCal/iCalTrigger.h D debian/tmp/usr/include/GNUstep/SaxObjC/SaxAttributeList.h D debian/tmp/usr/include/GNUstep/SaxObjC/SaxAttributes.h D debian/tmp/usr/include/GNUstep/SaxObjC/SaxContentHandler.h D debian/tmp/usr/include/GNUstep/SaxObjC/SaxDTDHandler.h D debian/tmp/usr/include/GNUstep/SaxObjC/SaxDeclHandler.h D debian/tmp/usr/include/GNUstep/SaxObjC/SaxDefaultHandler.h D debian/tmp/usr/include/GNUstep/SaxObjC/SaxDocumentHandler.h D debian/tmp/usr/include/GNUstep/SaxObjC/SaxEntityResolver.h D debian/tmp/usr/include/GNUstep/SaxObjC/SaxErrorHandler.h D debian/tmp/usr/include/GNUstep/SaxObjC/SaxException.h D debian/tmp/usr/include/GNUstep/SaxObjC/SaxHandlerBase.h D debian/tmp/usr/include/GNUstep/SaxObjC/SaxLexicalHandler.h D debian/tmp/usr/include/GNUstep/SaxObjC/SaxLocator.h D debian/tmp/usr/include/GNUstep/SaxObjC/SaxMethodCallHandler.h D debian/tmp/usr/include/GNUstep/SaxObjC/SaxNamespaceSupport.h D debian/tmp/usr/include/GNUstep/SaxObjC/SaxObjC.h D debian/tmp/usr/include/GNUstep/SaxObjC/SaxObjectDecoder.h D debian/tmp/usr/include/GNUstep/SaxObjC/SaxObjectModel.h D debian/tmp/usr/include/GNUstep/SaxObjC/SaxXMLFilter.h D debian/tmp/usr/include/GNUstep/SaxObjC/SaxXMLReader.h D debian/tmp/usr/include/GNUstep/SaxObjC/SaxXMLReaderFactory.h D debian/tmp/usr/include/GNUstep/SaxObjC/XMLNamespaces.h D debian/tmp/usr/include/GNUstep/SoOFS/OFSBaseObject.h D debian/tmp/usr/include/GNUstep/SoOFS/OFSChangeLog.h D debian/tmp/usr/include/GNUstep/SoOFS/OFSFactoryContext.h D debian/tmp/usr/include/GNUstep/SoOFS/OFSFactoryRegistry.h D debian/tmp/usr/include/GNUstep/SoOFS/OFSFile.h D debian/tmp/usr/include/GNUstep/SoOFS/OFSFileRenderer.h D debian/tmp/usr/include/GNUstep/SoOFS/OFSFolder.h D debian/tmp/usr/include/GNUstep/SoOFS/OFSFolderDataSource.h D debian/tmp/usr/include/GNUstep/SoOFS/OFSHttpPasswd.h D debian/tmp/usr/include/GNUstep/SoOFS/OFSImage.h D debian/tmp/usr/include/GNUstep/SoOFS/OFSPropertyListObject.h D debian/tmp/usr/include/GNUstep/SoOFS/OFSResourceManager.h D debian/tmp/usr/include/GNUstep/SoOFS/OFSWebDocument.h D debian/tmp/usr/include/GNUstep/SoOFS/OFSWebMethod.h D debian/tmp/usr/include/GNUstep/SoOFS/OFSWebMethodRenderer.h D debian/tmp/usr/include/GNUstep/SoOFS/OFSWebTemplate.h D debian/tmp/usr/include/GNUstep/SoOFS/SoOFS.h D debian/tmp/usr/include/GNUstep/WEExtensions/WEContextConditional.h D debian/tmp/usr/include/GNUstep/WEExtensions/WEResourceManager.h D debian/tmp/usr/include/GNUstep/WOExtensions/WOExtensions.h D debian/tmp/usr/include/GNUstep/WOExtensions/WORedirect.h D debian/tmp/usr/include/GNUstep/WOXML/WOXML.h D debian/tmp/usr/include/GNUstep/WOXML/WOXMLDecoder.h D debian/tmp/usr/include/GNUstep/WOXML/WOXMLMappingModel.h D debian/tmp/usr/include/GNUstep/XmlRpc/NSObject+XmlRpc.h D debian/tmp/usr/include/GNUstep/XmlRpc/XmlRpc.h D debian/tmp/usr/include/GNUstep/XmlRpc/XmlRpcCoder.h D debian/tmp/usr/include/GNUstep/XmlRpc/XmlRpcMethodCall.h D debian/tmp/usr/include/GNUstep/XmlRpc/XmlRpcMethodResponse.h D debian/tmp/usr/lib/GNUstep/GDLAdaptors-4.9/MySQL.gdladaptor/MySQL D debian/tmp/usr/lib/GNUstep/GDLAdaptors-4.9/MySQL.gdladaptor/Resources/Info-gnustep.plist D debian/tmp/usr/lib/GNUstep/GDLAdaptors-4.9/MySQL.gdladaptor/Resources/Version D debian/tmp/usr/lib/GNUstep/GDLAdaptors-4.9/MySQL.gdladaptor/stamp.make D debian/tmp/usr/lib/GNUstep/GDLAdaptors-4.9/PostgreSQL.gdladaptor/PostgreSQL D debian/tmp/usr/lib/GNUstep/GDLAdaptors-4.9/PostgreSQL.gdladaptor/Resources/Info-gnustep.plist D debian/tmp/usr/lib/GNUstep/GDLAdaptors-4.9/PostgreSQL.gdladaptor/Resources/Version D debian/tmp/usr/lib/GNUstep/GDLAdaptors-4.9/PostgreSQL.gdladaptor/stamp.make D debian/tmp/usr/lib/GNUstep/GDLAdaptors-4.9/SQLite3.gdladaptor/Resources/Info-gnustep.plist D debian/tmp/usr/lib/GNUstep/GDLAdaptors-4.9/SQLite3.gdladaptor/Resources/Version D debian/tmp/usr/lib/GNUstep/GDLAdaptors-4.9/SQLite3.gdladaptor/SQLite3 D debian/tmp/usr/lib/GNUstep/GDLAdaptors-4.9/SQLite3.gdladaptor/stamp.make D debian/tmp/usr/lib/GNUstep/Libraries/Resources/NGObjWeb/DAVPropMap.plist D debian/tmp/usr/lib/GNUstep/Libraries/Resources/NGObjWeb/Defaults.plist D debian/tmp/usr/lib/GNUstep/Libraries/Resources/NGObjWeb/Languages.plist D debian/tmp/usr/lib/GNUstep/SaxDrivers-4.9/STXSaxDriver.sax/Resources/Info-gnustep.plist D debian/tmp/usr/lib/GNUstep/SaxDrivers-4.9/STXSaxDriver.sax/Resources/Version D debian/tmp/usr/lib/GNUstep/SaxDrivers-4.9/STXSaxDriver.sax/STXSaxDriver D debian/tmp/usr/lib/GNUstep/SaxDrivers-4.9/STXSaxDriver.sax/bundle-info.plist D debian/tmp/usr/lib/GNUstep/SaxDrivers-4.9/STXSaxDriver.sax/stamp.make D debian/tmp/usr/lib/GNUstep/SaxDrivers-4.9/libxmlSAXDriver.sax/Resources/Info-gnustep.plist D debian/tmp/usr/lib/GNUstep/SaxDrivers-4.9/libxmlSAXDriver.sax/Resources/Version D debian/tmp/usr/lib/GNUstep/SaxDrivers-4.9/libxmlSAXDriver.sax/Resources/bundle-info.plist D debian/tmp/usr/lib/GNUstep/SaxDrivers-4.9/libxmlSAXDriver.sax/bundle-info.plist D debian/tmp/usr/lib/GNUstep/SaxDrivers-4.9/libxmlSAXDriver.sax/libxmlSAXDriver D debian/tmp/usr/lib/GNUstep/SaxDrivers-4.9/libxmlSAXDriver.sax/stamp.make D debian/tmp/usr/lib/GNUstep/SaxDrivers-4.9/versitSaxDriver.sax/Resources/Info-gnustep.plist D debian/tmp/usr/lib/GNUstep/SaxDrivers-4.9/versitSaxDriver.sax/Resources/bundle-info.plist D debian/tmp/usr/lib/GNUstep/SaxDrivers-4.9/versitSaxDriver.sax/bundle-info.plist D debian/tmp/usr/lib/GNUstep/SaxDrivers-4.9/versitSaxDriver.sax/stamp.make D debian/tmp/usr/lib/GNUstep/SaxDrivers-4.9/versitSaxDriver.sax/versitSaxDriver D debian/tmp/usr/lib/GNUstep/SaxMappings/NGiCal.xmap D debian/tmp/usr/lib/GNUstep/SoProducts-4.9/SoCore.sxp/Resources/Info-gnustep.plist D debian/tmp/usr/lib/GNUstep/SoProducts-4.9/SoCore.sxp/Resources/Version D debian/tmp/usr/lib/GNUstep/SoProducts-4.9/SoCore.sxp/Resources/product.plist D debian/tmp/usr/lib/GNUstep/SoProducts-4.9/SoCore.sxp/SoCore D debian/tmp/usr/lib/GNUstep/SoProducts-4.9/SoCore.sxp/stamp.make D debian/tmp/usr/lib/GNUstep/SoProducts-4.9/SoOFS.sxp/Resources/Info-gnustep.plist D debian/tmp/usr/lib/GNUstep/SoProducts-4.9/SoOFS.sxp/Resources/Version D debian/tmp/usr/lib/GNUstep/SoProducts-4.9/SoOFS.sxp/Resources/product.plist D debian/tmp/usr/lib/GNUstep/SoProducts-4.9/SoOFS.sxp/SoOFS D debian/tmp/usr/lib/GNUstep/SoProducts-4.9/SoOFS.sxp/stamp.make D debian/tmp/usr/lib/GNUstep/WOxElemBuilders-4.9/WEExtensions.wox/Resources/Info-gnustep.plist D debian/tmp/usr/lib/GNUstep/WOxElemBuilders-4.9/WEExtensions.wox/WEExtensions D debian/tmp/usr/lib/GNUstep/WOxElemBuilders-4.9/WEExtensions.wox/bundle-info.plist D debian/tmp/usr/lib/GNUstep/WOxElemBuilders-4.9/WEExtensions.wox/stamp.make D debian/tmp/usr/lib/GNUstep/WOxElemBuilders-4.9/WEPrototype.wox/Resources/Info-gnustep.plist D debian/tmp/usr/lib/GNUstep/WOxElemBuilders-4.9/WEPrototype.wox/WEPrototype D debian/tmp/usr/lib/GNUstep/WOxElemBuilders-4.9/WEPrototype.wox/bundle-info.plist D debian/tmp/usr/lib/GNUstep/WOxElemBuilders-4.9/WEPrototype.wox/stamp.make D debian/tmp/usr/lib/GNUstep/WOxElemBuilders-4.9/WOExtensions.wox/Resources/Info-gnustep.plist D debian/tmp/usr/lib/GNUstep/WOxElemBuilders-4.9/WOExtensions.wox/WOExtensions D debian/tmp/usr/lib/GNUstep/WOxElemBuilders-4.9/WOExtensions.wox/bundle-info.plist D debian/tmp/usr/lib/GNUstep/WOxElemBuilders-4.9/WOExtensions.wox/stamp.make D debian/tmp/usr/lib/libDOM.so.4.9 D debian/tmp/usr/lib/libDOM.so.4.9.24 D debian/tmp/usr/lib/libEOControl.so.4.9 D debian/tmp/usr/lib/libEOControl.so.4.9.74 D debian/tmp/usr/lib/libGDLAccess.so.4.9 D debian/tmp/usr/lib/libGDLAccess.so.4.9.63 D debian/tmp/usr/lib/libNGExtensions.so.4.9 D debian/tmp/usr/lib/libNGExtensions.so.4.9.203 D debian/tmp/usr/lib/libNGLdap.so.4.9 D debian/tmp/usr/lib/libNGLdap.so.4.9.35 D debian/tmp/usr/lib/libNGMime.so.4.9 D debian/tmp/usr/lib/libNGMime.so.4.9.3 D debian/tmp/usr/lib/libNGObjWeb.so.4.9 D debian/tmp/usr/lib/libNGObjWeb.so.4.9.37 D debian/tmp/usr/lib/libNGStreams.so.4.9 D debian/tmp/usr/lib/libNGStreams.so.4.9.57 D debian/tmp/usr/lib/libNGXmlRpc.so.4.9 D debian/tmp/usr/lib/libNGXmlRpc.so.4.9.17 D debian/tmp/usr/lib/libNGiCal.so.4.9 D debian/tmp/usr/lib/libNGiCal.so.4.9.84 D debian/tmp/usr/lib/libSaxObjC.so.4.9 D debian/tmp/usr/lib/libSaxObjC.so.4.9.66 D debian/tmp/usr/lib/libSoOFS.so.4.9 D debian/tmp/usr/lib/libSoOFS.so.4.9.25 D debian/tmp/usr/lib/libWEExtensions.so.4.9 D debian/tmp/usr/lib/libWEExtensions.so.4.9.94 D debian/tmp/usr/lib/libWEPrototype.so.4.9 D debian/tmp/usr/lib/libWEPrototype.so.4.9.9 D debian/tmp/usr/lib/libWOExtensions.so.4.9 D debian/tmp/usr/lib/libWOExtensions.so.4.9.31 D debian/tmp/usr/lib/libWOXML.so.4.9 D debian/tmp/usr/lib/libWOXML.so.4.9.9 D debian/tmp/usr/lib/libXmlRpc.so.4.9 D debian/tmp/usr/lib/libXmlRpc.so.4.9.31 D debian/tmp/usr/sbin/sope-4.9 D debian/tmp/usr/share/GNUstep/Makefiles/Additional/ngobjweb.make D debian/tmp/usr/share/GNUstep/Makefiles/woapp.make D debian/tmp/usr/share/GNUstep/Makefiles/wobundle.make D sope-appserver/mod_ngobjweb-apache2/500mod_ngobjweb.info D sope-appserver/mod_ngobjweb-apache2/CHANGES D sope-appserver/mod_ngobjweb-apache2/COPYRIGHT D sope-appserver/mod_ngobjweb-apache2/ChangeLog D sope-appserver/mod_ngobjweb-apache2/GNUmakefile D sope-appserver/mod_ngobjweb-apache2/NGBufferedDescriptor.c D sope-appserver/mod_ngobjweb-apache2/NGBufferedDescriptor.h D sope-appserver/mod_ngobjweb-apache2/README D sope-appserver/mod_ngobjweb-apache2/apversion.sh D sope-appserver/mod_ngobjweb-apache2/common.h D sope-appserver/mod_ngobjweb-apache2/config.c D sope-appserver/mod_ngobjweb-apache2/globals.c D sope-appserver/mod_ngobjweb-apache2/handler.c D sope-appserver/mod_ngobjweb-apache2/httpd.conf D sope-appserver/mod_ngobjweb-apache2/ngobjweb.load D sope-appserver/mod_ngobjweb-apache2/ngobjweb_module.c D sope-appserver/mod_ngobjweb-apache2/scanhttp.c D sope-appserver/mod_ngobjweb-apache2/skyrix.conf D sope-appserver/mod_ngobjweb-apache2/sns.c D sope-core/NGStreams/config.guess.upstream D sope-core/NGStreams/config.sub.upstream commit c782cc44f42f6e22c323c2184a77002320ed3ac9 Author: Ludovic Marcotte Date: Thu Jul 29 18:50:10 2010 +0000 Dropped samples target from makefiles Monotone-Parent: 843d1025bab5d142155d7ded15c9de17d3b599e6 Monotone-Revision: 5a11c3789ee188a9f196ebf8d7a3998dae7996b5 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2010-07-29T18:50:10 Monotone-Branch: ca.inverse.sope M sope-ldap/GNUmakefile M sope-xml/GNUmakefile commit 97280a38bd1583e282a90c5513a15c88add3dcca Author: Ludovic Marcotte Date: Thu Jul 29 18:40:21 2010 +0000 Cleaned up more stuff. Monotone-Parent: 592f1af929791fbdc8780afe81d8021d7c6fdd73 Monotone-Revision: 843d1025bab5d142155d7ded15c9de17d3b599e6 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2010-07-29T18:40:21 Monotone-Branch: ca.inverse.sope A maintenance/dummytool.c D sope-appserver/WOXML/samples/slashdot/GNUmakefile D sope-appserver/WOXML/samples/slashdot/SlashDotStory.m D sope-appserver/WOXML/samples/slashdot/slashdot.xmlmodel D sope-appserver/WOXML/samples/slashdot/woslash.m D sope-appserver/samples/BasicAuthSession/Application.m D sope-appserver/samples/BasicAuthSession/GNUmakefile D sope-appserver/samples/BasicAuthSession/Main.m D sope-appserver/samples/BasicAuthSession/Main.wo/Main.html D sope-appserver/samples/BasicAuthSession/Main.wo/Main.wod D sope-appserver/samples/BasicAuthSession/NSString+BasicAuth.h D sope-appserver/samples/BasicAuthSession/NSString+BasicAuth.m D sope-appserver/samples/BasicAuthSession/README D sope-appserver/samples/BasicAuthSession/common.h D sope-appserver/samples/COPYING D sope-appserver/samples/ChangeLog D sope-appserver/samples/CoreDataBlog/BlogDemo_DataModel.xcdatamodel/elements D sope-appserver/samples/CoreDataBlog/BlogDemo_DataModel.xcdatamodel/layout D sope-appserver/samples/CoreDataBlog/ChangeLog D sope-appserver/samples/CoreDataBlog/CoreDataBlog.conf D sope-appserver/samples/CoreDataBlog/CoreDataBlog.m D sope-appserver/samples/CoreDataBlog/Defaults.plist D sope-appserver/samples/CoreDataBlog/GNUmakefile D sope-appserver/samples/CoreDataBlog/GNUmakefile.postamble D sope-appserver/samples/CoreDataBlog/GNUmakefile.preamble D sope-appserver/samples/CoreDataBlog/Main.m D sope-appserver/samples/CoreDataBlog/Main.wo/Main.html D sope-appserver/samples/CoreDataBlog/Main.wo/Main.wod D sope-appserver/samples/CoreDataBlog/Main.wo/Main.woo D sope-appserver/samples/CoreDataBlog/MonthPage.m D sope-appserver/samples/CoreDataBlog/MonthPage.wo/MonthPage.html D sope-appserver/samples/CoreDataBlog/MonthPage.wo/MonthPage.wod D sope-appserver/samples/CoreDataBlog/MonthPage.wo/MonthPage.woo D sope-appserver/samples/CoreDataBlog/README D sope-appserver/samples/CoreDataBlog/RSS10.m D sope-appserver/samples/CoreDataBlog/RSS10.wo/RSS10.html D sope-appserver/samples/CoreDataBlog/RSS10.wo/RSS10.wod D sope-appserver/samples/CoreDataBlog/RSS10.wo/RSS10.woo D sope-appserver/samples/CoreDataBlog/Session.m D sope-appserver/samples/CoreDataBlog/WOCoreDataApplication.h D sope-appserver/samples/CoreDataBlog/WOCoreDataApplication.m D sope-appserver/samples/CoreDataBlog/WOSession+CoreData.h D sope-appserver/samples/CoreDataBlog/WOSession+CoreData.m D sope-appserver/samples/CoreDataBlog/common.h D sope-appserver/samples/CoreDataBlog/mulle-nat.rdf D sope-appserver/samples/GNUmakefile D sope-appserver/samples/HelloForm/ChangeLog D sope-appserver/samples/HelloForm/GNUmakefile D sope-appserver/samples/HelloForm/GNUmakefile.preamble D sope-appserver/samples/HelloForm/HelloForm.m D sope-appserver/samples/HelloForm/Main.css D sope-appserver/samples/HelloForm/Main.m D sope-appserver/samples/HelloForm/Main.wo/Main.html D sope-appserver/samples/HelloForm/Main.wo/Main.wod D sope-appserver/samples/HelloForm/common.h D sope-appserver/samples/HelloWorld/ChangeLog D sope-appserver/samples/HelloWorld/GNUmakefile D sope-appserver/samples/HelloWorld/GNUmakefile.preamble D sope-appserver/samples/HelloWorld/HelloWorld.m D sope-appserver/samples/HelloWorld/Main.m D sope-appserver/samples/HelloWorld/Main.wo/Main.html D sope-appserver/samples/HelloWorld/Main.wo/Main.wod D sope-appserver/samples/HelloWorld/common.h D sope-appserver/samples/README D sope-appserver/samples/SoCookieAuth/Application.m D sope-appserver/samples/SoCookieAuth/ChangeLog D sope-appserver/samples/SoCookieAuth/GNUmakefile D sope-appserver/samples/SoCookieAuth/GNUmakefile.preamble D sope-appserver/samples/SoCookieAuth/Main.m D sope-appserver/samples/SoCookieAuth/README D sope-appserver/samples/SoCookieAuth/common.h D sope-appserver/samples/TestPages/ChangeLog D sope-appserver/samples/TestPages/FormDisplay.m D sope-appserver/samples/TestPages/FormDisplay.wo/FormDisplay.html D sope-appserver/samples/TestPages/FormDisplay.wo/FormDisplay.wod D sope-appserver/samples/TestPages/GNUmakefile D sope-appserver/samples/TestPages/GNUmakefile.preamble D sope-appserver/samples/TestPages/Main.m D sope-appserver/samples/TestPages/Main.wo/Main.html D sope-appserver/samples/TestPages/Main.wo/Main.wod D sope-appserver/samples/TestPages/TestPages.m D sope-appserver/samples/TestPages/TwoForms.m D sope-appserver/samples/TestPages/TwoForms.wo/TwoForms.html D sope-appserver/samples/TestPages/TwoForms.wo/TwoForms.wod D sope-appserver/samples/TestPages/common.h D sope-appserver/samples/TestPrototype/ChangeLog D sope-appserver/samples/TestPrototype/GNUmakefile D sope-appserver/samples/TestPrototype/GNUmakefile.preamble D sope-appserver/samples/TestPrototype/Main.m D sope-appserver/samples/TestPrototype/Main.wo/Main.html D sope-appserver/samples/TestPrototype/Main.wo/Main.wod D sope-appserver/samples/TestPrototype/TestPrototype.m D sope-appserver/samples/TestPrototype/common.h D sope-appserver/samples/TestSite/.sope.plist D sope-appserver/samples/TestSite/ChangeLog D sope-appserver/samples/TestSite/Debug.xtmpl D sope-appserver/samples/TestSite/Main.xtmpl D sope-appserver/samples/TestSite/Projects/Main.xtmpl D sope-appserver/samples/TestSite/Projects/OGoLogo.gif D sope-appserver/samples/TestSite/Projects/blogstyle.css D sope-appserver/samples/TestSite/Projects/index.wox D sope-appserver/samples/TestSite/Projects/projectcard.wox D sope-appserver/samples/TestSite/Projects/stylesheet.css D sope-appserver/samples/TestSite/README D sope-appserver/samples/TestSite/accept.gif D sope-appserver/samples/TestSite/embed.wox D sope-appserver/samples/TestSite/favicon.ico D sope-appserver/samples/TestSite/htpasswd D sope-appserver/samples/TestSite/images/banner-new.gif D sope-appserver/samples/TestSite/images/banner.gif D sope-appserver/samples/TestSite/images/banner_back.gif D sope-appserver/samples/TestSite/images/banner_left.gif D sope-appserver/samples/TestSite/images/banner_right.gif D sope-appserver/samples/TestSite/index.html D sope-appserver/samples/TestSite/plisttest/Main.xtmpl D sope-appserver/samples/TestSite/plisttest/MyNews1.plist D sope-appserver/samples/TestSite/plisttest/MyNews2.plist D sope-appserver/samples/TestSite/plisttest/index.wox D sope-appserver/samples/TestSite/plone/Main.xtmpl D sope-appserver/samples/TestSite/plone/NOTES.txt D sope-appserver/samples/TestSite/plone/index.wox D sope-appserver/samples/TestSite/plone/linkOpaque.gif D sope-appserver/samples/TestSite/plone/linkTransparent.gif D sope-appserver/samples/TestSite/plone/loggedin.html D sope-appserver/samples/TestSite/plone/plone.css D sope-appserver/samples/TestSite/plone/ploneCustom.css D sope-appserver/samples/TestSite/plone/ploneNS4.css D sope-appserver/samples/TestSite/plone/plonePresentation.css D sope-appserver/samples/TestSite/plone/plonePrint.css D sope-appserver/samples/TestSite/plone/plone_formtooltip.js D sope-appserver/samples/TestSite/plone/plone_javascripts.js D sope-appserver/samples/TestSite/plone/required.gif D sope-appserver/samples/TestSite/plone/searchbox.wox D sope-appserver/samples/TestSite/stylesheet.css D sope-appserver/samples/TestSite/subdir/index.wox D sope-appserver/samples/TestSite/test.wox D sope-appserver/samples/TestSite/webfolders.xhtml D sope-appserver/samples/WOxExtTest/AlertPanel.m D sope-appserver/samples/WOxExtTest/AlertPanel.wox D sope-appserver/samples/WOxExtTest/Browser.m D sope-appserver/samples/WOxExtTest/Browser.wox D sope-appserver/samples/WOxExtTest/CalendarField.m D sope-appserver/samples/WOxExtTest/CalendarField.wox D sope-appserver/samples/WOxExtTest/ChangeLog D sope-appserver/samples/WOxExtTest/CheckBoxMatrix.m D sope-appserver/samples/WOxExtTest/CheckBoxMatrix.wox D sope-appserver/samples/WOxExtTest/CollapsibleContent.m D sope-appserver/samples/WOxExtTest/CollapsibleContent.wox D sope-appserver/samples/WOxExtTest/CollapsibleContentExt.m D sope-appserver/samples/WOxExtTest/CollapsibleContentExt.wox D sope-appserver/samples/WOxExtTest/ConfirmPanel.m D sope-appserver/samples/WOxExtTest/ConfirmPanel.wox D sope-appserver/samples/WOxExtTest/DateField.m D sope-appserver/samples/WOxExtTest/DateField.wox D sope-appserver/samples/WOxExtTest/DictionaryRepetition.m D sope-appserver/samples/WOxExtTest/DictionaryRepetition.wox D sope-appserver/samples/WOxExtTest/DirectAction.m D sope-appserver/samples/WOxExtTest/DnD.m D sope-appserver/samples/WOxExtTest/DnD.wox D sope-appserver/samples/WOxExtTest/Frame.m D sope-appserver/samples/WOxExtTest/Frame.wox D sope-appserver/samples/WOxExtTest/GNUmakefile D sope-appserver/samples/WOxExtTest/GNUmakefile.preamble D sope-appserver/samples/WOxExtTest/ImageFlyover.m D sope-appserver/samples/WOxExtTest/ImageFlyover.wox D sope-appserver/samples/WOxExtTest/KeyValueConditional.m D sope-appserver/samples/WOxExtTest/KeyValueConditional.wox D sope-appserver/samples/WOxExtTest/Lori.icns D sope-appserver/samples/WOxExtTest/Main.m D sope-appserver/samples/WOxExtTest/Main.wox D sope-appserver/samples/WOxExtTest/ModalWindow.m D sope-appserver/samples/WOxExtTest/ModalWindow.wox D sope-appserver/samples/WOxExtTest/MonthOverview.m D sope-appserver/samples/WOxExtTest/MonthOverview.wox D sope-appserver/samples/WOxExtTest/PageView.m D sope-appserver/samples/WOxExtTest/PageView.wox D sope-appserver/samples/WOxExtTest/PanelContent.m D sope-appserver/samples/WOxExtTest/PanelContent.wox D sope-appserver/samples/WOxExtTest/QualifierConditional.m D sope-appserver/samples/WOxExtTest/QualifierConditional.wox D sope-appserver/samples/WOxExtTest/RadioButtonMatrix.m D sope-appserver/samples/WOxExtTest/RadioButtonMatrix.wox D sope-appserver/samples/WOxExtTest/Resources/Dictionary.plist D sope-appserver/samples/WOxExtTest/Resources/TableView.plist D sope-appserver/samples/WOxExtTest/Resources/TreeView.plist D sope-appserver/samples/WOxExtTest/Resources/appointments.plist D sope-appserver/samples/WOxExtTest/RichString.m D sope-appserver/samples/WOxExtTest/RichString.wox D sope-appserver/samples/WOxExtTest/ShiftClick.m D sope-appserver/samples/WOxExtTest/ShiftClick.wox D sope-appserver/samples/WOxExtTest/Switch.m D sope-appserver/samples/WOxExtTest/Switch.wox D sope-appserver/samples/WOxExtTest/TabPanel.m D sope-appserver/samples/WOxExtTest/TabPanel.wox D sope-appserver/samples/WOxExtTest/TabView.m D sope-appserver/samples/WOxExtTest/TabView.wox D sope-appserver/samples/WOxExtTest/Table.m D sope-appserver/samples/WOxExtTest/Table.wox D sope-appserver/samples/WOxExtTest/TableMatrix.m D sope-appserver/samples/WOxExtTest/TableMatrix.wox D sope-appserver/samples/WOxExtTest/TableView.m D sope-appserver/samples/WOxExtTest/TableView.wox D sope-appserver/samples/WOxExtTest/TextFlyover.m D sope-appserver/samples/WOxExtTest/TextFlyover.wox D sope-appserver/samples/WOxExtTest/ThresholdColoredNumber.m D sope-appserver/samples/WOxExtTest/ThresholdColoredNumber.wox D sope-appserver/samples/WOxExtTest/TimeField.m D sope-appserver/samples/WOxExtTest/TimeField.wox D sope-appserver/samples/WOxExtTest/TreeView.m D sope-appserver/samples/WOxExtTest/TreeView.wox D sope-appserver/samples/WOxExtTest/ValidatedField.m D sope-appserver/samples/WOxExtTest/ValidatedField.wox D sope-appserver/samples/WOxExtTest/VarString.wox D sope-appserver/samples/WOxExtTest/WOxExtTest.m D sope-appserver/samples/WOxExtTest/WebServerResources/OGoLogo.gif D sope-appserver/samples/WOxExtTest/WebServerResources/collapsed.gif D sope-appserver/samples/WOxExtTest/WebServerResources/corner_left.gif D sope-appserver/samples/WOxExtTest/WebServerResources/corner_right.gif D sope-appserver/samples/WOxExtTest/WebServerResources/downward_sorted.gif D sope-appserver/samples/WOxExtTest/WebServerResources/expanded.gif D sope-appserver/samples/WOxExtTest/WebServerResources/first.gif D sope-appserver/samples/WOxExtTest/WebServerResources/first_blind.gif D sope-appserver/samples/WOxExtTest/WebServerResources/folder_closed.gif D sope-appserver/samples/WOxExtTest/WebServerResources/folder_opened.gif D sope-appserver/samples/WOxExtTest/WebServerResources/last.gif D sope-appserver/samples/WOxExtTest/WebServerResources/last_blind.gif D sope-appserver/samples/WOxExtTest/WebServerResources/menu_email.gif D sope-appserver/samples/WOxExtTest/WebServerResources/menu_email_inactive.gif D sope-appserver/samples/WOxExtTest/WebServerResources/next.gif D sope-appserver/samples/WOxExtTest/WebServerResources/next_blind.gif D sope-appserver/samples/WOxExtTest/WebServerResources/non_sorted.gif D sope-appserver/samples/WOxExtTest/WebServerResources/previous.gif D sope-appserver/samples/WOxExtTest/WebServerResources/previous_blind.gif D sope-appserver/samples/WOxExtTest/WebServerResources/tab_.gif D sope-appserver/samples/WOxExtTest/WebServerResources/tab_left.gif D sope-appserver/samples/WOxExtTest/WebServerResources/tab_news.gif D sope-appserver/samples/WOxExtTest/WebServerResources/tab_news_left.gif D sope-appserver/samples/WOxExtTest/WebServerResources/tab_news_selected.gif D sope-appserver/samples/WOxExtTest/WebServerResources/tab_persons.gif D sope-appserver/samples/WOxExtTest/WebServerResources/tab_persons_left.gif D sope-appserver/samples/WOxExtTest/WebServerResources/tab_persons_selected.gif D sope-appserver/samples/WOxExtTest/WebServerResources/tab_projects.gif D sope-appserver/samples/WOxExtTest/WebServerResources/tab_projects_left.gif D sope-appserver/samples/WOxExtTest/WebServerResources/tab_projects_selected.gif D sope-appserver/samples/WOxExtTest/WebServerResources/tab_selected.gif D sope-appserver/samples/WOxExtTest/WebServerResources/treeview_corner.gif D sope-appserver/samples/WOxExtTest/WebServerResources/treeview_corner_minus.gif D sope-appserver/samples/WOxExtTest/WebServerResources/treeview_corner_plus.gif D sope-appserver/samples/WOxExtTest/WebServerResources/treeview_junction.gif D sope-appserver/samples/WOxExtTest/WebServerResources/treeview_leaf.gif D sope-appserver/samples/WOxExtTest/WebServerResources/treeview_leaf_corner.gif D sope-appserver/samples/WOxExtTest/WebServerResources/treeview_line.gif D sope-appserver/samples/WOxExtTest/WebServerResources/treeview_minus.gif D sope-appserver/samples/WOxExtTest/WebServerResources/treeview_plus.gif D sope-appserver/samples/WOxExtTest/WebServerResources/treeview_space.gif D sope-appserver/samples/WOxExtTest/WebServerResources/upward_sorted.gif D sope-appserver/samples/WOxExtTest/WeekColumnView.m D sope-appserver/samples/WOxExtTest/WeekColumnView.wox D sope-appserver/samples/WOxExtTest/WeekOverview.m D sope-appserver/samples/WOxExtTest/WeekOverview.wox D sope-appserver/samples/WOxExtTest/common.h D sope-appserver/samples/WOxExtTest/favicon.ico D sope-appserver/samples/WOxExtTest/site.css D sope-appserver/samples/davpropget/GNUmakefile D sope-appserver/samples/davpropget/GNUmakefile.preamble D sope-appserver/samples/davpropget/NOTES D sope-appserver/samples/davpropget/README D sope-appserver/samples/davpropget/common.h D sope-appserver/samples/davpropget/davpropget.m D sope-appserver/samples/iCalPortal/COPYING D sope-appserver/samples/iCalPortal/COPYRIGHT D sope-appserver/samples/iCalPortal/ChangeLog D sope-appserver/samples/iCalPortal/DirectAction.m D sope-appserver/samples/iCalPortal/English.lproj/back.gif D sope-appserver/samples/iCalPortal/English.lproj/back_menu.gif D sope-appserver/samples/iCalPortal/English.lproj/back_menu2.gif D sope-appserver/samples/iCalPortal/English.lproj/back_seite.gif D sope-appserver/samples/iCalPortal/English.lproj/banner_a.gif D sope-appserver/samples/iCalPortal/English.lproj/banner_b.gif D sope-appserver/samples/iCalPortal/English.lproj/banner_c.gif D sope-appserver/samples/iCalPortal/English.lproj/banner_d.gif D sope-appserver/samples/iCalPortal/English.lproj/banner_deutsch.gif D sope-appserver/samples/iCalPortal/English.lproj/banner_e.gif D sope-appserver/samples/iCalPortal/English.lproj/favicon.ico D sope-appserver/samples/iCalPortal/English.lproj/feedback.gif D sope-appserver/samples/iCalPortal/English.lproj/free_hosting.gif D sope-appserver/samples/iCalPortal/English.lproj/line.gif D sope-appserver/samples/iCalPortal/English.lproj/main.strings D sope-appserver/samples/iCalPortal/English.lproj/pixel.gif D sope-appserver/samples/iCalPortal/English.lproj/powered_by_publisher.gif D sope-appserver/samples/iCalPortal/English.lproj/search.gif D sope-appserver/samples/iCalPortal/English.lproj/sidesmiley.gif D sope-appserver/samples/iCalPortal/English.lproj/site.css D sope-appserver/samples/iCalPortal/English.lproj/small.gif D sope-appserver/samples/iCalPortal/English.lproj/submit.gif D sope-appserver/samples/iCalPortal/English.lproj/tab_.gif D sope-appserver/samples/iCalPortal/English.lproj/tab_left.gif D sope-appserver/samples/iCalPortal/English.lproj/tab_selected.gif D sope-appserver/samples/iCalPortal/English.lproj/wp_config.gif D sope-appserver/samples/iCalPortal/English.lproj/wp_create.gif D sope-appserver/samples/iCalPortal/English.lproj/wp_faq.gif D sope-appserver/samples/iCalPortal/English.lproj/wp_feedback.gif D sope-appserver/samples/iCalPortal/English.lproj/wp_info.gif D sope-appserver/samples/iCalPortal/GNUmakefile D sope-appserver/samples/iCalPortal/GNUmakefile.preamble D sope-appserver/samples/iCalPortal/German.lproj/main.strings D sope-appserver/samples/iCalPortal/Pages/GNUmakefile D sope-appserver/samples/iCalPortal/Pages/iCalPortalBaseFrame.m D sope-appserver/samples/iCalPortal/Pages/iCalPortalBaseFrame.wox D sope-appserver/samples/iCalPortal/Pages/iCalPortalBox.m D sope-appserver/samples/iCalPortal/Pages/iCalPortalBox.wox D sope-appserver/samples/iCalPortal/Pages/iCalPortalCalTabs.m D sope-appserver/samples/iCalPortal/Pages/iCalPortalCalTabs.wox D sope-appserver/samples/iCalPortal/Pages/iCalPortalDayOverview.m D sope-appserver/samples/iCalPortal/Pages/iCalPortalDayOverview.wox D sope-appserver/samples/iCalPortal/Pages/iCalPortalFeedbackPage.m D sope-appserver/samples/iCalPortal/Pages/iCalPortalFeedbackPage.wox D sope-appserver/samples/iCalPortal/Pages/iCalPortalFrame.m D sope-appserver/samples/iCalPortal/Pages/iCalPortalFrame.wox D sope-appserver/samples/iCalPortal/Pages/iCalPortalHomePage.m D sope-appserver/samples/iCalPortal/Pages/iCalPortalHomePage.wox D sope-appserver/samples/iCalPortal/Pages/iCalPortalLeftMenu.m D sope-appserver/samples/iCalPortal/Pages/iCalPortalLeftMenu.wox D sope-appserver/samples/iCalPortal/Pages/iCalPortalLicensePage.m D sope-appserver/samples/iCalPortal/Pages/iCalPortalLicensePage.wox D sope-appserver/samples/iCalPortal/Pages/iCalPortalMonthView.m D sope-appserver/samples/iCalPortal/Pages/iCalPortalMonthView.wox D sope-appserver/samples/iCalPortal/Pages/iCalPortalProfilePage.m D sope-appserver/samples/iCalPortal/Pages/iCalPortalProfilePage.wox D sope-appserver/samples/iCalPortal/Pages/iCalPortalRegistrationPage.m D sope-appserver/samples/iCalPortal/Pages/iCalPortalRegistrationPage.wox D sope-appserver/samples/iCalPortal/Pages/iCalPortalRightMenu.m D sope-appserver/samples/iCalPortal/Pages/iCalPortalRightMenu.wox D sope-appserver/samples/iCalPortal/Pages/iCalPortalToDoView.m D sope-appserver/samples/iCalPortal/Pages/iCalPortalToDoView.wox D sope-appserver/samples/iCalPortal/Pages/iCalPortalWeekOverview.m D sope-appserver/samples/iCalPortal/Pages/iCalPortalWeekOverview.wox D sope-appserver/samples/iCalPortal/Pages/iCalPortalWelcomePage.m D sope-appserver/samples/iCalPortal/Pages/iCalPortalWelcomePage.wox D sope-appserver/samples/iCalPortal/README D sope-appserver/samples/iCalPortal/WebDAV/GNUmakefile D sope-appserver/samples/iCalPortal/WebDAV/iCalAction.h D sope-appserver/samples/iCalPortal/WebDAV/iCalAction.m D sope-appserver/samples/iCalPortal/WebDAV/iCalDeleteAction.h D sope-appserver/samples/iCalPortal/WebDAV/iCalDeleteAction.m D sope-appserver/samples/iCalPortal/WebDAV/iCalGetAction.h D sope-appserver/samples/iCalPortal/WebDAV/iCalGetAction.m D sope-appserver/samples/iCalPortal/WebDAV/iCalLockAction.h D sope-appserver/samples/iCalPortal/WebDAV/iCalLockAction.m D sope-appserver/samples/iCalPortal/WebDAV/iCalOptionsAction.h D sope-appserver/samples/iCalPortal/WebDAV/iCalOptionsAction.m D sope-appserver/samples/iCalPortal/WebDAV/iCalPublishAction.h D sope-appserver/samples/iCalPortal/WebDAV/iCalPublishAction.m D sope-appserver/samples/iCalPortal/WebDAV/iCalRequestHandler.h D sope-appserver/samples/iCalPortal/WebDAV/iCalRequestHandler.m D sope-appserver/samples/iCalPortal/common.h D sope-appserver/samples/iCalPortal/db/account.tmpl D sope-appserver/samples/iCalPortal/db/donald/.account.plist D sope-appserver/samples/iCalPortal/db/donald/korg.ics D sope-appserver/samples/iCalPortal/db/donald/mozcal-clean.ics D sope-appserver/samples/iCalPortal/db/donald/mozcal.ics D sope-appserver/samples/iCalPortal/db/donald/shire-cal1.ics D sope-appserver/samples/iCalPortal/db/donald/skytest1.ics D sope-appserver/samples/iCalPortal/db/donald/skytest2.ics D sope-appserver/samples/iCalPortal/iCalDayView.h D sope-appserver/samples/iCalPortal/iCalDayView.m D sope-appserver/samples/iCalPortal/iCalPortal.h D sope-appserver/samples/iCalPortal/iCalPortal.m D sope-appserver/samples/iCalPortal/iCalPortalCalendar.h D sope-appserver/samples/iCalPortal/iCalPortalCalendar.m D sope-appserver/samples/iCalPortal/iCalPortalDatabase.h D sope-appserver/samples/iCalPortal/iCalPortalDatabase.m D sope-appserver/samples/iCalPortal/iCalPortalPage.h D sope-appserver/samples/iCalPortal/iCalPortalPage.m D sope-appserver/samples/iCalPortal/iCalPortalUser.h D sope-appserver/samples/iCalPortal/iCalPortalUser.m D sope-appserver/samples/iCalPortal/iCalView.h D sope-appserver/samples/iCalPortal/iCalView.m D sope-appserver/samples/iCalPortal/iCalWeekView.h D sope-appserver/samples/iCalPortal/iCalWeekView.m D sope-appserver/samples/iCalPortal/icons.make D sope-appserver/samples/iCalPortal/mkpage.sh D sope-appserver/samples/parsedav/DAVParserTest.h D sope-appserver/samples/parsedav/DAVParserTest.m D sope-appserver/samples/parsedav/GNUmakefile D sope-appserver/samples/parsedav/GNUmakefile.preamble D sope-appserver/samples/parsedav/README D sope-appserver/samples/parsedav/common.h D sope-appserver/samples/parsedav/data/propupt1.xml D sope-appserver/samples/parsedav/parsedav.m D sope-appserver/samples/xmlrpc/GNUmakefile D sope-appserver/samples/xmlrpc/NGBloggerClient.h D sope-appserver/samples/xmlrpc/NGBloggerClient.m D sope-appserver/samples/xmlrpc/blogger_zidestore.m D sope-appserver/samples/xmlrpc/common.h D sope-appserver/samples/xmlrpc/meerkat_xml_channels.m D sope-core/samples/COPYING D sope-core/samples/ChangeLog D sope-core/samples/EOQualTool.h D sope-core/samples/EOQualTool.m D sope-core/samples/EncodingTool.h D sope-core/samples/EncodingTool.m D sope-core/samples/GNUmakefile D sope-core/samples/GNUmakefile.preamble D sope-core/samples/README D sope-core/samples/bmlookup.m D sope-core/samples/common.h D sope-core/samples/encoding.m D sope-core/samples/eoqual.m D sope-core/samples/fhs.make D sope-core/samples/fmdls.m D sope-core/samples/httpu_notify.m D sope-core/samples/ngcal.m D sope-core/samples/parserule.m D sope-core/samples/sope-rsrclookup.m D sope-core/samples/subclassing.m D sope-core/samples/testdirenum.m D sope-core/samples/testsock.m D sope-core/samples/testurl.m D sope-ldap/samples/COPYING D sope-ldap/samples/ChangeLog D sope-ldap/samples/GNUmakefile D sope-ldap/samples/GNUmakefile.preamble D sope-ldap/samples/README D sope-ldap/samples/common.h D sope-ldap/samples/fhs.make D sope-ldap/samples/ldap2dsml.m D sope-ldap/samples/ldapchkpwd.m D sope-ldap/samples/ldapls.m D sope-ldap/samples/pwd-check.m D sope-mime/samples/COPYING D sope-mime/samples/ChangeLog D sope-mime/samples/GNUmakefile D sope-mime/samples/GNUmakefile.preamble D sope-mime/samples/ImapListTool.h D sope-mime/samples/ImapListTool.m D sope-mime/samples/ImapQuotaTool.h D sope-mime/samples/ImapQuotaTool.m D sope-mime/samples/ImapTool.h D sope-mime/samples/ImapTool.m D sope-mime/samples/Mime2XmlTool.h D sope-mime/samples/Mime2XmlTool.m D sope-mime/samples/README D sope-mime/samples/data/bug883_at205.mail D sope-mime/samples/fhs.make D sope-mime/samples/imap_tool.m D sope-mime/samples/imapacl.m D sope-mime/samples/imapcontest.m D sope-mime/samples/imapls.m D sope-mime/samples/imapquota.m D sope-mime/samples/mime2xml.m D sope-mime/samples/sievetool.m D sope-mime/samples/test_qpdecode.m D sope-xml/samples/ChangeLog D sope-xml/samples/GNUmakefile D sope-xml/samples/GNUmakefile.preamble D sope-xml/samples/PlistSaxDriver/GNUmakefile D sope-xml/samples/PlistSaxDriver/PlistSaxDriver.m D sope-xml/samples/PlistSaxDriver/README D sope-xml/samples/PlistSaxDriver/bundle-info.plist D sope-xml/samples/README D sope-xml/samples/common.h D sope-xml/samples/data/Main.xtmpl D sope-xml/samples/data/skyrix-xml.xml D sope-xml/samples/data/slashdot.rss D sope-xml/samples/data/test-digit.xml D sope-xml/samples/domxml.m D sope-xml/samples/fhs.make D sope-xml/samples/rss2plist1.m D sope-xml/samples/rss2plist2.m D sope-xml/samples/rssparse.m D sope-xml/samples/rssparse.xmap D sope-xml/samples/saxxml.m D sope-xml/samples/testqp.m D sope-xml/samples/xmln.m commit d251060523a9d95e55f6b1263f64acdbe9f4feff Author: Ludovic Marcotte Date: Thu Jul 29 18:31:02 2010 +0000 Dropped even more crap Monotone-Parent: 9bcb2bf0639d76277b95a768b2586a6eda1a87ec Monotone-Revision: 592f1af929791fbdc8780afe81d8021d7c6fdd73 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2010-07-29T18:31:02 Monotone-Branch: ca.inverse.sope M GNUmakefile D INSTALL D README D TODO.txt D maintenance/ChangeLog D maintenance/License.rtf D maintenance/Welcome.rtf D maintenance/changes-4.3.7-to-4.3.8.txt D maintenance/changes-4.3.8-to-4.3.9.txt D maintenance/changes-4.3.9-to-4.3.10.txt D maintenance/changes-4.3.9-to-4.5a.1.txt D maintenance/changes-4.5.10-to-4.7.1.txt D maintenance/changes-4.5.4-to-4.5.5.txt D maintenance/changes-4.5.5-to-4.5.6.txt D maintenance/changes-4.5.6-to-4.5.7.txt D maintenance/changes-4.5.7-to-4.5.8.txt D maintenance/changes-4.5.8-to-4.5.9.txt D maintenance/changes-4.5.9-to-4.5.10.txt D maintenance/changes-4.5a.1-to-4.5a.2.txt D maintenance/changes-4.5a.2-to-4.5a.3.txt D maintenance/changes-4.5a.3-to-4.5a.4.txt D maintenance/changes-to-4.2pre.txt D maintenance/changes-to-4.3.1.txt D maintenance/changes-to-4.3.6.txt D maintenance/dummytool.c D maintenance/dummytool.m D maintenance/make-osxdmg.sh D maintenance/make-osxmpkg.sh D maintenance/make-osxpkg.sh D maintenance/mod_ngobjweb_centos43.spec D maintenance/mod_ngobjweb_conectiva10.spec D maintenance/mod_ngobjweb_fedora.spec D maintenance/mod_ngobjweb_mdk100.spec D maintenance/mod_ngobjweb_mdk101.spec D maintenance/mod_ngobjweb_redhat9.spec D maintenance/mod_ngobjweb_rhel3.spec D maintenance/mod_ngobjweb_rhel4.spec D maintenance/mod_ngobjweb_sles9.spec D maintenance/mod_ngobjweb_slss8.spec D maintenance/mod_ngobjweb_suse100.spec D maintenance/mod_ngobjweb_suse101.spec D maintenance/mod_ngobjweb_suse82.spec D maintenance/mod_ngobjweb_suse91.spec D maintenance/mod_ngobjweb_suse92.spec D maintenance/mod_ngobjweb_suse93.spec D maintenance/package-background.tiff D maintenance/package_background.tiff D maintenance/rm-sope-on-osxlib.sh D maintenance/sope-fixcopyright.sh D maintenance/sope.spec D maintenance/syncXcodeVersions.sh D maintenance/znek-fix-xcode-projects.sh D sope-ical/ChangeLog D sope-ical/GNUmakefile D sope-ical/NGiCal/COPYING D sope-ical/NGiCal/COPYRIGHT D sope-ical/NGiCal/ChangeLog D sope-ical/NGiCal/GNUmakefile D sope-ical/NGiCal/GNUmakefile.postamble D sope-ical/NGiCal/GNUmakefile.preamble D sope-ical/NGiCal/IcalElements.m D sope-ical/NGiCal/IcalResponse.h D sope-ical/NGiCal/IcalResponse.m D sope-ical/NGiCal/NGICalSaxHandler.h D sope-ical/NGiCal/NGICalSaxHandler.m D sope-ical/NGiCal/NGVCard.h D sope-ical/NGiCal/NGVCard.m D sope-ical/NGiCal/NGVCardAddress.h D sope-ical/NGiCal/NGVCardAddress.m D sope-ical/NGiCal/NGVCardName.h D sope-ical/NGiCal/NGVCardName.m D sope-ical/NGiCal/NGVCardOrg.h D sope-ical/NGiCal/NGVCardOrg.m D sope-ical/NGiCal/NGVCardPhone.h D sope-ical/NGiCal/NGVCardPhone.m D sope-ical/NGiCal/NGVCardSaxHandler.h D sope-ical/NGiCal/NGVCardSaxHandler.m D sope-ical/NGiCal/NGVCardSimpleValue.h D sope-ical/NGiCal/NGVCardSimpleValue.m D sope-ical/NGiCal/NGVCardStrArrayValue.h D sope-ical/NGiCal/NGVCardStrArrayValue.m D sope-ical/NGiCal/NGVCardValue.h D sope-ical/NGiCal/NGVCardValue.m D sope-ical/NGiCal/NGiCal-Info.plist D sope-ical/NGiCal/NGiCal.h D sope-ical/NGiCal/NGiCal.xmap D sope-ical/NGiCal/NSCalendarDate+ICal.h D sope-ical/NGiCal/NSCalendarDate+ICal.m D sope-ical/NGiCal/NSString+ICal.h D sope-ical/NGiCal/NSString+ICal.m D sope-ical/NGiCal/README D sope-ical/NGiCal/Version D sope-ical/NGiCal/common.h D sope-ical/NGiCal/fhs.make D sope-ical/NGiCal/iCalAlarm.h D sope-ical/NGiCal/iCalAlarm.m D sope-ical/NGiCal/iCalAttachment.h D sope-ical/NGiCal/iCalAttachment.m D sope-ical/NGiCal/iCalCalendar.h D sope-ical/NGiCal/iCalCalendar.m D sope-ical/NGiCal/iCalDailyRecurrenceCalculator.m D sope-ical/NGiCal/iCalDataSource.h D sope-ical/NGiCal/iCalDataSource.m D sope-ical/NGiCal/iCalDateHolder.h D sope-ical/NGiCal/iCalDateHolder.m D sope-ical/NGiCal/iCalDuration.h D sope-ical/NGiCal/iCalDuration.m D sope-ical/NGiCal/iCalEntityObject.h D sope-ical/NGiCal/iCalEntityObject.m D sope-ical/NGiCal/iCalEvent.h D sope-ical/NGiCal/iCalEvent.m D sope-ical/NGiCal/iCalEventChanges.h D sope-ical/NGiCal/iCalEventChanges.m D sope-ical/NGiCal/iCalFreeBusy.h D sope-ical/NGiCal/iCalFreeBusy.m D sope-ical/NGiCal/iCalJournal.h D sope-ical/NGiCal/iCalJournal.m D sope-ical/NGiCal/iCalMonthlyRecurrenceCalculator.m D sope-ical/NGiCal/iCalObject.h D sope-ical/NGiCal/iCalObject.m D sope-ical/NGiCal/iCalPerson.h D sope-ical/NGiCal/iCalPerson.m D sope-ical/NGiCal/iCalRecurrenceCalculator.h D sope-ical/NGiCal/iCalRecurrenceCalculator.m D sope-ical/NGiCal/iCalRecurrenceRule.h D sope-ical/NGiCal/iCalRecurrenceRule.m D sope-ical/NGiCal/iCalRenderer.h D sope-ical/NGiCal/iCalRenderer.m D sope-ical/NGiCal/iCalRepeatableEntityObject.h D sope-ical/NGiCal/iCalRepeatableEntityObject.m D sope-ical/NGiCal/iCalToDo.h D sope-ical/NGiCal/iCalToDo.m D sope-ical/NGiCal/iCalTrigger.h D sope-ical/NGiCal/iCalTrigger.m D sope-ical/NGiCal/iCalWeeklyRecurrenceCalculator.m D sope-ical/NGiCal/iCalYearlyRecurrenceCalculator.m D sope-ical/NGiCal/tests/NGiCalTests-Info.plist D sope-ical/NGiCal/tests/README D sope-ical/NGiCal/tests/common.h D sope-ical/NGiCal/tests/iCalRecurrenceCalculatorTests.m D sope-ical/README D sope-ical/README-OSX.txt D sope-ical/data/apple-fullrecord.vcf D sope-ical/data/chandler4979-trumba-tz1.ics D sope-ical/data/evo22-fullrecord.vcf D sope-ical/data/evo22-fulltask.ics D sope-ical/data/evo26-bug1714-wrapline-1.ics D sope-ical/data/evo26-multilinefields1-bug1714.ics D sope-ical/data/inv-simple1.vcf D sope-ical/data/kab41-vcard-full.vcf D sope-ical/data/kabc34-fullrecord.vcf D sope-ical/data/kde-vcard-bug1594.vcf D sope-ical/data/kde-vcard1.vcf D sope-ical/data/kde-vcard2-ns.vcf D sope-ical/data/kde-vcard3-moz.vcf D sope-ical/data/kde-vcard4-evo.vcf D sope-ical/data/kde-vcard5.vcf D sope-ical/data/kde-vcard6.vcf D sope-ical/data/kolab-contact-AWsUn40yOr.eml D sope-ical/data/kolab-event-libkcal-1899114701.872.eml D sope-ical/data/kolab-todo-libkcal-595002338.801.eml D sope-ical/data/korg-342-meeting.ics D sope-ical/data/korg-allday-bug1585.ics D sope-ical/data/korg34-fulltask.ics D sope-ical/data/outlook2002.vcf D sope-ical/data/synthesis-syncml1.xml D sope-ical/data/tb203-full-John_Doe.vcf D sope-ical/data/test-noodle1.ics D sope-ical/data/test1-libical.txt D sope-ical/data/test1.ics D sope-ical/data/test2-libical.txt D sope-ical/data/test2.vfb D sope-ical/data/test3-libical.txt D sope-ical/data/test3.ics D sope-ical/data/test4-libical.txt D sope-ical/data/test4.ics D sope-ical/data/test5-entourage.ics D sope-ical/data/test5-libical.txt D sope-ical/data/test6-appleical.ics D sope-ical/data/test6-libical.txt D sope-ical/samples/COPYING D sope-ical/samples/ChangeLog D sope-ical/samples/GNUmakefile D sope-ical/samples/GNUmakefile.preamble D sope-ical/samples/README D sope-ical/samples/common.h D sope-ical/samples/fhs.make D sope-ical/samples/icalds.m D sope-ical/samples/icalparsetest.m D sope-ical/samples/ievalrrule.m D sope-ical/samples/vcf2xml.m D sope-ical/samples/vcfparsetest.m D sope-ical/versitSaxDriver/AUTHORS D sope-ical/versitSaxDriver/COPYING D sope-ical/versitSaxDriver/COPYRIGHT D sope-ical/versitSaxDriver/ChangeLog D sope-ical/versitSaxDriver/GNUmakefile D sope-ical/versitSaxDriver/GNUmakefile.postamble D sope-ical/versitSaxDriver/GNUmakefile.preamble D sope-ical/versitSaxDriver/README D sope-ical/versitSaxDriver/VSSaxDriver.h D sope-ical/versitSaxDriver/VSSaxDriver.m D sope-ical/versitSaxDriver/VSStringFormatter.h D sope-ical/versitSaxDriver/VSStringFormatter.m D sope-ical/versitSaxDriver/VSiCalSaxDriver.h D sope-ical/versitSaxDriver/VSiCalSaxDriver.m D sope-ical/versitSaxDriver/VSvCardSaxDriver.h D sope-ical/versitSaxDriver/VSvCardSaxDriver.m D sope-ical/versitSaxDriver/Version D sope-ical/versitSaxDriver/bundle-info.plist D sope-ical/versitSaxDriver/common.h D sope-ical/versitSaxDriver/fhs.make D sope-ical/versitSaxDriver/versitSaxDriver-Info.plist D sopex/COPYING D sopex/COPYRIGHT D sopex/ChangeLog D sopex/GNUmakefile D sopex/PROJECTLEAD D sopex/README D sopex/README-WebObjects D sopex/SOPEX/CHANGES D sopex/SOPEX/COPYING D sopex/SOPEX/COPYRIGHT D sopex/SOPEX/ChangeLog D sopex/SOPEX/Clean.tiff D sopex/SOPEX/English.lproj/InfoPlist.strings D sopex/SOPEX/English.lproj/Localizable.strings D sopex/SOPEX/English.lproj/SOPEXBrowserController.nib/classes.nib D sopex/SOPEX/English.lproj/SOPEXBrowserController.nib/info.nib D sopex/SOPEX/English.lproj/SOPEXBrowserController.nib/keyedobjects.nib D sopex/SOPEX/English.lproj/SOPEXConsole.nib/classes.nib D sopex/SOPEX/English.lproj/SOPEXConsole.nib/info.nib D sopex/SOPEX/English.lproj/SOPEXConsole.nib/keyedobjects.nib D sopex/SOPEX/English.lproj/SOPEXConsole.toolbar D sopex/SOPEX/English.lproj/SOPEXStatisticsNatLang.plist D sopex/SOPEX/English.lproj/SOPEXStats.nib/classes.nib D sopex/SOPEX/English.lproj/SOPEXStats.nib/info.nib D sopex/SOPEX/English.lproj/SOPEXStats.nib/keyedobjects.nib D sopex/SOPEX/English.lproj/SOPEXWebUI.toolbar D sopex/SOPEX/GNUmakefile D sopex/SOPEX/GNUmakefile.preamble D sopex/SOPEX/Info.plist D sopex/SOPEX/Lori.icns D sopex/SOPEX/NSBundle+Ext.h D sopex/SOPEX/NSBundle+Ext.m D sopex/SOPEX/NSString+Ext.h D sopex/SOPEX/NSString+Ext.m D sopex/SOPEX/PROJECTLEAD D sopex/SOPEX/README D sopex/SOPEX/Reload.tiff D sopex/SOPEX/SOPEX.h D sopex/SOPEX/SOPEXAppController.h D sopex/SOPEX/SOPEXAppController.m D sopex/SOPEX/SOPEXAuthPanel.h D sopex/SOPEX/SOPEXAuthPanel.m D sopex/SOPEX/SOPEXBrowserController.h D sopex/SOPEX/SOPEXBrowserController.m D sopex/SOPEX/SOPEXBrowserWindow.h D sopex/SOPEX/SOPEXBrowserWindow.m D sopex/SOPEX/SOPEXConsole.h D sopex/SOPEX/SOPEXConsole.m D sopex/SOPEX/SOPEXConsoleAppender.m D sopex/SOPEX/SOPEXConsoleEventFormatter.m D sopex/SOPEX/SOPEXConstants.h D sopex/SOPEX/SOPEXConstants.m D sopex/SOPEX/SOPEXContentValidator.h D sopex/SOPEX/SOPEXContentValidator.m D sopex/SOPEX/SOPEXDocument.h D sopex/SOPEX/SOPEXDocument.m D sopex/SOPEX/SOPEXMain.h D sopex/SOPEX/SOPEXMain.m D sopex/SOPEX/SOPEXRangeUtilities.h D sopex/SOPEX/SOPEXRangeUtilities.m D sopex/SOPEX/SOPEXSheetRunner.h D sopex/SOPEX/SOPEXSheetRunner.m D sopex/SOPEX/SOPEXStatisticsController.h D sopex/SOPEX/SOPEXStatisticsController.m D sopex/SOPEX/SOPEXTextView.h D sopex/SOPEX/SOPEXTextView.m D sopex/SOPEX/SOPEXToolbarController.h D sopex/SOPEX/SOPEXToolbarController.m D sopex/SOPEX/SOPEXWODocument.h D sopex/SOPEX/SOPEXWODocument.m D sopex/SOPEX/SOPEXWOXDocument.h D sopex/SOPEX/SOPEXWOXDocument.m D sopex/SOPEX/SOPEXWebConnection.h D sopex/SOPEX/SOPEXWebConnection.m D sopex/SOPEX/SOPEXWebMetaParser.h D sopex/SOPEX/SOPEXWebMetaParser.m D sopex/SOPEX/TODO D sopex/SOPEX/Version D sopex/SOPEX/WebView+Ext.h D sopex/SOPEX/WebView+Ext.m D sopex/SOPEX/common.h D sopex/SOPEX/version.plist D sopex/Samples/ChangeLog D sopex/Samples/WOxExtTest/AlertPanel.m D sopex/Samples/WOxExtTest/AlertPanel.wox D sopex/Samples/WOxExtTest/Application.h D sopex/Samples/WOxExtTest/Application.m D sopex/Samples/WOxExtTest/Browser.m D sopex/Samples/WOxExtTest/Browser.wox D sopex/Samples/WOxExtTest/CalendarField.m D sopex/Samples/WOxExtTest/CalendarField.wox D sopex/Samples/WOxExtTest/CheckBoxMatrix.m D sopex/Samples/WOxExtTest/CheckBoxMatrix.wox D sopex/Samples/WOxExtTest/CollapsibleContent.m D sopex/Samples/WOxExtTest/CollapsibleContent.wox D sopex/Samples/WOxExtTest/CollapsibleContentExt.m D sopex/Samples/WOxExtTest/CollapsibleContentExt.wox D sopex/Samples/WOxExtTest/ConfirmPanel.m D sopex/Samples/WOxExtTest/ConfirmPanel.wox D sopex/Samples/WOxExtTest/DateField.m D sopex/Samples/WOxExtTest/DateField.wox D sopex/Samples/WOxExtTest/Dictionary.plist D sopex/Samples/WOxExtTest/DictionaryRepetition.m D sopex/Samples/WOxExtTest/DictionaryRepetition.wox D sopex/Samples/WOxExtTest/DirectAction.h D sopex/Samples/WOxExtTest/DirectAction.m D sopex/Samples/WOxExtTest/DnD.m D sopex/Samples/WOxExtTest/DnD.wox D sopex/Samples/WOxExtTest/English.lproj/InfoPlist.strings D sopex/Samples/WOxExtTest/English.lproj/MainMenu.nib/classes.nib D sopex/Samples/WOxExtTest/English.lproj/MainMenu.nib/info.nib D sopex/Samples/WOxExtTest/English.lproj/MainMenu.nib/keyedobjects.nib D sopex/Samples/WOxExtTest/Frame.m D sopex/Samples/WOxExtTest/Frame.wox D sopex/Samples/WOxExtTest/ImageFlyover.m D sopex/Samples/WOxExtTest/ImageFlyover.wox D sopex/Samples/WOxExtTest/Info.plist D sopex/Samples/WOxExtTest/KeyValueConditional.m D sopex/Samples/WOxExtTest/KeyValueConditional.wox D sopex/Samples/WOxExtTest/Lori.icns D sopex/Samples/WOxExtTest/Main.m D sopex/Samples/WOxExtTest/Main.wox D sopex/Samples/WOxExtTest/ModalWindow.m D sopex/Samples/WOxExtTest/ModalWindow.wox D sopex/Samples/WOxExtTest/MonthOverview.m D sopex/Samples/WOxExtTest/MonthOverview.wox D sopex/Samples/WOxExtTest/PageView.m D sopex/Samples/WOxExtTest/PageView.wox D sopex/Samples/WOxExtTest/QualifierConditional.m D sopex/Samples/WOxExtTest/QualifierConditional.wox D sopex/Samples/WOxExtTest/README D sopex/Samples/WOxExtTest/RadioButtonMatrix.m D sopex/Samples/WOxExtTest/RadioButtonMatrix.wox D sopex/Samples/WOxExtTest/RichString.m D sopex/Samples/WOxExtTest/RichString.wox D sopex/Samples/WOxExtTest/Session.h D sopex/Samples/WOxExtTest/Session.m D sopex/Samples/WOxExtTest/ShiftClick.m D sopex/Samples/WOxExtTest/ShiftClick.wox D sopex/Samples/WOxExtTest/Switch.m D sopex/Samples/WOxExtTest/Switch.wox D sopex/Samples/WOxExtTest/TabPanel.m D sopex/Samples/WOxExtTest/TabPanel.wox D sopex/Samples/WOxExtTest/TabView.m D sopex/Samples/WOxExtTest/TabView.wox D sopex/Samples/WOxExtTest/Table.m D sopex/Samples/WOxExtTest/Table.wox D sopex/Samples/WOxExtTest/TableMatrix.m D sopex/Samples/WOxExtTest/TableMatrix.wox D sopex/Samples/WOxExtTest/TableView.m D sopex/Samples/WOxExtTest/TableView.plist D sopex/Samples/WOxExtTest/TableView.wox D sopex/Samples/WOxExtTest/TextFlyover.m D sopex/Samples/WOxExtTest/TextFlyover.wox D sopex/Samples/WOxExtTest/ThresholdColoredNumber.m D sopex/Samples/WOxExtTest/ThresholdColoredNumber.wox D sopex/Samples/WOxExtTest/TimeField.m D sopex/Samples/WOxExtTest/TimeField.wox D sopex/Samples/WOxExtTest/TreeView.m D sopex/Samples/WOxExtTest/TreeView.plist D sopex/Samples/WOxExtTest/TreeView.wox D sopex/Samples/WOxExtTest/ValidatedField.m D sopex/Samples/WOxExtTest/ValidatedField.wox D sopex/Samples/WOxExtTest/VarString.wox D sopex/Samples/WOxExtTest/WOExtTest_main.m D sopex/Samples/WOxExtTest/WebServerResources/OGoLogo.gif D sopex/Samples/WOxExtTest/WebServerResources/collapsed.gif D sopex/Samples/WOxExtTest/WebServerResources/corner_left.gif D sopex/Samples/WOxExtTest/WebServerResources/corner_right.gif D sopex/Samples/WOxExtTest/WebServerResources/downward_sorted.gif D sopex/Samples/WOxExtTest/WebServerResources/expanded.gif D sopex/Samples/WOxExtTest/WebServerResources/favicon.ico D sopex/Samples/WOxExtTest/WebServerResources/first.gif D sopex/Samples/WOxExtTest/WebServerResources/first_blind.gif D sopex/Samples/WOxExtTest/WebServerResources/folder_closed.gif D sopex/Samples/WOxExtTest/WebServerResources/folder_opened.gif D sopex/Samples/WOxExtTest/WebServerResources/last.gif D sopex/Samples/WOxExtTest/WebServerResources/last_blind.gif D sopex/Samples/WOxExtTest/WebServerResources/menu_email.gif D sopex/Samples/WOxExtTest/WebServerResources/menu_email_inactive.gif D sopex/Samples/WOxExtTest/WebServerResources/next.gif D sopex/Samples/WOxExtTest/WebServerResources/next_blind.gif D sopex/Samples/WOxExtTest/WebServerResources/non_sorted.gif D sopex/Samples/WOxExtTest/WebServerResources/previous.gif D sopex/Samples/WOxExtTest/WebServerResources/previous_blind.gif D sopex/Samples/WOxExtTest/WebServerResources/site.css D sopex/Samples/WOxExtTest/WebServerResources/tab_.gif D sopex/Samples/WOxExtTest/WebServerResources/tab_left.gif D sopex/Samples/WOxExtTest/WebServerResources/tab_news.gif D sopex/Samples/WOxExtTest/WebServerResources/tab_news_left.gif D sopex/Samples/WOxExtTest/WebServerResources/tab_news_selected.gif D sopex/Samples/WOxExtTest/WebServerResources/tab_persons.gif D sopex/Samples/WOxExtTest/WebServerResources/tab_persons_left.gif D sopex/Samples/WOxExtTest/WebServerResources/tab_persons_selected.gif D sopex/Samples/WOxExtTest/WebServerResources/tab_projects.gif D sopex/Samples/WOxExtTest/WebServerResources/tab_projects_left.gif D sopex/Samples/WOxExtTest/WebServerResources/tab_projects_selected.gif D sopex/Samples/WOxExtTest/WebServerResources/tab_selected.gif D sopex/Samples/WOxExtTest/WebServerResources/treeview_corner.gif D sopex/Samples/WOxExtTest/WebServerResources/treeview_corner_minus.gif D sopex/Samples/WOxExtTest/WebServerResources/treeview_corner_plus.gif D sopex/Samples/WOxExtTest/WebServerResources/treeview_junction.gif D sopex/Samples/WOxExtTest/WebServerResources/treeview_leaf.gif D sopex/Samples/WOxExtTest/WebServerResources/treeview_leaf_corner.gif D sopex/Samples/WOxExtTest/WebServerResources/treeview_line.gif D sopex/Samples/WOxExtTest/WebServerResources/treeview_minus.gif D sopex/Samples/WOxExtTest/WebServerResources/treeview_plus.gif D sopex/Samples/WOxExtTest/WebServerResources/treeview_space.gif D sopex/Samples/WOxExtTest/WebServerResources/upward_sorted.gif D sopex/Samples/WOxExtTest/WeekColumnView.m D sopex/Samples/WOxExtTest/WeekColumnView.wox D sopex/Samples/WOxExtTest/WeekOverview.m D sopex/Samples/WOxExtTest/WeekOverview.wox D sopex/Samples/WOxExtTest/appointments.plist D sopex/Samples/WOxExtTest/common.h D sopex/Samples/WOxExtTest/version.plist D sopex/Templates/ChangeLog D sopex/Templates/File Templates/SOPE/Web Component (wo).pbfiletemplate/TemplateInfo.plist D sopex/Templates/File Templates/SOPE/Web Component (wo).pbfiletemplate/wo.h D sopex/Templates/File Templates/SOPE/Web Component (wo).pbfiletemplate/wo.html D sopex/Templates/File Templates/SOPE/Web Component (wo).pbfiletemplate/wo.m D sopex/Templates/File Templates/SOPE/Web Component (wo).pbfiletemplate/wo.wod D sopex/Templates/File Templates/SOPE/Web Component (wox).pbfiletemplate/TemplateInfo.plist D sopex/Templates/File Templates/SOPE/Web Component (wox).pbfiletemplate/wox.h D sopex/Templates/File Templates/SOPE/Web Component (wox).pbfiletemplate/wox.m D sopex/Templates/File Templates/SOPE/Web Component (wox).pbfiletemplate/wox.wox D sopex/Templates/Project Templates/SOPE/Web Application (WOx)/Application.h D sopex/Templates/Project Templates/SOPE/Web Application (WOx)/Application.m D sopex/Templates/Project Templates/SOPE/Web Application (WOx)/COPYING D sopex/Templates/Project Templates/SOPE/Web Application (WOx)/COPYRIGHT D sopex/Templates/Project Templates/SOPE/Web Application (WOx)/ChangeLog D sopex/Templates/Project Templates/SOPE/Web Application (WOx)/DirectAction.h D sopex/Templates/Project Templates/SOPE/Web Application (WOx)/DirectAction.m D sopex/Templates/Project Templates/SOPE/Web Application (WOx)/English.lproj/InfoPlist.strings D sopex/Templates/Project Templates/SOPE/Web Application (WOx)/English.lproj/MainMenu.nib/classes.nib D sopex/Templates/Project Templates/SOPE/Web Application (WOx)/English.lproj/MainMenu.nib/info.nib D sopex/Templates/Project Templates/SOPE/Web Application (WOx)/English.lproj/MainMenu.nib/keyedobjects.nib D sopex/Templates/Project Templates/SOPE/Web Application (WOx)/GNUmakefile D sopex/Templates/Project Templates/SOPE/Web Application (WOx)/GNUmakefile.postamble D sopex/Templates/Project Templates/SOPE/Web Application (WOx)/GNUmakefile.preamble D sopex/Templates/Project Templates/SOPE/Web Application (WOx)/Info.plist D sopex/Templates/Project Templates/SOPE/Web Application (WOx)/Lori.icns D sopex/Templates/Project Templates/SOPE/Web Application (WOx)/Main.m D sopex/Templates/Project Templates/SOPE/Web Application (WOx)/Main.wox D sopex/Templates/Project Templates/SOPE/Web Application (WOx)/NOTES D sopex/Templates/Project Templates/SOPE/Web Application (WOx)/PROJECTLEAD D sopex/Templates/Project Templates/SOPE/Web Application (WOx)/README D sopex/Templates/Project Templates/SOPE/Web Application (WOx)/Session.h D sopex/Templates/Project Templates/SOPE/Web Application (WOx)/Session.m D sopex/Templates/Project Templates/SOPE/Web Application (WOx)/TODO D sopex/Templates/Project Templates/SOPE/Web Application (WOx)/Version D sopex/Templates/Project Templates/SOPE/Web Application (WOx)/WebApp.xcode/TemplateInfo.plist D sopex/Templates/Project Templates/SOPE/Web Application (WOx)/WebApp.xcode/project.pbxproj D sopex/Templates/Project Templates/SOPE/Web Application (WOx)/WebApp_main.m D sopex/Templates/Project Templates/SOPE/Web Application (WOx)/WebServerResources/favicon.ico D sopex/Templates/Project Templates/SOPE/Web Application (WOx)/common.h D sopex/Templates/Project Templates/SOPE/Web Application (WOx)/version.plist D sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/Application.h D sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/Application.m D sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/COPYING D sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/COPYRIGHT D sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/ChangeLog D sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/DirectAction.h D sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/DirectAction.m D sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/English.lproj/InfoPlist.strings D sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/English.lproj/MainMenu.nib/classes.nib D sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/English.lproj/MainMenu.nib/info.nib D sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/English.lproj/MainMenu.nib/keyedobjects.nib D sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/GNUmakefile D sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/GNUmakefile.postamble D sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/GNUmakefile.preamble D sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/Info.plist D sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/Lori.icns D sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/Main.m D sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/Main.wo/Main.api D sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/Main.wo/Main.html D sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/Main.wo/Main.wod D sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/Main.wo/Main.woo D sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/NOTES D sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/PROJECTLEAD D sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/README D sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/Session.h D sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/Session.m D sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/TODO D sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/Version D sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/WebApp.xcode/TemplateInfo.plist D sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/WebApp.xcode/project.pbxproj D sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/WebApp_main.m D sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/WebServerResources/favicon.ico D sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/common.h D sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/version.plist D sopex/Templates/README D sopex/WebObjects/COPYING D sopex/WebObjects/COPYRIGHT D sopex/WebObjects/ChangeLog D sopex/WebObjects/English.lproj/InfoPlist.strings D sopex/WebObjects/GNUmakefile D sopex/WebObjects/INSTALL D sopex/WebObjects/Info.plist D sopex/WebObjects/PROJECTLEAD D sopex/WebObjects/README D sopex/WebObjects/Version D sopex/WebObjects/WebObjects.h D sopex/WebObjects/main.c D sopex/WebObjects/version.plist D xcconfig/Common.xcconfig D xcconfig/Development.xcconfig D xcconfig/Wrapper.xcconfig commit 038b1c607481b8b6ab1e4a125eaf1bf68d403e6b Author: Ludovic Marcotte Date: Thu Jul 29 18:27:44 2010 +0000 See ChangeLog Monotone-Parent: 4408649e520f6bcf86ac267f33864c565cc9e03d Monotone-Revision: 9bcb2bf0639d76277b95a768b2586a6eda1a87ec Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2010-07-29T18:27:44 Monotone-Branch: ca.inverse.sope M ChangeLog M GNUmakefile D PROJECTLEAD D README-OSX.txt D Recycler/ApacheWO/.cvsignore D Recycler/ApacheWO/20040608 D Recycler/ApacheWO/AWODirectoryConfig.h D Recycler/ApacheWO/AWODirectoryConfig.m D Recycler/ApacheWO/AWOServerConfig.h D Recycler/ApacheWO/AWOServerConfig.m D Recycler/ApacheWO/AliasMap.h D Recycler/ApacheWO/AliasMap.m D Recycler/ApacheWO/ApacheCommands.plist D Recycler/ApacheWO/ApacheHandlers.plist D Recycler/ApacheWO/ApacheResourceManager.h D Recycler/ApacheWO/ApacheResourceManager.m D Recycler/ApacheWO/ApacheWO+Echo.m D Recycler/ApacheWO/ApacheWO+Echo2.m D Recycler/ApacheWO/ApacheWO+RequestHandler.m D Recycler/ApacheWO/ApacheWO+hooks.m D Recycler/ApacheWO/ApacheWO+woxpage.m D Recycler/ApacheWO/ApacheWO.h D Recycler/ApacheWO/ApacheWO.m D Recycler/ApacheWO/ApacheWOTransaction.h D Recycler/ApacheWO/ApacheWOTransaction.m D Recycler/ApacheWO/ChangeLog D Recycler/ApacheWO/GNUmakefile D Recycler/ApacheWO/README D Recycler/ApacheWO/TestApp/GNUmakefile D Recycler/ApacheWO/TestApp/TestApp.m D Recycler/ApacheWO/WOComponent+Apache.m D Recycler/ApacheWO/WORequest+Apache.h D Recycler/ApacheWO/WORequest+Apache.m D Recycler/ApacheWO/WORequestHandler+Apache.h D Recycler/ApacheWO/WORequestHandler+Apache.m D Recycler/ApacheWO/WOResponse+Apache.h D Recycler/ApacheWO/WOResponse+Apache.m D Recycler/ApacheWO/common.h D Recycler/ApacheWO/docs/Embed.wox D Recycler/ApacheWO/docs/Frame.wox D Recycler/ApacheWO/docs/Page2.wox D Recycler/ApacheWO/docs/Page3.wox D Recycler/ApacheWO/docs/RqInfo.wox D Recycler/ApacheWO/docs/SSIPage.shtml D Recycler/ApacheWO/docs/SlowMarket.gif D Recycler/ApacheWO/docs/Table.wox D Recycler/ApacheWO/docs/WoPage1.wo/WoPage1.html D Recycler/ApacheWO/docs/WoPage1.wo/WoPage1.js D Recycler/ApacheWO/docs/WoPage1.wo/WoPage1.wod D Recycler/ApacheWO/docs/bigimg.gif D Recycler/ApacheWO/docs/imgs/SlowMarket.wox D Recycler/ApacheWO/docs/renameme-.htaccess D Recycler/ApacheWO/docs/requests.wox D Recycler/ApacheWO/docs/subdir/renameme-.htaccess D Recycler/ApacheWO/docs/subdir/test.wox D Recycler/ApacheWO/docs/test.html D Recycler/ApacheWO/docs/test.wox D Recycler/ApacheWO/docs/wa.rqh D Recycler/ApacheWO/docs/xmlrpc.rqh D Recycler/ApacheWO/httpd.conf D Recycler/ApacheWO/httpd.sh D Recycler/CFXMLSaxDriver/CFXMLSaxDriver-Info.plist D Recycler/CFXMLSaxDriver/CFXMLSaxDriver.h D Recycler/CFXMLSaxDriver/CFXMLSaxDriver.m D Recycler/CFXMLSaxDriver/COPYING D Recycler/CFXMLSaxDriver/ChangeLog D Recycler/CFXMLSaxDriver/README D Recycler/CFXMLSaxDriver/bundle-info.plist D Recycler/ExpatSaxDriver/COPYING D Recycler/ExpatSaxDriver/ExpatSaxDriver-Info.plist D Recycler/ExpatSaxDriver/ExpatSaxDriver.m D Recycler/ExpatSaxDriver/ExpatSaxDriver.xcodeproj/project.pbxproj D Recycler/ExpatSaxDriver/ExpatSaxDriver.xcodeproj/znek.perspective D Recycler/ExpatSaxDriver/GNUmakefile D Recycler/ExpatSaxDriver/README D Recycler/ExpatSaxDriver/Version D Recycler/ExpatSaxDriver/bundle-info.plist D Recycler/ExpatSaxDriver/common.h D Recycler/ExpatSaxDriver/unicode.h D Recycler/GDLContentStore/COPYING D Recycler/GDLContentStore/COPYRIGHT D Recycler/GDLContentStore/ChangeLog D Recycler/GDLContentStore/EOAdaptorChannel+GCS.h D Recycler/GDLContentStore/EOAdaptorChannel+GCS.m D Recycler/GDLContentStore/EOQualifier+GCS.h D Recycler/GDLContentStore/EOQualifier+GCS.m D Recycler/GDLContentStore/GCSChannelManager.h D Recycler/GDLContentStore/GCSChannelManager.m D Recycler/GDLContentStore/GCSContext.h D Recycler/GDLContentStore/GCSContext.m D Recycler/GDLContentStore/GCSFieldExtractor.h D Recycler/GDLContentStore/GCSFieldExtractor.m D Recycler/GDLContentStore/GCSFieldInfo.h D Recycler/GDLContentStore/GCSFieldInfo.m D Recycler/GDLContentStore/GCSFolder.h D Recycler/GDLContentStore/GCSFolder.m D Recycler/GDLContentStore/GCSFolderManager.h D Recycler/GDLContentStore/GCSFolderManager.m D Recycler/GDLContentStore/GCSFolderType.h D Recycler/GDLContentStore/GCSFolderType.m D Recycler/GDLContentStore/GCSStringFormatter.h D Recycler/GDLContentStore/GCSStringFormatter.m D Recycler/GDLContentStore/GNUmakefile D Recycler/GDLContentStore/GNUmakefile.preamble D Recycler/GDLContentStore/NSURL+GCS.h D Recycler/GDLContentStore/NSURL+GCS.m D Recycler/GDLContentStore/README D Recycler/GDLContentStore/Version D Recycler/GDLContentStore/common.h D Recycler/GDLContentStore/fhs.make D Recycler/GDLContentStore/gcs_cat.m D Recycler/GDLContentStore/gcs_gensql.m D Recycler/GDLContentStore/gcs_ls.m D Recycler/GDLContentStore/gcs_mkdir.m D Recycler/GDLContentStore/gcs_recreatequick.m D Recycler/NGJavaScript/COPYING D Recycler/NGJavaScript/ChangeLog D Recycler/NGJavaScript/Core+JS.subproj/EODataSource+JS.m D Recycler/NGJavaScript/Core+JS.subproj/EOJavaScriptGrouping.h D Recycler/NGJavaScript/Core+JS.subproj/EOJavaScriptGrouping.m D Recycler/NGJavaScript/Core+JS.subproj/EONull+JS.m D Recycler/NGJavaScript/Core+JS.subproj/GNUmakefile D Recycler/NGJavaScript/Core+JS.subproj/GNUmakefile.preamble D Recycler/NGJavaScript/Core+JS.subproj/NGFileManager+JS.m D Recycler/NGJavaScript/Core+JS.subproj/NSArray+JS.m D Recycler/NGJavaScript/Core+JS.subproj/NSDate+JS.m D Recycler/NGJavaScript/Core+JS.subproj/NSDictionary+JS.m D Recycler/NGJavaScript/Core+JS.subproj/NSNumber+JS.m D Recycler/NGJavaScript/Core+JS.subproj/NSObject+JS.h D Recycler/NGJavaScript/Core+JS.subproj/NSObject+JS.m D Recycler/NGJavaScript/Core+JS.subproj/NSString+JS.h D Recycler/NGJavaScript/Core+JS.subproj/NSString+JS.m D Recycler/NGJavaScript/Core+JS.subproj/NSUserDefaults+JS.m D Recycler/NGJavaScript/GNUmakefile D Recycler/NGJavaScript/GNUmakefile.preamble D Recycler/NGJavaScript/JSObjectOps.m D Recycler/NGJavaScript/NGJavaScript-Info.plist D Recycler/NGJavaScript/NGJavaScript.h D Recycler/NGJavaScript/NGJavaScriptArray.m D Recycler/NGJavaScript/NGJavaScriptCallable.h D Recycler/NGJavaScript/NGJavaScriptCallable.m D Recycler/NGJavaScript/NGJavaScriptContext.h D Recycler/NGJavaScript/NGJavaScriptContext.m D Recycler/NGJavaScript/NGJavaScriptDecls.h D Recycler/NGJavaScript/NGJavaScriptError.h D Recycler/NGJavaScript/NGJavaScriptError.m D Recycler/NGJavaScript/NGJavaScriptFunction.h D Recycler/NGJavaScript/NGJavaScriptFunction.m D Recycler/NGJavaScript/NGJavaScriptLanguage.m D Recycler/NGJavaScript/NGJavaScriptObjCClassInfo.h D Recycler/NGJavaScript/NGJavaScriptObjCClassInfo.m D Recycler/NGJavaScript/NGJavaScriptObject.h D Recycler/NGJavaScript/NGJavaScriptObject.m D Recycler/NGJavaScript/NGJavaScriptObjectHandler.h D Recycler/NGJavaScript/NGJavaScriptObjectHandler.m D Recycler/NGJavaScript/NGJavaScriptObjectMappingContext.h D Recycler/NGJavaScript/NGJavaScriptObjectMappingContext.m D Recycler/NGJavaScript/NGJavaScriptRuntime.h D Recycler/NGJavaScript/NGJavaScriptRuntime.m D Recycler/NGJavaScript/NGJavaScriptShadow.h D Recycler/NGJavaScript/NGJavaScriptShadow.m D Recycler/NGJavaScript/README D Recycler/NGJavaScript/ScriptLanguages.plist D Recycler/NGJavaScript/TODO D Recycler/NGJavaScript/Version D Recycler/NGJavaScript/common.h D Recycler/NGJavaScript/dummy.m D Recycler/NGJavaScript/globals.h D Recycler/NGJavaScript/globals.m D Recycler/NGJavaScript/jsobjops.m D Recycler/NGJavaScript/testjs.m D Recycler/NGJavaScript/tests/Blah.h D Recycler/NGJavaScript/tests/Blah.m D Recycler/NGJavaScript/tests/Combined.h D Recycler/NGJavaScript/tests/Combined.m D Recycler/NGJavaScript/tests/GNUmakefile D Recycler/NGJavaScript/tests/JSArchivingTests.h D Recycler/NGJavaScript/tests/JSArchivingTests.m D Recycler/NGJavaScript/tests/JSBridgeTests.h D Recycler/NGJavaScript/tests/JSBridgeTests.m D Recycler/NGJavaScript/tests/JSTest.h D Recycler/NGJavaScript/tests/JSTest.m D Recycler/NGJavaScript/tests/MyNum.h D Recycler/NGJavaScript/tests/MyNum.m D Recycler/NGObjDOM/COPYING D Recycler/NGObjDOM/COPYRIGHT D Recycler/NGObjDOM/ChangeLog D Recycler/NGObjDOM/Dynamic.subproj/COPYING D Recycler/NGObjDOM/Dynamic.subproj/ChangeLog D Recycler/NGObjDOM/Dynamic.subproj/GNUmakefile D Recycler/NGObjDOM/Dynamic.subproj/ODBindNodeRenderFactory.h D Recycler/NGObjDOM/Dynamic.subproj/ODBindNodeRenderFactory.m D Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_checkbox.m D Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_collapsible.m D Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_datefield.m D Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_fieldset.m D Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_foreach.m D Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_form.m D Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_groupings.h D Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_groupings.m D Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_if.m D Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_multiselection.m D Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_nbsp.m D Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_popupbutton.m D Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_radiobutton.m D Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_sortorderings.h D Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_sortorderings.m D Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_string.m D Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_switch.m D Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_tablecell.h D Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_tablecell.m D Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_tabledata.m D Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_tableheader.m D Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_tableview+Private.h D Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_tableview+Private.m D Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_tableview.m D Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_tabview.m D Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_viewertitle.m D Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_with.m D Recycler/NGObjDOM/GNUmakefile D Recycler/NGObjDOM/GNUmakefile.postamble D Recycler/NGObjDOM/GNUmakefile.preamble D Recycler/NGObjDOM/NGObjDOM-Info.plist D Recycler/NGObjDOM/NGObjDOM.h D Recycler/NGObjDOM/NGObjDOMModule.m D Recycler/NGObjDOM/ODNamespaces.h D Recycler/NGObjDOM/ODNodeRenderer+attributes.h D Recycler/NGObjDOM/ODNodeRenderer+attributes.m D Recycler/NGObjDOM/ODNodeRenderer.h D Recycler/NGObjDOM/ODNodeRenderer.m D Recycler/NGObjDOM/ODNodeRendererFactory.h D Recycler/NGObjDOM/ODNodeRendererFactory.m D Recycler/NGObjDOM/ODNodeRendererFactorySet.h D Recycler/NGObjDOM/ODNodeRendererFactorySet.m D Recycler/NGObjDOM/ODREmbedComponent.h D Recycler/NGObjDOM/ODREmbedComponent.m D Recycler/NGObjDOM/ODRGenericTag.h D Recycler/NGObjDOM/ODRGenericTag.m D Recycler/NGObjDOM/ODRNodeText.h D Recycler/NGObjDOM/ODRNodeText.m D Recycler/NGObjDOM/ODRWebObject.h D Recycler/NGObjDOM/ODRWebObject.m D Recycler/NGObjDOM/ODR_bind_collapsible.h D Recycler/NGObjDOM/ODR_bind_fieldset.h D Recycler/NGObjDOM/ODR_bind_tableview.h D Recycler/NGObjDOM/ODR_bind_tabview.h D Recycler/NGObjDOM/ODR_bind_viewertitle.h D Recycler/NGObjDOM/ODResourceManager.h D Recycler/NGObjDOM/ODResourceManager.m D Recycler/NGObjDOM/ODWONodeRenderFactory.m D Recycler/NGObjDOM/README D Recycler/NGObjDOM/Version D Recycler/NGObjDOM/WOContext+Cursor.h D Recycler/NGObjDOM/WORenderDOM.h D Recycler/NGObjDOM/WORenderDOM.m D Recycler/NGObjDOM/XHTML.subproj/COPYING D Recycler/NGObjDOM/XHTML.subproj/ChangeLog D Recycler/NGObjDOM/XHTML.subproj/GNUmakefile D Recycler/NGObjDOM/XHTML.subproj/GNUmakefile.preamble D Recycler/NGObjDOM/XHTML.subproj/ODRDynamicXHTMLTag.h D Recycler/NGObjDOM/XHTML.subproj/ODRDynamicXHTMLTag.m D Recycler/NGObjDOM/XHTML.subproj/ODR_XHTML_a.m D Recycler/NGObjDOM/XHTML.subproj/ODR_XHTML_button.m D Recycler/NGObjDOM/XHTML.subproj/ODR_XHTML_form.m D Recycler/NGObjDOM/XHTML.subproj/ODR_XHTML_img.m D Recycler/NGObjDOM/XHTML.subproj/ODR_XHTML_input.m D Recycler/NGObjDOM/XHTML.subproj/ODR_XHTML_option.m D Recycler/NGObjDOM/XHTML.subproj/ODR_XHTML_select.m D Recycler/NGObjDOM/XHTML.subproj/ODR_XHTML_textarea.m D Recycler/NGObjDOM/XHTML.subproj/ODXHTMLNodeRenderFactory.h D Recycler/NGObjDOM/XHTML.subproj/ODXHTMLNodeRenderFactory.m D Recycler/NGObjDOM/XHTML.subproj/bundle-info.plist D Recycler/NGObjDOM/XUL.subproj/COPYING D Recycler/NGObjDOM/XUL.subproj/GNUmakefile D Recycler/NGObjDOM/XUL.subproj/GNUmakefile.preamble D Recycler/NGObjDOM/XUL.subproj/ODRDynamicXULTag.h D Recycler/NGObjDOM/XUL.subproj/ODRDynamicXULTag.m D Recycler/NGObjDOM/XUL.subproj/ODR_XUL_box.h D Recycler/NGObjDOM/XUL.subproj/ODR_XUL_box.m D Recycler/NGObjDOM/XUL.subproj/ODR_XUL_button.m D Recycler/NGObjDOM/XUL.subproj/ODR_XUL_column.m D Recycler/NGObjDOM/XUL.subproj/ODR_XUL_columns.m D Recycler/NGObjDOM/XUL.subproj/ODR_XUL_grid.m D Recycler/NGObjDOM/XUL.subproj/ODR_XUL_image.m D Recycler/NGObjDOM/XUL.subproj/ODR_XUL_spring.m D Recycler/NGObjDOM/XUL.subproj/ODR_XUL_tab.m D Recycler/NGObjDOM/XUL.subproj/ODR_XUL_text.m D Recycler/NGObjDOM/XUL.subproj/ODR_XUL_textfield.m D Recycler/NGObjDOM/XUL.subproj/ODR_XUL_title.m D Recycler/NGObjDOM/XUL.subproj/ODR_XUL_titledbox.m D Recycler/NGObjDOM/XUL.subproj/ODR_XUL_window.m D Recycler/NGObjDOM/XUL.subproj/ODXULNodeRenderFactory.h D Recycler/NGObjDOM/XUL.subproj/ODXULNodeRenderFactory.m D Recycler/NGObjDOM/XUL.subproj/bundle-info.plist D Recycler/NGObjDOM/bundle-info.plist D Recycler/NGObjDOM/common.h D Recycler/NGObjDOM/dummy.m D Recycler/NGObjDOM/fhs.make D Recycler/NGObjDOM/used_privates.h D Recycler/NGScripting/COPYING D Recycler/NGScripting/ChangeLog D Recycler/NGScripting/GNUmakefile D Recycler/NGScripting/GNUmakefile.preamble D Recycler/NGScripting/NGObjectMappingContext.h D Recycler/NGScripting/NGObjectMappingContext.m D Recycler/NGScripting/NGScriptLanguage.h D Recycler/NGScripting/NGScriptLanguage.m D Recycler/NGScripting/NGScripting-Info.plist D Recycler/NGScripting/NSObject+Scripting.h D Recycler/NGScripting/NSObject+Scripting.m D Recycler/NGScripting/Version D Recycler/NGScripting/common.h D Recycler/NGScripting/fhs.make D Recycler/Snippets/NGCString.h D Recycler/Snippets/NGCString.m D Recycler/Snippets/NGStringScanEnumerator.m D Recycler/SxComponents/COPYING D Recycler/SxComponents/ChangeLog D Recycler/SxComponents/GNUmakefile D Recycler/SxComponents/GNUmakefile.preamble D Recycler/SxComponents/NSObject+SxXmlRpcValue.m D Recycler/SxComponents/README D Recycler/SxComponents/SxBasicAuthCredentials.h D Recycler/SxComponents/SxBasicAuthCredentials.m D Recycler/SxComponents/SxComponent.h D Recycler/SxComponents/SxComponent.m D Recycler/SxComponents/SxComponentException.h D Recycler/SxComponents/SxComponentException.m D Recycler/SxComponents/SxComponentInvocation.h D Recycler/SxComponents/SxComponentInvocation.m D Recycler/SxComponents/SxComponentMethodSignature.h D Recycler/SxComponents/SxComponentMethodSignature.m D Recycler/SxComponents/SxComponentRegistry.h D Recycler/SxComponents/SxComponentRegistry.m D Recycler/SxComponents/SxComponents.h D Recycler/SxComponents/SxXmlRpcComponent.h D Recycler/SxComponents/SxXmlRpcComponent.m D Recycler/SxComponents/SxXmlRpcInvocation.h D Recycler/SxComponents/SxXmlRpcInvocation.m D Recycler/SxComponents/SxXmlRpcRegBackend.m D Recycler/SxComponents/Version D Recycler/SxComponents/common.h D Recycler/SxComponents/fhs.make D Recycler/SxComponents/sxc_call.m D Recycler/SxComponents/sxc_ls.m D Recycler/iCalSaxDriver/COPYING D Recycler/iCalSaxDriver/COPYRIGHT D Recycler/iCalSaxDriver/ChangeLog D Recycler/iCalSaxDriver/GNUmakefile D Recycler/iCalSaxDriver/GNUmakefile.postamble D Recycler/iCalSaxDriver/GNUmakefile.preamble D Recycler/iCalSaxDriver/ICalSaxParser.h D Recycler/iCalSaxDriver/ICalSaxParser.m D Recycler/iCalSaxDriver/NSCalendarDate+ICal.h D Recycler/iCalSaxDriver/NSCalendarDate+ICal.m D Recycler/iCalSaxDriver/NSString+ICal.h D Recycler/iCalSaxDriver/NSString+ICal.m D Recycler/iCalSaxDriver/README D Recycler/iCalSaxDriver/TODO D Recycler/iCalSaxDriver/Version D Recycler/iCalSaxDriver/bundle-info.plist D Recycler/iCalSaxDriver/common.h D Recycler/iCalSaxDriver/fhs.make D Recycler/iCalSaxDriver/iCalSaxDriver-Info.plist D Recycler/iCalSaxDriver/iCalSaxDriver.xcode/project.pbxproj D Recycler/iCalSaxDriver/unicode.h D Recycler/iCalSaxDriver/version.plist D Recycler/mod_objc/ApModuleBaseClass+Callbacks.m D Recycler/mod_objc/ApModuleBaseClass+Cmds.m D Recycler/mod_objc/ApModuleBaseClass+Handler.m D Recycler/mod_objc/ApModuleBaseClass.h D Recycler/mod_objc/ApModuleBaseClass.m D Recycler/mod_objc/ApTest.m D Recycler/mod_objc/ApacheCmdParms.h D Recycler/mod_objc/ApacheCmdParms.m D Recycler/mod_objc/ApacheConnection.h D Recycler/mod_objc/ApacheConnection.m D Recycler/mod_objc/ApacheModule.h D Recycler/mod_objc/ApacheModule.m D Recycler/mod_objc/ApacheObject.h D Recycler/mod_objc/ApacheObject.m D Recycler/mod_objc/ApacheRequest.h D Recycler/mod_objc/ApacheRequest.m D Recycler/mod_objc/ApacheResourcePool.h D Recycler/mod_objc/ApacheResourcePool.m D Recycler/mod_objc/ApacheServer.h D Recycler/mod_objc/ApacheServer.m D Recycler/mod_objc/ApacheTable.h D Recycler/mod_objc/ApacheTable.m D Recycler/mod_objc/GNUmakefile D Recycler/mod_objc/GSBundleModule.m D Recycler/mod_objc/README D Recycler/mod_objc/genApacheModule.sh D Recycler/mod_objc/mod_gsbundle.m D Recycler/mod_objc/test.conf D SOPE-Info.plist D SOPE.xcodeproj/project.pbxproj D gnustep-make/.cvsignore D gnustep-make/ANNOUNCE D gnustep-make/COPYING D gnustep-make/ChangeLog D gnustep-make/ChangeLog.1 D gnustep-make/Documentation/.cvsignore D gnustep-make/Documentation/.latex2html-init D gnustep-make/Documentation/DESIGN D gnustep-make/Documentation/GNUmakefile D gnustep-make/Documentation/GNUstep.7 D gnustep-make/Documentation/README.Cygwin D gnustep-make/Documentation/README.Darwin D gnustep-make/Documentation/README.MinGW D gnustep-make/Documentation/README.MinGWOnCygwin D gnustep-make/Documentation/README.NetBSD D gnustep-make/Documentation/announce.texi D gnustep-make/Documentation/end.texi D gnustep-make/Documentation/faq.texi D gnustep-make/Documentation/filesystem.texi D gnustep-make/Documentation/gnustep-howto.texi D gnustep-make/Documentation/gnustep.init D gnustep-make/Documentation/install.texi D gnustep-make/Documentation/internals.tex D gnustep-make/Documentation/machines.texi D gnustep-make/Documentation/make.texi D gnustep-make/Documentation/news.texi D gnustep-make/Documentation/openapp.1 D gnustep-make/Documentation/readme.texi D gnustep-make/Documentation/userfaq.texi D gnustep-make/FAQ D gnustep-make/GNUmakefile D gnustep-make/GNUmakefile.in D gnustep-make/GNUmakefile.postamble D gnustep-make/GNUmakefile.preamble D gnustep-make/GNUstep-HOWTO D gnustep-make/GNUstep-reset.sh D gnustep-make/GNUstep.conf D gnustep-make/GNUstep.conf.in D gnustep-make/GNUstep.csh D gnustep-make/GNUstep.csh.in D gnustep-make/GNUstep.sh D gnustep-make/GNUstep.sh.in D gnustep-make/GNUsteprc.in D gnustep-make/INSTALL D gnustep-make/Instance/Documentation/autogsdoc.make D gnustep-make/Instance/Documentation/gsdoc.make D gnustep-make/Instance/Documentation/install_files.make D gnustep-make/Instance/Documentation/javadoc.make D gnustep-make/Instance/Documentation/latex.make D gnustep-make/Instance/Documentation/texi.make D gnustep-make/Instance/README D gnustep-make/Instance/Shared/README D gnustep-make/Instance/Shared/bundle.make D gnustep-make/Instance/Shared/headers.make D gnustep-make/Instance/Shared/java.make D gnustep-make/Instance/Shared/pch.make D gnustep-make/Instance/Shared/stamp-string.make D gnustep-make/Instance/Shared/strings.make D gnustep-make/Instance/application.make D gnustep-make/Instance/bundle.make D gnustep-make/Instance/clibrary.make D gnustep-make/Instance/ctool.make D gnustep-make/Instance/documentation.make D gnustep-make/Instance/framework.make D gnustep-make/Instance/gcj-tool.make D gnustep-make/Instance/gswapp.make D gnustep-make/Instance/gswbundle.make D gnustep-make/Instance/java-tool.make D gnustep-make/Instance/java.make D gnustep-make/Instance/library.make D gnustep-make/Instance/objc.make D gnustep-make/Instance/palette.make D gnustep-make/Instance/resource-set.make D gnustep-make/Instance/rules.make D gnustep-make/Instance/service.make D gnustep-make/Instance/subproject.make D gnustep-make/Instance/test-application.make D gnustep-make/Instance/test-library.make D gnustep-make/Instance/test-tool.make D gnustep-make/Instance/tool.make D gnustep-make/Master/README D gnustep-make/Master/aggregate.make D gnustep-make/Master/application.make D gnustep-make/Master/bundle.make D gnustep-make/Master/clibrary.make D gnustep-make/Master/ctool.make D gnustep-make/Master/documentation.make D gnustep-make/Master/framework.make D gnustep-make/Master/gcj-tool.make D gnustep-make/Master/gswapp.make D gnustep-make/Master/gswbundle.make D gnustep-make/Master/java-tool.make D gnustep-make/Master/java.make D gnustep-make/Master/library.make D gnustep-make/Master/objc.make D gnustep-make/Master/palette.make D gnustep-make/Master/resource-set.make D gnustep-make/Master/rpm.make D gnustep-make/Master/rules.make D gnustep-make/Master/service.make D gnustep-make/Master/source-distribution.make D gnustep-make/Master/subproject.make D gnustep-make/Master/test-application.make D gnustep-make/Master/test-library.make D gnustep-make/Master/test-tool.make D gnustep-make/Master/tool.make D gnustep-make/NEWS D gnustep-make/README D gnustep-make/Version D gnustep-make/aggregate.make D gnustep-make/application.make D gnustep-make/bundle.make D gnustep-make/clean_cpu.sh D gnustep-make/clean_os.sh D gnustep-make/clean_vendor.sh D gnustep-make/clibrary.make D gnustep-make/common.make D gnustep-make/config.guess D gnustep-make/config.h D gnustep-make/config.h.in D gnustep-make/config.log D gnustep-make/config.make D gnustep-make/config.make.in D gnustep-make/config.site D gnustep-make/config.status D gnustep-make/config.sub D gnustep-make/config_thread.m D gnustep-make/configure D gnustep-make/configure.ac D gnustep-make/cpu.sh D gnustep-make/create_domain_dir_tree.sh D gnustep-make/ctool.make D gnustep-make/debugapp D gnustep-make/debugapp.in D gnustep-make/documentation.make D gnustep-make/executable.template D gnustep-make/executable.template.in D gnustep-make/fixpath.sh D gnustep-make/fixpath.sh.in D gnustep-make/framework.make D gnustep-make/gcj-tool.make D gnustep-make/gnustep-make.spec D gnustep-make/gnustep-make.spec.in D gnustep-make/gswapp.make D gnustep-make/gswbundle.make D gnustep-make/install-sh D gnustep-make/java-executable.template D gnustep-make/java-tool.make D gnustep-make/java.make D gnustep-make/jni.make D gnustep-make/ld_lib_path.csh D gnustep-make/ld_lib_path.sh D gnustep-make/library-combo.make D gnustep-make/library.make D gnustep-make/messages.make D gnustep-make/mkinstalldirs D gnustep-make/move_obsolete_paths.sh D gnustep-make/names.make D gnustep-make/native-library.make D gnustep-make/objc.make D gnustep-make/openapp D gnustep-make/openapp.in D gnustep-make/opentool D gnustep-make/opentool.in D gnustep-make/os.sh D gnustep-make/palette.make D gnustep-make/relative_path.sh D gnustep-make/resource-set.make D gnustep-make/rules.make D gnustep-make/service.make D gnustep-make/setlocaltz.sh D gnustep-make/spec-debug-alone-rules.template D gnustep-make/spec-debug-rules.template D gnustep-make/spec-rules.template D gnustep-make/strip_makefiles.sh D gnustep-make/subproject.make D gnustep-make/tar-exclude-list D gnustep-make/target.make D gnustep-make/test-application.make D gnustep-make/test-library.make D gnustep-make/test-tool.make D gnustep-make/tool.make D gnustep-make/transform_paths.sh D gnustep-make/user_home.c D gnustep-make/vendor.sh D gnustep-make/which_lib D gnustep-make/which_lib.c D libFoundation/ANNOUNCE D libFoundation/AUTHORS D libFoundation/COPYING D libFoundation/ChangeLog D libFoundation/Foundation/DefaultScannerHandler.m D libFoundation/Foundation/FFCallInvocation.h D libFoundation/Foundation/FFCallInvocation.m D libFoundation/Foundation/FormatScanner.m D libFoundation/Foundation/Foundation.h D libFoundation/Foundation/GCArray.m D libFoundation/Foundation/GCDictionary.m D libFoundation/Foundation/GCObject.m D libFoundation/Foundation/GNUmakefile D libFoundation/Foundation/GNUmakefile.alone D libFoundation/Foundation/GNUmakefile.postamble D libFoundation/Foundation/GarbageCollector.m D libFoundation/Foundation/NSAccount.h D libFoundation/Foundation/NSAccount.m D libFoundation/Foundation/NSAllocDebugZone.h D libFoundation/Foundation/NSAllocDebugZone.m D libFoundation/Foundation/NSArchiver.h D libFoundation/Foundation/NSArchiver.m D libFoundation/Foundation/NSArray.h D libFoundation/Foundation/NSArray.m D libFoundation/Foundation/NSAttributedString.h D libFoundation/Foundation/NSAttributedString.m D libFoundation/Foundation/NSAutoreleasePool.h D libFoundation/Foundation/NSAutoreleasePool.m D libFoundation/Foundation/NSBundle.h D libFoundation/Foundation/NSBundle.m D libFoundation/Foundation/NSByteOrder.h D libFoundation/Foundation/NSCalendarDate.h D libFoundation/Foundation/NSCalendarDate.m D libFoundation/Foundation/NSCalendarDateScanf.h D libFoundation/Foundation/NSCalendarDateScanf.m D libFoundation/Foundation/NSCalendarDateScannerHandler.h D libFoundation/Foundation/NSCalendarDateScannerHandler.m D libFoundation/Foundation/NSCharacterSet.h D libFoundation/Foundation/NSCharacterSet.m D libFoundation/Foundation/NSClassDescription.h D libFoundation/Foundation/NSClassDescription.m D libFoundation/Foundation/NSClassicException.h D libFoundation/Foundation/NSCoder.h D libFoundation/Foundation/NSCoder.m D libFoundation/Foundation/NSComparisonPredicate.h D libFoundation/Foundation/NSComparisonPredicate.m D libFoundation/Foundation/NSCompoundPredicate.h D libFoundation/Foundation/NSCompoundPredicate.m D libFoundation/Foundation/NSConcreteArray.h D libFoundation/Foundation/NSConcreteArray.m D libFoundation/Foundation/NSConcreteCharacterSet.h D libFoundation/Foundation/NSConcreteCharacterSet.m D libFoundation/Foundation/NSConcreteData.h D libFoundation/Foundation/NSConcreteData.m D libFoundation/Foundation/NSConcreteDate.h D libFoundation/Foundation/NSConcreteDate.m D libFoundation/Foundation/NSConcreteDictionary.h D libFoundation/Foundation/NSConcreteDictionary.m D libFoundation/Foundation/NSConcreteFileHandle.h D libFoundation/Foundation/NSConcreteFileHandle.m D libFoundation/Foundation/NSConcreteMutableDictionary.m D libFoundation/Foundation/NSConcreteMutableString.m D libFoundation/Foundation/NSConcreteNumber.h D libFoundation/Foundation/NSConcreteNumber.m D libFoundation/Foundation/NSConcreteNumber.m.sh D libFoundation/Foundation/NSConcreteScanner.h D libFoundation/Foundation/NSConcreteScanner.m D libFoundation/Foundation/NSConcreteSet.h D libFoundation/Foundation/NSConcreteSet.m D libFoundation/Foundation/NSConcreteString.h D libFoundation/Foundation/NSConcreteString.m D libFoundation/Foundation/NSConcreteTimeZone.h D libFoundation/Foundation/NSConcreteTimeZone.m D libFoundation/Foundation/NSConcreteTimeZoneDetail.h D libFoundation/Foundation/NSConcreteTimeZoneDetail.m D libFoundation/Foundation/NSConcreteUTF16String.m D libFoundation/Foundation/NSConcreteUnixTask.h D libFoundation/Foundation/NSConcreteUnixTask.m D libFoundation/Foundation/NSConcreteValue.h D libFoundation/Foundation/NSConcreteValue.m D libFoundation/Foundation/NSConcreteWindowsFileHandle.h D libFoundation/Foundation/NSConcreteWindowsFileHandle.m D libFoundation/Foundation/NSConcreteWindowsTask.h D libFoundation/Foundation/NSConcreteWindowsTask.m D libFoundation/Foundation/NSConnection.h D libFoundation/Foundation/NSConnection.m D libFoundation/Foundation/NSData.h D libFoundation/Foundation/NSData.m D libFoundation/Foundation/NSDate.h D libFoundation/Foundation/NSDate.m D libFoundation/Foundation/NSDateFormatter.h D libFoundation/Foundation/NSDateFormatter.m D libFoundation/Foundation/NSDebug.h D libFoundation/Foundation/NSDebug.m D libFoundation/Foundation/NSDecimal.h D libFoundation/Foundation/NSDecimal.m D libFoundation/Foundation/NSDecimalNumber.h D libFoundation/Foundation/NSDecimalNumber.m D libFoundation/Foundation/NSDefaultZone.h D libFoundation/Foundation/NSDefaultZone.m D libFoundation/Foundation/NSDictionary.h D libFoundation/Foundation/NSDictionary.m D libFoundation/Foundation/NSDistantObject.h D libFoundation/Foundation/NSDistributedLock.h D libFoundation/Foundation/NSDistributedLock.m D libFoundation/Foundation/NSDistributedNotificationCenter.h D libFoundation/Foundation/NSDistributedNotificationCenter.m D libFoundation/Foundation/NSEnumerator.h D libFoundation/Foundation/NSEnumerator.m D libFoundation/Foundation/NSError.h D libFoundation/Foundation/NSError.m D libFoundation/Foundation/NSException.m D libFoundation/Foundation/NSExceptionWithoutNested.h D libFoundation/Foundation/NSExpression.h D libFoundation/Foundation/NSExpression.m D libFoundation/Foundation/NSFileHandle.h D libFoundation/Foundation/NSFileHandle.m D libFoundation/Foundation/NSFileManager.h D libFoundation/Foundation/NSFileManager.m D libFoundation/Foundation/NSFileURLHandle.h D libFoundation/Foundation/NSFileURLHandle.m D libFoundation/Foundation/NSFormatter.h D libFoundation/Foundation/NSFormatter.m D libFoundation/Foundation/NSFrameInvocation.h D libFoundation/Foundation/NSFrameInvocation.m D libFoundation/Foundation/NSFuncallException.h D libFoundation/Foundation/NSGeometry.h D libFoundation/Foundation/NSGeometry.m D libFoundation/Foundation/NSHashMap.m D libFoundation/Foundation/NSHashTable.h D libFoundation/Foundation/NSHost.h D libFoundation/Foundation/NSHost.m D libFoundation/Foundation/NSInputStream.m D libFoundation/Foundation/NSInvocation.h D libFoundation/Foundation/NSInvocation.m D libFoundation/Foundation/NSKeyValueCoding.h D libFoundation/Foundation/NSLock.h D libFoundation/Foundation/NSLock.m D libFoundation/Foundation/NSMapTable.h D libFoundation/Foundation/NSMappedData.h D libFoundation/Foundation/NSMappedData.m D libFoundation/Foundation/NSMessagePort.m D libFoundation/Foundation/NSMethodSignature.h D libFoundation/Foundation/NSMethodSignature.m D libFoundation/Foundation/NSNotification.h D libFoundation/Foundation/NSNotification.m D libFoundation/Foundation/NSNotificationCenter.m D libFoundation/Foundation/NSNotificationQueue.h D libFoundation/Foundation/NSNotificationQueue.m D libFoundation/Foundation/NSNull.h D libFoundation/Foundation/NSNull.m D libFoundation/Foundation/NSNumber.m D libFoundation/Foundation/NSNumberFormatter.h D libFoundation/Foundation/NSNumberFormatter.m D libFoundation/Foundation/NSObjCRuntime.h D libFoundation/Foundation/NSObjCRuntime.m D libFoundation/Foundation/NSObject+PropLists.h D libFoundation/Foundation/NSObject.h.in D libFoundation/Foundation/NSObject.m D libFoundation/Foundation/NSObjectAllocation.m D libFoundation/Foundation/NSObjectInvocation.h D libFoundation/Foundation/NSObjectInvocation.m D libFoundation/Foundation/NSOutputStream.m D libFoundation/Foundation/NSPathUtilities.h D libFoundation/Foundation/NSPathUtilities.m D libFoundation/Foundation/NSPipe.m D libFoundation/Foundation/NSPort.h D libFoundation/Foundation/NSPort.m D libFoundation/Foundation/NSPortCoder.h D libFoundation/Foundation/NSPortCoder.m D libFoundation/Foundation/NSPortMessage.h D libFoundation/Foundation/NSPortMessage.m D libFoundation/Foundation/NSPortNameServer.h D libFoundation/Foundation/NSPortNameServer.m D libFoundation/Foundation/NSPosixFileDescriptor.h D libFoundation/Foundation/NSPosixFileDescriptor.m D libFoundation/Foundation/NSPredicate.h D libFoundation/Foundation/NSPredicate.m D libFoundation/Foundation/NSPredicateParser.m D libFoundation/Foundation/NSProcessInfo.h D libFoundation/Foundation/NSProcessInfo.m D libFoundation/Foundation/NSProxy.h D libFoundation/Foundation/NSProxy.m D libFoundation/Foundation/NSRange.h D libFoundation/Foundation/NSRange.m D libFoundation/Foundation/NSRunLoop.h D libFoundation/Foundation/NSRunLoop.m D libFoundation/Foundation/NSScanner.h D libFoundation/Foundation/NSScanner.m D libFoundation/Foundation/NSScriptKeyValueCoding.h D libFoundation/Foundation/NSSerialization.h D libFoundation/Foundation/NSSerialization.m D libFoundation/Foundation/NSSet.h D libFoundation/Foundation/NSSet.m D libFoundation/Foundation/NSSocketPort.m D libFoundation/Foundation/NSSortDescriptor.h D libFoundation/Foundation/NSSortDescriptor.m D libFoundation/Foundation/NSStream.h D libFoundation/Foundation/NSStream.m D libFoundation/Foundation/NSString+StringEncoding.m D libFoundation/Foundation/NSString.h D libFoundation/Foundation/NSString.m D libFoundation/Foundation/NSStringScanner.m D libFoundation/Foundation/NSTask.h D libFoundation/Foundation/NSTask.m D libFoundation/Foundation/NSThread.h D libFoundation/Foundation/NSThread.m D libFoundation/Foundation/NSTimeZone.h D libFoundation/Foundation/NSTimeZone.m D libFoundation/Foundation/NSTimer.h D libFoundation/Foundation/NSTimer.m D libFoundation/Foundation/NSURL.h D libFoundation/Foundation/NSURL.m D libFoundation/Foundation/NSURLHandle.h D libFoundation/Foundation/NSURLHandle.m D libFoundation/Foundation/NSUndoManager.h D libFoundation/Foundation/NSUndoManager.m D libFoundation/Foundation/NSUserDefaults.h D libFoundation/Foundation/NSUserDefaults.m D libFoundation/Foundation/NSUtilities.h D libFoundation/Foundation/NSUtilities.m D libFoundation/Foundation/NSVMPage.m D libFoundation/Foundation/NSValue.h D libFoundation/Foundation/NSValue.m D libFoundation/Foundation/NSZone.h D libFoundation/Foundation/NSZone.m D libFoundation/Foundation/PrintfFormatScanner.m D libFoundation/Foundation/PrintfScannerHandler.m D libFoundation/Foundation/PrivateThreadData.h D libFoundation/Foundation/PrivateThreadData.m D libFoundation/Foundation/PropertyListParser.h D libFoundation/Foundation/PropertyListParser.m D libFoundation/Foundation/PropertyListParserUnichar.m D libFoundation/Foundation/StackZone.h D libFoundation/Foundation/StackZone.m D libFoundation/Foundation/UnixSignalHandler.h D libFoundation/Foundation/UnixSignalHandler.m D libFoundation/Foundation/behavior.m D libFoundation/Foundation/byte_order.h D libFoundation/Foundation/common.h D libFoundation/Foundation/common.m D libFoundation/Foundation/cvtutf.c D libFoundation/Foundation/cvtutf.h D libFoundation/Foundation/encoding.m D libFoundation/Foundation/err.m D libFoundation/Foundation/exceptions/EncodingFormatExceptions.h D libFoundation/Foundation/exceptions/EncodingFormatExceptions.m D libFoundation/Foundation/exceptions/FoundationException.h D libFoundation/Foundation/exceptions/FoundationException.m D libFoundation/Foundation/exceptions/FoundationExceptions.h D libFoundation/Foundation/exceptions/GeneralExceptions.h D libFoundation/Foundation/exceptions/GeneralExceptions.m D libFoundation/Foundation/exceptions/NSCoderExceptions.h D libFoundation/Foundation/exceptions/NSCoderExceptions.m D libFoundation/Foundation/exceptions/NSFileHandleExceptions.h D libFoundation/Foundation/exceptions/NSFileHandleExceptions.m D libFoundation/Foundation/exceptions/NSInvocationExceptions.h D libFoundation/Foundation/exceptions/NSInvocationExceptions.m D libFoundation/Foundation/exceptions/NSValueExceptions.h D libFoundation/Foundation/exceptions/NSValueExceptions.m D libFoundation/Foundation/exceptions/StringExceptions.h D libFoundation/Foundation/exceptions/StringExceptions.m D libFoundation/Foundation/fhs.make D libFoundation/Foundation/lfmemory.h.in D libFoundation/Foundation/libFoundation.def D libFoundation/Foundation/libFoundation.make.in D libFoundation/Foundation/load.m D libFoundation/Foundation/misc.m D libFoundation/Foundation/objc-runtime.m D libFoundation/Foundation/realpath.m D libFoundation/Foundation/scanFloat.def D libFoundation/Foundation/scanInt.def D libFoundation/Foundation/thr-mach.m D libFoundation/GNUmakefile D libFoundation/GNUmakefile.alone D libFoundation/INSTALL.txt D libFoundation/NEWS D libFoundation/README D libFoundation/README.first D libFoundation/README.gc D libFoundation/README.mingw32 D libFoundation/README.osx D libFoundation/README.sparc D libFoundation/Resources/CharacterSets/alphanumericCharacterSet.bitmap D libFoundation/Resources/CharacterSets/controlCharacterSet.bitmap D libFoundation/Resources/CharacterSets/decimalDigitCharacterSet.bitmap D libFoundation/Resources/CharacterSets/decomposableCharacterSet.bitmap D libFoundation/Resources/CharacterSets/emptyCharacterSet.bitmap D libFoundation/Resources/CharacterSets/illegalCharacterSet.bitmap D libFoundation/Resources/CharacterSets/letterCharacterSet.bitmap D libFoundation/Resources/CharacterSets/lowercaseLetterCharacterSet.bitmap D libFoundation/Resources/CharacterSets/nonBaseCharacterSet.bitmap D libFoundation/Resources/CharacterSets/punctuationCharacterSet.bitmap D libFoundation/Resources/CharacterSets/uppercaseLetterCharacterSet.bitmap D libFoundation/Resources/CharacterSets/whitespaceAndNewlineCharacterSet.bitmap D libFoundation/Resources/CharacterSets/whitespaceCharacterSet.bitmap D libFoundation/Resources/Defaults/English.plist D libFoundation/Resources/Defaults/French.plist D libFoundation/Resources/Defaults/German.plist D libFoundation/Resources/Defaults/NSGlobalDomain.plist D libFoundation/Resources/Defaults/Romanian.plist D libFoundation/Resources/GNUmakefile D libFoundation/Resources/GNUmakefile.alone D libFoundation/Resources/TimeZoneInfo/Asia/Calcutta D libFoundation/Resources/TimeZoneInfo/Australia/NSW D libFoundation/Resources/TimeZoneInfo/Australia/North D libFoundation/Resources/TimeZoneInfo/Australia/Queensland D libFoundation/Resources/TimeZoneInfo/Australia/South D libFoundation/Resources/TimeZoneInfo/Australia/Tasmania D libFoundation/Resources/TimeZoneInfo/Australia/Victoria D libFoundation/Resources/TimeZoneInfo/Australia/West D libFoundation/Resources/TimeZoneInfo/CET D libFoundation/Resources/TimeZoneInfo/CLST D libFoundation/Resources/TimeZoneInfo/CST6CDT D libFoundation/Resources/TimeZoneInfo/Canada/Atlantic D libFoundation/Resources/TimeZoneInfo/Canada/Central D libFoundation/Resources/TimeZoneInfo/Canada/East-Saskatchewan D libFoundation/Resources/TimeZoneInfo/Canada/Eastern D libFoundation/Resources/TimeZoneInfo/Canada/Mountain D libFoundation/Resources/TimeZoneInfo/Canada/Newfoundland D libFoundation/Resources/TimeZoneInfo/Canada/Pacific D libFoundation/Resources/TimeZoneInfo/Canada/Yukon D libFoundation/Resources/TimeZoneInfo/EET D libFoundation/Resources/TimeZoneInfo/EST D libFoundation/Resources/TimeZoneInfo/EST5EDT D libFoundation/Resources/TimeZoneInfo/Europe/Berlin D libFoundation/Resources/TimeZoneInfo/Europe/Brussels D libFoundation/Resources/TimeZoneInfo/Europe/Paris D libFoundation/Resources/TimeZoneInfo/GB-Eire D libFoundation/Resources/TimeZoneInfo/GMT D libFoundation/Resources/TimeZoneInfo/GMT+0_30 D libFoundation/Resources/TimeZoneInfo/GMT+1 D libFoundation/Resources/TimeZoneInfo/GMT+10 D libFoundation/Resources/TimeZoneInfo/GMT+10_30 D libFoundation/Resources/TimeZoneInfo/GMT+11 D libFoundation/Resources/TimeZoneInfo/GMT+11_30 D libFoundation/Resources/TimeZoneInfo/GMT+12 D libFoundation/Resources/TimeZoneInfo/GMT+13 D libFoundation/Resources/TimeZoneInfo/GMT+14 D libFoundation/Resources/TimeZoneInfo/GMT+1_30 D libFoundation/Resources/TimeZoneInfo/GMT+2 D libFoundation/Resources/TimeZoneInfo/GMT+2_30 D libFoundation/Resources/TimeZoneInfo/GMT+3 D libFoundation/Resources/TimeZoneInfo/GMT+3_30 D libFoundation/Resources/TimeZoneInfo/GMT+4 D libFoundation/Resources/TimeZoneInfo/GMT+4_30 D libFoundation/Resources/TimeZoneInfo/GMT+5 D libFoundation/Resources/TimeZoneInfo/GMT+5_30 D libFoundation/Resources/TimeZoneInfo/GMT+6 D libFoundation/Resources/TimeZoneInfo/GMT+6_30 D libFoundation/Resources/TimeZoneInfo/GMT+7 D libFoundation/Resources/TimeZoneInfo/GMT+7_30 D libFoundation/Resources/TimeZoneInfo/GMT+8 D libFoundation/Resources/TimeZoneInfo/GMT+8_30 D libFoundation/Resources/TimeZoneInfo/GMT+9 D libFoundation/Resources/TimeZoneInfo/GMT+9_30 D libFoundation/Resources/TimeZoneInfo/GMT-0_30 D libFoundation/Resources/TimeZoneInfo/GMT-1 D libFoundation/Resources/TimeZoneInfo/GMT-10 D libFoundation/Resources/TimeZoneInfo/GMT-10_30 D libFoundation/Resources/TimeZoneInfo/GMT-11 D libFoundation/Resources/TimeZoneInfo/GMT-11_30 D libFoundation/Resources/TimeZoneInfo/GMT-12 D libFoundation/Resources/TimeZoneInfo/GMT-1_30 D libFoundation/Resources/TimeZoneInfo/GMT-2 D libFoundation/Resources/TimeZoneInfo/GMT-2_30 D libFoundation/Resources/TimeZoneInfo/GMT-3 D libFoundation/Resources/TimeZoneInfo/GMT-3_30 D libFoundation/Resources/TimeZoneInfo/GMT-4 D libFoundation/Resources/TimeZoneInfo/GMT-4_30 D libFoundation/Resources/TimeZoneInfo/GMT-5 D libFoundation/Resources/TimeZoneInfo/GMT-5_30 D libFoundation/Resources/TimeZoneInfo/GMT-6 D libFoundation/Resources/TimeZoneInfo/GMT-6_30 D libFoundation/Resources/TimeZoneInfo/GMT-7 D libFoundation/Resources/TimeZoneInfo/GMT-7_30 D libFoundation/Resources/TimeZoneInfo/GMT-8 D libFoundation/Resources/TimeZoneInfo/GMT-8_30 D libFoundation/Resources/TimeZoneInfo/GMT-9 D libFoundation/Resources/TimeZoneInfo/GMT-9_30 D libFoundation/Resources/TimeZoneInfo/Greenwich D libFoundation/Resources/TimeZoneInfo/HST D libFoundation/Resources/TimeZoneInfo/Iceland D libFoundation/Resources/TimeZoneInfo/Japan D libFoundation/Resources/TimeZoneInfo/MET D libFoundation/Resources/TimeZoneInfo/MST D libFoundation/Resources/TimeZoneInfo/MST7MDT D libFoundation/Resources/TimeZoneInfo/NZ D libFoundation/Resources/TimeZoneInfo/PST8PDT D libFoundation/Resources/TimeZoneInfo/Poland D libFoundation/Resources/TimeZoneInfo/RegionsDictionary D libFoundation/Resources/TimeZoneInfo/SAST D libFoundation/Resources/TimeZoneInfo/SGT D libFoundation/Resources/TimeZoneInfo/Singapore D libFoundation/Resources/TimeZoneInfo/SystemV/AST4 D libFoundation/Resources/TimeZoneInfo/SystemV/AST4ADT D libFoundation/Resources/TimeZoneInfo/SystemV/CST6 D libFoundation/Resources/TimeZoneInfo/SystemV/CST6CDT D libFoundation/Resources/TimeZoneInfo/SystemV/EST5 D libFoundation/Resources/TimeZoneInfo/SystemV/EST5EDT D libFoundation/Resources/TimeZoneInfo/SystemV/HST10 D libFoundation/Resources/TimeZoneInfo/SystemV/MST7 D libFoundation/Resources/TimeZoneInfo/SystemV/MST7MDT D libFoundation/Resources/TimeZoneInfo/SystemV/PST8 D libFoundation/Resources/TimeZoneInfo/SystemV/PST8PDT D libFoundation/Resources/TimeZoneInfo/SystemV/YST9 D libFoundation/Resources/TimeZoneInfo/SystemV/YST9YDT D libFoundation/Resources/TimeZoneInfo/Turkey D libFoundation/Resources/TimeZoneInfo/UCT D libFoundation/Resources/TimeZoneInfo/US/Arizona D libFoundation/Resources/TimeZoneInfo/US/Central D libFoundation/Resources/TimeZoneInfo/US/East-Indiana D libFoundation/Resources/TimeZoneInfo/US/Eastern D libFoundation/Resources/TimeZoneInfo/US/Hawaii D libFoundation/Resources/TimeZoneInfo/US/Mountain D libFoundation/Resources/TimeZoneInfo/US/Pacific D libFoundation/Resources/TimeZoneInfo/US/Pacific-New D libFoundation/Resources/TimeZoneInfo/US/Yukon D libFoundation/Resources/TimeZoneInfo/UTC D libFoundation/Resources/TimeZoneInfo/Universal D libFoundation/Resources/TimeZoneInfo/W-SU D libFoundation/Resources/TimeZoneInfo/WET D libFoundation/Resources/TimeZoneInfo/create D libFoundation/TODO D libFoundation/Version D libFoundation/aclocal.m4 D libFoundation/config.guess D libFoundation/config.h.in D libFoundation/config.h.win32 D libFoundation/config.mak.in D libFoundation/config.mak.win32 D libFoundation/config.sub D libFoundation/config/alpha/linux-gnu.h D libFoundation/config/generic/generic.h D libFoundation/config/hppa/hppa.h D libFoundation/config/i386/cygwin32.h D libFoundation/config/i386/freebsd.h D libFoundation/config/i386/gnu.h D libFoundation/config/i386/i386.h D libFoundation/config/i386/linux-gnu.h D libFoundation/config/i386/linux.h D libFoundation/config/i386/mingw32.h D libFoundation/config/i386/nextstep3.h D libFoundation/config/i386/nextstep4.h D libFoundation/config/i386/openbsd3.7.h D libFoundation/config/i386/openbsd3.8.h D libFoundation/config/i386/openbsd3.9.h D libFoundation/config/i386/solaris2.5.1.h D libFoundation/config/i386/solaris2.9.h D libFoundation/config/m68k/m68k.h D libFoundation/config/m68k/nextstep3.h D libFoundation/config/powerpc/powerpc.h D libFoundation/config/powerpc64/gnu.h D libFoundation/config/powerpc64/linux-gnu.h D libFoundation/config/powerpc64/linux.h D libFoundation/config/powerpc64/powerpc64.h D libFoundation/config/sparc/solaris2.4.h D libFoundation/config/sparc/sparc.h D libFoundation/config/x86_64/linux-gnu.h D libFoundation/config/x86_64/linux.h D libFoundation/config/x86_64/x86_64.h D libFoundation/configure D libFoundation/configure.bat D libFoundation/configure.in D libFoundation/debian/changelog D libFoundation/debian/compat D libFoundation/debian/control D libFoundation/debian/copyright D libFoundation/debian/docs D libFoundation/debian/libfoundation-data.install D libFoundation/debian/libfoundation-tools.install D libFoundation/debian/libfoundation-tools.links D libFoundation/debian/libfoundation1.0-dev.install D libFoundation/debian/libfoundation1.0.install D libFoundation/debian/libfoundation1.1-data.install D libFoundation/debian/libfoundation1.1-dev.install D libFoundation/debian/libfoundation1.1-tools.install D libFoundation/debian/libfoundation1.1-tools.links D libFoundation/debian/libfoundation1.1.install D libFoundation/debian/rules D libFoundation/doc/GNUmakefile D libFoundation/doc/README D libFoundation/doc/libFoundation.texi D libFoundation/doc/signature-test.pl D libFoundation/examples/Defaults.m D libFoundation/examples/GNUmakefile D libFoundation/examples/GNUmakefile.alone D libFoundation/examples/chkdict.m D libFoundation/examples/fhs.make D libFoundation/examples/fmls.m D libFoundation/examples/fmrm.m D libFoundation/examples/printenv.m D libFoundation/extensions/DefaultScannerHandler.h D libFoundation/extensions/FormatScanner.h D libFoundation/extensions/GCArray.h D libFoundation/extensions/GCDictionary.h D libFoundation/extensions/GCObject.h D libFoundation/extensions/GarbageCollector.h D libFoundation/extensions/NSException.h D libFoundation/extensions/PrintfFormatScanner.h D libFoundation/extensions/PrintfScannerHandler.h D libFoundation/extensions/encoding.h D libFoundation/extensions/exceptions/FoundationException.h D libFoundation/extensions/exceptions/GeneralExceptions.h D libFoundation/extensions/exceptions/NSCoderExceptions.h D libFoundation/extensions/objc-runtime.h D libFoundation/extensions/support.h D libFoundation/gsfix.make.in D libFoundation/install-sh D libFoundation/libfoundation.spec D libFoundation/misc/GNUmakefile D libFoundation/misc/testnested.c D libFoundation/misc/testurl.m D libFoundation/mkinstalldirs D libFoundation/sharedlib.mak D patch-stamp D sope-appserver/NGObjWeb/NGHttp/NGHttp.xcodeproj/project.pbxproj D sope-appserver/NGObjWeb/NGObjWeb.xcodeproj/project.pbxproj D sope-appserver/NGObjWeb/SoObjects/SoObjects.xcodeproj/project.pbxproj D sope-appserver/NGObjWeb/WebDAV/WebDAV.xcodeproj/project.pbxproj D sope-appserver/NGXmlRpc/NGXmlRpc.xcodeproj/project.pbxproj D sope-appserver/SoOFS/SoOFS.xcodeproj/project.pbxproj D sope-appserver/WEExtensions/WEExtensions.xcodeproj/project.pbxproj D sope-appserver/WEPrototype/WEPrototype.xcodeproj/project.pbxproj D sope-appserver/WOExtensions/WOExtensions.xcodeproj/project.pbxproj D sope-appserver/mod_ngobjweb-apache2/mod_ngobjweb.xcodeproj/project.pbxproj D sope-appserver/mod_ngobjweb/mod_ngobjweb.xcodeproj/project.pbxproj D sope-appserver/sope-appserver.xcodeproj/project.pbxproj D sope-core/EOControl/EOControl.xcodeproj/project.pbxproj D sope-core/EOCoreData/EOCoreData.xcodeproj/project.pbxproj D sope-core/NGExtensions/NGExtensions.xcodeproj/project.pbxproj D sope-core/NGStreams/NGStreams.xcodeproj/project.pbxproj D sope-core/sope-core.xcodeproj/project.pbxproj D sope-gdl1/GDLAccess/GDLAccess.xcodeproj/project.pbxproj D sope-gdl1/PostgreSQL/PostgreSQL.xcodeproj/project.pbxproj D sope-gdl1/SQLite3/SQLite3.xcodeproj/project.pbxproj D sope-gdl1/sope-gdl1.xcodeproj/project.pbxproj D sope-ical/NGiCal/NGiCal.xcodeproj/project.pbxproj D sope-ical/sope-ical.xcodeproj/project.pbxproj D sope-ical/versitSaxDriver/versitSaxDriver.xcodeproj/project.pbxproj D sope-ldap/NGLdap/NGLdap.xcodeproj/project.pbxproj D sope-ldap/sope-ldap.xcodeproj/project.pbxproj D sope-mime/NGImap4/NGImap4.xcodeproj/project.pbxproj D sope-mime/NGMail/NGMail.xcodeproj/project.pbxproj D sope-mime/NGMime/NGMime.xcodeproj/project.pbxproj D sope-mime/sope-mime.xcodeproj/project.pbxproj D sope-xml/ChangeLogSaxDriver/ChangeLogSaxDriver.xcodeproj/project.pbxproj D sope-xml/DOM/DOM.xcodeproj/project.pbxproj D sope-xml/STXSaxDriver/STXSaxDriver.xcodeproj/project.pbxproj D sope-xml/SaxObjC/SaxObjC.xcodeproj/project.pbxproj D sope-xml/XmlRpc/XmlRpc.xcodeproj/project.pbxproj D sope-xml/libxmlSAXDriver/libxmlSAXDriver.xcodeproj/project.pbxproj D sope-xml/sope-xml.xcodeproj/project.pbxproj D sopex/SOPEX/SOPEX.xcodeproj/project.pbxproj D sopex/Samples/WOxExtTest/WOExtTest.xcodeproj/project.pbxproj D sopex/WebObjects/WebObjects.xcodeproj/project.pbxproj D xmlrpc_call/ChangeLog D xmlrpc_call/GNUmakefile D xmlrpc_call/GNUmakefile.preamble D xmlrpc_call/HandleCredentialsClient.h D xmlrpc_call/HandleCredentialsClient.m D xmlrpc_call/NSObject+Printing.m D xmlrpc_call/README D xmlrpc_call/XmlRpcClientTool.h D xmlrpc_call/XmlRpcClientTool.m D xmlrpc_call/common.h D xmlrpc_call/fhs.make D xmlrpc_call/xmlrpc_call.m D xmlrpc_call/xmlrpc_call.xcodeproj/project.pbxproj D xmlrpc_call/xmlrpc_call.xcodeproj/znek.perspective commit 9e7c4005160a21778c9a15a5cb6dfe379cf587a5 Author: Ludovic Marcotte Date: Thu Jul 29 17:59:06 2010 +0000 See ChangeLog Monotone-Parent: a3ff652a2fbe233cded539aeefdee2668df58c75 Monotone-Revision: 4408649e520f6bcf86ac267f33864c565cc9e03d Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2010-07-29T17:59:06 Monotone-Branch: ca.inverse.sope M ChangeLog M debian/changelog M debian/compat M debian/control M debian/control.in M debian/copyright M debian/libsope-appserver_SOPEVER_-dev.install M debian/libsope-appserver_SOPEVER_.install M debian/libsope-core_SOPEVER_-dev.install M debian/libsope-gdl1-_SOPEVER_-dev.install M debian/libsope-ical_SOPEVER_-dev.install M debian/libsope-ical_SOPEVER_.install M debian/libsope-ldap_SOPEVER_-dev.install M debian/libsope-mime_SOPEVER_-dev.install M debian/libsope-xml_SOPEVER_-dev.install M debian/patches/sope-gsmake2.diff M debian/rules M debian/sope_SOPEVER_-gdl1-postgresql.install M debian/sope_SOPEVER_-libxmlsaxdriver.install M debian/sope_SOPEVER_-stxsaxdriver.install M debian/sope_SOPEVER_-versitsaxdriver.install commit 9cc70b45be9235e77b7744abcf631f8ff5193c00 Author: Ludovic Marcotte Date: Thu Jul 29 17:45:00 2010 +0000 See ChangeLog Monotone-Parent: c98854ace8d5141925016369142b44606e4a148f Monotone-Revision: a3ff652a2fbe233cded539aeefdee2668df58c75 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2010-07-29T17:45:00 Monotone-Branch: ca.inverse.sope A ChangeLog M GNUmakefile M configure M sope-appserver/GNUmakefile M sope-appserver/NGObjWeb/Associations/GNUmakefile M sope-appserver/NGObjWeb/ChangeLog M sope-appserver/NGObjWeb/DAVPropMap.plist M sope-appserver/NGObjWeb/DynamicElements/GNUmakefile M sope-appserver/NGObjWeb/DynamicElements/WOConditional.m M sope-appserver/NGObjWeb/DynamicElements/WOGenericElement.m M sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.h M sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.m M sope-appserver/NGObjWeb/DynamicElements/WORepetition.m M sope-appserver/NGObjWeb/DynamicElements/WOString.m M sope-appserver/NGObjWeb/DynamicElements/WOxHTMLElemBuilder.m M sope-appserver/NGObjWeb/DynamicElements/_WOComplexHyperlink.m M sope-appserver/NGObjWeb/DynamicElements/_WOTemporaryHyperlink.m M sope-appserver/NGObjWeb/GNUmakefile M sope-appserver/NGObjWeb/GNUmakefile.postamble M sope-appserver/NGObjWeb/GNUmakefile.preamble M sope-appserver/NGObjWeb/NGHttp/GNUmakefile M sope-appserver/NGObjWeb/NGHttp/NGHttpRequest.m M sope-appserver/NGObjWeb/NGObjWeb/WOAdaptor.h M sope-appserver/NGObjWeb/NGObjWeb/WOCoreApplication.h M sope-appserver/NGObjWeb/SoObjects/GNUmakefile M sope-appserver/NGObjWeb/SoObjects/GNUmakefile.preamble M sope-appserver/NGObjWeb/SoObjects/SoObject.h M sope-appserver/NGObjWeb/SoObjects/SoObject.m M sope-appserver/NGObjWeb/SoObjects/SoProductLoader.m M sope-appserver/NGObjWeb/SoObjects/SoProductRegistry.m M sope-appserver/NGObjWeb/Templates/GNUmakefile M sope-appserver/NGObjWeb/Templates/GNUmakefile.preamble M sope-appserver/NGObjWeb/Templates/WOApplication+Builders.m M sope-appserver/NGObjWeb/Templates/WOWrapperTemplateBuilder.m M sope-appserver/NGObjWeb/Templates/WOxComponentElemBuilder.m M sope-appserver/NGObjWeb/Templates/WOxElemBuilder.m M sope-appserver/NGObjWeb/Templates/WOxTemplateBuilder.m M sope-appserver/NGObjWeb/WOComponentDefinition.m M sope-appserver/NGObjWeb/WOCookie.m M sope-appserver/NGObjWeb/WOCoreApplication+Bundle.m M sope-appserver/NGObjWeb/WOCoreApplication.m M sope-appserver/NGObjWeb/WODirectAction.m M sope-appserver/NGObjWeb/WODynamicElement.m M sope-appserver/NGObjWeb/WOHTTPConnection.m M sope-appserver/NGObjWeb/WOHTTPURLHandle.m M sope-appserver/NGObjWeb/WOHttpAdaptor/GNUmakefile M sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpAdaptor.h M sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpAdaptor.m M sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpTransaction.m M sope-appserver/NGObjWeb/WOMessage+XML.m M sope-appserver/NGObjWeb/WOMessage.m M sope-appserver/NGObjWeb/WOWatchDogApplicationMain.m M sope-appserver/NGObjWeb/WebDAV/GNUmakefile M sope-appserver/NGObjWeb/WebDAV/SoObjectResultEntry.m M sope-appserver/NGObjWeb/WebDAV/SoWebDAVRenderer.m M sope-appserver/NGObjWeb/woapp-gs.make M sope-appserver/NGObjWeb/wobundle-gs.make M sope-appserver/NGXmlRpc/GNUmakefile M sope-appserver/SoOFS/GNUmakefile M sope-appserver/SoOFS/GNUmakefile.preamble M sope-appserver/WEExtensions/ChangeLog M sope-appserver/WEExtensions/GNUmakefile M sope-appserver/WEExtensions/GNUmakefile.preamble M sope-appserver/WEExtensions/WEResourceManager.m M sope-appserver/WEExtensions/WETableView/GNUmakefile M sope-appserver/WEPrototype/GNUmakefile M sope-appserver/WEPrototype/GNUmakefile.preamble M sope-appserver/WEPrototype/doc/GNUmakefile M sope-appserver/WOExtensions/GNUmakefile M sope-appserver/WOExtensions/GNUmakefile.preamble M sope-appserver/WOXML/GNUmakefile M sope-appserver/WOXML/GNUmakefile.preamble M sope-appserver/common.make M sope-appserver/mod_ngobjweb/GNUmakefile M sope-appserver/samples/CoreDataBlog/GNUmakefile M sope-appserver/samples/GNUmakefile M sope-appserver/samples/HelloForm/GNUmakefile M sope-appserver/samples/HelloWorld/GNUmakefile M sope-appserver/samples/SoCookieAuth/GNUmakefile M sope-appserver/samples/TestPages/GNUmakefile M sope-appserver/samples/TestPrototype/GNUmakefile M sope-appserver/samples/WOxExtTest/GNUmakefile M sope-appserver/samples/davpropget/GNUmakefile M sope-appserver/samples/iCalPortal/GNUmakefile M sope-appserver/samples/iCalPortal/GNUmakefile.preamble M sope-appserver/samples/iCalPortal/Pages/GNUmakefile M sope-appserver/samples/iCalPortal/WebDAV/GNUmakefile M sope-appserver/samples/parsedav/GNUmakefile M sope-appserver/samples/xmlrpc/GNUmakefile M sope-core/EOControl/GNUmakefile M sope-core/EOCoreData/GNUmakefile M sope-core/GNUmakefile M sope-core/NGExtensions/ChangeLog M sope-core/NGExtensions/EOExt.subproj/EOGlobalID+Ext.m M sope-core/NGExtensions/EOExt.subproj/GNUmakefile M sope-core/NGExtensions/FdExt.subproj/GNUmakefile M sope-core/NGExtensions/FdExt.subproj/NSString+Encoding.m M sope-core/NGExtensions/FdExt.subproj/NSString+Ext.m M sope-core/NGExtensions/GNUmakefile M sope-core/NGExtensions/NGBase64Coding.m M sope-core/NGExtensions/NGBundleManager.m M sope-core/NGExtensions/NGExtensions/NGResourceLocator.h M sope-core/NGExtensions/NGExtensions/NSString+Ext.h M sope-core/NGExtensions/NGLogging.subproj/GNUmakefile M sope-core/NGExtensions/NGResourceLocator.m M sope-core/NGExtensions/NGRuleEngine.subproj/GNUmakefile M sope-core/NGExtensions/NGRuleEngine.subproj/NGRuleModel.m M sope-core/NGExtensions/XmlExt.subproj/GNUmakefile M sope-core/NGStreams/ChangeLog M sope-core/NGStreams/GNUmakefile M sope-core/NGStreams/GNUmakefile.preamble M sope-core/NGStreams/NGActiveSocket.m M sope-core/NGStreams/NGCTextStream.m M sope-core/NGStreams/NGCharBuffer.m M sope-core/NGStreams/NGDatagramSocket.m M sope-core/NGStreams/NGGZipStream.m M sope-core/NGStreams/NGStream+serialization.m M sope-core/NGStreams/NGStreams/NGActiveSocket.h M sope-core/NGStreams/NGStreams/NGDatagramSocket.h M sope-core/common.make M sope-core/samples/GNUmakefile M sope-gdl1/FrontBase2/GNUmakefile M sope-gdl1/GDLAccess/EOAdaptor.h M sope-gdl1/GDLAccess/EOAdaptor.m M sope-gdl1/GDLAccess/FoundationExt/GNUmakefile M sope-gdl1/GDLAccess/GNUmakefile M sope-gdl1/GDLAccess/GNUmakefile.preamble M sope-gdl1/GDLAccess/common.h M sope-gdl1/GNUmakefile M sope-gdl1/MySQL/GNUmakefile M sope-gdl1/MySQL/GNUmakefile.preamble M sope-gdl1/MySQL/MySQL4Channel.m M sope-gdl1/Oracle8/ChangeLog M sope-gdl1/Oracle8/GNUmakefile M sope-gdl1/Oracle8/OracleAdaptorChannel.m M sope-gdl1/Oracle8/OracleAdaptorChannelController.m M sope-gdl1/PostgreSQL/GNUmakefile M sope-gdl1/PostgreSQL/GNUmakefile.preamble M sope-gdl1/SQLite3/GNUmakefile M sope-gdl1/SQLite3/GNUmakefile.preamble M sope-ical/GNUmakefile M sope-ical/NGiCal/GNUmakefile M sope-ical/NGiCal/GNUmakefile.postamble M sope-ical/samples/GNUmakefile M sope-ical/versitSaxDriver/GNUmakefile M sope-ldap/GNUmakefile M sope-ldap/NGLdap/ChangeLog M sope-ldap/NGLdap/GNUmakefile M sope-ldap/NGLdap/NGLdapConnection.h M sope-ldap/NGLdap/NGLdapConnection.m M sope-ldap/NGLdap/NGLdapEntry.m M sope-ldap/samples/GNUmakefile M sope-mime/GNUmakefile M sope-mime/NGImap4/ChangeLog M sope-mime/NGImap4/EOQualifier+IMAPAdditions.m M sope-mime/NGImap4/GNUmakefile M sope-mime/NGImap4/NGImap4Client.h M sope-mime/NGImap4/NGImap4Client.m M sope-mime/NGImap4/NGImap4Connection.h M sope-mime/NGImap4/NGImap4Connection.m M sope-mime/NGImap4/NGImap4ConnectionManager.m M sope-mime/NGImap4/NGImap4Functions.h M sope-mime/NGImap4/NGImap4Functions.m M sope-mime/NGImap4/NGImap4ResponseNormalizer.h M sope-mime/NGImap4/NGImap4ResponseNormalizer.m M sope-mime/NGImap4/NGImap4ResponseParser.m M sope-mime/NGImap4/NGSieveClient.m M sope-mime/NGImap4/NSString+Imap4.m M sope-mime/NGMail/ChangeLog M sope-mime/NGMail/GNUmakefile M sope-mime/NGMail/NGMailAddressParser.h M sope-mime/NGMail/NGMailAddressParser.m M sope-mime/NGMail/NGMimeMessageGenerator.m M sope-mime/NGMail/NGSmtpClient.m M sope-mime/NGMail/NSData+MimeQP.m M sope-mime/NGMime/ChangeLog M sope-mime/NGMime/GNUmakefile M sope-mime/NGMime/GNUmakefile.preamble M sope-mime/NGMime/NGMimeAddressHeaderFieldGenerator.m M sope-mime/NGMime/NGMimeBodyParser.m M sope-mime/NGMime/NGMimeBodyPart.m M sope-mime/NGMime/NGMimeContentDispositionHeaderFieldGenerator.m M sope-mime/NGMime/NGMimeContentTypeHeaderFieldGenerator.m M sope-mime/NGMime/NGMimeHeaderFieldGeneratorSet.m M sope-mime/NGMime/NGMimeMultipartBodyParser.m M sope-mime/NGMime/NGMimePartGenerator.m M sope-mime/NGMime/NGMimePartParser.h M sope-mime/NGMime/NGMimePartParser.m M sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m M sope-mime/NGMime/NGMimeType.m M sope-mime/samples/GNUmakefile M sope-xml/ChangeLogSaxDriver/GNUmakefile M sope-xml/DOM/GNUmakefile M sope-xml/DOM/GNUmakefile.preamble M sope-xml/GNUmakefile M sope-xml/STXSaxDriver/ExtraSTX/GNUmakefile M sope-xml/STXSaxDriver/GNUmakefile M sope-xml/STXSaxDriver/Model/GNUmakefile M sope-xml/SaxObjC/GNUmakefile M sope-xml/SaxObjC/GNUmakefile.preamble M sope-xml/SaxObjC/SaxObjectModel.h M sope-xml/SaxObjC/SaxObjectModel.m M sope-xml/SaxObjC/SaxXMLReaderFactory.m M sope-xml/SaxObjC/XMLNamespaces.h M sope-xml/XmlRpc/GNUmakefile M sope-xml/XmlRpc/GNUmakefile.preamble M sope-xml/common.make M sope-xml/libxmlSAXDriver/GNUmakefile M sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.h M sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.m M sope-xml/pyxSAXDriver/GNUmakefile M sope-xml/samples/GNUmakefile M sope-xml/samples/GNUmakefile.preamble M sope-xml/samples/PlistSaxDriver/GNUmakefile M xmlrpc_call/GNUmakefile M xmlrpc_call/GNUmakefile.preamble commit f94d0381bb1f67b067a2c2767a0e39e68be5c37d Author: Ludovic Marcotte Date: Thu Jul 29 17:27:45 2010 +0000 Added SOPE (r1664) to Inverse's monotone repo. Monotone-Revision: c98854ace8d5141925016369142b44606e4a148f Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2010-07-29T17:27:45 Monotone-Branch: ca.inverse.sope A COPYRIGHT A GNUmakefile A INSTALL A PROJECTLEAD A README A README-OSX.txt A Recycler/ApacheWO/.cvsignore A Recycler/ApacheWO/20040608 A Recycler/ApacheWO/AWODirectoryConfig.h A Recycler/ApacheWO/AWODirectoryConfig.m A Recycler/ApacheWO/AWOServerConfig.h A Recycler/ApacheWO/AWOServerConfig.m A Recycler/ApacheWO/AliasMap.h A Recycler/ApacheWO/AliasMap.m A Recycler/ApacheWO/ApacheCommands.plist A Recycler/ApacheWO/ApacheHandlers.plist A Recycler/ApacheWO/ApacheResourceManager.h A Recycler/ApacheWO/ApacheResourceManager.m A Recycler/ApacheWO/ApacheWO+Echo.m A Recycler/ApacheWO/ApacheWO+Echo2.m A Recycler/ApacheWO/ApacheWO+RequestHandler.m A Recycler/ApacheWO/ApacheWO+hooks.m A Recycler/ApacheWO/ApacheWO+woxpage.m A Recycler/ApacheWO/ApacheWO.h A Recycler/ApacheWO/ApacheWO.m A Recycler/ApacheWO/ApacheWOTransaction.h A Recycler/ApacheWO/ApacheWOTransaction.m A Recycler/ApacheWO/ChangeLog A Recycler/ApacheWO/GNUmakefile A Recycler/ApacheWO/README A Recycler/ApacheWO/TestApp/GNUmakefile A Recycler/ApacheWO/TestApp/TestApp.m A Recycler/ApacheWO/WOComponent+Apache.m A Recycler/ApacheWO/WORequest+Apache.h A Recycler/ApacheWO/WORequest+Apache.m A Recycler/ApacheWO/WORequestHandler+Apache.h A Recycler/ApacheWO/WORequestHandler+Apache.m A Recycler/ApacheWO/WOResponse+Apache.h A Recycler/ApacheWO/WOResponse+Apache.m A Recycler/ApacheWO/common.h A Recycler/ApacheWO/docs/Embed.wox A Recycler/ApacheWO/docs/Frame.wox A Recycler/ApacheWO/docs/Page2.wox A Recycler/ApacheWO/docs/Page3.wox A Recycler/ApacheWO/docs/RqInfo.wox A Recycler/ApacheWO/docs/SSIPage.shtml A Recycler/ApacheWO/docs/SlowMarket.gif A Recycler/ApacheWO/docs/Table.wox A Recycler/ApacheWO/docs/WoPage1.wo/WoPage1.html A Recycler/ApacheWO/docs/WoPage1.wo/WoPage1.js A Recycler/ApacheWO/docs/WoPage1.wo/WoPage1.wod A Recycler/ApacheWO/docs/bigimg.gif A Recycler/ApacheWO/docs/imgs/SlowMarket.wox A Recycler/ApacheWO/docs/renameme-.htaccess A Recycler/ApacheWO/docs/requests.wox A Recycler/ApacheWO/docs/subdir/renameme-.htaccess A Recycler/ApacheWO/docs/subdir/test.wox A Recycler/ApacheWO/docs/test.html A Recycler/ApacheWO/docs/test.wox A Recycler/ApacheWO/docs/wa.rqh A Recycler/ApacheWO/docs/xmlrpc.rqh A Recycler/ApacheWO/httpd.conf A Recycler/ApacheWO/httpd.sh A Recycler/CFXMLSaxDriver/CFXMLSaxDriver-Info.plist A Recycler/CFXMLSaxDriver/CFXMLSaxDriver.h A Recycler/CFXMLSaxDriver/CFXMLSaxDriver.m A Recycler/CFXMLSaxDriver/COPYING A Recycler/CFXMLSaxDriver/ChangeLog A Recycler/CFXMLSaxDriver/README A Recycler/CFXMLSaxDriver/bundle-info.plist A Recycler/ExpatSaxDriver/COPYING A Recycler/ExpatSaxDriver/ExpatSaxDriver-Info.plist A Recycler/ExpatSaxDriver/ExpatSaxDriver.m A Recycler/ExpatSaxDriver/ExpatSaxDriver.xcodeproj/project.pbxproj A Recycler/ExpatSaxDriver/ExpatSaxDriver.xcodeproj/znek.perspective A Recycler/ExpatSaxDriver/GNUmakefile A Recycler/ExpatSaxDriver/README A Recycler/ExpatSaxDriver/Version A Recycler/ExpatSaxDriver/bundle-info.plist A Recycler/ExpatSaxDriver/common.h A Recycler/ExpatSaxDriver/unicode.h A Recycler/GDLContentStore/COPYING A Recycler/GDLContentStore/COPYRIGHT A Recycler/GDLContentStore/ChangeLog A Recycler/GDLContentStore/EOAdaptorChannel+GCS.h A Recycler/GDLContentStore/EOAdaptorChannel+GCS.m A Recycler/GDLContentStore/EOQualifier+GCS.h A Recycler/GDLContentStore/EOQualifier+GCS.m A Recycler/GDLContentStore/GCSChannelManager.h A Recycler/GDLContentStore/GCSChannelManager.m A Recycler/GDLContentStore/GCSContext.h A Recycler/GDLContentStore/GCSContext.m A Recycler/GDLContentStore/GCSFieldExtractor.h A Recycler/GDLContentStore/GCSFieldExtractor.m A Recycler/GDLContentStore/GCSFieldInfo.h A Recycler/GDLContentStore/GCSFieldInfo.m A Recycler/GDLContentStore/GCSFolder.h A Recycler/GDLContentStore/GCSFolder.m A Recycler/GDLContentStore/GCSFolderManager.h A Recycler/GDLContentStore/GCSFolderManager.m A Recycler/GDLContentStore/GCSFolderType.h A Recycler/GDLContentStore/GCSFolderType.m A Recycler/GDLContentStore/GCSStringFormatter.h A Recycler/GDLContentStore/GCSStringFormatter.m A Recycler/GDLContentStore/GNUmakefile A Recycler/GDLContentStore/GNUmakefile.preamble A Recycler/GDLContentStore/NSURL+GCS.h A Recycler/GDLContentStore/NSURL+GCS.m A Recycler/GDLContentStore/README A Recycler/GDLContentStore/Version A Recycler/GDLContentStore/common.h A Recycler/GDLContentStore/fhs.make A Recycler/GDLContentStore/gcs_cat.m A Recycler/GDLContentStore/gcs_gensql.m A Recycler/GDLContentStore/gcs_ls.m A Recycler/GDLContentStore/gcs_mkdir.m A Recycler/GDLContentStore/gcs_recreatequick.m A Recycler/NGJavaScript/COPYING A Recycler/NGJavaScript/ChangeLog A Recycler/NGJavaScript/Core+JS.subproj/EODataSource+JS.m A Recycler/NGJavaScript/Core+JS.subproj/EOJavaScriptGrouping.h A Recycler/NGJavaScript/Core+JS.subproj/EOJavaScriptGrouping.m A Recycler/NGJavaScript/Core+JS.subproj/EONull+JS.m A Recycler/NGJavaScript/Core+JS.subproj/GNUmakefile A Recycler/NGJavaScript/Core+JS.subproj/GNUmakefile.preamble A Recycler/NGJavaScript/Core+JS.subproj/NGFileManager+JS.m A Recycler/NGJavaScript/Core+JS.subproj/NSArray+JS.m A Recycler/NGJavaScript/Core+JS.subproj/NSDate+JS.m A Recycler/NGJavaScript/Core+JS.subproj/NSDictionary+JS.m A Recycler/NGJavaScript/Core+JS.subproj/NSNumber+JS.m A Recycler/NGJavaScript/Core+JS.subproj/NSObject+JS.h A Recycler/NGJavaScript/Core+JS.subproj/NSObject+JS.m A Recycler/NGJavaScript/Core+JS.subproj/NSString+JS.h A Recycler/NGJavaScript/Core+JS.subproj/NSString+JS.m A Recycler/NGJavaScript/Core+JS.subproj/NSUserDefaults+JS.m A Recycler/NGJavaScript/GNUmakefile A Recycler/NGJavaScript/GNUmakefile.preamble A Recycler/NGJavaScript/JSObjectOps.m A Recycler/NGJavaScript/NGJavaScript-Info.plist A Recycler/NGJavaScript/NGJavaScript.h A Recycler/NGJavaScript/NGJavaScriptArray.m A Recycler/NGJavaScript/NGJavaScriptCallable.h A Recycler/NGJavaScript/NGJavaScriptCallable.m A Recycler/NGJavaScript/NGJavaScriptContext.h A Recycler/NGJavaScript/NGJavaScriptContext.m A Recycler/NGJavaScript/NGJavaScriptDecls.h A Recycler/NGJavaScript/NGJavaScriptError.h A Recycler/NGJavaScript/NGJavaScriptError.m A Recycler/NGJavaScript/NGJavaScriptFunction.h A Recycler/NGJavaScript/NGJavaScriptFunction.m A Recycler/NGJavaScript/NGJavaScriptLanguage.m A Recycler/NGJavaScript/NGJavaScriptObjCClassInfo.h A Recycler/NGJavaScript/NGJavaScriptObjCClassInfo.m A Recycler/NGJavaScript/NGJavaScriptObject.h A Recycler/NGJavaScript/NGJavaScriptObject.m A Recycler/NGJavaScript/NGJavaScriptObjectHandler.h A Recycler/NGJavaScript/NGJavaScriptObjectHandler.m A Recycler/NGJavaScript/NGJavaScriptObjectMappingContext.h A Recycler/NGJavaScript/NGJavaScriptObjectMappingContext.m A Recycler/NGJavaScript/NGJavaScriptRuntime.h A Recycler/NGJavaScript/NGJavaScriptRuntime.m A Recycler/NGJavaScript/NGJavaScriptShadow.h A Recycler/NGJavaScript/NGJavaScriptShadow.m A Recycler/NGJavaScript/README A Recycler/NGJavaScript/ScriptLanguages.plist A Recycler/NGJavaScript/TODO A Recycler/NGJavaScript/Version A Recycler/NGJavaScript/common.h A Recycler/NGJavaScript/dummy.m A Recycler/NGJavaScript/globals.h A Recycler/NGJavaScript/globals.m A Recycler/NGJavaScript/jsobjops.m A Recycler/NGJavaScript/testjs.m A Recycler/NGJavaScript/tests/Blah.h A Recycler/NGJavaScript/tests/Blah.m A Recycler/NGJavaScript/tests/Combined.h A Recycler/NGJavaScript/tests/Combined.m A Recycler/NGJavaScript/tests/GNUmakefile A Recycler/NGJavaScript/tests/JSArchivingTests.h A Recycler/NGJavaScript/tests/JSArchivingTests.m A Recycler/NGJavaScript/tests/JSBridgeTests.h A Recycler/NGJavaScript/tests/JSBridgeTests.m A Recycler/NGJavaScript/tests/JSTest.h A Recycler/NGJavaScript/tests/JSTest.m A Recycler/NGJavaScript/tests/MyNum.h A Recycler/NGJavaScript/tests/MyNum.m A Recycler/NGObjDOM/COPYING A Recycler/NGObjDOM/COPYRIGHT A Recycler/NGObjDOM/ChangeLog A Recycler/NGObjDOM/Dynamic.subproj/COPYING A Recycler/NGObjDOM/Dynamic.subproj/ChangeLog A Recycler/NGObjDOM/Dynamic.subproj/GNUmakefile A Recycler/NGObjDOM/Dynamic.subproj/ODBindNodeRenderFactory.h A Recycler/NGObjDOM/Dynamic.subproj/ODBindNodeRenderFactory.m A Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_checkbox.m A Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_collapsible.m A Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_datefield.m A Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_fieldset.m A Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_foreach.m A Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_form.m A Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_groupings.h A Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_groupings.m A Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_if.m A Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_multiselection.m A Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_nbsp.m A Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_popupbutton.m A Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_radiobutton.m A Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_sortorderings.h A Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_sortorderings.m A Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_string.m A Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_switch.m A Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_tablecell.h A Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_tablecell.m A Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_tabledata.m A Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_tableheader.m A Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_tableview+Private.h A Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_tableview+Private.m A Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_tableview.m A Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_tabview.m A Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_viewertitle.m A Recycler/NGObjDOM/Dynamic.subproj/ODR_bind_with.m A Recycler/NGObjDOM/GNUmakefile A Recycler/NGObjDOM/GNUmakefile.postamble A Recycler/NGObjDOM/GNUmakefile.preamble A Recycler/NGObjDOM/NGObjDOM-Info.plist A Recycler/NGObjDOM/NGObjDOM.h A Recycler/NGObjDOM/NGObjDOMModule.m A Recycler/NGObjDOM/ODNamespaces.h A Recycler/NGObjDOM/ODNodeRenderer+attributes.h A Recycler/NGObjDOM/ODNodeRenderer+attributes.m A Recycler/NGObjDOM/ODNodeRenderer.h A Recycler/NGObjDOM/ODNodeRenderer.m A Recycler/NGObjDOM/ODNodeRendererFactory.h A Recycler/NGObjDOM/ODNodeRendererFactory.m A Recycler/NGObjDOM/ODNodeRendererFactorySet.h A Recycler/NGObjDOM/ODNodeRendererFactorySet.m A Recycler/NGObjDOM/ODREmbedComponent.h A Recycler/NGObjDOM/ODREmbedComponent.m A Recycler/NGObjDOM/ODRGenericTag.h A Recycler/NGObjDOM/ODRGenericTag.m A Recycler/NGObjDOM/ODRNodeText.h A Recycler/NGObjDOM/ODRNodeText.m A Recycler/NGObjDOM/ODRWebObject.h A Recycler/NGObjDOM/ODRWebObject.m A Recycler/NGObjDOM/ODR_bind_collapsible.h A Recycler/NGObjDOM/ODR_bind_fieldset.h A Recycler/NGObjDOM/ODR_bind_tableview.h A Recycler/NGObjDOM/ODR_bind_tabview.h A Recycler/NGObjDOM/ODR_bind_viewertitle.h A Recycler/NGObjDOM/ODResourceManager.h A Recycler/NGObjDOM/ODResourceManager.m A Recycler/NGObjDOM/ODWONodeRenderFactory.m A Recycler/NGObjDOM/README A Recycler/NGObjDOM/Version A Recycler/NGObjDOM/WOContext+Cursor.h A Recycler/NGObjDOM/WORenderDOM.h A Recycler/NGObjDOM/WORenderDOM.m A Recycler/NGObjDOM/XHTML.subproj/COPYING A Recycler/NGObjDOM/XHTML.subproj/ChangeLog A Recycler/NGObjDOM/XHTML.subproj/GNUmakefile A Recycler/NGObjDOM/XHTML.subproj/GNUmakefile.preamble A Recycler/NGObjDOM/XHTML.subproj/ODRDynamicXHTMLTag.h A Recycler/NGObjDOM/XHTML.subproj/ODRDynamicXHTMLTag.m A Recycler/NGObjDOM/XHTML.subproj/ODR_XHTML_a.m A Recycler/NGObjDOM/XHTML.subproj/ODR_XHTML_button.m A Recycler/NGObjDOM/XHTML.subproj/ODR_XHTML_form.m A Recycler/NGObjDOM/XHTML.subproj/ODR_XHTML_img.m A Recycler/NGObjDOM/XHTML.subproj/ODR_XHTML_input.m A Recycler/NGObjDOM/XHTML.subproj/ODR_XHTML_option.m A Recycler/NGObjDOM/XHTML.subproj/ODR_XHTML_select.m A Recycler/NGObjDOM/XHTML.subproj/ODR_XHTML_textarea.m A Recycler/NGObjDOM/XHTML.subproj/ODXHTMLNodeRenderFactory.h A Recycler/NGObjDOM/XHTML.subproj/ODXHTMLNodeRenderFactory.m A Recycler/NGObjDOM/XHTML.subproj/bundle-info.plist A Recycler/NGObjDOM/XUL.subproj/COPYING A Recycler/NGObjDOM/XUL.subproj/GNUmakefile A Recycler/NGObjDOM/XUL.subproj/GNUmakefile.preamble A Recycler/NGObjDOM/XUL.subproj/ODRDynamicXULTag.h A Recycler/NGObjDOM/XUL.subproj/ODRDynamicXULTag.m A Recycler/NGObjDOM/XUL.subproj/ODR_XUL_box.h A Recycler/NGObjDOM/XUL.subproj/ODR_XUL_box.m A Recycler/NGObjDOM/XUL.subproj/ODR_XUL_button.m A Recycler/NGObjDOM/XUL.subproj/ODR_XUL_column.m A Recycler/NGObjDOM/XUL.subproj/ODR_XUL_columns.m A Recycler/NGObjDOM/XUL.subproj/ODR_XUL_grid.m A Recycler/NGObjDOM/XUL.subproj/ODR_XUL_image.m A Recycler/NGObjDOM/XUL.subproj/ODR_XUL_spring.m A Recycler/NGObjDOM/XUL.subproj/ODR_XUL_tab.m A Recycler/NGObjDOM/XUL.subproj/ODR_XUL_text.m A Recycler/NGObjDOM/XUL.subproj/ODR_XUL_textfield.m A Recycler/NGObjDOM/XUL.subproj/ODR_XUL_title.m A Recycler/NGObjDOM/XUL.subproj/ODR_XUL_titledbox.m A Recycler/NGObjDOM/XUL.subproj/ODR_XUL_window.m A Recycler/NGObjDOM/XUL.subproj/ODXULNodeRenderFactory.h A Recycler/NGObjDOM/XUL.subproj/ODXULNodeRenderFactory.m A Recycler/NGObjDOM/XUL.subproj/bundle-info.plist A Recycler/NGObjDOM/bundle-info.plist A Recycler/NGObjDOM/common.h A Recycler/NGObjDOM/dummy.m A Recycler/NGObjDOM/fhs.make A Recycler/NGObjDOM/used_privates.h A Recycler/NGScripting/COPYING A Recycler/NGScripting/ChangeLog A Recycler/NGScripting/GNUmakefile A Recycler/NGScripting/GNUmakefile.preamble A Recycler/NGScripting/NGObjectMappingContext.h A Recycler/NGScripting/NGObjectMappingContext.m A Recycler/NGScripting/NGScriptLanguage.h A Recycler/NGScripting/NGScriptLanguage.m A Recycler/NGScripting/NGScripting-Info.plist A Recycler/NGScripting/NSObject+Scripting.h A Recycler/NGScripting/NSObject+Scripting.m A Recycler/NGScripting/Version A Recycler/NGScripting/common.h A Recycler/NGScripting/fhs.make A Recycler/Snippets/NGCString.h A Recycler/Snippets/NGCString.m A Recycler/Snippets/NGStringScanEnumerator.m A Recycler/SxComponents/COPYING A Recycler/SxComponents/ChangeLog A Recycler/SxComponents/GNUmakefile A Recycler/SxComponents/GNUmakefile.preamble A Recycler/SxComponents/NSObject+SxXmlRpcValue.m A Recycler/SxComponents/README A Recycler/SxComponents/SxBasicAuthCredentials.h A Recycler/SxComponents/SxBasicAuthCredentials.m A Recycler/SxComponents/SxComponent.h A Recycler/SxComponents/SxComponent.m A Recycler/SxComponents/SxComponentException.h A Recycler/SxComponents/SxComponentException.m A Recycler/SxComponents/SxComponentInvocation.h A Recycler/SxComponents/SxComponentInvocation.m A Recycler/SxComponents/SxComponentMethodSignature.h A Recycler/SxComponents/SxComponentMethodSignature.m A Recycler/SxComponents/SxComponentRegistry.h A Recycler/SxComponents/SxComponentRegistry.m A Recycler/SxComponents/SxComponents.h A Recycler/SxComponents/SxXmlRpcComponent.h A Recycler/SxComponents/SxXmlRpcComponent.m A Recycler/SxComponents/SxXmlRpcInvocation.h A Recycler/SxComponents/SxXmlRpcInvocation.m A Recycler/SxComponents/SxXmlRpcRegBackend.m A Recycler/SxComponents/Version A Recycler/SxComponents/common.h A Recycler/SxComponents/fhs.make A Recycler/SxComponents/sxc_call.m A Recycler/SxComponents/sxc_ls.m A Recycler/iCalSaxDriver/COPYING A Recycler/iCalSaxDriver/COPYRIGHT A Recycler/iCalSaxDriver/ChangeLog A Recycler/iCalSaxDriver/GNUmakefile A Recycler/iCalSaxDriver/GNUmakefile.postamble A Recycler/iCalSaxDriver/GNUmakefile.preamble A Recycler/iCalSaxDriver/ICalSaxParser.h A Recycler/iCalSaxDriver/ICalSaxParser.m A Recycler/iCalSaxDriver/NSCalendarDate+ICal.h A Recycler/iCalSaxDriver/NSCalendarDate+ICal.m A Recycler/iCalSaxDriver/NSString+ICal.h A Recycler/iCalSaxDriver/NSString+ICal.m A Recycler/iCalSaxDriver/README A Recycler/iCalSaxDriver/TODO A Recycler/iCalSaxDriver/Version A Recycler/iCalSaxDriver/bundle-info.plist A Recycler/iCalSaxDriver/common.h A Recycler/iCalSaxDriver/fhs.make A Recycler/iCalSaxDriver/iCalSaxDriver-Info.plist A Recycler/iCalSaxDriver/iCalSaxDriver.xcode/project.pbxproj A Recycler/iCalSaxDriver/unicode.h A Recycler/iCalSaxDriver/version.plist A Recycler/mod_objc/ApModuleBaseClass+Callbacks.m A Recycler/mod_objc/ApModuleBaseClass+Cmds.m A Recycler/mod_objc/ApModuleBaseClass+Handler.m A Recycler/mod_objc/ApModuleBaseClass.h A Recycler/mod_objc/ApModuleBaseClass.m A Recycler/mod_objc/ApTest.m A Recycler/mod_objc/ApacheCmdParms.h A Recycler/mod_objc/ApacheCmdParms.m A Recycler/mod_objc/ApacheConnection.h A Recycler/mod_objc/ApacheConnection.m A Recycler/mod_objc/ApacheModule.h A Recycler/mod_objc/ApacheModule.m A Recycler/mod_objc/ApacheObject.h A Recycler/mod_objc/ApacheObject.m A Recycler/mod_objc/ApacheRequest.h A Recycler/mod_objc/ApacheRequest.m A Recycler/mod_objc/ApacheResourcePool.h A Recycler/mod_objc/ApacheResourcePool.m A Recycler/mod_objc/ApacheServer.h A Recycler/mod_objc/ApacheServer.m A Recycler/mod_objc/ApacheTable.h A Recycler/mod_objc/ApacheTable.m A Recycler/mod_objc/GNUmakefile A Recycler/mod_objc/GSBundleModule.m A Recycler/mod_objc/README A Recycler/mod_objc/genApacheModule.sh A Recycler/mod_objc/mod_gsbundle.m A Recycler/mod_objc/test.conf A SOPE-Info.plist A SOPE.xcodeproj/project.pbxproj A TODO.txt A Version A build-stamp A configure A controlfiles-stamp A debian/500mod_ngobjweb.info A debian/changelog A debian/compat A debian/control A debian/control.in A debian/copyright A debian/files A debian/libapache-mod-ngobjweb.dirs A debian/libapache-mod-ngobjweb.install A debian/libapache-mod-ngobjweb.postinst A debian/libapache-mod-ngobjweb.postrm A debian/libapache-mod-ngobjweb.prerm A debian/libapache2-mod-ngobjweb.dirs A debian/libapache2-mod-ngobjweb.install A debian/libapache2-mod-ngobjweb.postinst A debian/libapache2-mod-ngobjweb.prerm A debian/libsope-appserver4.9-dev.debhelper.log A debian/libsope-appserver4.9-dev.install A debian/libsope-appserver4.9-dev/DEBIAN/control A debian/libsope-appserver4.9-dev/DEBIAN/md5sums A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGHttp/NGHttp.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGHttp/NGHttpBodyParser.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGHttp/NGHttpCookie.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGHttp/NGHttpDecls.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGHttp/NGHttpHeaderFieldParser.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGHttp/NGHttpHeaderFields.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGHttp/NGHttpMessage.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGHttp/NGHttpMessageParser.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGHttp/NGHttpRequest.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGHttp/NGHttpResponse.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGHttp/NGUrlFormCoder.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/EOFetchSpecification+SoDAV.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/NGObjWeb.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/NGObjWebDecls.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/NSException+HTTP.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/NSString+JavaScriptEscaping.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/OWResourceManager.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/OWResponder.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/OWViewRequestHandler.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SaxDAVHandler.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoActionInvocation.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoApplication.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoClass.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoClassRegistry.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoClassSecurityInfo.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoComponent.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoControlPanel.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoCookieAuthenticator.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoDAV.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoDAVLockManager.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoDAVSQLParser.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoDefaultRenderer.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoHTTPAuthenticator.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoLookupAssociation.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoObjCClass.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoObject+SoDAV.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoObject.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoObjectDataSource.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoObjectMethodDispatcher.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoObjectRequestHandler.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoObjectResultEntry.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoObjectWebDAVDispatcher.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoObjects.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoPageInvocation.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoPermissions.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoProduct.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoProductClassInfo.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoProductLoader.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoProductRegistry.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoProductResourceManager.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoSecurityException.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoSecurityManager.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoSelectorInvocation.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoSubContext.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoSubscription.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoSubscriptionManager.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoTemplateRenderer.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoUser.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoWebDAVRenderer.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/SoWebDAVValue.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WEClientCapabilities.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOActionResults.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOActionURL.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOAdaptor.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOApplication.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOAssociation.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOComponent.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOComponentDefinition.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOComponentScript.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOContext+SoObjects.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOContext.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOCookie.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOCoreApplication.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WODirectAction.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WODisplayGroup.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WODynamicElement.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOElement.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOElementTrackingContext.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOHTMLDynamicElement.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOHTTPConnection.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOMailDelivery.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOMessage.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOPageGenerationContext.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOProxyRequestHandler.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WORequest+So.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WORequest.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WORequestHandler.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOResourceManager.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOResponse.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOSession.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOSessionStore.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOStatisticsStore.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOTemplate.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOTemplateBuilder.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGObjWeb/WOxElemBuilder.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGXmlRpc/NGAsyncResultProxy.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGXmlRpc/NGXmlRpc.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGXmlRpc/NGXmlRpcAction.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGXmlRpc/NGXmlRpcClient.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGXmlRpc/NGXmlRpcInvocation.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGXmlRpc/NGXmlRpcMethodSignature.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGXmlRpc/NGXmlRpcRequestHandler.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGXmlRpc/NSObject+Reflection.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGXmlRpc/WODirectAction+XmlRpc.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGXmlRpc/WODirectAction+XmlRpcIntrospection.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGXmlRpc/XmlRpcMethodCall+WO.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/NGXmlRpc/XmlRpcMethodResponse+WO.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/SoOFS/OFSBaseObject.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/SoOFS/OFSChangeLog.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/SoOFS/OFSFactoryContext.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/SoOFS/OFSFactoryRegistry.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/SoOFS/OFSFile.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/SoOFS/OFSFileRenderer.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/SoOFS/OFSFolder.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/SoOFS/OFSFolderDataSource.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/SoOFS/OFSHttpPasswd.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/SoOFS/OFSImage.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/SoOFS/OFSPropertyListObject.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/SoOFS/OFSResourceManager.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/SoOFS/OFSWebDocument.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/SoOFS/OFSWebMethod.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/SoOFS/OFSWebMethodRenderer.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/SoOFS/OFSWebTemplate.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/SoOFS/SoOFS.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/WEExtensions/WEContextConditional.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/WEExtensions/WEResourceManager.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/WOExtensions/WOExtensions.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/WOExtensions/WORedirect.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/WOXML/WOXML.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/WOXML/WOXMLDecoder.h A debian/libsope-appserver4.9-dev/usr/include/GNUstep/WOXML/WOXMLMappingModel.h A debian/libsope-appserver4.9-dev/usr/share/doc/libsope-appserver4.9-dev/changelog.Debian.gz A debian/libsope-appserver4.9-dev/usr/share/doc/libsope-appserver4.9-dev/copyright A debian/libsope-appserver4.9.debhelper.log A debian/libsope-appserver4.9.install A debian/libsope-appserver4.9.postinst.debhelper A debian/libsope-appserver4.9.postrm.debhelper A debian/libsope-appserver4.9.substvars A debian/libsope-appserver4.9/DEBIAN/control A debian/libsope-appserver4.9/DEBIAN/md5sums A debian/libsope-appserver4.9/DEBIAN/postinst A debian/libsope-appserver4.9/DEBIAN/postrm A debian/libsope-appserver4.9/DEBIAN/shlibs A debian/libsope-appserver4.9/usr/lib/libNGObjWeb.so.4.9 A debian/libsope-appserver4.9/usr/lib/libNGObjWeb.so.4.9.37 A debian/libsope-appserver4.9/usr/lib/libNGXmlRpc.so.4.9 A debian/libsope-appserver4.9/usr/lib/libNGXmlRpc.so.4.9.17 A debian/libsope-appserver4.9/usr/lib/libSoOFS.so.4.9 A debian/libsope-appserver4.9/usr/lib/libSoOFS.so.4.9.25 A debian/libsope-appserver4.9/usr/lib/libWEExtensions.so.4.9 A debian/libsope-appserver4.9/usr/lib/libWEExtensions.so.4.9.94 A debian/libsope-appserver4.9/usr/lib/libWEPrototype.so.4.9 A debian/libsope-appserver4.9/usr/lib/libWEPrototype.so.4.9.9 A debian/libsope-appserver4.9/usr/lib/libWOExtensions.so.4.9 A debian/libsope-appserver4.9/usr/lib/libWOExtensions.so.4.9.31 A debian/libsope-appserver4.9/usr/lib/libWOXML.so.4.9 A debian/libsope-appserver4.9/usr/lib/libWOXML.so.4.9.9 A debian/libsope-appserver4.9/usr/share/doc/libsope-appserver4.9/changelog.Debian.gz A debian/libsope-appserver4.9/usr/share/doc/libsope-appserver4.9/copyright A debian/libsope-appserver_SOPEVER_-dev.install A debian/libsope-appserver_SOPEVER_.install A debian/libsope-core4.9-dev.debhelper.log A debian/libsope-core4.9-dev.install A debian/libsope-core4.9-dev/DEBIAN/control A debian/libsope-core4.9-dev/DEBIAN/md5sums A debian/libsope-core4.9-dev/usr/include/GNUstep/EOControl/EOArrayDataSource.h A debian/libsope-core4.9-dev/usr/include/GNUstep/EOControl/EOClassDescription.h A debian/libsope-core4.9-dev/usr/include/GNUstep/EOControl/EOControl.h A debian/libsope-core4.9-dev/usr/include/GNUstep/EOControl/EOControlDecls.h A debian/libsope-core4.9-dev/usr/include/GNUstep/EOControl/EODataSource.h A debian/libsope-core4.9-dev/usr/include/GNUstep/EOControl/EODetailDataSource.h A debian/libsope-core4.9-dev/usr/include/GNUstep/EOControl/EOFetchSpecification.h A debian/libsope-core4.9-dev/usr/include/GNUstep/EOControl/EOGenericRecord.h A debian/libsope-core4.9-dev/usr/include/GNUstep/EOControl/EOGlobalID.h A debian/libsope-core4.9-dev/usr/include/GNUstep/EOControl/EOKeyGlobalID.h A debian/libsope-core4.9-dev/usr/include/GNUstep/EOControl/EOKeyValueArchiver.h A debian/libsope-core4.9-dev/usr/include/GNUstep/EOControl/EOKeyValueCoding.h A debian/libsope-core4.9-dev/usr/include/GNUstep/EOControl/EONull.h A debian/libsope-core4.9-dev/usr/include/GNUstep/EOControl/EOObserver.h A debian/libsope-core4.9-dev/usr/include/GNUstep/EOControl/EOQualifier.h A debian/libsope-core4.9-dev/usr/include/GNUstep/EOControl/EOSQLParser.h A debian/libsope-core4.9-dev/usr/include/GNUstep/EOControl/EOSortOrdering.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/AutoDefines.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/DOMNode+EOQualifier.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/EOCacheDataSource.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/EOCompoundDataSource.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/EODataSource+NGExtensions.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/EOFetchSpecification+plist.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/EOFilterDataSource.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/EOGrouping.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/EOGroupingSet.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/EOKeyGrouping.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/EOKeyMapDataSource.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/EOQualifier+CtxEval.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/EOQualifier+plist.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/EOQualifierGrouping.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/EOSortOrdering+plist.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/EOTrueQualifier.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/IndexFunc.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGBase64Coding.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGBaseTypes.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGBitSet.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGBundleManager.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGCalendarDateRange.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGCharBuffers.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGCustomFileManager.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGDirectoryEnumerator.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGExtensions.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGExtensionsDecls.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGFileFolderInfoDataSource.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGFileManager.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGFileManagerURL.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGHashMap.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGLogAppender.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGLogEvent.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGLogEventFormatter.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGLogFileHandleAppender.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGLogLevel.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGLogSyslogAppender.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGLogger.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGLoggerManager.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGLogging.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGMemoryAllocation.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGMerging.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGObjCRuntime.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGObjectMacros.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGPropertyListParser.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGQuotedPrintableCoding.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGResourceLocator.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGRule.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGRuleAssignment.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGRuleContext.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGRuleEngine.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGRuleModel.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NGStack.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NSArray+enumerator.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NSAutoreleasePool+misc.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NSBundle+misc.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NSCalendarDate+misc.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NSData+gzip.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NSData+misc.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NSDictionary+misc.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NSEnumerator+misc.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NSException+misc.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NSFileManager+Extensions.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NSMethodSignature+misc.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NSNull+misc.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NSObject+Logs.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NSObject+Values.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NSProcessInfo+misc.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NSRunLoop+FileObjects.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NSSet+enumerator.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NSString+Encoding.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NSString+Escaping.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NSString+Ext.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NSString+Formatting.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NSString+German.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NSString+misc.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGExtensions/NSURL+misc.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGActiveSocket.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGBase64Stream.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGBufferedStream.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGByteBuffer.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGByteCountStream.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGCTextStream.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGCharBuffer.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGConcreteStreamFileHandle.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGDataStream.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGDatagramPacket.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGDatagramSocket.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGDescriptorFunctions.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGFileStream.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGFilterStream.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGFilterTextStream.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGGZipStream.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGInternetSocketAddress.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGInternetSocketDomain.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGLocalSocketAddress.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGLocalSocketDomain.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGLockingStream.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGNet.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGNetDecls.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGNetUtilities.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGPassiveSocket.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGSocket.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGSocketExceptions.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGSocketProtocols.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGStream.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGStreamExceptions.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGStreamPipe.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGStreamProtocols.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGStreams.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGStreamsDecls.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGStringTextStream.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGTerminalSupport.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGTextStream.h A debian/libsope-core4.9-dev/usr/include/GNUstep/NGStreams/NGTextStreamProtocols.h A debian/libsope-core4.9-dev/usr/share/doc/libsope-core4.9-dev/changelog.Debian.gz A debian/libsope-core4.9-dev/usr/share/doc/libsope-core4.9-dev/copyright A debian/libsope-core4.9.debhelper.log A debian/libsope-core4.9.install A debian/libsope-core4.9.postinst.debhelper A debian/libsope-core4.9.postrm.debhelper A debian/libsope-core4.9.substvars A debian/libsope-core4.9/DEBIAN/control A debian/libsope-core4.9/DEBIAN/md5sums A debian/libsope-core4.9/DEBIAN/postinst A debian/libsope-core4.9/DEBIAN/postrm A debian/libsope-core4.9/DEBIAN/shlibs A debian/libsope-core4.9/usr/lib/libEOControl.so.4.9 A debian/libsope-core4.9/usr/lib/libEOControl.so.4.9.74 A debian/libsope-core4.9/usr/lib/libNGExtensions.so.4.9 A debian/libsope-core4.9/usr/lib/libNGExtensions.so.4.9.203 A debian/libsope-core4.9/usr/lib/libNGStreams.so.4.9 A debian/libsope-core4.9/usr/lib/libNGStreams.so.4.9.57 A debian/libsope-core4.9/usr/share/doc/libsope-core4.9/changelog.Debian.gz A debian/libsope-core4.9/usr/share/doc/libsope-core4.9/copyright A debian/libsope-core_SOPEVER_-dev.install A debian/libsope-core_SOPEVER_.install A debian/libsope-gdl1-4.9-dev.debhelper.log A debian/libsope-gdl1-4.9-dev.install A debian/libsope-gdl1-4.9-dev/DEBIAN/control A debian/libsope-gdl1-4.9-dev/DEBIAN/md5sums A debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOAdaptor.h A debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOAdaptorChannel+Attributes.h A debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOAdaptorChannel.h A debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOAdaptorContext.h A debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOAdaptorDataSource.h A debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOAdaptorGlobalID.h A debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOAdaptorOperation.h A debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOArrayProxy.h A debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOAttribute.h A debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOAttributeOrdering.h A debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOCustomValues.h A debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EODatabase.h A debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EODatabaseChannel.h A debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EODatabaseContext.h A debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EODatabaseFault.h A debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EODatabaseFaultResolver.h A debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EODelegateResponse.h A debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOEntity+Factory.h A debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOEntity.h A debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOExpressionArray.h A debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOFExceptions.h A debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOFault.h A debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOFaultHandler.h A debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOGenericRecord.h A debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOJoinTypes.h A debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOKeySortOrdering.h A debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOModel.h A debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOModelGroup.h A debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EONull.h A debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOObjectUniquer.h A debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOPrimaryKeyDictionary.h A debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOQuotedExpression.h A debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EORecordDictionary.h A debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EORelationship.h A debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOSQLExpression.h A debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/EOSQLQualifier.h A debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/GDLAccess.h A debian/libsope-gdl1-4.9-dev/usr/include/GNUstep/GDLAccess/NSObject+EONullInit.h A debian/libsope-gdl1-4.9-dev/usr/share/doc/libsope-gdl1-4.9-dev/changelog.Debian.gz A debian/libsope-gdl1-4.9-dev/usr/share/doc/libsope-gdl1-4.9-dev/copyright A debian/libsope-gdl1-4.9.debhelper.log A debian/libsope-gdl1-4.9.install A debian/libsope-gdl1-4.9.postinst.debhelper A debian/libsope-gdl1-4.9.postrm.debhelper A debian/libsope-gdl1-4.9.substvars A debian/libsope-gdl1-4.9/DEBIAN/control A debian/libsope-gdl1-4.9/DEBIAN/md5sums A debian/libsope-gdl1-4.9/DEBIAN/postinst A debian/libsope-gdl1-4.9/DEBIAN/postrm A debian/libsope-gdl1-4.9/DEBIAN/shlibs A debian/libsope-gdl1-4.9/usr/lib/libGDLAccess.so.4.9 A debian/libsope-gdl1-4.9/usr/lib/libGDLAccess.so.4.9.63 A debian/libsope-gdl1-4.9/usr/share/doc/libsope-gdl1-4.9/changelog.Debian.gz A debian/libsope-gdl1-4.9/usr/share/doc/libsope-gdl1-4.9/copyright A debian/libsope-gdl1-_SOPEVER_-dev.install A debian/libsope-gdl1-_SOPEVER_.install A debian/libsope-ical4.9-dev.debhelper.log A debian/libsope-ical4.9-dev.install A debian/libsope-ical4.9-dev/DEBIAN/control A debian/libsope-ical4.9-dev/DEBIAN/md5sums A debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/NGVCard.h A debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/NGVCardAddress.h A debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/NGVCardName.h A debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/NGVCardOrg.h A debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/NGVCardPhone.h A debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/NGVCardSaxHandler.h A debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/NGVCardSimpleValue.h A debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/NGVCardStrArrayValue.h A debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/NGVCardValue.h A debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/NGiCal.h A debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/NSCalendarDate+ICal.h A debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/iCalAlarm.h A debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/iCalAttachment.h A debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/iCalCalendar.h A debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/iCalDataSource.h A debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/iCalDuration.h A debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/iCalEntityObject.h A debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/iCalEvent.h A debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/iCalEventChanges.h A debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/iCalFreeBusy.h A debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/iCalJournal.h A debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/iCalObject.h A debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/iCalPerson.h A debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/iCalRecurrenceCalculator.h A debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/iCalRecurrenceRule.h A debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/iCalRenderer.h A debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/iCalRepeatableEntityObject.h A debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/iCalToDo.h A debian/libsope-ical4.9-dev/usr/include/GNUstep/NGiCal/iCalTrigger.h A debian/libsope-ical4.9-dev/usr/share/doc/libsope-ical4.9-dev/changelog.Debian.gz A debian/libsope-ical4.9-dev/usr/share/doc/libsope-ical4.9-dev/copyright A debian/libsope-ical4.9.debhelper.log A debian/libsope-ical4.9.install A debian/libsope-ical4.9.postinst.debhelper A debian/libsope-ical4.9.postrm.debhelper A debian/libsope-ical4.9.substvars A debian/libsope-ical4.9/DEBIAN/control A debian/libsope-ical4.9/DEBIAN/md5sums A debian/libsope-ical4.9/DEBIAN/postinst A debian/libsope-ical4.9/DEBIAN/postrm A debian/libsope-ical4.9/DEBIAN/shlibs A debian/libsope-ical4.9/usr/lib/libNGiCal.so.4.9 A debian/libsope-ical4.9/usr/lib/libNGiCal.so.4.9.84 A debian/libsope-ical4.9/usr/share/doc/libsope-ical4.9/changelog.Debian.gz A debian/libsope-ical4.9/usr/share/doc/libsope-ical4.9/copyright A debian/libsope-ical_SOPEVER_-dev.install A debian/libsope-ical_SOPEVER_.install A debian/libsope-ldap4.9-dev.debhelper.log A debian/libsope-ldap4.9-dev.install A debian/libsope-ldap4.9-dev/DEBIAN/control A debian/libsope-ldap4.9-dev/DEBIAN/md5sums A debian/libsope-ldap4.9-dev/usr/include/GNUstep/NGLdap/EOQualifier+LDAP.h A debian/libsope-ldap4.9-dev/usr/include/GNUstep/NGLdap/NGLdap.h A debian/libsope-ldap4.9-dev/usr/include/GNUstep/NGLdap/NGLdapAttribute.h A debian/libsope-ldap4.9-dev/usr/include/GNUstep/NGLdap/NGLdapConnection.h A debian/libsope-ldap4.9-dev/usr/include/GNUstep/NGLdap/NGLdapDataSource.h A debian/libsope-ldap4.9-dev/usr/include/GNUstep/NGLdap/NGLdapEntry.h A debian/libsope-ldap4.9-dev/usr/include/GNUstep/NGLdap/NGLdapFileManager.h A debian/libsope-ldap4.9-dev/usr/include/GNUstep/NGLdap/NGLdapGlobalID.h A debian/libsope-ldap4.9-dev/usr/include/GNUstep/NGLdap/NGLdapModification.h A debian/libsope-ldap4.9-dev/usr/include/GNUstep/NGLdap/NGLdapSearchResultEnumerator.h A debian/libsope-ldap4.9-dev/usr/include/GNUstep/NGLdap/NGLdapURL.h A debian/libsope-ldap4.9-dev/usr/include/GNUstep/NGLdap/NSString+DN.h A debian/libsope-ldap4.9-dev/usr/share/doc/libsope-ldap4.9-dev/changelog.Debian.gz A debian/libsope-ldap4.9-dev/usr/share/doc/libsope-ldap4.9-dev/copyright A debian/libsope-ldap4.9.debhelper.log A debian/libsope-ldap4.9.install A debian/libsope-ldap4.9.postinst.debhelper A debian/libsope-ldap4.9.postrm.debhelper A debian/libsope-ldap4.9.substvars A debian/libsope-ldap4.9/DEBIAN/control A debian/libsope-ldap4.9/DEBIAN/md5sums A debian/libsope-ldap4.9/DEBIAN/postinst A debian/libsope-ldap4.9/DEBIAN/postrm A debian/libsope-ldap4.9/DEBIAN/shlibs A debian/libsope-ldap4.9/usr/lib/libNGLdap.so.4.9 A debian/libsope-ldap4.9/usr/lib/libNGLdap.so.4.9.35 A debian/libsope-ldap4.9/usr/share/doc/libsope-ldap4.9/changelog.Debian.gz A debian/libsope-ldap4.9/usr/share/doc/libsope-ldap4.9/copyright A debian/libsope-ldap_SOPEVER_-dev.install A debian/libsope-ldap_SOPEVER_.install A debian/libsope-mime4.9-dev.debhelper.log A debian/libsope-mime4.9-dev.install A debian/libsope-mime4.9-dev/DEBIAN/control A debian/libsope-mime4.9-dev/DEBIAN/md5sums A debian/libsope-mime4.9-dev/usr/include/GNUstep/NGImap4/NGImap4.h A debian/libsope-mime4.9-dev/usr/include/GNUstep/NGImap4/NGImap4Client.h A debian/libsope-mime4.9-dev/usr/include/GNUstep/NGImap4/NGImap4Connection.h A debian/libsope-mime4.9-dev/usr/include/GNUstep/NGImap4/NGImap4ConnectionManager.h A debian/libsope-mime4.9-dev/usr/include/GNUstep/NGImap4/NGImap4Context.h A debian/libsope-mime4.9-dev/usr/include/GNUstep/NGImap4/NGImap4DataSource.h A debian/libsope-mime4.9-dev/usr/include/GNUstep/NGImap4/NGImap4Envelope.h A debian/libsope-mime4.9-dev/usr/include/GNUstep/NGImap4/NGImap4EnvelopeAddress.h A debian/libsope-mime4.9-dev/usr/include/GNUstep/NGImap4/NGImap4FileManager.h A debian/libsope-mime4.9-dev/usr/include/GNUstep/NGImap4/NGImap4Folder.h A debian/libsope-mime4.9-dev/usr/include/GNUstep/NGImap4/NGImap4MailboxInfo.h A debian/libsope-mime4.9-dev/usr/include/GNUstep/NGImap4/NGImap4Message.h A debian/libsope-mime4.9-dev/usr/include/GNUstep/NGImap4/NGImap4ResponseParser.h A debian/libsope-mime4.9-dev/usr/include/GNUstep/NGImap4/NGImap4ServerRoot.h A debian/libsope-mime4.9-dev/usr/include/GNUstep/NGImap4/NGImap4Support.h A debian/libsope-mime4.9-dev/usr/include/GNUstep/NGImap4/NGSieveClient.h A debian/libsope-mime4.9-dev/usr/include/GNUstep/NGImap4/NSString+Imap4.h A debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMail/NGMBoxReader.h A debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMail/NGMail.h A debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMail/NGMailAddress.h A debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMail/NGMailAddressList.h A debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMail/NGMailAddressParser.h A debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMail/NGMailDecls.h A debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMail/NGMimeMessage.h A debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMail/NGMimeMessageGenerator.h A debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMail/NGMimeMessageParser.h A debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMail/NGPop3Client.h A debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMail/NGPop3Support.h A debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMail/NGSendMail.h A debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMail/NGSmtpClient.h A debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMail/NGSmtpSupport.h A debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMime/NGConcreteMimeType.h A debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMime/NGMime.h A debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMime/NGMimeBodyGenerator.h A debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMime/NGMimeBodyParser.h A debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMime/NGMimeBodyPart.h A debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMime/NGMimeBodyPartParser.h A debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMime/NGMimeDecls.h A debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMime/NGMimeExceptions.h A debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMime/NGMimeFileData.h A debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMime/NGMimeGeneratorProtocols.h A debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMime/NGMimeHeaderFieldGenerator.h A debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMime/NGMimeHeaderFieldParser.h A debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMime/NGMimeHeaderFields.h A debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMime/NGMimeJoinedData.h A debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMime/NGMimeMultipartBody.h A debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMime/NGMimePartGenerator.h A debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMime/NGMimePartParser.h A debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMime/NGMimeType.h A debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMime/NGMimeUtilities.h A debian/libsope-mime4.9-dev/usr/include/GNUstep/NGMime/NGPart.h A debian/libsope-mime4.9-dev/usr/share/doc/libsope-mime4.9-dev/changelog.Debian.gz A debian/libsope-mime4.9-dev/usr/share/doc/libsope-mime4.9-dev/copyright A debian/libsope-mime4.9.debhelper.log A debian/libsope-mime4.9.install A debian/libsope-mime4.9.postinst.debhelper A debian/libsope-mime4.9.postrm.debhelper A debian/libsope-mime4.9.substvars A debian/libsope-mime4.9/DEBIAN/control A debian/libsope-mime4.9/DEBIAN/md5sums A debian/libsope-mime4.9/DEBIAN/postinst A debian/libsope-mime4.9/DEBIAN/postrm A debian/libsope-mime4.9/DEBIAN/shlibs A debian/libsope-mime4.9/usr/lib/libNGMime.so.4.9 A debian/libsope-mime4.9/usr/lib/libNGMime.so.4.9.3 A debian/libsope-mime4.9/usr/share/doc/libsope-mime4.9/changelog.Debian.gz A debian/libsope-mime4.9/usr/share/doc/libsope-mime4.9/copyright A debian/libsope-mime_SOPEVER_-dev.install A debian/libsope-mime_SOPEVER_.install A debian/libsope-xml4.9-dev.debhelper.log A debian/libsope-xml4.9-dev.install A debian/libsope-xml4.9-dev/DEBIAN/control A debian/libsope-xml4.9-dev/DEBIAN/md5sums A debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOM.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMAttribute.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMBuilder.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMBuilderFactory.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMCDATASection.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMCharacterData.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMComment.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMDocument.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMDocumentFragment.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMDocumentType.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMElement.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMEntity.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMEntityReference.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMImplementation.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMNamedNodeMap.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMNode+Enum.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMNode+QueryPath.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMNode.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMNodeWalker.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMNotation.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMPYXOutputter.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMProcessingInstruction.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMProtocols.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMQueryPathExpression.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMSaxBuilder.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMSaxHandler.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMText.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/DOMXMLOutputter.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/DOM/EDOM.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/SaxObjC/SaxAttributeList.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/SaxObjC/SaxAttributes.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/SaxObjC/SaxContentHandler.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/SaxObjC/SaxDTDHandler.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/SaxObjC/SaxDeclHandler.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/SaxObjC/SaxDefaultHandler.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/SaxObjC/SaxDocumentHandler.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/SaxObjC/SaxEntityResolver.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/SaxObjC/SaxErrorHandler.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/SaxObjC/SaxException.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/SaxObjC/SaxHandlerBase.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/SaxObjC/SaxLexicalHandler.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/SaxObjC/SaxLocator.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/SaxObjC/SaxMethodCallHandler.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/SaxObjC/SaxNamespaceSupport.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/SaxObjC/SaxObjC.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/SaxObjC/SaxObjectDecoder.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/SaxObjC/SaxObjectModel.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/SaxObjC/SaxXMLFilter.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/SaxObjC/SaxXMLReader.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/SaxObjC/SaxXMLReaderFactory.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/SaxObjC/XMLNamespaces.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/XmlRpc/NSObject+XmlRpc.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/XmlRpc/XmlRpc.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/XmlRpc/XmlRpcCoder.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/XmlRpc/XmlRpcMethodCall.h A debian/libsope-xml4.9-dev/usr/include/GNUstep/XmlRpc/XmlRpcMethodResponse.h A debian/libsope-xml4.9-dev/usr/share/doc/libsope-xml4.9-dev/changelog.Debian.gz A debian/libsope-xml4.9-dev/usr/share/doc/libsope-xml4.9-dev/copyright A debian/libsope-xml4.9.debhelper.log A debian/libsope-xml4.9.install A debian/libsope-xml4.9.postinst.debhelper A debian/libsope-xml4.9.postrm.debhelper A debian/libsope-xml4.9.substvars A debian/libsope-xml4.9/DEBIAN/control A debian/libsope-xml4.9/DEBIAN/md5sums A debian/libsope-xml4.9/DEBIAN/postinst A debian/libsope-xml4.9/DEBIAN/postrm A debian/libsope-xml4.9/DEBIAN/shlibs A debian/libsope-xml4.9/usr/lib/libDOM.so.4.9 A debian/libsope-xml4.9/usr/lib/libDOM.so.4.9.24 A debian/libsope-xml4.9/usr/lib/libSaxObjC.so.4.9 A debian/libsope-xml4.9/usr/lib/libSaxObjC.so.4.9.66 A debian/libsope-xml4.9/usr/lib/libXmlRpc.so.4.9 A debian/libsope-xml4.9/usr/lib/libXmlRpc.so.4.9.31 A debian/libsope-xml4.9/usr/share/doc/libsope-xml4.9/changelog.Debian.gz A debian/libsope-xml4.9/usr/share/doc/libsope-xml4.9/copyright A debian/libsope-xml_SOPEVER_-dev.install A debian/libsope-xml_SOPEVER_.install A debian/libsope4.9-dev.debhelper.log A debian/libsope4.9-dev/DEBIAN/control A debian/libsope4.9-dev/DEBIAN/md5sums A debian/libsope4.9-dev/usr/share/doc/libsope4.9-dev/changelog.Debian.gz A debian/libsope4.9-dev/usr/share/doc/libsope4.9-dev/copyright A debian/ngobjweb.load A debian/patches/00list A debian/patches/sope-gsmake2.diff A debian/patches/sope-patchset-r1660.diff A debian/rules A debian/sope-tools.debhelper.log A debian/sope-tools.install A debian/sope-tools.links A debian/sope-tools.substvars A debian/sope-tools/DEBIAN/control A debian/sope-tools/DEBIAN/md5sums A debian/sope-tools/usr/bin/connect-EOAdaptor A debian/sope-tools/usr/bin/domxml A debian/sope-tools/usr/bin/ldap2dsml A debian/sope-tools/usr/bin/ldapchkpwd A debian/sope-tools/usr/bin/ldapls A debian/sope-tools/usr/bin/load-EOAdaptor A debian/sope-tools/usr/bin/rss2plist1 A debian/sope-tools/usr/bin/rss2plist2 A debian/sope-tools/usr/bin/rssparse A debian/sope-tools/usr/bin/saxxml A debian/sope-tools/usr/bin/testqp A debian/sope-tools/usr/bin/wod A debian/sope-tools/usr/bin/xmln A debian/sope-tools/usr/bin/xmlrpc_call A debian/sope-tools/usr/share/doc/sope-tools/changelog.Debian.gz A debian/sope-tools/usr/share/doc/sope-tools/copyright A debian/sope4.9-appserver.debhelper.log A debian/sope4.9-appserver.install A debian/sope4.9-appserver.links A debian/sope4.9-appserver.substvars A debian/sope4.9-appserver/DEBIAN/control A debian/sope4.9-appserver/DEBIAN/md5sums A debian/sope4.9-appserver/usr/sbin/sope-4.9 A debian/sope4.9-appserver/usr/share/doc/sope4.9-appserver/changelog.Debian.gz A debian/sope4.9-appserver/usr/share/doc/sope4.9-appserver/copyright A debian/sope4.9-gdl1-postgresql.debhelper.log A debian/sope4.9-gdl1-postgresql.install A debian/sope4.9-gdl1-postgresql/DEBIAN/control A debian/sope4.9-gdl1-postgresql/DEBIAN/md5sums A debian/sope4.9-gdl1-postgresql/usr/share/doc/sope4.9-gdl1-postgresql/changelog.Debian.gz A debian/sope4.9-gdl1-postgresql/usr/share/doc/sope4.9-gdl1-postgresql/copyright A debian/sope4.9-libxmlsaxdriver.debhelper.log A debian/sope4.9-libxmlsaxdriver.install A debian/sope4.9-libxmlsaxdriver/DEBIAN/control A debian/sope4.9-libxmlsaxdriver/DEBIAN/md5sums A debian/sope4.9-libxmlsaxdriver/usr/share/doc/sope4.9-libxmlsaxdriver/changelog.Debian.gz A debian/sope4.9-libxmlsaxdriver/usr/share/doc/sope4.9-libxmlsaxdriver/copyright A debian/sope4.9-stxsaxdriver.debhelper.log A debian/sope4.9-stxsaxdriver.install A debian/sope4.9-stxsaxdriver/DEBIAN/control A debian/sope4.9-stxsaxdriver/DEBIAN/md5sums A debian/sope4.9-stxsaxdriver/usr/share/doc/sope4.9-stxsaxdriver/changelog.Debian.gz A debian/sope4.9-stxsaxdriver/usr/share/doc/sope4.9-stxsaxdriver/copyright A debian/sope4.9-versitsaxdriver.debhelper.log A debian/sope4.9-versitsaxdriver.install A debian/sope4.9-versitsaxdriver/DEBIAN/control A debian/sope4.9-versitsaxdriver/DEBIAN/md5sums A debian/sope4.9-versitsaxdriver/usr/share/doc/sope4.9-versitsaxdriver/changelog.Debian.gz A debian/sope4.9-versitsaxdriver/usr/share/doc/sope4.9-versitsaxdriver/copyright A debian/sope_SOPEVER_-appserver.install A debian/sope_SOPEVER_-appserver.links A debian/sope_SOPEVER_-gdl1-postgresql.install A debian/sope_SOPEVER_-libxmlsaxdriver.install A debian/sope_SOPEVER_-stxsaxdriver.install A debian/sope_SOPEVER_-versitsaxdriver.install A debian/tmp/usr/bin/connect-EOAdaptor A debian/tmp/usr/bin/domxml A debian/tmp/usr/bin/ldap2dsml A debian/tmp/usr/bin/ldapchkpwd A debian/tmp/usr/bin/ldapls A debian/tmp/usr/bin/load-EOAdaptor A debian/tmp/usr/bin/rss2plist1 A debian/tmp/usr/bin/rss2plist2 A debian/tmp/usr/bin/rssparse A debian/tmp/usr/bin/saxxml A debian/tmp/usr/bin/testqp A debian/tmp/usr/bin/wod A debian/tmp/usr/bin/xmln A debian/tmp/usr/bin/xmlrpc_call A debian/tmp/usr/include/GNUstep/DOM/DOM.h A debian/tmp/usr/include/GNUstep/DOM/DOMAttribute.h A debian/tmp/usr/include/GNUstep/DOM/DOMBuilder.h A debian/tmp/usr/include/GNUstep/DOM/DOMBuilderFactory.h A debian/tmp/usr/include/GNUstep/DOM/DOMCDATASection.h A debian/tmp/usr/include/GNUstep/DOM/DOMCharacterData.h A debian/tmp/usr/include/GNUstep/DOM/DOMComment.h A debian/tmp/usr/include/GNUstep/DOM/DOMDocument.h A debian/tmp/usr/include/GNUstep/DOM/DOMDocumentFragment.h A debian/tmp/usr/include/GNUstep/DOM/DOMDocumentType.h A debian/tmp/usr/include/GNUstep/DOM/DOMElement.h A debian/tmp/usr/include/GNUstep/DOM/DOMEntity.h A debian/tmp/usr/include/GNUstep/DOM/DOMEntityReference.h A debian/tmp/usr/include/GNUstep/DOM/DOMImplementation.h A debian/tmp/usr/include/GNUstep/DOM/DOMNamedNodeMap.h A debian/tmp/usr/include/GNUstep/DOM/DOMNode+Enum.h A debian/tmp/usr/include/GNUstep/DOM/DOMNode+QueryPath.h A debian/tmp/usr/include/GNUstep/DOM/DOMNode.h A debian/tmp/usr/include/GNUstep/DOM/DOMNodeWalker.h A debian/tmp/usr/include/GNUstep/DOM/DOMNotation.h A debian/tmp/usr/include/GNUstep/DOM/DOMPYXOutputter.h A debian/tmp/usr/include/GNUstep/DOM/DOMProcessingInstruction.h A debian/tmp/usr/include/GNUstep/DOM/DOMProtocols.h A debian/tmp/usr/include/GNUstep/DOM/DOMQueryPathExpression.h A debian/tmp/usr/include/GNUstep/DOM/DOMSaxBuilder.h A debian/tmp/usr/include/GNUstep/DOM/DOMSaxHandler.h A debian/tmp/usr/include/GNUstep/DOM/DOMText.h A debian/tmp/usr/include/GNUstep/DOM/DOMXMLOutputter.h A debian/tmp/usr/include/GNUstep/DOM/EDOM.h A debian/tmp/usr/include/GNUstep/EOControl/EOArrayDataSource.h A debian/tmp/usr/include/GNUstep/EOControl/EOClassDescription.h A debian/tmp/usr/include/GNUstep/EOControl/EOControl.h A debian/tmp/usr/include/GNUstep/EOControl/EOControlDecls.h A debian/tmp/usr/include/GNUstep/EOControl/EODataSource.h A debian/tmp/usr/include/GNUstep/EOControl/EODetailDataSource.h A debian/tmp/usr/include/GNUstep/EOControl/EOFetchSpecification.h A debian/tmp/usr/include/GNUstep/EOControl/EOGenericRecord.h A debian/tmp/usr/include/GNUstep/EOControl/EOGlobalID.h A debian/tmp/usr/include/GNUstep/EOControl/EOKeyGlobalID.h A debian/tmp/usr/include/GNUstep/EOControl/EOKeyValueArchiver.h A debian/tmp/usr/include/GNUstep/EOControl/EOKeyValueCoding.h A debian/tmp/usr/include/GNUstep/EOControl/EONull.h A debian/tmp/usr/include/GNUstep/EOControl/EOObserver.h A debian/tmp/usr/include/GNUstep/EOControl/EOQualifier.h A debian/tmp/usr/include/GNUstep/EOControl/EOSQLParser.h A debian/tmp/usr/include/GNUstep/EOControl/EOSortOrdering.h A debian/tmp/usr/include/GNUstep/GDLAccess/EOAdaptor.h A debian/tmp/usr/include/GNUstep/GDLAccess/EOAdaptorChannel+Attributes.h A debian/tmp/usr/include/GNUstep/GDLAccess/EOAdaptorChannel.h A debian/tmp/usr/include/GNUstep/GDLAccess/EOAdaptorContext.h A debian/tmp/usr/include/GNUstep/GDLAccess/EOAdaptorDataSource.h A debian/tmp/usr/include/GNUstep/GDLAccess/EOAdaptorGlobalID.h A debian/tmp/usr/include/GNUstep/GDLAccess/EOAdaptorOperation.h A debian/tmp/usr/include/GNUstep/GDLAccess/EOArrayProxy.h A debian/tmp/usr/include/GNUstep/GDLAccess/EOAttribute.h A debian/tmp/usr/include/GNUstep/GDLAccess/EOAttributeOrdering.h A debian/tmp/usr/include/GNUstep/GDLAccess/EOCustomValues.h A debian/tmp/usr/include/GNUstep/GDLAccess/EODatabase.h A debian/tmp/usr/include/GNUstep/GDLAccess/EODatabaseChannel.h A debian/tmp/usr/include/GNUstep/GDLAccess/EODatabaseContext.h A debian/tmp/usr/include/GNUstep/GDLAccess/EODatabaseFault.h A debian/tmp/usr/include/GNUstep/GDLAccess/EODatabaseFaultResolver.h A debian/tmp/usr/include/GNUstep/GDLAccess/EODelegateResponse.h A debian/tmp/usr/include/GNUstep/GDLAccess/EOEntity+Factory.h A debian/tmp/usr/include/GNUstep/GDLAccess/EOEntity.h A debian/tmp/usr/include/GNUstep/GDLAccess/EOExpressionArray.h A debian/tmp/usr/include/GNUstep/GDLAccess/EOFExceptions.h A debian/tmp/usr/include/GNUstep/GDLAccess/EOFault.h A debian/tmp/usr/include/GNUstep/GDLAccess/EOFaultHandler.h A debian/tmp/usr/include/GNUstep/GDLAccess/EOGenericRecord.h A debian/tmp/usr/include/GNUstep/GDLAccess/EOJoinTypes.h A debian/tmp/usr/include/GNUstep/GDLAccess/EOKeySortOrdering.h A debian/tmp/usr/include/GNUstep/GDLAccess/EOModel.h A debian/tmp/usr/include/GNUstep/GDLAccess/EOModelGroup.h A debian/tmp/usr/include/GNUstep/GDLAccess/EONull.h A debian/tmp/usr/include/GNUstep/GDLAccess/EOObjectUniquer.h A debian/tmp/usr/include/GNUstep/GDLAccess/EOPrimaryKeyDictionary.h A debian/tmp/usr/include/GNUstep/GDLAccess/EOQuotedExpression.h A debian/tmp/usr/include/GNUstep/GDLAccess/EORecordDictionary.h A debian/tmp/usr/include/GNUstep/GDLAccess/EORelationship.h A debian/tmp/usr/include/GNUstep/GDLAccess/EOSQLExpression.h A debian/tmp/usr/include/GNUstep/GDLAccess/EOSQLQualifier.h A debian/tmp/usr/include/GNUstep/GDLAccess/GDLAccess.h A debian/tmp/usr/include/GNUstep/GDLAccess/NSObject+EONullInit.h A debian/tmp/usr/include/GNUstep/NGExtensions/AutoDefines.h A debian/tmp/usr/include/GNUstep/NGExtensions/DOMNode+EOQualifier.h A debian/tmp/usr/include/GNUstep/NGExtensions/EOCacheDataSource.h A debian/tmp/usr/include/GNUstep/NGExtensions/EOCompoundDataSource.h A debian/tmp/usr/include/GNUstep/NGExtensions/EODataSource+NGExtensions.h A debian/tmp/usr/include/GNUstep/NGExtensions/EOFetchSpecification+plist.h A debian/tmp/usr/include/GNUstep/NGExtensions/EOFilterDataSource.h A debian/tmp/usr/include/GNUstep/NGExtensions/EOGrouping.h A debian/tmp/usr/include/GNUstep/NGExtensions/EOGroupingSet.h A debian/tmp/usr/include/GNUstep/NGExtensions/EOKeyGrouping.h A debian/tmp/usr/include/GNUstep/NGExtensions/EOKeyMapDataSource.h A debian/tmp/usr/include/GNUstep/NGExtensions/EOQualifier+CtxEval.h A debian/tmp/usr/include/GNUstep/NGExtensions/EOQualifier+plist.h A debian/tmp/usr/include/GNUstep/NGExtensions/EOQualifierGrouping.h A debian/tmp/usr/include/GNUstep/NGExtensions/EOSortOrdering+plist.h A debian/tmp/usr/include/GNUstep/NGExtensions/EOTrueQualifier.h A debian/tmp/usr/include/GNUstep/NGExtensions/IndexFunc.h A debian/tmp/usr/include/GNUstep/NGExtensions/NGBase64Coding.h A debian/tmp/usr/include/GNUstep/NGExtensions/NGBaseTypes.h A debian/tmp/usr/include/GNUstep/NGExtensions/NGBitSet.h A debian/tmp/usr/include/GNUstep/NGExtensions/NGBundleManager.h A debian/tmp/usr/include/GNUstep/NGExtensions/NGCalendarDateRange.h A debian/tmp/usr/include/GNUstep/NGExtensions/NGCharBuffers.h A debian/tmp/usr/include/GNUstep/NGExtensions/NGCustomFileManager.h A debian/tmp/usr/include/GNUstep/NGExtensions/NGDirectoryEnumerator.h A debian/tmp/usr/include/GNUstep/NGExtensions/NGExtensions.h A debian/tmp/usr/include/GNUstep/NGExtensions/NGExtensionsDecls.h A debian/tmp/usr/include/GNUstep/NGExtensions/NGFileFolderInfoDataSource.h A debian/tmp/usr/include/GNUstep/NGExtensions/NGFileManager.h A debian/tmp/usr/include/GNUstep/NGExtensions/NGFileManagerURL.h A debian/tmp/usr/include/GNUstep/NGExtensions/NGHashMap.h A debian/tmp/usr/include/GNUstep/NGExtensions/NGLogAppender.h A debian/tmp/usr/include/GNUstep/NGExtensions/NGLogEvent.h A debian/tmp/usr/include/GNUstep/NGExtensions/NGLogEventFormatter.h A debian/tmp/usr/include/GNUstep/NGExtensions/NGLogFileHandleAppender.h A debian/tmp/usr/include/GNUstep/NGExtensions/NGLogLevel.h A debian/tmp/usr/include/GNUstep/NGExtensions/NGLogSyslogAppender.h A debian/tmp/usr/include/GNUstep/NGExtensions/NGLogger.h A debian/tmp/usr/include/GNUstep/NGExtensions/NGLoggerManager.h A debian/tmp/usr/include/GNUstep/NGExtensions/NGLogging.h A debian/tmp/usr/include/GNUstep/NGExtensions/NGMemoryAllocation.h A debian/tmp/usr/include/GNUstep/NGExtensions/NGMerging.h A debian/tmp/usr/include/GNUstep/NGExtensions/NGObjCRuntime.h A debian/tmp/usr/include/GNUstep/NGExtensions/NGObjectMacros.h A debian/tmp/usr/include/GNUstep/NGExtensions/NGPropertyListParser.h A debian/tmp/usr/include/GNUstep/NGExtensions/NGQuotedPrintableCoding.h A debian/tmp/usr/include/GNUstep/NGExtensions/NGResourceLocator.h A debian/tmp/usr/include/GNUstep/NGExtensions/NGRule.h A debian/tmp/usr/include/GNUstep/NGExtensions/NGRuleAssignment.h A debian/tmp/usr/include/GNUstep/NGExtensions/NGRuleContext.h A debian/tmp/usr/include/GNUstep/NGExtensions/NGRuleEngine.h A debian/tmp/usr/include/GNUstep/NGExtensions/NGRuleModel.h A debian/tmp/usr/include/GNUstep/NGExtensions/NGStack.h A debian/tmp/usr/include/GNUstep/NGExtensions/NSArray+enumerator.h A debian/tmp/usr/include/GNUstep/NGExtensions/NSAutoreleasePool+misc.h A debian/tmp/usr/include/GNUstep/NGExtensions/NSBundle+misc.h A debian/tmp/usr/include/GNUstep/NGExtensions/NSCalendarDate+misc.h A debian/tmp/usr/include/GNUstep/NGExtensions/NSData+gzip.h A debian/tmp/usr/include/GNUstep/NGExtensions/NSData+misc.h A debian/tmp/usr/include/GNUstep/NGExtensions/NSDictionary+misc.h A debian/tmp/usr/include/GNUstep/NGExtensions/NSEnumerator+misc.h A debian/tmp/usr/include/GNUstep/NGExtensions/NSException+misc.h A debian/tmp/usr/include/GNUstep/NGExtensions/NSFileManager+Extensions.h A debian/tmp/usr/include/GNUstep/NGExtensions/NSMethodSignature+misc.h A debian/tmp/usr/include/GNUstep/NGExtensions/NSNull+misc.h A debian/tmp/usr/include/GNUstep/NGExtensions/NSObject+Logs.h A debian/tmp/usr/include/GNUstep/NGExtensions/NSObject+Values.h A debian/tmp/usr/include/GNUstep/NGExtensions/NSProcessInfo+misc.h A debian/tmp/usr/include/GNUstep/NGExtensions/NSRunLoop+FileObjects.h A debian/tmp/usr/include/GNUstep/NGExtensions/NSSet+enumerator.h A debian/tmp/usr/include/GNUstep/NGExtensions/NSString+Encoding.h A debian/tmp/usr/include/GNUstep/NGExtensions/NSString+Escaping.h A debian/tmp/usr/include/GNUstep/NGExtensions/NSString+Ext.h A debian/tmp/usr/include/GNUstep/NGExtensions/NSString+Formatting.h A debian/tmp/usr/include/GNUstep/NGExtensions/NSString+German.h A debian/tmp/usr/include/GNUstep/NGExtensions/NSString+misc.h A debian/tmp/usr/include/GNUstep/NGExtensions/NSURL+misc.h A debian/tmp/usr/include/GNUstep/NGHttp/NGHttp.h A debian/tmp/usr/include/GNUstep/NGHttp/NGHttpBodyParser.h A debian/tmp/usr/include/GNUstep/NGHttp/NGHttpCookie.h A debian/tmp/usr/include/GNUstep/NGHttp/NGHttpDecls.h A debian/tmp/usr/include/GNUstep/NGHttp/NGHttpHeaderFieldParser.h A debian/tmp/usr/include/GNUstep/NGHttp/NGHttpHeaderFields.h A debian/tmp/usr/include/GNUstep/NGHttp/NGHttpMessage.h A debian/tmp/usr/include/GNUstep/NGHttp/NGHttpMessageParser.h A debian/tmp/usr/include/GNUstep/NGHttp/NGHttpRequest.h A debian/tmp/usr/include/GNUstep/NGHttp/NGHttpResponse.h A debian/tmp/usr/include/GNUstep/NGHttp/NGUrlFormCoder.h A debian/tmp/usr/include/GNUstep/NGImap4/NGImap4.h A debian/tmp/usr/include/GNUstep/NGImap4/NGImap4Client.h A debian/tmp/usr/include/GNUstep/NGImap4/NGImap4Connection.h A debian/tmp/usr/include/GNUstep/NGImap4/NGImap4ConnectionManager.h A debian/tmp/usr/include/GNUstep/NGImap4/NGImap4Context.h A debian/tmp/usr/include/GNUstep/NGImap4/NGImap4DataSource.h A debian/tmp/usr/include/GNUstep/NGImap4/NGImap4Envelope.h A debian/tmp/usr/include/GNUstep/NGImap4/NGImap4EnvelopeAddress.h A debian/tmp/usr/include/GNUstep/NGImap4/NGImap4FileManager.h A debian/tmp/usr/include/GNUstep/NGImap4/NGImap4Folder.h A debian/tmp/usr/include/GNUstep/NGImap4/NGImap4MailboxInfo.h A debian/tmp/usr/include/GNUstep/NGImap4/NGImap4Message.h A debian/tmp/usr/include/GNUstep/NGImap4/NGImap4ResponseParser.h A debian/tmp/usr/include/GNUstep/NGImap4/NGImap4ServerRoot.h A debian/tmp/usr/include/GNUstep/NGImap4/NGImap4Support.h A debian/tmp/usr/include/GNUstep/NGImap4/NGSieveClient.h A debian/tmp/usr/include/GNUstep/NGImap4/NSString+Imap4.h A debian/tmp/usr/include/GNUstep/NGLdap/EOQualifier+LDAP.h A debian/tmp/usr/include/GNUstep/NGLdap/NGLdap.h A debian/tmp/usr/include/GNUstep/NGLdap/NGLdapAttribute.h A debian/tmp/usr/include/GNUstep/NGLdap/NGLdapConnection.h A debian/tmp/usr/include/GNUstep/NGLdap/NGLdapDataSource.h A debian/tmp/usr/include/GNUstep/NGLdap/NGLdapEntry.h A debian/tmp/usr/include/GNUstep/NGLdap/NGLdapFileManager.h A debian/tmp/usr/include/GNUstep/NGLdap/NGLdapGlobalID.h A debian/tmp/usr/include/GNUstep/NGLdap/NGLdapModification.h A debian/tmp/usr/include/GNUstep/NGLdap/NGLdapSearchResultEnumerator.h A debian/tmp/usr/include/GNUstep/NGLdap/NGLdapURL.h A debian/tmp/usr/include/GNUstep/NGLdap/NSString+DN.h A debian/tmp/usr/include/GNUstep/NGMail/NGMBoxReader.h A debian/tmp/usr/include/GNUstep/NGMail/NGMail.h A debian/tmp/usr/include/GNUstep/NGMail/NGMailAddress.h A debian/tmp/usr/include/GNUstep/NGMail/NGMailAddressList.h A debian/tmp/usr/include/GNUstep/NGMail/NGMailAddressParser.h A debian/tmp/usr/include/GNUstep/NGMail/NGMailDecls.h A debian/tmp/usr/include/GNUstep/NGMail/NGMimeMessage.h A debian/tmp/usr/include/GNUstep/NGMail/NGMimeMessageGenerator.h A debian/tmp/usr/include/GNUstep/NGMail/NGMimeMessageParser.h A debian/tmp/usr/include/GNUstep/NGMail/NGPop3Client.h A debian/tmp/usr/include/GNUstep/NGMail/NGPop3Support.h A debian/tmp/usr/include/GNUstep/NGMail/NGSendMail.h A debian/tmp/usr/include/GNUstep/NGMail/NGSmtpClient.h A debian/tmp/usr/include/GNUstep/NGMail/NGSmtpSupport.h A debian/tmp/usr/include/GNUstep/NGMime/NGConcreteMimeType.h A debian/tmp/usr/include/GNUstep/NGMime/NGMime.h A debian/tmp/usr/include/GNUstep/NGMime/NGMimeBodyGenerator.h A debian/tmp/usr/include/GNUstep/NGMime/NGMimeBodyParser.h A debian/tmp/usr/include/GNUstep/NGMime/NGMimeBodyPart.h A debian/tmp/usr/include/GNUstep/NGMime/NGMimeBodyPartParser.h A debian/tmp/usr/include/GNUstep/NGMime/NGMimeDecls.h A debian/tmp/usr/include/GNUstep/NGMime/NGMimeExceptions.h A debian/tmp/usr/include/GNUstep/NGMime/NGMimeFileData.h A debian/tmp/usr/include/GNUstep/NGMime/NGMimeGeneratorProtocols.h A debian/tmp/usr/include/GNUstep/NGMime/NGMimeHeaderFieldGenerator.h A debian/tmp/usr/include/GNUstep/NGMime/NGMimeHeaderFieldParser.h A debian/tmp/usr/include/GNUstep/NGMime/NGMimeHeaderFields.h A debian/tmp/usr/include/GNUstep/NGMime/NGMimeJoinedData.h A debian/tmp/usr/include/GNUstep/NGMime/NGMimeMultipartBody.h A debian/tmp/usr/include/GNUstep/NGMime/NGMimePartGenerator.h A debian/tmp/usr/include/GNUstep/NGMime/NGMimePartParser.h A debian/tmp/usr/include/GNUstep/NGMime/NGMimeType.h A debian/tmp/usr/include/GNUstep/NGMime/NGMimeUtilities.h A debian/tmp/usr/include/GNUstep/NGMime/NGPart.h A debian/tmp/usr/include/GNUstep/NGObjWeb/EOFetchSpecification+SoDAV.h A debian/tmp/usr/include/GNUstep/NGObjWeb/NGObjWeb.h A debian/tmp/usr/include/GNUstep/NGObjWeb/NGObjWebDecls.h A debian/tmp/usr/include/GNUstep/NGObjWeb/NSException+HTTP.h A debian/tmp/usr/include/GNUstep/NGObjWeb/NSString+JavaScriptEscaping.h A debian/tmp/usr/include/GNUstep/NGObjWeb/OWResourceManager.h A debian/tmp/usr/include/GNUstep/NGObjWeb/OWResponder.h A debian/tmp/usr/include/GNUstep/NGObjWeb/OWViewRequestHandler.h A debian/tmp/usr/include/GNUstep/NGObjWeb/SaxDAVHandler.h A debian/tmp/usr/include/GNUstep/NGObjWeb/SoActionInvocation.h A debian/tmp/usr/include/GNUstep/NGObjWeb/SoApplication.h A debian/tmp/usr/include/GNUstep/NGObjWeb/SoClass.h A debian/tmp/usr/include/GNUstep/NGObjWeb/SoClassRegistry.h A debian/tmp/usr/include/GNUstep/NGObjWeb/SoClassSecurityInfo.h A debian/tmp/usr/include/GNUstep/NGObjWeb/SoComponent.h A debian/tmp/usr/include/GNUstep/NGObjWeb/SoControlPanel.h A debian/tmp/usr/include/GNUstep/NGObjWeb/SoCookieAuthenticator.h A debian/tmp/usr/include/GNUstep/NGObjWeb/SoDAV.h A debian/tmp/usr/include/GNUstep/NGObjWeb/SoDAVLockManager.h A debian/tmp/usr/include/GNUstep/NGObjWeb/SoDAVSQLParser.h A debian/tmp/usr/include/GNUstep/NGObjWeb/SoDefaultRenderer.h A debian/tmp/usr/include/GNUstep/NGObjWeb/SoHTTPAuthenticator.h A debian/tmp/usr/include/GNUstep/NGObjWeb/SoLookupAssociation.h A debian/tmp/usr/include/GNUstep/NGObjWeb/SoObjCClass.h A debian/tmp/usr/include/GNUstep/NGObjWeb/SoObject+SoDAV.h A debian/tmp/usr/include/GNUstep/NGObjWeb/SoObject.h A debian/tmp/usr/include/GNUstep/NGObjWeb/SoObjectDataSource.h A debian/tmp/usr/include/GNUstep/NGObjWeb/SoObjectMethodDispatcher.h A debian/tmp/usr/include/GNUstep/NGObjWeb/SoObjectRequestHandler.h A debian/tmp/usr/include/GNUstep/NGObjWeb/SoObjectResultEntry.h A debian/tmp/usr/include/GNUstep/NGObjWeb/SoObjectWebDAVDispatcher.h A debian/tmp/usr/include/GNUstep/NGObjWeb/SoObjects.h A debian/tmp/usr/include/GNUstep/NGObjWeb/SoPageInvocation.h A debian/tmp/usr/include/GNUstep/NGObjWeb/SoPermissions.h A debian/tmp/usr/include/GNUstep/NGObjWeb/SoProduct.h A debian/tmp/usr/include/GNUstep/NGObjWeb/SoProductClassInfo.h A debian/tmp/usr/include/GNUstep/NGObjWeb/SoProductLoader.h A debian/tmp/usr/include/GNUstep/NGObjWeb/SoProductRegistry.h A debian/tmp/usr/include/GNUstep/NGObjWeb/SoProductResourceManager.h A debian/tmp/usr/include/GNUstep/NGObjWeb/SoSecurityException.h A debian/tmp/usr/include/GNUstep/NGObjWeb/SoSecurityManager.h A debian/tmp/usr/include/GNUstep/NGObjWeb/SoSelectorInvocation.h A debian/tmp/usr/include/GNUstep/NGObjWeb/SoSubContext.h A debian/tmp/usr/include/GNUstep/NGObjWeb/SoSubscription.h A debian/tmp/usr/include/GNUstep/NGObjWeb/SoSubscriptionManager.h A debian/tmp/usr/include/GNUstep/NGObjWeb/SoTemplateRenderer.h A debian/tmp/usr/include/GNUstep/NGObjWeb/SoUser.h A debian/tmp/usr/include/GNUstep/NGObjWeb/SoWebDAVRenderer.h A debian/tmp/usr/include/GNUstep/NGObjWeb/SoWebDAVValue.h A debian/tmp/usr/include/GNUstep/NGObjWeb/WEClientCapabilities.h A debian/tmp/usr/include/GNUstep/NGObjWeb/WOActionResults.h A debian/tmp/usr/include/GNUstep/NGObjWeb/WOActionURL.h A debian/tmp/usr/include/GNUstep/NGObjWeb/WOAdaptor.h A debian/tmp/usr/include/GNUstep/NGObjWeb/WOApplication.h A debian/tmp/usr/include/GNUstep/NGObjWeb/WOAssociation.h A debian/tmp/usr/include/GNUstep/NGObjWeb/WOComponent.h A debian/tmp/usr/include/GNUstep/NGObjWeb/WOComponentDefinition.h A debian/tmp/usr/include/GNUstep/NGObjWeb/WOComponentScript.h A debian/tmp/usr/include/GNUstep/NGObjWeb/WOContext+SoObjects.h A debian/tmp/usr/include/GNUstep/NGObjWeb/WOContext.h A debian/tmp/usr/include/GNUstep/NGObjWeb/WOCookie.h A debian/tmp/usr/include/GNUstep/NGObjWeb/WOCoreApplication.h A debian/tmp/usr/include/GNUstep/NGObjWeb/WODirectAction.h A debian/tmp/usr/include/GNUstep/NGObjWeb/WODisplayGroup.h A debian/tmp/usr/include/GNUstep/NGObjWeb/WODynamicElement.h A debian/tmp/usr/include/GNUstep/NGObjWeb/WOElement.h A debian/tmp/usr/include/GNUstep/NGObjWeb/WOElementTrackingContext.h A debian/tmp/usr/include/GNUstep/NGObjWeb/WOHTMLDynamicElement.h A debian/tmp/usr/include/GNUstep/NGObjWeb/WOHTTPConnection.h A debian/tmp/usr/include/GNUstep/NGObjWeb/WOMailDelivery.h A debian/tmp/usr/include/GNUstep/NGObjWeb/WOMessage.h A debian/tmp/usr/include/GNUstep/NGObjWeb/WOPageGenerationContext.h A debian/tmp/usr/include/GNUstep/NGObjWeb/WOProxyRequestHandler.h A debian/tmp/usr/include/GNUstep/NGObjWeb/WORequest+So.h A debian/tmp/usr/include/GNUstep/NGObjWeb/WORequest.h A debian/tmp/usr/include/GNUstep/NGObjWeb/WORequestHandler.h A debian/tmp/usr/include/GNUstep/NGObjWeb/WOResourceManager.h A debian/tmp/usr/include/GNUstep/NGObjWeb/WOResponse.h A debian/tmp/usr/include/GNUstep/NGObjWeb/WOSession.h A debian/tmp/usr/include/GNUstep/NGObjWeb/WOSessionStore.h A debian/tmp/usr/include/GNUstep/NGObjWeb/WOStatisticsStore.h A debian/tmp/usr/include/GNUstep/NGObjWeb/WOTemplate.h A debian/tmp/usr/include/GNUstep/NGObjWeb/WOTemplateBuilder.h A debian/tmp/usr/include/GNUstep/NGObjWeb/WOxElemBuilder.h A debian/tmp/usr/include/GNUstep/NGStreams/NGActiveSocket.h A debian/tmp/usr/include/GNUstep/NGStreams/NGBase64Stream.h A debian/tmp/usr/include/GNUstep/NGStreams/NGBufferedStream.h A debian/tmp/usr/include/GNUstep/NGStreams/NGByteBuffer.h A debian/tmp/usr/include/GNUstep/NGStreams/NGByteCountStream.h A debian/tmp/usr/include/GNUstep/NGStreams/NGCTextStream.h A debian/tmp/usr/include/GNUstep/NGStreams/NGCharBuffer.h A debian/tmp/usr/include/GNUstep/NGStreams/NGConcreteStreamFileHandle.h A debian/tmp/usr/include/GNUstep/NGStreams/NGDataStream.h A debian/tmp/usr/include/GNUstep/NGStreams/NGDatagramPacket.h A debian/tmp/usr/include/GNUstep/NGStreams/NGDatagramSocket.h A debian/tmp/usr/include/GNUstep/NGStreams/NGDescriptorFunctions.h A debian/tmp/usr/include/GNUstep/NGStreams/NGFileStream.h A debian/tmp/usr/include/GNUstep/NGStreams/NGFilterStream.h A debian/tmp/usr/include/GNUstep/NGStreams/NGFilterTextStream.h A debian/tmp/usr/include/GNUstep/NGStreams/NGGZipStream.h A debian/tmp/usr/include/GNUstep/NGStreams/NGInternetSocketAddress.h A debian/tmp/usr/include/GNUstep/NGStreams/NGInternetSocketDomain.h A debian/tmp/usr/include/GNUstep/NGStreams/NGLocalSocketAddress.h A debian/tmp/usr/include/GNUstep/NGStreams/NGLocalSocketDomain.h A debian/tmp/usr/include/GNUstep/NGStreams/NGLockingStream.h A debian/tmp/usr/include/GNUstep/NGStreams/NGNet.h A debian/tmp/usr/include/GNUstep/NGStreams/NGNetDecls.h A debian/tmp/usr/include/GNUstep/NGStreams/NGNetUtilities.h A debian/tmp/usr/include/GNUstep/NGStreams/NGPassiveSocket.h A debian/tmp/usr/include/GNUstep/NGStreams/NGSocket.h A debian/tmp/usr/include/GNUstep/NGStreams/NGSocketExceptions.h A debian/tmp/usr/include/GNUstep/NGStreams/NGSocketProtocols.h A debian/tmp/usr/include/GNUstep/NGStreams/NGStream.h A debian/tmp/usr/include/GNUstep/NGStreams/NGStreamExceptions.h A debian/tmp/usr/include/GNUstep/NGStreams/NGStreamPipe.h A debian/tmp/usr/include/GNUstep/NGStreams/NGStreamProtocols.h A debian/tmp/usr/include/GNUstep/NGStreams/NGStreams.h A debian/tmp/usr/include/GNUstep/NGStreams/NGStreamsDecls.h A debian/tmp/usr/include/GNUstep/NGStreams/NGStringTextStream.h A debian/tmp/usr/include/GNUstep/NGStreams/NGTerminalSupport.h A debian/tmp/usr/include/GNUstep/NGStreams/NGTextStream.h A debian/tmp/usr/include/GNUstep/NGStreams/NGTextStreamProtocols.h A debian/tmp/usr/include/GNUstep/NGXmlRpc/NGAsyncResultProxy.h A debian/tmp/usr/include/GNUstep/NGXmlRpc/NGXmlRpc.h A debian/tmp/usr/include/GNUstep/NGXmlRpc/NGXmlRpcAction.h A debian/tmp/usr/include/GNUstep/NGXmlRpc/NGXmlRpcClient.h A debian/tmp/usr/include/GNUstep/NGXmlRpc/NGXmlRpcInvocation.h A debian/tmp/usr/include/GNUstep/NGXmlRpc/NGXmlRpcMethodSignature.h A debian/tmp/usr/include/GNUstep/NGXmlRpc/NGXmlRpcRequestHandler.h A debian/tmp/usr/include/GNUstep/NGXmlRpc/NSObject+Reflection.h A debian/tmp/usr/include/GNUstep/NGXmlRpc/WODirectAction+XmlRpc.h A debian/tmp/usr/include/GNUstep/NGXmlRpc/WODirectAction+XmlRpcIntrospection.h A debian/tmp/usr/include/GNUstep/NGXmlRpc/XmlRpcMethodCall+WO.h A debian/tmp/usr/include/GNUstep/NGXmlRpc/XmlRpcMethodResponse+WO.h A debian/tmp/usr/include/GNUstep/NGiCal/NGVCard.h A debian/tmp/usr/include/GNUstep/NGiCal/NGVCardAddress.h A debian/tmp/usr/include/GNUstep/NGiCal/NGVCardName.h A debian/tmp/usr/include/GNUstep/NGiCal/NGVCardOrg.h A debian/tmp/usr/include/GNUstep/NGiCal/NGVCardPhone.h A debian/tmp/usr/include/GNUstep/NGiCal/NGVCardSaxHandler.h A debian/tmp/usr/include/GNUstep/NGiCal/NGVCardSimpleValue.h A debian/tmp/usr/include/GNUstep/NGiCal/NGVCardStrArrayValue.h A debian/tmp/usr/include/GNUstep/NGiCal/NGVCardValue.h A debian/tmp/usr/include/GNUstep/NGiCal/NGiCal.h A debian/tmp/usr/include/GNUstep/NGiCal/NSCalendarDate+ICal.h A debian/tmp/usr/include/GNUstep/NGiCal/iCalAlarm.h A debian/tmp/usr/include/GNUstep/NGiCal/iCalAttachment.h A debian/tmp/usr/include/GNUstep/NGiCal/iCalCalendar.h A debian/tmp/usr/include/GNUstep/NGiCal/iCalDataSource.h A debian/tmp/usr/include/GNUstep/NGiCal/iCalDuration.h A debian/tmp/usr/include/GNUstep/NGiCal/iCalEntityObject.h A debian/tmp/usr/include/GNUstep/NGiCal/iCalEvent.h A debian/tmp/usr/include/GNUstep/NGiCal/iCalEventChanges.h A debian/tmp/usr/include/GNUstep/NGiCal/iCalFreeBusy.h A debian/tmp/usr/include/GNUstep/NGiCal/iCalJournal.h A debian/tmp/usr/include/GNUstep/NGiCal/iCalObject.h A debian/tmp/usr/include/GNUstep/NGiCal/iCalPerson.h A debian/tmp/usr/include/GNUstep/NGiCal/iCalRecurrenceCalculator.h A debian/tmp/usr/include/GNUstep/NGiCal/iCalRecurrenceRule.h A debian/tmp/usr/include/GNUstep/NGiCal/iCalRenderer.h A debian/tmp/usr/include/GNUstep/NGiCal/iCalRepeatableEntityObject.h A debian/tmp/usr/include/GNUstep/NGiCal/iCalToDo.h A debian/tmp/usr/include/GNUstep/NGiCal/iCalTrigger.h A debian/tmp/usr/include/GNUstep/SaxObjC/SaxAttributeList.h A debian/tmp/usr/include/GNUstep/SaxObjC/SaxAttributes.h A debian/tmp/usr/include/GNUstep/SaxObjC/SaxContentHandler.h A debian/tmp/usr/include/GNUstep/SaxObjC/SaxDTDHandler.h A debian/tmp/usr/include/GNUstep/SaxObjC/SaxDeclHandler.h A debian/tmp/usr/include/GNUstep/SaxObjC/SaxDefaultHandler.h A debian/tmp/usr/include/GNUstep/SaxObjC/SaxDocumentHandler.h A debian/tmp/usr/include/GNUstep/SaxObjC/SaxEntityResolver.h A debian/tmp/usr/include/GNUstep/SaxObjC/SaxErrorHandler.h A debian/tmp/usr/include/GNUstep/SaxObjC/SaxException.h A debian/tmp/usr/include/GNUstep/SaxObjC/SaxHandlerBase.h A debian/tmp/usr/include/GNUstep/SaxObjC/SaxLexicalHandler.h A debian/tmp/usr/include/GNUstep/SaxObjC/SaxLocator.h A debian/tmp/usr/include/GNUstep/SaxObjC/SaxMethodCallHandler.h A debian/tmp/usr/include/GNUstep/SaxObjC/SaxNamespaceSupport.h A debian/tmp/usr/include/GNUstep/SaxObjC/SaxObjC.h A debian/tmp/usr/include/GNUstep/SaxObjC/SaxObjectDecoder.h A debian/tmp/usr/include/GNUstep/SaxObjC/SaxObjectModel.h A debian/tmp/usr/include/GNUstep/SaxObjC/SaxXMLFilter.h A debian/tmp/usr/include/GNUstep/SaxObjC/SaxXMLReader.h A debian/tmp/usr/include/GNUstep/SaxObjC/SaxXMLReaderFactory.h A debian/tmp/usr/include/GNUstep/SaxObjC/XMLNamespaces.h A debian/tmp/usr/include/GNUstep/SoOFS/OFSBaseObject.h A debian/tmp/usr/include/GNUstep/SoOFS/OFSChangeLog.h A debian/tmp/usr/include/GNUstep/SoOFS/OFSFactoryContext.h A debian/tmp/usr/include/GNUstep/SoOFS/OFSFactoryRegistry.h A debian/tmp/usr/include/GNUstep/SoOFS/OFSFile.h A debian/tmp/usr/include/GNUstep/SoOFS/OFSFileRenderer.h A debian/tmp/usr/include/GNUstep/SoOFS/OFSFolder.h A debian/tmp/usr/include/GNUstep/SoOFS/OFSFolderDataSource.h A debian/tmp/usr/include/GNUstep/SoOFS/OFSHttpPasswd.h A debian/tmp/usr/include/GNUstep/SoOFS/OFSImage.h A debian/tmp/usr/include/GNUstep/SoOFS/OFSPropertyListObject.h A debian/tmp/usr/include/GNUstep/SoOFS/OFSResourceManager.h A debian/tmp/usr/include/GNUstep/SoOFS/OFSWebDocument.h A debian/tmp/usr/include/GNUstep/SoOFS/OFSWebMethod.h A debian/tmp/usr/include/GNUstep/SoOFS/OFSWebMethodRenderer.h A debian/tmp/usr/include/GNUstep/SoOFS/OFSWebTemplate.h A debian/tmp/usr/include/GNUstep/SoOFS/SoOFS.h A debian/tmp/usr/include/GNUstep/WEExtensions/WEContextConditional.h A debian/tmp/usr/include/GNUstep/WEExtensions/WEResourceManager.h A debian/tmp/usr/include/GNUstep/WOExtensions/WOExtensions.h A debian/tmp/usr/include/GNUstep/WOExtensions/WORedirect.h A debian/tmp/usr/include/GNUstep/WOXML/WOXML.h A debian/tmp/usr/include/GNUstep/WOXML/WOXMLDecoder.h A debian/tmp/usr/include/GNUstep/WOXML/WOXMLMappingModel.h A debian/tmp/usr/include/GNUstep/XmlRpc/NSObject+XmlRpc.h A debian/tmp/usr/include/GNUstep/XmlRpc/XmlRpc.h A debian/tmp/usr/include/GNUstep/XmlRpc/XmlRpcCoder.h A debian/tmp/usr/include/GNUstep/XmlRpc/XmlRpcMethodCall.h A debian/tmp/usr/include/GNUstep/XmlRpc/XmlRpcMethodResponse.h A debian/tmp/usr/lib/GNUstep/GDLAdaptors-4.9/MySQL.gdladaptor/MySQL A debian/tmp/usr/lib/GNUstep/GDLAdaptors-4.9/MySQL.gdladaptor/Resources/Info-gnustep.plist A debian/tmp/usr/lib/GNUstep/GDLAdaptors-4.9/MySQL.gdladaptor/Resources/Version A debian/tmp/usr/lib/GNUstep/GDLAdaptors-4.9/MySQL.gdladaptor/stamp.make A debian/tmp/usr/lib/GNUstep/GDLAdaptors-4.9/PostgreSQL.gdladaptor/PostgreSQL A debian/tmp/usr/lib/GNUstep/GDLAdaptors-4.9/PostgreSQL.gdladaptor/Resources/Info-gnustep.plist A debian/tmp/usr/lib/GNUstep/GDLAdaptors-4.9/PostgreSQL.gdladaptor/Resources/Version A debian/tmp/usr/lib/GNUstep/GDLAdaptors-4.9/PostgreSQL.gdladaptor/stamp.make A debian/tmp/usr/lib/GNUstep/GDLAdaptors-4.9/SQLite3.gdladaptor/Resources/Info-gnustep.plist A debian/tmp/usr/lib/GNUstep/GDLAdaptors-4.9/SQLite3.gdladaptor/Resources/Version A debian/tmp/usr/lib/GNUstep/GDLAdaptors-4.9/SQLite3.gdladaptor/SQLite3 A debian/tmp/usr/lib/GNUstep/GDLAdaptors-4.9/SQLite3.gdladaptor/stamp.make A debian/tmp/usr/lib/GNUstep/Libraries/Resources/NGObjWeb/DAVPropMap.plist A debian/tmp/usr/lib/GNUstep/Libraries/Resources/NGObjWeb/Defaults.plist A debian/tmp/usr/lib/GNUstep/Libraries/Resources/NGObjWeb/Languages.plist A debian/tmp/usr/lib/GNUstep/SaxDrivers-4.9/STXSaxDriver.sax/Resources/Info-gnustep.plist A debian/tmp/usr/lib/GNUstep/SaxDrivers-4.9/STXSaxDriver.sax/Resources/Version A debian/tmp/usr/lib/GNUstep/SaxDrivers-4.9/STXSaxDriver.sax/STXSaxDriver A debian/tmp/usr/lib/GNUstep/SaxDrivers-4.9/STXSaxDriver.sax/bundle-info.plist A debian/tmp/usr/lib/GNUstep/SaxDrivers-4.9/STXSaxDriver.sax/stamp.make A debian/tmp/usr/lib/GNUstep/SaxDrivers-4.9/libxmlSAXDriver.sax/Resources/Info-gnustep.plist A debian/tmp/usr/lib/GNUstep/SaxDrivers-4.9/libxmlSAXDriver.sax/Resources/Version A debian/tmp/usr/lib/GNUstep/SaxDrivers-4.9/libxmlSAXDriver.sax/Resources/bundle-info.plist A debian/tmp/usr/lib/GNUstep/SaxDrivers-4.9/libxmlSAXDriver.sax/bundle-info.plist A debian/tmp/usr/lib/GNUstep/SaxDrivers-4.9/libxmlSAXDriver.sax/libxmlSAXDriver A debian/tmp/usr/lib/GNUstep/SaxDrivers-4.9/libxmlSAXDriver.sax/stamp.make A debian/tmp/usr/lib/GNUstep/SaxDrivers-4.9/versitSaxDriver.sax/Resources/Info-gnustep.plist A debian/tmp/usr/lib/GNUstep/SaxDrivers-4.9/versitSaxDriver.sax/Resources/bundle-info.plist A debian/tmp/usr/lib/GNUstep/SaxDrivers-4.9/versitSaxDriver.sax/bundle-info.plist A debian/tmp/usr/lib/GNUstep/SaxDrivers-4.9/versitSaxDriver.sax/stamp.make A debian/tmp/usr/lib/GNUstep/SaxDrivers-4.9/versitSaxDriver.sax/versitSaxDriver A debian/tmp/usr/lib/GNUstep/SaxMappings/NGiCal.xmap A debian/tmp/usr/lib/GNUstep/SoProducts-4.9/SoCore.sxp/Resources/Info-gnustep.plist A debian/tmp/usr/lib/GNUstep/SoProducts-4.9/SoCore.sxp/Resources/Version A debian/tmp/usr/lib/GNUstep/SoProducts-4.9/SoCore.sxp/Resources/product.plist A debian/tmp/usr/lib/GNUstep/SoProducts-4.9/SoCore.sxp/SoCore A debian/tmp/usr/lib/GNUstep/SoProducts-4.9/SoCore.sxp/stamp.make A debian/tmp/usr/lib/GNUstep/SoProducts-4.9/SoOFS.sxp/Resources/Info-gnustep.plist A debian/tmp/usr/lib/GNUstep/SoProducts-4.9/SoOFS.sxp/Resources/Version A debian/tmp/usr/lib/GNUstep/SoProducts-4.9/SoOFS.sxp/Resources/product.plist A debian/tmp/usr/lib/GNUstep/SoProducts-4.9/SoOFS.sxp/SoOFS A debian/tmp/usr/lib/GNUstep/SoProducts-4.9/SoOFS.sxp/stamp.make A debian/tmp/usr/lib/GNUstep/WOxElemBuilders-4.9/WEExtensions.wox/Resources/Info-gnustep.plist A debian/tmp/usr/lib/GNUstep/WOxElemBuilders-4.9/WEExtensions.wox/WEExtensions A debian/tmp/usr/lib/GNUstep/WOxElemBuilders-4.9/WEExtensions.wox/bundle-info.plist A debian/tmp/usr/lib/GNUstep/WOxElemBuilders-4.9/WEExtensions.wox/stamp.make A debian/tmp/usr/lib/GNUstep/WOxElemBuilders-4.9/WEPrototype.wox/Resources/Info-gnustep.plist A debian/tmp/usr/lib/GNUstep/WOxElemBuilders-4.9/WEPrototype.wox/WEPrototype A debian/tmp/usr/lib/GNUstep/WOxElemBuilders-4.9/WEPrototype.wox/bundle-info.plist A debian/tmp/usr/lib/GNUstep/WOxElemBuilders-4.9/WEPrototype.wox/stamp.make A debian/tmp/usr/lib/GNUstep/WOxElemBuilders-4.9/WOExtensions.wox/Resources/Info-gnustep.plist A debian/tmp/usr/lib/GNUstep/WOxElemBuilders-4.9/WOExtensions.wox/WOExtensions A debian/tmp/usr/lib/GNUstep/WOxElemBuilders-4.9/WOExtensions.wox/bundle-info.plist A debian/tmp/usr/lib/GNUstep/WOxElemBuilders-4.9/WOExtensions.wox/stamp.make A debian/tmp/usr/lib/libDOM.so.4.9 A debian/tmp/usr/lib/libDOM.so.4.9.24 A debian/tmp/usr/lib/libEOControl.so.4.9 A debian/tmp/usr/lib/libEOControl.so.4.9.74 A debian/tmp/usr/lib/libGDLAccess.so.4.9 A debian/tmp/usr/lib/libGDLAccess.so.4.9.63 A debian/tmp/usr/lib/libNGExtensions.so.4.9 A debian/tmp/usr/lib/libNGExtensions.so.4.9.203 A debian/tmp/usr/lib/libNGLdap.so.4.9 A debian/tmp/usr/lib/libNGLdap.so.4.9.35 A debian/tmp/usr/lib/libNGMime.so.4.9 A debian/tmp/usr/lib/libNGMime.so.4.9.3 A debian/tmp/usr/lib/libNGObjWeb.so.4.9 A debian/tmp/usr/lib/libNGObjWeb.so.4.9.37 A debian/tmp/usr/lib/libNGStreams.so.4.9 A debian/tmp/usr/lib/libNGStreams.so.4.9.57 A debian/tmp/usr/lib/libNGXmlRpc.so.4.9 A debian/tmp/usr/lib/libNGXmlRpc.so.4.9.17 A debian/tmp/usr/lib/libNGiCal.so.4.9 A debian/tmp/usr/lib/libNGiCal.so.4.9.84 A debian/tmp/usr/lib/libSaxObjC.so.4.9 A debian/tmp/usr/lib/libSaxObjC.so.4.9.66 A debian/tmp/usr/lib/libSoOFS.so.4.9 A debian/tmp/usr/lib/libSoOFS.so.4.9.25 A debian/tmp/usr/lib/libWEExtensions.so.4.9 A debian/tmp/usr/lib/libWEExtensions.so.4.9.94 A debian/tmp/usr/lib/libWEPrototype.so.4.9 A debian/tmp/usr/lib/libWEPrototype.so.4.9.9 A debian/tmp/usr/lib/libWOExtensions.so.4.9 A debian/tmp/usr/lib/libWOExtensions.so.4.9.31 A debian/tmp/usr/lib/libWOXML.so.4.9 A debian/tmp/usr/lib/libWOXML.so.4.9.9 A debian/tmp/usr/lib/libXmlRpc.so.4.9 A debian/tmp/usr/lib/libXmlRpc.so.4.9.31 A debian/tmp/usr/sbin/sope-4.9 A debian/tmp/usr/share/GNUstep/Makefiles/Additional/ngobjweb.make A debian/tmp/usr/share/GNUstep/Makefiles/woapp.make A debian/tmp/usr/share/GNUstep/Makefiles/wobundle.make A gnustep-make/.cvsignore A gnustep-make/ANNOUNCE A gnustep-make/COPYING A gnustep-make/ChangeLog A gnustep-make/ChangeLog.1 A gnustep-make/Documentation/.cvsignore A gnustep-make/Documentation/.latex2html-init A gnustep-make/Documentation/DESIGN A gnustep-make/Documentation/GNUmakefile A gnustep-make/Documentation/GNUstep.7 A gnustep-make/Documentation/README.Cygwin A gnustep-make/Documentation/README.Darwin A gnustep-make/Documentation/README.MinGW A gnustep-make/Documentation/README.MinGWOnCygwin A gnustep-make/Documentation/README.NetBSD A gnustep-make/Documentation/announce.texi A gnustep-make/Documentation/end.texi A gnustep-make/Documentation/faq.texi A gnustep-make/Documentation/filesystem.texi A gnustep-make/Documentation/gnustep-howto.texi A gnustep-make/Documentation/gnustep.init A gnustep-make/Documentation/install.texi A gnustep-make/Documentation/internals.tex A gnustep-make/Documentation/machines.texi A gnustep-make/Documentation/make.texi A gnustep-make/Documentation/news.texi A gnustep-make/Documentation/openapp.1 A gnustep-make/Documentation/readme.texi A gnustep-make/Documentation/userfaq.texi A gnustep-make/FAQ A gnustep-make/GNUmakefile A gnustep-make/GNUmakefile.in A gnustep-make/GNUmakefile.postamble A gnustep-make/GNUmakefile.preamble A gnustep-make/GNUstep-HOWTO A gnustep-make/GNUstep-reset.sh A gnustep-make/GNUstep.conf A gnustep-make/GNUstep.conf.in A gnustep-make/GNUstep.csh A gnustep-make/GNUstep.csh.in A gnustep-make/GNUstep.sh A gnustep-make/GNUstep.sh.in A gnustep-make/GNUsteprc.in A gnustep-make/INSTALL A gnustep-make/Instance/Documentation/autogsdoc.make A gnustep-make/Instance/Documentation/gsdoc.make A gnustep-make/Instance/Documentation/install_files.make A gnustep-make/Instance/Documentation/javadoc.make A gnustep-make/Instance/Documentation/latex.make A gnustep-make/Instance/Documentation/texi.make A gnustep-make/Instance/README A gnustep-make/Instance/Shared/README A gnustep-make/Instance/Shared/bundle.make A gnustep-make/Instance/Shared/headers.make A gnustep-make/Instance/Shared/java.make A gnustep-make/Instance/Shared/pch.make A gnustep-make/Instance/Shared/stamp-string.make A gnustep-make/Instance/Shared/strings.make A gnustep-make/Instance/application.make A gnustep-make/Instance/bundle.make A gnustep-make/Instance/clibrary.make A gnustep-make/Instance/ctool.make A gnustep-make/Instance/documentation.make A gnustep-make/Instance/framework.make A gnustep-make/Instance/gcj-tool.make A gnustep-make/Instance/gswapp.make A gnustep-make/Instance/gswbundle.make A gnustep-make/Instance/java-tool.make A gnustep-make/Instance/java.make A gnustep-make/Instance/library.make A gnustep-make/Instance/objc.make A gnustep-make/Instance/palette.make A gnustep-make/Instance/resource-set.make A gnustep-make/Instance/rules.make A gnustep-make/Instance/service.make A gnustep-make/Instance/subproject.make A gnustep-make/Instance/test-application.make A gnustep-make/Instance/test-library.make A gnustep-make/Instance/test-tool.make A gnustep-make/Instance/tool.make A gnustep-make/Master/README A gnustep-make/Master/aggregate.make A gnustep-make/Master/application.make A gnustep-make/Master/bundle.make A gnustep-make/Master/clibrary.make A gnustep-make/Master/ctool.make A gnustep-make/Master/documentation.make A gnustep-make/Master/framework.make A gnustep-make/Master/gcj-tool.make A gnustep-make/Master/gswapp.make A gnustep-make/Master/gswbundle.make A gnustep-make/Master/java-tool.make A gnustep-make/Master/java.make A gnustep-make/Master/library.make A gnustep-make/Master/objc.make A gnustep-make/Master/palette.make A gnustep-make/Master/resource-set.make A gnustep-make/Master/rpm.make A gnustep-make/Master/rules.make A gnustep-make/Master/service.make A gnustep-make/Master/source-distribution.make A gnustep-make/Master/subproject.make A gnustep-make/Master/test-application.make A gnustep-make/Master/test-library.make A gnustep-make/Master/test-tool.make A gnustep-make/Master/tool.make A gnustep-make/NEWS A gnustep-make/README A gnustep-make/Version A gnustep-make/aggregate.make A gnustep-make/application.make A gnustep-make/bundle.make A gnustep-make/clean_cpu.sh A gnustep-make/clean_os.sh A gnustep-make/clean_vendor.sh A gnustep-make/clibrary.make A gnustep-make/common.make A gnustep-make/config.guess A gnustep-make/config.h A gnustep-make/config.h.in A gnustep-make/config.log A gnustep-make/config.make A gnustep-make/config.make.in A gnustep-make/config.site A gnustep-make/config.status A gnustep-make/config.sub A gnustep-make/config_thread.m A gnustep-make/configure A gnustep-make/configure.ac A gnustep-make/cpu.sh A gnustep-make/create_domain_dir_tree.sh A gnustep-make/ctool.make A gnustep-make/debugapp A gnustep-make/debugapp.in A gnustep-make/documentation.make A gnustep-make/executable.template A gnustep-make/executable.template.in A gnustep-make/fixpath.sh A gnustep-make/fixpath.sh.in A gnustep-make/framework.make A gnustep-make/gcj-tool.make A gnustep-make/gnustep-make.spec A gnustep-make/gnustep-make.spec.in A gnustep-make/gswapp.make A gnustep-make/gswbundle.make A gnustep-make/install-sh A gnustep-make/java-executable.template A gnustep-make/java-tool.make A gnustep-make/java.make A gnustep-make/jni.make A gnustep-make/ld_lib_path.csh A gnustep-make/ld_lib_path.sh A gnustep-make/library-combo.make A gnustep-make/library.make A gnustep-make/messages.make A gnustep-make/mkinstalldirs A gnustep-make/move_obsolete_paths.sh A gnustep-make/names.make A gnustep-make/native-library.make A gnustep-make/objc.make A gnustep-make/openapp A gnustep-make/openapp.in A gnustep-make/opentool A gnustep-make/opentool.in A gnustep-make/os.sh A gnustep-make/palette.make A gnustep-make/relative_path.sh A gnustep-make/resource-set.make A gnustep-make/rules.make A gnustep-make/service.make A gnustep-make/setlocaltz.sh A gnustep-make/spec-debug-alone-rules.template A gnustep-make/spec-debug-rules.template A gnustep-make/spec-rules.template A gnustep-make/strip_makefiles.sh A gnustep-make/subproject.make A gnustep-make/tar-exclude-list A gnustep-make/target.make A gnustep-make/test-application.make A gnustep-make/test-library.make A gnustep-make/test-tool.make A gnustep-make/tool.make A gnustep-make/transform_paths.sh A gnustep-make/user_home.c A gnustep-make/vendor.sh A gnustep-make/which_lib A gnustep-make/which_lib.c A libFoundation/ANNOUNCE A libFoundation/AUTHORS A libFoundation/COPYING A libFoundation/ChangeLog A libFoundation/Foundation/DefaultScannerHandler.m A libFoundation/Foundation/FFCallInvocation.h A libFoundation/Foundation/FFCallInvocation.m A libFoundation/Foundation/FormatScanner.m A libFoundation/Foundation/Foundation.h A libFoundation/Foundation/GCArray.m A libFoundation/Foundation/GCDictionary.m A libFoundation/Foundation/GCObject.m A libFoundation/Foundation/GNUmakefile A libFoundation/Foundation/GNUmakefile.alone A libFoundation/Foundation/GNUmakefile.postamble A libFoundation/Foundation/GarbageCollector.m A libFoundation/Foundation/NSAccount.h A libFoundation/Foundation/NSAccount.m A libFoundation/Foundation/NSAllocDebugZone.h A libFoundation/Foundation/NSAllocDebugZone.m A libFoundation/Foundation/NSArchiver.h A libFoundation/Foundation/NSArchiver.m A libFoundation/Foundation/NSArray.h A libFoundation/Foundation/NSArray.m A libFoundation/Foundation/NSAttributedString.h A libFoundation/Foundation/NSAttributedString.m A libFoundation/Foundation/NSAutoreleasePool.h A libFoundation/Foundation/NSAutoreleasePool.m A libFoundation/Foundation/NSBundle.h A libFoundation/Foundation/NSBundle.m A libFoundation/Foundation/NSByteOrder.h A libFoundation/Foundation/NSCalendarDate.h A libFoundation/Foundation/NSCalendarDate.m A libFoundation/Foundation/NSCalendarDateScanf.h A libFoundation/Foundation/NSCalendarDateScanf.m A libFoundation/Foundation/NSCalendarDateScannerHandler.h A libFoundation/Foundation/NSCalendarDateScannerHandler.m A libFoundation/Foundation/NSCharacterSet.h A libFoundation/Foundation/NSCharacterSet.m A libFoundation/Foundation/NSClassDescription.h A libFoundation/Foundation/NSClassDescription.m A libFoundation/Foundation/NSClassicException.h A libFoundation/Foundation/NSCoder.h A libFoundation/Foundation/NSCoder.m A libFoundation/Foundation/NSComparisonPredicate.h A libFoundation/Foundation/NSComparisonPredicate.m A libFoundation/Foundation/NSCompoundPredicate.h A libFoundation/Foundation/NSCompoundPredicate.m A libFoundation/Foundation/NSConcreteArray.h A libFoundation/Foundation/NSConcreteArray.m A libFoundation/Foundation/NSConcreteCharacterSet.h A libFoundation/Foundation/NSConcreteCharacterSet.m A libFoundation/Foundation/NSConcreteData.h A libFoundation/Foundation/NSConcreteData.m A libFoundation/Foundation/NSConcreteDate.h A libFoundation/Foundation/NSConcreteDate.m A libFoundation/Foundation/NSConcreteDictionary.h A libFoundation/Foundation/NSConcreteDictionary.m A libFoundation/Foundation/NSConcreteFileHandle.h A libFoundation/Foundation/NSConcreteFileHandle.m A libFoundation/Foundation/NSConcreteMutableDictionary.m A libFoundation/Foundation/NSConcreteMutableString.m A libFoundation/Foundation/NSConcreteNumber.h A libFoundation/Foundation/NSConcreteNumber.m A libFoundation/Foundation/NSConcreteNumber.m.sh A libFoundation/Foundation/NSConcreteScanner.h A libFoundation/Foundation/NSConcreteScanner.m A libFoundation/Foundation/NSConcreteSet.h A libFoundation/Foundation/NSConcreteSet.m A libFoundation/Foundation/NSConcreteString.h A libFoundation/Foundation/NSConcreteString.m A libFoundation/Foundation/NSConcreteTimeZone.h A libFoundation/Foundation/NSConcreteTimeZone.m A libFoundation/Foundation/NSConcreteTimeZoneDetail.h A libFoundation/Foundation/NSConcreteTimeZoneDetail.m A libFoundation/Foundation/NSConcreteUTF16String.m A libFoundation/Foundation/NSConcreteUnixTask.h A libFoundation/Foundation/NSConcreteUnixTask.m A libFoundation/Foundation/NSConcreteValue.h A libFoundation/Foundation/NSConcreteValue.m A libFoundation/Foundation/NSConcreteWindowsFileHandle.h A libFoundation/Foundation/NSConcreteWindowsFileHandle.m A libFoundation/Foundation/NSConcreteWindowsTask.h A libFoundation/Foundation/NSConcreteWindowsTask.m A libFoundation/Foundation/NSConnection.h A libFoundation/Foundation/NSConnection.m A libFoundation/Foundation/NSData.h A libFoundation/Foundation/NSData.m A libFoundation/Foundation/NSDate.h A libFoundation/Foundation/NSDate.m A libFoundation/Foundation/NSDateFormatter.h A libFoundation/Foundation/NSDateFormatter.m A libFoundation/Foundation/NSDebug.h A libFoundation/Foundation/NSDebug.m A libFoundation/Foundation/NSDecimal.h A libFoundation/Foundation/NSDecimal.m A libFoundation/Foundation/NSDecimalNumber.h A libFoundation/Foundation/NSDecimalNumber.m A libFoundation/Foundation/NSDefaultZone.h A libFoundation/Foundation/NSDefaultZone.m A libFoundation/Foundation/NSDictionary.h A libFoundation/Foundation/NSDictionary.m A libFoundation/Foundation/NSDistantObject.h A libFoundation/Foundation/NSDistributedLock.h A libFoundation/Foundation/NSDistributedLock.m A libFoundation/Foundation/NSDistributedNotificationCenter.h A libFoundation/Foundation/NSDistributedNotificationCenter.m A libFoundation/Foundation/NSEnumerator.h A libFoundation/Foundation/NSEnumerator.m A libFoundation/Foundation/NSError.h A libFoundation/Foundation/NSError.m A libFoundation/Foundation/NSException.m A libFoundation/Foundation/NSExceptionWithoutNested.h A libFoundation/Foundation/NSExpression.h A libFoundation/Foundation/NSExpression.m A libFoundation/Foundation/NSFileHandle.h A libFoundation/Foundation/NSFileHandle.m A libFoundation/Foundation/NSFileManager.h A libFoundation/Foundation/NSFileManager.m A libFoundation/Foundation/NSFileURLHandle.h A libFoundation/Foundation/NSFileURLHandle.m A libFoundation/Foundation/NSFormatter.h A libFoundation/Foundation/NSFormatter.m A libFoundation/Foundation/NSFrameInvocation.h A libFoundation/Foundation/NSFrameInvocation.m A libFoundation/Foundation/NSFuncallException.h A libFoundation/Foundation/NSGeometry.h A libFoundation/Foundation/NSGeometry.m A libFoundation/Foundation/NSHashMap.m A libFoundation/Foundation/NSHashTable.h A libFoundation/Foundation/NSHost.h A libFoundation/Foundation/NSHost.m A libFoundation/Foundation/NSInputStream.m A libFoundation/Foundation/NSInvocation.h A libFoundation/Foundation/NSInvocation.m A libFoundation/Foundation/NSKeyValueCoding.h A libFoundation/Foundation/NSLock.h A libFoundation/Foundation/NSLock.m A libFoundation/Foundation/NSMapTable.h A libFoundation/Foundation/NSMappedData.h A libFoundation/Foundation/NSMappedData.m A libFoundation/Foundation/NSMessagePort.m A libFoundation/Foundation/NSMethodSignature.h A libFoundation/Foundation/NSMethodSignature.m A libFoundation/Foundation/NSNotification.h A libFoundation/Foundation/NSNotification.m A libFoundation/Foundation/NSNotificationCenter.m A libFoundation/Foundation/NSNotificationQueue.h A libFoundation/Foundation/NSNotificationQueue.m A libFoundation/Foundation/NSNull.h A libFoundation/Foundation/NSNull.m A libFoundation/Foundation/NSNumber.m A libFoundation/Foundation/NSNumberFormatter.h A libFoundation/Foundation/NSNumberFormatter.m A libFoundation/Foundation/NSObjCRuntime.h A libFoundation/Foundation/NSObjCRuntime.m A libFoundation/Foundation/NSObject+PropLists.h A libFoundation/Foundation/NSObject.h.in A libFoundation/Foundation/NSObject.m A libFoundation/Foundation/NSObjectAllocation.m A libFoundation/Foundation/NSObjectInvocation.h A libFoundation/Foundation/NSObjectInvocation.m A libFoundation/Foundation/NSOutputStream.m A libFoundation/Foundation/NSPathUtilities.h A libFoundation/Foundation/NSPathUtilities.m A libFoundation/Foundation/NSPipe.m A libFoundation/Foundation/NSPort.h A libFoundation/Foundation/NSPort.m A libFoundation/Foundation/NSPortCoder.h A libFoundation/Foundation/NSPortCoder.m A libFoundation/Foundation/NSPortMessage.h A libFoundation/Foundation/NSPortMessage.m A libFoundation/Foundation/NSPortNameServer.h A libFoundation/Foundation/NSPortNameServer.m A libFoundation/Foundation/NSPosixFileDescriptor.h A libFoundation/Foundation/NSPosixFileDescriptor.m A libFoundation/Foundation/NSPredicate.h A libFoundation/Foundation/NSPredicate.m A libFoundation/Foundation/NSPredicateParser.m A libFoundation/Foundation/NSProcessInfo.h A libFoundation/Foundation/NSProcessInfo.m A libFoundation/Foundation/NSProxy.h A libFoundation/Foundation/NSProxy.m A libFoundation/Foundation/NSRange.h A libFoundation/Foundation/NSRange.m A libFoundation/Foundation/NSRunLoop.h A libFoundation/Foundation/NSRunLoop.m A libFoundation/Foundation/NSScanner.h A libFoundation/Foundation/NSScanner.m A libFoundation/Foundation/NSScriptKeyValueCoding.h A libFoundation/Foundation/NSSerialization.h A libFoundation/Foundation/NSSerialization.m A libFoundation/Foundation/NSSet.h A libFoundation/Foundation/NSSet.m A libFoundation/Foundation/NSSocketPort.m A libFoundation/Foundation/NSSortDescriptor.h A libFoundation/Foundation/NSSortDescriptor.m A libFoundation/Foundation/NSStream.h A libFoundation/Foundation/NSStream.m A libFoundation/Foundation/NSString+StringEncoding.m A libFoundation/Foundation/NSString.h A libFoundation/Foundation/NSString.m A libFoundation/Foundation/NSStringScanner.m A libFoundation/Foundation/NSTask.h A libFoundation/Foundation/NSTask.m A libFoundation/Foundation/NSThread.h A libFoundation/Foundation/NSThread.m A libFoundation/Foundation/NSTimeZone.h A libFoundation/Foundation/NSTimeZone.m A libFoundation/Foundation/NSTimer.h A libFoundation/Foundation/NSTimer.m A libFoundation/Foundation/NSURL.h A libFoundation/Foundation/NSURL.m A libFoundation/Foundation/NSURLHandle.h A libFoundation/Foundation/NSURLHandle.m A libFoundation/Foundation/NSUndoManager.h A libFoundation/Foundation/NSUndoManager.m A libFoundation/Foundation/NSUserDefaults.h A libFoundation/Foundation/NSUserDefaults.m A libFoundation/Foundation/NSUtilities.h A libFoundation/Foundation/NSUtilities.m A libFoundation/Foundation/NSVMPage.m A libFoundation/Foundation/NSValue.h A libFoundation/Foundation/NSValue.m A libFoundation/Foundation/NSZone.h A libFoundation/Foundation/NSZone.m A libFoundation/Foundation/PrintfFormatScanner.m A libFoundation/Foundation/PrintfScannerHandler.m A libFoundation/Foundation/PrivateThreadData.h A libFoundation/Foundation/PrivateThreadData.m A libFoundation/Foundation/PropertyListParser.h A libFoundation/Foundation/PropertyListParser.m A libFoundation/Foundation/PropertyListParserUnichar.m A libFoundation/Foundation/StackZone.h A libFoundation/Foundation/StackZone.m A libFoundation/Foundation/UnixSignalHandler.h A libFoundation/Foundation/UnixSignalHandler.m A libFoundation/Foundation/behavior.m A libFoundation/Foundation/byte_order.h A libFoundation/Foundation/common.h A libFoundation/Foundation/common.m A libFoundation/Foundation/cvtutf.c A libFoundation/Foundation/cvtutf.h A libFoundation/Foundation/encoding.m A libFoundation/Foundation/err.m A libFoundation/Foundation/exceptions/EncodingFormatExceptions.h A libFoundation/Foundation/exceptions/EncodingFormatExceptions.m A libFoundation/Foundation/exceptions/FoundationException.h A libFoundation/Foundation/exceptions/FoundationException.m A libFoundation/Foundation/exceptions/FoundationExceptions.h A libFoundation/Foundation/exceptions/GeneralExceptions.h A libFoundation/Foundation/exceptions/GeneralExceptions.m A libFoundation/Foundation/exceptions/NSCoderExceptions.h A libFoundation/Foundation/exceptions/NSCoderExceptions.m A libFoundation/Foundation/exceptions/NSFileHandleExceptions.h A libFoundation/Foundation/exceptions/NSFileHandleExceptions.m A libFoundation/Foundation/exceptions/NSInvocationExceptions.h A libFoundation/Foundation/exceptions/NSInvocationExceptions.m A libFoundation/Foundation/exceptions/NSValueExceptions.h A libFoundation/Foundation/exceptions/NSValueExceptions.m A libFoundation/Foundation/exceptions/StringExceptions.h A libFoundation/Foundation/exceptions/StringExceptions.m A libFoundation/Foundation/fhs.make A libFoundation/Foundation/lfmemory.h.in A libFoundation/Foundation/libFoundation.def A libFoundation/Foundation/libFoundation.make.in A libFoundation/Foundation/load.m A libFoundation/Foundation/misc.m A libFoundation/Foundation/objc-runtime.m A libFoundation/Foundation/realpath.m A libFoundation/Foundation/scanFloat.def A libFoundation/Foundation/scanInt.def A libFoundation/Foundation/thr-mach.m A libFoundation/GNUmakefile A libFoundation/GNUmakefile.alone A libFoundation/INSTALL.txt A libFoundation/NEWS A libFoundation/README A libFoundation/README.first A libFoundation/README.gc A libFoundation/README.mingw32 A libFoundation/README.osx A libFoundation/README.sparc A libFoundation/Resources/CharacterSets/alphanumericCharacterSet.bitmap A libFoundation/Resources/CharacterSets/controlCharacterSet.bitmap A libFoundation/Resources/CharacterSets/decimalDigitCharacterSet.bitmap A libFoundation/Resources/CharacterSets/decomposableCharacterSet.bitmap A libFoundation/Resources/CharacterSets/emptyCharacterSet.bitmap A libFoundation/Resources/CharacterSets/illegalCharacterSet.bitmap A libFoundation/Resources/CharacterSets/letterCharacterSet.bitmap A libFoundation/Resources/CharacterSets/lowercaseLetterCharacterSet.bitmap A libFoundation/Resources/CharacterSets/nonBaseCharacterSet.bitmap A libFoundation/Resources/CharacterSets/punctuationCharacterSet.bitmap A libFoundation/Resources/CharacterSets/uppercaseLetterCharacterSet.bitmap A libFoundation/Resources/CharacterSets/whitespaceAndNewlineCharacterSet.bitmap A libFoundation/Resources/CharacterSets/whitespaceCharacterSet.bitmap A libFoundation/Resources/Defaults/English.plist A libFoundation/Resources/Defaults/French.plist A libFoundation/Resources/Defaults/German.plist A libFoundation/Resources/Defaults/NSGlobalDomain.plist A libFoundation/Resources/Defaults/Romanian.plist A libFoundation/Resources/GNUmakefile A libFoundation/Resources/GNUmakefile.alone A libFoundation/Resources/TimeZoneInfo/Asia/Calcutta A libFoundation/Resources/TimeZoneInfo/Australia/NSW A libFoundation/Resources/TimeZoneInfo/Australia/North A libFoundation/Resources/TimeZoneInfo/Australia/Queensland A libFoundation/Resources/TimeZoneInfo/Australia/South A libFoundation/Resources/TimeZoneInfo/Australia/Tasmania A libFoundation/Resources/TimeZoneInfo/Australia/Victoria A libFoundation/Resources/TimeZoneInfo/Australia/West A libFoundation/Resources/TimeZoneInfo/CET A libFoundation/Resources/TimeZoneInfo/CLST A libFoundation/Resources/TimeZoneInfo/CST6CDT A libFoundation/Resources/TimeZoneInfo/Canada/Atlantic A libFoundation/Resources/TimeZoneInfo/Canada/Central A libFoundation/Resources/TimeZoneInfo/Canada/East-Saskatchewan A libFoundation/Resources/TimeZoneInfo/Canada/Eastern A libFoundation/Resources/TimeZoneInfo/Canada/Mountain A libFoundation/Resources/TimeZoneInfo/Canada/Newfoundland A libFoundation/Resources/TimeZoneInfo/Canada/Pacific A libFoundation/Resources/TimeZoneInfo/Canada/Yukon A libFoundation/Resources/TimeZoneInfo/EET A libFoundation/Resources/TimeZoneInfo/EST A libFoundation/Resources/TimeZoneInfo/EST5EDT A libFoundation/Resources/TimeZoneInfo/Europe/Berlin A libFoundation/Resources/TimeZoneInfo/Europe/Brussels A libFoundation/Resources/TimeZoneInfo/Europe/Paris A libFoundation/Resources/TimeZoneInfo/GB-Eire A libFoundation/Resources/TimeZoneInfo/GMT A libFoundation/Resources/TimeZoneInfo/GMT+0_30 A libFoundation/Resources/TimeZoneInfo/GMT+1 A libFoundation/Resources/TimeZoneInfo/GMT+10 A libFoundation/Resources/TimeZoneInfo/GMT+10_30 A libFoundation/Resources/TimeZoneInfo/GMT+11 A libFoundation/Resources/TimeZoneInfo/GMT+11_30 A libFoundation/Resources/TimeZoneInfo/GMT+12 A libFoundation/Resources/TimeZoneInfo/GMT+13 A libFoundation/Resources/TimeZoneInfo/GMT+14 A libFoundation/Resources/TimeZoneInfo/GMT+1_30 A libFoundation/Resources/TimeZoneInfo/GMT+2 A libFoundation/Resources/TimeZoneInfo/GMT+2_30 A libFoundation/Resources/TimeZoneInfo/GMT+3 A libFoundation/Resources/TimeZoneInfo/GMT+3_30 A libFoundation/Resources/TimeZoneInfo/GMT+4 A libFoundation/Resources/TimeZoneInfo/GMT+4_30 A libFoundation/Resources/TimeZoneInfo/GMT+5 A libFoundation/Resources/TimeZoneInfo/GMT+5_30 A libFoundation/Resources/TimeZoneInfo/GMT+6 A libFoundation/Resources/TimeZoneInfo/GMT+6_30 A libFoundation/Resources/TimeZoneInfo/GMT+7 A libFoundation/Resources/TimeZoneInfo/GMT+7_30 A libFoundation/Resources/TimeZoneInfo/GMT+8 A libFoundation/Resources/TimeZoneInfo/GMT+8_30 A libFoundation/Resources/TimeZoneInfo/GMT+9 A libFoundation/Resources/TimeZoneInfo/GMT+9_30 A libFoundation/Resources/TimeZoneInfo/GMT-0_30 A libFoundation/Resources/TimeZoneInfo/GMT-1 A libFoundation/Resources/TimeZoneInfo/GMT-10 A libFoundation/Resources/TimeZoneInfo/GMT-10_30 A libFoundation/Resources/TimeZoneInfo/GMT-11 A libFoundation/Resources/TimeZoneInfo/GMT-11_30 A libFoundation/Resources/TimeZoneInfo/GMT-12 A libFoundation/Resources/TimeZoneInfo/GMT-1_30 A libFoundation/Resources/TimeZoneInfo/GMT-2 A libFoundation/Resources/TimeZoneInfo/GMT-2_30 A libFoundation/Resources/TimeZoneInfo/GMT-3 A libFoundation/Resources/TimeZoneInfo/GMT-3_30 A libFoundation/Resources/TimeZoneInfo/GMT-4 A libFoundation/Resources/TimeZoneInfo/GMT-4_30 A libFoundation/Resources/TimeZoneInfo/GMT-5 A libFoundation/Resources/TimeZoneInfo/GMT-5_30 A libFoundation/Resources/TimeZoneInfo/GMT-6 A libFoundation/Resources/TimeZoneInfo/GMT-6_30 A libFoundation/Resources/TimeZoneInfo/GMT-7 A libFoundation/Resources/TimeZoneInfo/GMT-7_30 A libFoundation/Resources/TimeZoneInfo/GMT-8 A libFoundation/Resources/TimeZoneInfo/GMT-8_30 A libFoundation/Resources/TimeZoneInfo/GMT-9 A libFoundation/Resources/TimeZoneInfo/GMT-9_30 A libFoundation/Resources/TimeZoneInfo/Greenwich A libFoundation/Resources/TimeZoneInfo/HST A libFoundation/Resources/TimeZoneInfo/Iceland A libFoundation/Resources/TimeZoneInfo/Japan A libFoundation/Resources/TimeZoneInfo/MET A libFoundation/Resources/TimeZoneInfo/MST A libFoundation/Resources/TimeZoneInfo/MST7MDT A libFoundation/Resources/TimeZoneInfo/NZ A libFoundation/Resources/TimeZoneInfo/PST8PDT A libFoundation/Resources/TimeZoneInfo/Poland A libFoundation/Resources/TimeZoneInfo/RegionsDictionary A libFoundation/Resources/TimeZoneInfo/SAST A libFoundation/Resources/TimeZoneInfo/SGT A libFoundation/Resources/TimeZoneInfo/Singapore A libFoundation/Resources/TimeZoneInfo/SystemV/AST4 A libFoundation/Resources/TimeZoneInfo/SystemV/AST4ADT A libFoundation/Resources/TimeZoneInfo/SystemV/CST6 A libFoundation/Resources/TimeZoneInfo/SystemV/CST6CDT A libFoundation/Resources/TimeZoneInfo/SystemV/EST5 A libFoundation/Resources/TimeZoneInfo/SystemV/EST5EDT A libFoundation/Resources/TimeZoneInfo/SystemV/HST10 A libFoundation/Resources/TimeZoneInfo/SystemV/MST7 A libFoundation/Resources/TimeZoneInfo/SystemV/MST7MDT A libFoundation/Resources/TimeZoneInfo/SystemV/PST8 A libFoundation/Resources/TimeZoneInfo/SystemV/PST8PDT A libFoundation/Resources/TimeZoneInfo/SystemV/YST9 A libFoundation/Resources/TimeZoneInfo/SystemV/YST9YDT A libFoundation/Resources/TimeZoneInfo/Turkey A libFoundation/Resources/TimeZoneInfo/UCT A libFoundation/Resources/TimeZoneInfo/US/Arizona A libFoundation/Resources/TimeZoneInfo/US/Central A libFoundation/Resources/TimeZoneInfo/US/East-Indiana A libFoundation/Resources/TimeZoneInfo/US/Eastern A libFoundation/Resources/TimeZoneInfo/US/Hawaii A libFoundation/Resources/TimeZoneInfo/US/Mountain A libFoundation/Resources/TimeZoneInfo/US/Pacific A libFoundation/Resources/TimeZoneInfo/US/Pacific-New A libFoundation/Resources/TimeZoneInfo/US/Yukon A libFoundation/Resources/TimeZoneInfo/UTC A libFoundation/Resources/TimeZoneInfo/Universal A libFoundation/Resources/TimeZoneInfo/W-SU A libFoundation/Resources/TimeZoneInfo/WET A libFoundation/Resources/TimeZoneInfo/create A libFoundation/TODO A libFoundation/Version A libFoundation/aclocal.m4 A libFoundation/config.guess A libFoundation/config.h.in A libFoundation/config.h.win32 A libFoundation/config.mak.in A libFoundation/config.mak.win32 A libFoundation/config.sub A libFoundation/config/alpha/linux-gnu.h A libFoundation/config/generic/generic.h A libFoundation/config/hppa/hppa.h A libFoundation/config/i386/cygwin32.h A libFoundation/config/i386/freebsd.h A libFoundation/config/i386/gnu.h A libFoundation/config/i386/i386.h A libFoundation/config/i386/linux-gnu.h A libFoundation/config/i386/linux.h A libFoundation/config/i386/mingw32.h A libFoundation/config/i386/nextstep3.h A libFoundation/config/i386/nextstep4.h A libFoundation/config/i386/openbsd3.7.h A libFoundation/config/i386/openbsd3.8.h A libFoundation/config/i386/openbsd3.9.h A libFoundation/config/i386/solaris2.5.1.h A libFoundation/config/i386/solaris2.9.h A libFoundation/config/m68k/m68k.h A libFoundation/config/m68k/nextstep3.h A libFoundation/config/powerpc/powerpc.h A libFoundation/config/powerpc64/gnu.h A libFoundation/config/powerpc64/linux-gnu.h A libFoundation/config/powerpc64/linux.h A libFoundation/config/powerpc64/powerpc64.h A libFoundation/config/sparc/solaris2.4.h A libFoundation/config/sparc/sparc.h A libFoundation/config/x86_64/linux-gnu.h A libFoundation/config/x86_64/linux.h A libFoundation/config/x86_64/x86_64.h A libFoundation/configure A libFoundation/configure.bat A libFoundation/configure.in A libFoundation/debian/changelog A libFoundation/debian/compat A libFoundation/debian/control A libFoundation/debian/copyright A libFoundation/debian/docs A libFoundation/debian/libfoundation-data.install A libFoundation/debian/libfoundation-tools.install A libFoundation/debian/libfoundation-tools.links A libFoundation/debian/libfoundation1.0-dev.install A libFoundation/debian/libfoundation1.0.install A libFoundation/debian/libfoundation1.1-data.install A libFoundation/debian/libfoundation1.1-dev.install A libFoundation/debian/libfoundation1.1-tools.install A libFoundation/debian/libfoundation1.1-tools.links A libFoundation/debian/libfoundation1.1.install A libFoundation/debian/rules A libFoundation/doc/GNUmakefile A libFoundation/doc/README A libFoundation/doc/libFoundation.texi A libFoundation/doc/signature-test.pl A libFoundation/examples/Defaults.m A libFoundation/examples/GNUmakefile A libFoundation/examples/GNUmakefile.alone A libFoundation/examples/chkdict.m A libFoundation/examples/fhs.make A libFoundation/examples/fmls.m A libFoundation/examples/fmrm.m A libFoundation/examples/printenv.m A libFoundation/extensions/DefaultScannerHandler.h A libFoundation/extensions/FormatScanner.h A libFoundation/extensions/GCArray.h A libFoundation/extensions/GCDictionary.h A libFoundation/extensions/GCObject.h A libFoundation/extensions/GarbageCollector.h A libFoundation/extensions/NSException.h A libFoundation/extensions/PrintfFormatScanner.h A libFoundation/extensions/PrintfScannerHandler.h A libFoundation/extensions/encoding.h A libFoundation/extensions/exceptions/FoundationException.h A libFoundation/extensions/exceptions/GeneralExceptions.h A libFoundation/extensions/exceptions/NSCoderExceptions.h A libFoundation/extensions/objc-runtime.h A libFoundation/extensions/support.h A libFoundation/gsfix.make.in A libFoundation/install-sh A libFoundation/libfoundation.spec A libFoundation/misc/GNUmakefile A libFoundation/misc/testnested.c A libFoundation/misc/testurl.m A libFoundation/mkinstalldirs A libFoundation/sharedlib.mak A maintenance/ChangeLog A maintenance/License.rtf A maintenance/Welcome.rtf A maintenance/changes-4.3.7-to-4.3.8.txt A maintenance/changes-4.3.8-to-4.3.9.txt A maintenance/changes-4.3.9-to-4.3.10.txt A maintenance/changes-4.3.9-to-4.5a.1.txt A maintenance/changes-4.5.10-to-4.7.1.txt A maintenance/changes-4.5.4-to-4.5.5.txt A maintenance/changes-4.5.5-to-4.5.6.txt A maintenance/changes-4.5.6-to-4.5.7.txt A maintenance/changes-4.5.7-to-4.5.8.txt A maintenance/changes-4.5.8-to-4.5.9.txt A maintenance/changes-4.5.9-to-4.5.10.txt A maintenance/changes-4.5a.1-to-4.5a.2.txt A maintenance/changes-4.5a.2-to-4.5a.3.txt A maintenance/changes-4.5a.3-to-4.5a.4.txt A maintenance/changes-to-4.2pre.txt A maintenance/changes-to-4.3.1.txt A maintenance/changes-to-4.3.6.txt A maintenance/dummytool.c A maintenance/dummytool.m A maintenance/make-osxdmg.sh A maintenance/make-osxmpkg.sh A maintenance/make-osxpkg.sh A maintenance/mod_ngobjweb_centos43.spec A maintenance/mod_ngobjweb_conectiva10.spec A maintenance/mod_ngobjweb_fedora.spec A maintenance/mod_ngobjweb_mdk100.spec A maintenance/mod_ngobjweb_mdk101.spec A maintenance/mod_ngobjweb_redhat9.spec A maintenance/mod_ngobjweb_rhel3.spec A maintenance/mod_ngobjweb_rhel4.spec A maintenance/mod_ngobjweb_sles9.spec A maintenance/mod_ngobjweb_slss8.spec A maintenance/mod_ngobjweb_suse100.spec A maintenance/mod_ngobjweb_suse101.spec A maintenance/mod_ngobjweb_suse82.spec A maintenance/mod_ngobjweb_suse91.spec A maintenance/mod_ngobjweb_suse92.spec A maintenance/mod_ngobjweb_suse93.spec A maintenance/package-background.tiff A maintenance/package_background.tiff A maintenance/rm-sope-on-osxlib.sh A maintenance/sope-fixcopyright.sh A maintenance/sope.spec A maintenance/syncXcodeVersions.sh A maintenance/znek-fix-xcode-projects.sh A patch-stamp A sope-appserver/COPYING A sope-appserver/COPYRIGHT A sope-appserver/ChangeLog A sope-appserver/GNUmakefile A sope-appserver/NGObjWeb/Associations/GNUmakefile A sope-appserver/NGObjWeb/Associations/GNUmakefile.preamble A sope-appserver/NGObjWeb/Associations/NSUserDefaults+KVC.m A sope-appserver/NGObjWeb/Associations/WOAssociation.m A sope-appserver/NGObjWeb/Associations/WOKeyPathAssociation.h A sope-appserver/NGObjWeb/Associations/WOKeyPathAssociation.m A sope-appserver/NGObjWeb/Associations/WOKeyPathAssociationSystemKVC.m A sope-appserver/NGObjWeb/Associations/WOLabelAssociation.h A sope-appserver/NGObjWeb/Associations/WOLabelAssociation.m A sope-appserver/NGObjWeb/Associations/WOResourceURLAssociation.h A sope-appserver/NGObjWeb/Associations/WOResourceURLAssociation.m A sope-appserver/NGObjWeb/Associations/WOScriptAssociation.h A sope-appserver/NGObjWeb/Associations/WOScriptAssociation.m A sope-appserver/NGObjWeb/Associations/WOValueAssociation.h A sope-appserver/NGObjWeb/Associations/WOValueAssociation.m A sope-appserver/NGObjWeb/Associations/common.h A sope-appserver/NGObjWeb/COPYING A sope-appserver/NGObjWeb/COPYRIGHT A sope-appserver/NGObjWeb/ChangeLog A sope-appserver/NGObjWeb/DAVPropMap.plist A sope-appserver/NGObjWeb/Defaults.plist A sope-appserver/NGObjWeb/DynamicElements/GNUmakefile A sope-appserver/NGObjWeb/DynamicElements/GNUmakefile.preamble A sope-appserver/NGObjWeb/DynamicElements/README A sope-appserver/NGObjWeb/DynamicElements/WOActionURL.api A sope-appserver/NGObjWeb/DynamicElements/WOActionURL.m A sope-appserver/NGObjWeb/DynamicElements/WOActiveImage.m A sope-appserver/NGObjWeb/DynamicElements/WOBody.api A sope-appserver/NGObjWeb/DynamicElements/WOBody.m A sope-appserver/NGObjWeb/DynamicElements/WOBrowser.api A sope-appserver/NGObjWeb/DynamicElements/WOBrowser.m A sope-appserver/NGObjWeb/DynamicElements/WOCheckBox.api A sope-appserver/NGObjWeb/DynamicElements/WOCheckBox.m A sope-appserver/NGObjWeb/DynamicElements/WOCheckBoxList.api A sope-appserver/NGObjWeb/DynamicElements/WOCheckBoxList.m A sope-appserver/NGObjWeb/DynamicElements/WOComponentContent.h A sope-appserver/NGObjWeb/DynamicElements/WOComponentContent.m A sope-appserver/NGObjWeb/DynamicElements/WOComponentReference.api A sope-appserver/NGObjWeb/DynamicElements/WOComponentReference.h A sope-appserver/NGObjWeb/DynamicElements/WOComponentReference.m A sope-appserver/NGObjWeb/DynamicElements/WOCompoundElement.h A sope-appserver/NGObjWeb/DynamicElements/WOCompoundElement.m A sope-appserver/NGObjWeb/DynamicElements/WOConditional.api A sope-appserver/NGObjWeb/DynamicElements/WOConditional.m A sope-appserver/NGObjWeb/DynamicElements/WOCopyValue.api A sope-appserver/NGObjWeb/DynamicElements/WOCopyValue.m A sope-appserver/NGObjWeb/DynamicElements/WOEmbeddedObject.api A sope-appserver/NGObjWeb/DynamicElements/WOEmbeddedObject.m A sope-appserver/NGObjWeb/DynamicElements/WOEntity.api A sope-appserver/NGObjWeb/DynamicElements/WOEntity.m A sope-appserver/NGObjWeb/DynamicElements/WOFileUpload.api A sope-appserver/NGObjWeb/DynamicElements/WOFileUpload.m A sope-appserver/NGObjWeb/DynamicElements/WOForm.api A sope-appserver/NGObjWeb/DynamicElements/WOForm.h A sope-appserver/NGObjWeb/DynamicElements/WOForm.m A sope-appserver/NGObjWeb/DynamicElements/WOFragment.api A sope-appserver/NGObjWeb/DynamicElements/WOFragment.m A sope-appserver/NGObjWeb/DynamicElements/WOFrame.api A sope-appserver/NGObjWeb/DynamicElements/WOFrame.m A sope-appserver/NGObjWeb/DynamicElements/WOGenericContainer.api A sope-appserver/NGObjWeb/DynamicElements/WOGenericContainer.m A sope-appserver/NGObjWeb/DynamicElements/WOGenericElement.api A sope-appserver/NGObjWeb/DynamicElements/WOGenericElement.h A sope-appserver/NGObjWeb/DynamicElements/WOGenericElement.m A sope-appserver/NGObjWeb/DynamicElements/WOHTMLDynamicElement.h A sope-appserver/NGObjWeb/DynamicElements/WOHTMLDynamicElement.m A sope-appserver/NGObjWeb/DynamicElements/WOHiddenField.api A sope-appserver/NGObjWeb/DynamicElements/WOHiddenField.m A sope-appserver/NGObjWeb/DynamicElements/WOHtml.m A sope-appserver/NGObjWeb/DynamicElements/WOHyperlink.api A sope-appserver/NGObjWeb/DynamicElements/WOHyperlink.h A sope-appserver/NGObjWeb/DynamicElements/WOHyperlink.m A sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.h A sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.m A sope-appserver/NGObjWeb/DynamicElements/WOIFrame.api A sope-appserver/NGObjWeb/DynamicElements/WOIFrame.m A sope-appserver/NGObjWeb/DynamicElements/WOImage.api A sope-appserver/NGObjWeb/DynamicElements/WOImage.h A sope-appserver/NGObjWeb/DynamicElements/WOImage.m A sope-appserver/NGObjWeb/DynamicElements/WOImageButton.api A sope-appserver/NGObjWeb/DynamicElements/WOImageButton.m A sope-appserver/NGObjWeb/DynamicElements/WOInput.h A sope-appserver/NGObjWeb/DynamicElements/WOInput.m A sope-appserver/NGObjWeb/DynamicElements/WOJavaScript.api A sope-appserver/NGObjWeb/DynamicElements/WOJavaScript.m A sope-appserver/NGObjWeb/DynamicElements/WOMetaRefresh.api A sope-appserver/NGObjWeb/DynamicElements/WOMetaRefresh.m A sope-appserver/NGObjWeb/DynamicElements/WONestedList.api A sope-appserver/NGObjWeb/DynamicElements/WONestedList.m A sope-appserver/NGObjWeb/DynamicElements/WONoContentElement.h A sope-appserver/NGObjWeb/DynamicElements/WONoContentElement.m A sope-appserver/NGObjWeb/DynamicElements/WOPasswordField.api A sope-appserver/NGObjWeb/DynamicElements/WOPasswordField.m A sope-appserver/NGObjWeb/DynamicElements/WOPopUpButton.api A sope-appserver/NGObjWeb/DynamicElements/WOPopUpButton.m A sope-appserver/NGObjWeb/DynamicElements/WOQuickTime.api A sope-appserver/NGObjWeb/DynamicElements/WOQuickTime.m A sope-appserver/NGObjWeb/DynamicElements/WORadioButton.api A sope-appserver/NGObjWeb/DynamicElements/WORadioButton.m A sope-appserver/NGObjWeb/DynamicElements/WORadioButtonList.api A sope-appserver/NGObjWeb/DynamicElements/WORadioButtonList.m A sope-appserver/NGObjWeb/DynamicElements/WORepetition.api A sope-appserver/NGObjWeb/DynamicElements/WORepetition.m A sope-appserver/NGObjWeb/DynamicElements/WOResetButton.api A sope-appserver/NGObjWeb/DynamicElements/WOResetButton.m A sope-appserver/NGObjWeb/DynamicElements/WOResourceURL.api A sope-appserver/NGObjWeb/DynamicElements/WOResourceURL.m A sope-appserver/NGObjWeb/DynamicElements/WOSetCursor.api A sope-appserver/NGObjWeb/DynamicElements/WOSetCursor.m A sope-appserver/NGObjWeb/DynamicElements/WOSetHeader.api A sope-appserver/NGObjWeb/DynamicElements/WOSetHeader.m A sope-appserver/NGObjWeb/DynamicElements/WOString.api A sope-appserver/NGObjWeb/DynamicElements/WOString.m A sope-appserver/NGObjWeb/DynamicElements/WOSubmitButton.api A sope-appserver/NGObjWeb/DynamicElements/WOSubmitButton.m A sope-appserver/NGObjWeb/DynamicElements/WOSwitchComponent.api A sope-appserver/NGObjWeb/DynamicElements/WOSwitchComponent.m A sope-appserver/NGObjWeb/DynamicElements/WOText.api A sope-appserver/NGObjWeb/DynamicElements/WOText.m A sope-appserver/NGObjWeb/DynamicElements/WOTextField.api A sope-appserver/NGObjWeb/DynamicElements/WOTextField.m A sope-appserver/NGObjWeb/DynamicElements/WOVBScript.api A sope-appserver/NGObjWeb/DynamicElements/WOVBScript.m A sope-appserver/NGObjWeb/DynamicElements/WOxControlElemBuilder.m A sope-appserver/NGObjWeb/DynamicElements/WOxHTMLElemBuilder.m A sope-appserver/NGObjWeb/DynamicElements/WOxMiscElemBuilder.m A sope-appserver/NGObjWeb/DynamicElements/WOxTalElemBuilder.m A sope-appserver/NGObjWeb/DynamicElements/WOxXULElemBuilder.m A sope-appserver/NGObjWeb/DynamicElements/_WOCommonStaticDAHyperlink.m A sope-appserver/NGObjWeb/DynamicElements/_WOComplexHyperlink.m A sope-appserver/NGObjWeb/DynamicElements/_WOConstResourceImage.m A sope-appserver/NGObjWeb/DynamicElements/_WOResourceImage.m A sope-appserver/NGObjWeb/DynamicElements/_WOSimpleActionHyperlink.m A sope-appserver/NGObjWeb/DynamicElements/_WOStaticHTMLElement.h A sope-appserver/NGObjWeb/DynamicElements/_WOStaticHTMLElement.m A sope-appserver/NGObjWeb/DynamicElements/_WOTemporaryHyperlink.m A sope-appserver/NGObjWeb/DynamicElements/decommon.h A sope-appserver/NGObjWeb/GNUmakefile A sope-appserver/NGObjWeb/GNUmakefile.postamble A sope-appserver/NGObjWeb/GNUmakefile.preamble A sope-appserver/NGObjWeb/Languages.plist A sope-appserver/NGObjWeb/NGHttp+WO.h A sope-appserver/NGObjWeb/NGHttp+WO.m A sope-appserver/NGObjWeb/NGHttp/ChangeLog A sope-appserver/NGObjWeb/NGHttp/GNUmakefile A sope-appserver/NGObjWeb/NGHttp/GNUmakefile.preamble A sope-appserver/NGObjWeb/NGHttp/NGHttp-Info.plist A sope-appserver/NGObjWeb/NGHttp/NGHttp.h A sope-appserver/NGObjWeb/NGHttp/NGHttp.m A sope-appserver/NGObjWeb/NGHttp/NGHttp.xcodeproj/project.pbxproj A sope-appserver/NGObjWeb/NGHttp/NGHttpBodyParser.h A sope-appserver/NGObjWeb/NGHttp/NGHttpBodyParser.m A sope-appserver/NGObjWeb/NGHttp/NGHttpCookie.h A sope-appserver/NGObjWeb/NGHttp/NGHttpCookie.m A sope-appserver/NGObjWeb/NGHttp/NGHttpDecls.h A sope-appserver/NGObjWeb/NGHttp/NGHttpHeaderFieldParser.h A sope-appserver/NGObjWeb/NGHttp/NGHttpHeaderFieldParser.m A sope-appserver/NGObjWeb/NGHttp/NGHttpHeaderFields.h A sope-appserver/NGObjWeb/NGHttp/NGHttpHeaderFields.m A sope-appserver/NGObjWeb/NGHttp/NGHttpMessage.h A sope-appserver/NGObjWeb/NGHttp/NGHttpMessage.m A sope-appserver/NGObjWeb/NGHttp/NGHttpMessageParser.h A sope-appserver/NGObjWeb/NGHttp/NGHttpMessageParser.m A sope-appserver/NGObjWeb/NGHttp/NGHttpRequest.h A sope-appserver/NGObjWeb/NGHttp/NGHttpRequest.m A sope-appserver/NGObjWeb/NGHttp/NGHttpResponse.h A sope-appserver/NGObjWeb/NGHttp/NGHttpResponse.m A sope-appserver/NGObjWeb/NGHttp/NGUrlFormCoder.h A sope-appserver/NGObjWeb/NGHttp/NGUrlFormCoder.m A sope-appserver/NGObjWeb/NGHttp/README A sope-appserver/NGObjWeb/NGHttp/common.h A sope-appserver/NGObjWeb/NGObjWeb-Info.plist A sope-appserver/NGObjWeb/NGObjWeb.m A sope-appserver/NGObjWeb/NGObjWeb.xcodeproj/project.pbxproj A sope-appserver/NGObjWeb/NGObjWeb/NGObjWeb.h A sope-appserver/NGObjWeb/NGObjWeb/NGObjWebDecls.h A sope-appserver/NGObjWeb/NGObjWeb/NSString+JavaScriptEscaping.h A sope-appserver/NGObjWeb/NGObjWeb/OWResourceManager.h A sope-appserver/NGObjWeb/NGObjWeb/OWResponder.h A sope-appserver/NGObjWeb/NGObjWeb/OWViewRequestHandler.h A sope-appserver/NGObjWeb/NGObjWeb/WEClientCapabilities.h A sope-appserver/NGObjWeb/NGObjWeb/WOActionResults.h A sope-appserver/NGObjWeb/NGObjWeb/WOActionURL.h A sope-appserver/NGObjWeb/NGObjWeb/WOAdaptor.h A sope-appserver/NGObjWeb/NGObjWeb/WOApplication.h A sope-appserver/NGObjWeb/NGObjWeb/WOAssociation.h A sope-appserver/NGObjWeb/NGObjWeb/WOComponent.h A sope-appserver/NGObjWeb/NGObjWeb/WOComponentDefinition.h A sope-appserver/NGObjWeb/NGObjWeb/WOComponentScript.h A sope-appserver/NGObjWeb/NGObjWeb/WOContext.h A sope-appserver/NGObjWeb/NGObjWeb/WOCookie.h A sope-appserver/NGObjWeb/NGObjWeb/WOCoreApplication.h A sope-appserver/NGObjWeb/NGObjWeb/WODirectAction.h A sope-appserver/NGObjWeb/NGObjWeb/WODisplayGroup.h A sope-appserver/NGObjWeb/NGObjWeb/WODynamicElement.h A sope-appserver/NGObjWeb/NGObjWeb/WOElement.h A sope-appserver/NGObjWeb/NGObjWeb/WOElementTrackingContext.h A sope-appserver/NGObjWeb/NGObjWeb/WOHTMLDynamicElement.h A sope-appserver/NGObjWeb/NGObjWeb/WOHTTPConnection.h A sope-appserver/NGObjWeb/NGObjWeb/WOMailDelivery.h A sope-appserver/NGObjWeb/NGObjWeb/WOMessage.h A sope-appserver/NGObjWeb/NGObjWeb/WOPageGenerationContext.h A sope-appserver/NGObjWeb/NGObjWeb/WOProxyRequestHandler.h A sope-appserver/NGObjWeb/NGObjWeb/WORequest.h A sope-appserver/NGObjWeb/NGObjWeb/WORequestHandler.h A sope-appserver/NGObjWeb/NGObjWeb/WOResourceManager.h A sope-appserver/NGObjWeb/NGObjWeb/WOResponse.h A sope-appserver/NGObjWeb/NGObjWeb/WOSession.h A sope-appserver/NGObjWeb/NGObjWeb/WOSessionStore.h A sope-appserver/NGObjWeb/NGObjWeb/WOStatisticsStore.h A sope-appserver/NGObjWeb/NGObjWeb/WOTemplate.h A sope-appserver/NGObjWeb/NGObjWeb/WOTemplateBuilder.h A sope-appserver/NGObjWeb/NGObjWeb/WOxElemBuilder.h A sope-appserver/NGObjWeb/NSObject+WO.h A sope-appserver/NGObjWeb/NSObject+WO.m A sope-appserver/NGObjWeb/NSString+JavaScriptEscaping.m A sope-appserver/NGObjWeb/OWResourceManager.m A sope-appserver/NGObjWeb/OWViewRequestHandler.m A sope-appserver/NGObjWeb/README A sope-appserver/NGObjWeb/SNSConnection.h A sope-appserver/NGObjWeb/SNSConnection.m A sope-appserver/NGObjWeb/SoCoreProduct.m A sope-appserver/NGObjWeb/SoObjects/GNUmakefile A sope-appserver/NGObjWeb/SoObjects/GNUmakefile.preamble A sope-appserver/NGObjWeb/SoObjects/NOTES A sope-appserver/NGObjWeb/SoObjects/NSException+HTTP.h A sope-appserver/NGObjWeb/SoObjects/NSException+HTTP.m A sope-appserver/NGObjWeb/SoObjects/README A sope-appserver/NGObjWeb/SoObjects/SoActionInvocation.h A sope-appserver/NGObjWeb/SoObjects/SoActionInvocation.m A sope-appserver/NGObjWeb/SoObjects/SoApplication.h A sope-appserver/NGObjWeb/SoObjects/SoApplication.m A sope-appserver/NGObjWeb/SoObjects/SoClass.h A sope-appserver/NGObjWeb/SoObjects/SoClass.m A sope-appserver/NGObjWeb/SoObjects/SoClassRegistry.h A sope-appserver/NGObjWeb/SoObjects/SoClassRegistry.m A sope-appserver/NGObjWeb/SoObjects/SoClassSecurityInfo.h A sope-appserver/NGObjWeb/SoObjects/SoClassSecurityInfo.m A sope-appserver/NGObjWeb/SoObjects/SoComponent.h A sope-appserver/NGObjWeb/SoObjects/SoComponent.m A sope-appserver/NGObjWeb/SoObjects/SoControlPanel.h A sope-appserver/NGObjWeb/SoObjects/SoControlPanel.m A sope-appserver/NGObjWeb/SoObjects/SoCookieAuthenticator.h A sope-appserver/NGObjWeb/SoObjects/SoCookieAuthenticator.m A sope-appserver/NGObjWeb/SoObjects/SoCore-SXP-Info.plist A sope-appserver/NGObjWeb/SoObjects/SoDefaultRenderer.h A sope-appserver/NGObjWeb/SoObjects/SoDefaultRenderer.m A sope-appserver/NGObjWeb/SoObjects/SoHTTPAuthenticator.h A sope-appserver/NGObjWeb/SoObjects/SoHTTPAuthenticator.m A sope-appserver/NGObjWeb/SoObjects/SoLookupAssociation.h A sope-appserver/NGObjWeb/SoObjects/SoLookupAssociation.m A sope-appserver/NGObjWeb/SoObjects/SoObjCClass.h A sope-appserver/NGObjWeb/SoObjects/SoObjCClass.m A sope-appserver/NGObjWeb/SoObjects/SoObject+Traversal.m A sope-appserver/NGObjWeb/SoObjects/SoObject.h A sope-appserver/NGObjWeb/SoObjects/SoObject.m A sope-appserver/NGObjWeb/SoObjects/SoObjectMethodDispatcher.h A sope-appserver/NGObjWeb/SoObjects/SoObjectMethodDispatcher.m A sope-appserver/NGObjWeb/SoObjects/SoObjectRequestHandler.h A sope-appserver/NGObjWeb/SoObjects/SoObjectRequestHandler.m A sope-appserver/NGObjWeb/SoObjects/SoObjectSOAPDispatcher.h A sope-appserver/NGObjWeb/SoObjects/SoObjectSOAPDispatcher.m A sope-appserver/NGObjWeb/SoObjects/SoObjectXmlRpcDispatcher.h A sope-appserver/NGObjWeb/SoObjects/SoObjectXmlRpcDispatcher.m A sope-appserver/NGObjWeb/SoObjects/SoObjects-Info.plist A sope-appserver/NGObjWeb/SoObjects/SoObjects.h A sope-appserver/NGObjWeb/SoObjects/SoObjects.xcodeproj/project.pbxproj A sope-appserver/NGObjWeb/SoObjects/SoPageInvocation.h A sope-appserver/NGObjWeb/SoObjects/SoPageInvocation.m A sope-appserver/NGObjWeb/SoObjects/SoPermissions.h A sope-appserver/NGObjWeb/SoObjects/SoPermissions.m A sope-appserver/NGObjWeb/SoObjects/SoProduct.h A sope-appserver/NGObjWeb/SoObjects/SoProduct.m A sope-appserver/NGObjWeb/SoObjects/SoProductClassInfo.h A sope-appserver/NGObjWeb/SoObjects/SoProductClassInfo.m A sope-appserver/NGObjWeb/SoObjects/SoProductLoader.h A sope-appserver/NGObjWeb/SoObjects/SoProductLoader.m A sope-appserver/NGObjWeb/SoObjects/SoProductRegistry.h A sope-appserver/NGObjWeb/SoObjects/SoProductRegistry.m A sope-appserver/NGObjWeb/SoObjects/SoProductResourceManager.h A sope-appserver/NGObjWeb/SoObjects/SoProductResourceManager.m A sope-appserver/NGObjWeb/SoObjects/SoSecurityException.h A sope-appserver/NGObjWeb/SoObjects/SoSecurityException.m A sope-appserver/NGObjWeb/SoObjects/SoSecurityManager.h A sope-appserver/NGObjWeb/SoObjects/SoSecurityManager.m A sope-appserver/NGObjWeb/SoObjects/SoSelectorInvocation.h A sope-appserver/NGObjWeb/SoObjects/SoSelectorInvocation.m A sope-appserver/NGObjWeb/SoObjects/SoSubContext.h A sope-appserver/NGObjWeb/SoObjects/SoSubContext.m A sope-appserver/NGObjWeb/SoObjects/SoTemplateRenderer.h A sope-appserver/NGObjWeb/SoObjects/SoTemplateRenderer.m A sope-appserver/NGObjWeb/SoObjects/SoUser.h A sope-appserver/NGObjWeb/SoObjects/SoUser.m A sope-appserver/NGObjWeb/SoObjects/TODO A sope-appserver/NGObjWeb/SoObjects/WOComponent+SoObjects.m A sope-appserver/NGObjWeb/SoObjects/WOContext+SoObjects.h A sope-appserver/NGObjWeb/SoObjects/WOContext+SoObjects.m A sope-appserver/NGObjWeb/SoObjects/WODirectAction+SoObjects.m A sope-appserver/NGObjWeb/SoObjects/WODirectActionRequestHandler+SoObjects.m A sope-appserver/NGObjWeb/SoObjects/WORequest+So.h A sope-appserver/NGObjWeb/SoObjects/WORequest+So.m A sope-appserver/NGObjWeb/SoObjects/common.h A sope-appserver/NGObjWeb/SoObjects/product.plist A sope-appserver/NGObjWeb/TODO A sope-appserver/NGObjWeb/TROUBLESHOOTING A sope-appserver/NGObjWeb/Templates/GNUmakefile A sope-appserver/NGObjWeb/Templates/GNUmakefile.preamble A sope-appserver/NGObjWeb/Templates/README-Templates.txt A sope-appserver/NGObjWeb/Templates/WOApplication+Builders.m A sope-appserver/NGObjWeb/Templates/WOComponentScript.m A sope-appserver/NGObjWeb/Templates/WOComponentScriptPart.m A sope-appserver/NGObjWeb/Templates/WODParser.h A sope-appserver/NGObjWeb/Templates/WODParser.m A sope-appserver/NGObjWeb/Templates/WOHTMLParser.h A sope-appserver/NGObjWeb/Templates/WOHTMLParser.m A sope-appserver/NGObjWeb/Templates/WOSubcomponentInfo.m A sope-appserver/NGObjWeb/Templates/WOTemplate.m A sope-appserver/NGObjWeb/Templates/WOTemplateBuilder.m A sope-appserver/NGObjWeb/Templates/WOWrapperTemplateBuilder.h A sope-appserver/NGObjWeb/Templates/WOWrapperTemplateBuilder.m A sope-appserver/NGObjWeb/Templates/WOxComponentElemBuilder.m A sope-appserver/NGObjWeb/Templates/WOxElemBuilder.m A sope-appserver/NGObjWeb/Templates/WOxTagClassElemBuilder.m A sope-appserver/NGObjWeb/Templates/WOxTemplateBuilder.h A sope-appserver/NGObjWeb/Templates/WOxTemplateBuilder.m A sope-appserver/NGObjWeb/Templates/common.h A sope-appserver/NGObjWeb/UnixSignalHandler.h A sope-appserver/NGObjWeb/UnixSignalHandler.m A sope-appserver/NGObjWeb/Version A sope-appserver/NGObjWeb/WEClientCapabilities.m A sope-appserver/NGObjWeb/WOAdaptor.m A sope-appserver/NGObjWeb/WOApplication+defaults.m A sope-appserver/NGObjWeb/WOApplication+private.h A sope-appserver/NGObjWeb/WOApplication.m A sope-appserver/NGObjWeb/WOApplicationMain.m A sope-appserver/NGObjWeb/WOChildComponentReference.h A sope-appserver/NGObjWeb/WOChildComponentReference.m A sope-appserver/NGObjWeb/WOComponent+JS.m A sope-appserver/NGObjWeb/WOComponent+Sync.m A sope-appserver/NGObjWeb/WOComponent+private.h A sope-appserver/NGObjWeb/WOComponent.m A sope-appserver/NGObjWeb/WOComponentDefinition.m A sope-appserver/NGObjWeb/WOComponentFault.h A sope-appserver/NGObjWeb/WOComponentFault.m A sope-appserver/NGObjWeb/WOComponentRequestHandler.h A sope-appserver/NGObjWeb/WOComponentRequestHandler.m A sope-appserver/NGObjWeb/WOContext+private.h A sope-appserver/NGObjWeb/WOContext.m A sope-appserver/NGObjWeb/WOCookie.m A sope-appserver/NGObjWeb/WOCoreApplication+Bundle.m A sope-appserver/NGObjWeb/WOCoreApplication.m A sope-appserver/NGObjWeb/WODirectAction.m A sope-appserver/NGObjWeb/WODirectActionRequestHandler.h A sope-appserver/NGObjWeb/WODirectActionRequestHandler.m A sope-appserver/NGObjWeb/WODisplayGroup.m A sope-appserver/NGObjWeb/WODynamicElement.m A sope-appserver/NGObjWeb/WOElement+private.h A sope-appserver/NGObjWeb/WOElement.m A sope-appserver/NGObjWeb/WOElementID.h A sope-appserver/NGObjWeb/WOElementID.m A sope-appserver/NGObjWeb/WOFileSessionStore.m A sope-appserver/NGObjWeb/WOHTTPConnection.m A sope-appserver/NGObjWeb/WOHTTPURLHandle.m A sope-appserver/NGObjWeb/WOHttpAdaptor/GNUmakefile A sope-appserver/NGObjWeb/WOHttpAdaptor/GNUmakefile.preamble A sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpAdaptor.h A sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpAdaptor.m A sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpTransaction.h A sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpTransaction.m A sope-appserver/NGObjWeb/WOHttpAdaptor/WORecordRequestStream.h A sope-appserver/NGObjWeb/WOHttpAdaptor/WORecordRequestStream.m A sope-appserver/NGObjWeb/WOHttpAdaptor/WORequest+Adaptor.h A sope-appserver/NGObjWeb/WOHttpAdaptor/WORequest+Adaptor.m A sope-appserver/NGObjWeb/WOHttpAdaptor/WORequestParser.h A sope-appserver/NGObjWeb/WOHttpAdaptor/WORequestParser.m A sope-appserver/NGObjWeb/WOHttpAdaptor/common.h A sope-appserver/NGObjWeb/WOMailDelivery.m A sope-appserver/NGObjWeb/WOMessage+Validation.m A sope-appserver/NGObjWeb/WOMessage+XML.m A sope-appserver/NGObjWeb/WOMessage.m A sope-appserver/NGObjWeb/WOPageRequestHandler.m A sope-appserver/NGObjWeb/WOProxyRequestHandler.m A sope-appserver/NGObjWeb/WORequest.m A sope-appserver/NGObjWeb/WORequestHandler+private.h A sope-appserver/NGObjWeb/WORequestHandler.m A sope-appserver/NGObjWeb/WOResourceManager.m A sope-appserver/NGObjWeb/WOResourceRequestHandler.m A sope-appserver/NGObjWeb/WOResponse+private.h A sope-appserver/NGObjWeb/WOResponse.m A sope-appserver/NGObjWeb/WORunLoop.h A sope-appserver/NGObjWeb/WORunLoop.m A sope-appserver/NGObjWeb/WOScriptedComponent.h A sope-appserver/NGObjWeb/WOScriptedComponent.m A sope-appserver/NGObjWeb/WOServerDefaults.m A sope-appserver/NGObjWeb/WOServerSessionStore.m A sope-appserver/NGObjWeb/WOSession.m A sope-appserver/NGObjWeb/WOSessionStore.m A sope-appserver/NGObjWeb/WOSimpleHTTPParser.h A sope-appserver/NGObjWeb/WOSimpleHTTPParser.m A sope-appserver/NGObjWeb/WOStatisticsStore.m A sope-appserver/NGObjWeb/WOStats.m A sope-appserver/NGObjWeb/WOWatchDogApplicationMain.m A sope-appserver/NGObjWeb/WOWatchDogApplicationMainOSX.m A sope-appserver/NGObjWeb/WebDAV/DAVFetchSpec.txt A sope-appserver/NGObjWeb/WebDAV/EOFetchSpecification+SoDAV.h A sope-appserver/NGObjWeb/WebDAV/EOFetchSpecification+SoDAV.m A sope-appserver/NGObjWeb/WebDAV/GNUmakefile A sope-appserver/NGObjWeb/WebDAV/GNUmakefile.preamble A sope-appserver/NGObjWeb/WebDAV/README A sope-appserver/NGObjWeb/WebDAV/SaxDAVHandler.h A sope-appserver/NGObjWeb/WebDAV/SaxDAVHandler.m A sope-appserver/NGObjWeb/WebDAV/SoDAV.h A sope-appserver/NGObjWeb/WebDAV/SoDAVLockManager.h A sope-appserver/NGObjWeb/WebDAV/SoDAVLockManager.m A sope-appserver/NGObjWeb/WebDAV/SoDAVSQLParser.h A sope-appserver/NGObjWeb/WebDAV/SoDAVSQLParser.m A sope-appserver/NGObjWeb/WebDAV/SoObject+SoDAV.h A sope-appserver/NGObjWeb/WebDAV/SoObject+SoDAV.m A sope-appserver/NGObjWeb/WebDAV/SoObject+SoDAVQuery.m A sope-appserver/NGObjWeb/WebDAV/SoObjectDataSource.h A sope-appserver/NGObjWeb/WebDAV/SoObjectDataSource.m A sope-appserver/NGObjWeb/WebDAV/SoObjectResultEntry.h A sope-appserver/NGObjWeb/WebDAV/SoObjectResultEntry.m A sope-appserver/NGObjWeb/WebDAV/SoObjectWebDAVDispatcher.h A sope-appserver/NGObjWeb/WebDAV/SoObjectWebDAVDispatcher.m A sope-appserver/NGObjWeb/WebDAV/SoSubscription.h A sope-appserver/NGObjWeb/WebDAV/SoSubscription.m A sope-appserver/NGObjWeb/WebDAV/SoSubscriptionManager.h A sope-appserver/NGObjWeb/WebDAV/SoSubscriptionManager.m A sope-appserver/NGObjWeb/WebDAV/SoWebDAVRenderer.h A sope-appserver/NGObjWeb/WebDAV/SoWebDAVRenderer.m A sope-appserver/NGObjWeb/WebDAV/SoWebDAVValue.h A sope-appserver/NGObjWeb/WebDAV/SoWebDAVValue.m A sope-appserver/NGObjWeb/WebDAV/TODO A sope-appserver/NGObjWeb/WebDAV/WebDAV-Info.plist A sope-appserver/NGObjWeb/WebDAV/WebDAV.xcodeproj/project.pbxproj A sope-appserver/NGObjWeb/WebDAV/common.h A sope-appserver/NGObjWeb/_WOStringTable.h A sope-appserver/NGObjWeb/_WOStringTable.m A sope-appserver/NGObjWeb/common.h A sope-appserver/NGObjWeb/doc/Makefile A sope-appserver/NGObjWeb/doc/WOActionURL.3 A sope-appserver/NGObjWeb/doc/WOBody.3 A sope-appserver/NGObjWeb/doc/WOBrowser.3 A sope-appserver/NGObjWeb/doc/WOCheckBox.3 A sope-appserver/NGObjWeb/doc/WOCheckBoxList.3 A sope-appserver/NGObjWeb/doc/WOComponentReference.3 A sope-appserver/NGObjWeb/doc/WOConditional.3 A sope-appserver/NGObjWeb/doc/WOCopyValue.3 A sope-appserver/NGObjWeb/doc/WOEmbeddedObject.3 A sope-appserver/NGObjWeb/doc/WOEntity.3 A sope-appserver/NGObjWeb/doc/WOFileUpload.3 A sope-appserver/NGObjWeb/doc/WOForm.3 A sope-appserver/NGObjWeb/doc/WOFrame.3 A sope-appserver/NGObjWeb/doc/WOGenericContainer.3 A sope-appserver/NGObjWeb/doc/WOGenericElement.3 A sope-appserver/NGObjWeb/doc/WOHiddenField.3 A sope-appserver/NGObjWeb/doc/WOHyperlink.3 A sope-appserver/NGObjWeb/doc/WOIFrame.3 A sope-appserver/NGObjWeb/doc/WOImage.3 A sope-appserver/NGObjWeb/doc/WOImageButton.3 A sope-appserver/NGObjWeb/doc/WOJavaScript.3 A sope-appserver/NGObjWeb/doc/WOMetaRefresh.3 A sope-appserver/NGObjWeb/doc/WONestedList.3 A sope-appserver/NGObjWeb/doc/WOPasswordField.3 A sope-appserver/NGObjWeb/doc/WOPopUpButton.3 A sope-appserver/NGObjWeb/doc/WOQuickTime.3 A sope-appserver/NGObjWeb/doc/WORadioButton.3 A sope-appserver/NGObjWeb/doc/WORadioButtonList.3 A sope-appserver/NGObjWeb/doc/WORepetition.3 A sope-appserver/NGObjWeb/doc/WOResetButton.3 A sope-appserver/NGObjWeb/doc/WOResourceURL.3 A sope-appserver/NGObjWeb/doc/WOSetCursor.3 A sope-appserver/NGObjWeb/doc/WOSetHeader.3 A sope-appserver/NGObjWeb/doc/WOString.3 A sope-appserver/NGObjWeb/doc/WOSubmitButton.3 A sope-appserver/NGObjWeb/doc/WOSwitchComponent.3 A sope-appserver/NGObjWeb/doc/WOText.3 A sope-appserver/NGObjWeb/doc/WOTextField.3 A sope-appserver/NGObjWeb/doc/WOVBScript.3 A sope-appserver/NGObjWeb/dummy.m A sope-appserver/NGObjWeb/fhs.make A sope-appserver/NGObjWeb/ngobjweb.make A sope-appserver/NGObjWeb/sope-ngobjweb-defaults.5 A sope-appserver/NGObjWeb/subdirs.make A sope-appserver/NGObjWeb/woapi2man.py A sope-appserver/NGObjWeb/woapp-gs.make A sope-appserver/NGObjWeb/wobundle-gs.make A sope-appserver/NGObjWeb/wod.m A sope-appserver/NGXmlRpc/ChangeLog A sope-appserver/NGXmlRpc/EOFetchSpecification+XmlRpcCoding.m A sope-appserver/NGXmlRpc/EOKeyGlobalID+XmlRpcCoding.m A sope-appserver/NGXmlRpc/EONull+XmlRpcCoding.m A sope-appserver/NGXmlRpc/EOQualifier+XmlRpcCoding.m A sope-appserver/NGXmlRpc/EOSortOrdering+XmlRpcCoding.m A sope-appserver/NGXmlRpc/GNUmakefile A sope-appserver/NGXmlRpc/GNUmakefile.preamble A sope-appserver/NGXmlRpc/NGAsyncResultProxy.h A sope-appserver/NGXmlRpc/NGAsyncResultProxy.m A sope-appserver/NGXmlRpc/NGXmlRpc-Info.plist A sope-appserver/NGXmlRpc/NGXmlRpc.h A sope-appserver/NGXmlRpc/NGXmlRpc.xcodeproj/project.pbxproj A sope-appserver/NGXmlRpc/NGXmlRpcAction+Registry.m A sope-appserver/NGXmlRpc/NGXmlRpcAction.h A sope-appserver/NGXmlRpc/NGXmlRpcAction.m A sope-appserver/NGXmlRpc/NGXmlRpcClient.h A sope-appserver/NGXmlRpc/NGXmlRpcClient.m A sope-appserver/NGXmlRpc/NGXmlRpcInvocation.h A sope-appserver/NGXmlRpc/NGXmlRpcInvocation.m A sope-appserver/NGXmlRpc/NGXmlRpcMethodSignature.h A sope-appserver/NGXmlRpc/NGXmlRpcMethodSignature.m A sope-appserver/NGXmlRpc/NGXmlRpcRequestHandler.h A sope-appserver/NGXmlRpc/NGXmlRpcRequestHandler.m A sope-appserver/NGXmlRpc/NSObject+Reflection.h A sope-appserver/NGXmlRpc/NSObject+Reflection.m A sope-appserver/NGXmlRpc/Version A sope-appserver/NGXmlRpc/WODirectAction+XmlRpc.h A sope-appserver/NGXmlRpc/WODirectAction+XmlRpc.m A sope-appserver/NGXmlRpc/WODirectAction+XmlRpcIntrospection.h A sope-appserver/NGXmlRpc/WODirectAction+XmlRpcIntrospection.m A sope-appserver/NGXmlRpc/WOMessage+XmlRpcCoding.m A sope-appserver/NGXmlRpc/WORequest+XmlRpcCoding.m A sope-appserver/NGXmlRpc/WOResponse+XmlRpcCoding.m A sope-appserver/NGXmlRpc/XmlRpcMethodCall+WO.h A sope-appserver/NGXmlRpc/XmlRpcMethodCall+WO.m A sope-appserver/NGXmlRpc/XmlRpcMethodResponse+WO.h A sope-appserver/NGXmlRpc/XmlRpcMethodResponse+WO.m A sope-appserver/NGXmlRpc/common.h A sope-appserver/NGXmlRpc/fhs.make A sope-appserver/PROJECTLEAD A sope-appserver/README-OSX.txt A sope-appserver/SOPE-Info.plist A sope-appserver/SoOFS/ChangeLog A sope-appserver/SoOFS/GNUmakefile A sope-appserver/SoOFS/GNUmakefile.preamble A sope-appserver/SoOFS/OFSBaseObject.h A sope-appserver/SoOFS/OFSBaseObject.m A sope-appserver/SoOFS/OFSChangeLog.h A sope-appserver/SoOFS/OFSChangeLog.m A sope-appserver/SoOFS/OFSFactoryContext.h A sope-appserver/SoOFS/OFSFactoryContext.m A sope-appserver/SoOFS/OFSFactoryRegistry.h A sope-appserver/SoOFS/OFSFactoryRegistry.m A sope-appserver/SoOFS/OFSFile.h A sope-appserver/SoOFS/OFSFile.m A sope-appserver/SoOFS/OFSFileRenderer.h A sope-appserver/SoOFS/OFSFileRenderer.m A sope-appserver/SoOFS/OFSFolder+SoDAV.m A sope-appserver/SoOFS/OFSFolder.h A sope-appserver/SoOFS/OFSFolder.m A sope-appserver/SoOFS/OFSFolderClassDescription.h A sope-appserver/SoOFS/OFSFolderClassDescription.m A sope-appserver/SoOFS/OFSFolderDataSource.h A sope-appserver/SoOFS/OFSFolderDataSource.m A sope-appserver/SoOFS/OFSHttpPasswd.h A sope-appserver/SoOFS/OFSHttpPasswd.m A sope-appserver/SoOFS/OFSImage.h A sope-appserver/SoOFS/OFSImage.m A sope-appserver/SoOFS/OFSPropertyListObject.h A sope-appserver/SoOFS/OFSPropertyListObject.m A sope-appserver/SoOFS/OFSResourceManager.h A sope-appserver/SoOFS/OFSResourceManager.m A sope-appserver/SoOFS/OFSWebDocument.h A sope-appserver/SoOFS/OFSWebDocument.m A sope-appserver/SoOFS/OFSWebMethod.h A sope-appserver/SoOFS/OFSWebMethod.m A sope-appserver/SoOFS/OFSWebMethodRenderer.h A sope-appserver/SoOFS/OFSWebMethodRenderer.m A sope-appserver/SoOFS/OFSWebTemplate.h A sope-appserver/SoOFS/OFSWebTemplate.m A sope-appserver/SoOFS/README A sope-appserver/SoOFS/SoOFS-Info.plist A sope-appserver/SoOFS/SoOFS-SXP-Info.plist A sope-appserver/SoOFS/SoOFS.h A sope-appserver/SoOFS/SoOFS.xcodeproj/project.pbxproj A sope-appserver/SoOFS/SoOFSProduct.m A sope-appserver/SoOFS/TODO A sope-appserver/SoOFS/Version A sope-appserver/SoOFS/common.h A sope-appserver/SoOFS/fhs.make A sope-appserver/SoOFS/product.plist A sope-appserver/SoOFS/sope.8 A sope-appserver/SoOFS/sope.m A sope-appserver/Version A sope-appserver/WEExtensions/COPYING A sope-appserver/WEExtensions/COPYRIGHT A sope-appserver/WEExtensions/ChangeLog A sope-appserver/WEExtensions/GNUmakefile A sope-appserver/WEExtensions/GNUmakefile.postamble A sope-appserver/WEExtensions/GNUmakefile.preamble A sope-appserver/WEExtensions/JSClipboard.api A sope-appserver/WEExtensions/JSClipboard.m A sope-appserver/WEExtensions/JSMenu.api A sope-appserver/WEExtensions/JSMenu.h A sope-appserver/WEExtensions/JSMenu.m A sope-appserver/WEExtensions/JSMenuItem.api A sope-appserver/WEExtensions/JSMenuItem.h A sope-appserver/WEExtensions/JSMenuItem.m A sope-appserver/WEExtensions/JSShiftClick.api A sope-appserver/WEExtensions/JSShiftClick.m A sope-appserver/WEExtensions/JSStringTable.api A sope-appserver/WEExtensions/JSStringTable.m A sope-appserver/WEExtensions/README A sope-appserver/WEExtensions/TODO A sope-appserver/WEExtensions/Version A sope-appserver/WEExtensions/WEBrowser.api A sope-appserver/WEExtensions/WEBrowser.m A sope-appserver/WEExtensions/WECalendarField.api A sope-appserver/WEExtensions/WECalendarField.h A sope-appserver/WEExtensions/WECalendarField.m A sope-appserver/WEExtensions/WECase.api A sope-appserver/WEExtensions/WECollapsibleComponentContent.api A sope-appserver/WEExtensions/WECollapsibleComponentContent.m A sope-appserver/WEExtensions/WEComponentValue.api A sope-appserver/WEExtensions/WEComponentValue.m A sope-appserver/WEExtensions/WEContextConditional.api A sope-appserver/WEExtensions/WEContextConditional.h A sope-appserver/WEExtensions/WEContextConditional.m A sope-appserver/WEExtensions/WEContextKey.api A sope-appserver/WEExtensions/WEContextKey.m A sope-appserver/WEExtensions/WEDateField.api A sope-appserver/WEExtensions/WEDateField.m A sope-appserver/WEExtensions/WEDragContainer.api A sope-appserver/WEExtensions/WEDragContainer.m A sope-appserver/WEExtensions/WEDropContainer.api A sope-appserver/WEExtensions/WEDropContainer.m A sope-appserver/WEExtensions/WEDropScript.h A sope-appserver/WEExtensions/WEDropScript.js A sope-appserver/WEExtensions/WEDropScript.jsm A sope-appserver/WEExtensions/WEEpozEditor.api A sope-appserver/WEExtensions/WEEpozEditor.m A sope-appserver/WEExtensions/WEExtensions-Info.plist A sope-appserver/WEExtensions/WEExtensions.xcodeproj/project.pbxproj A sope-appserver/WEExtensions/WEExtensionsBundle.m A sope-appserver/WEExtensions/WEHSpanTableMatrix.api A sope-appserver/WEExtensions/WEMonthLabel.api A sope-appserver/WEExtensions/WEMonthOverview.api A sope-appserver/WEExtensions/WEMonthOverview.m A sope-appserver/WEExtensions/WEPageItem.api A sope-appserver/WEExtensions/WEPageLink.api A sope-appserver/WEExtensions/WEPageLink.m A sope-appserver/WEExtensions/WEPageView.api A sope-appserver/WEExtensions/WEPageView.m A sope-appserver/WEExtensions/WEQualifierConditional.api A sope-appserver/WEExtensions/WEQualifierConditional.m A sope-appserver/WEExtensions/WERedirect.api A sope-appserver/WEExtensions/WERedirect.m A sope-appserver/WEExtensions/WEResourceKey.h A sope-appserver/WEExtensions/WEResourceKey.m A sope-appserver/WEExtensions/WEResourceManager.h A sope-appserver/WEExtensions/WEResourceManager.m A sope-appserver/WEExtensions/WERichString.api A sope-appserver/WEExtensions/WERichString.m A sope-appserver/WEExtensions/WEStringTable.h A sope-appserver/WEExtensions/WEStringTable.m A sope-appserver/WEExtensions/WEStringTableManager.h A sope-appserver/WEExtensions/WEStringTableManager.m A sope-appserver/WEExtensions/WESwitch.api A sope-appserver/WEExtensions/WESwitch.m A sope-appserver/WEExtensions/WETabItem.api A sope-appserver/WEExtensions/WETabItem.m A sope-appserver/WEExtensions/WETabView.api A sope-appserver/WEExtensions/WETabView.h A sope-appserver/WEExtensions/WETabView.m A sope-appserver/WEExtensions/WETableCalcMatrix.h A sope-appserver/WEExtensions/WETableCalcMatrix.m A sope-appserver/WEExtensions/WETableMatrix.api A sope-appserver/WEExtensions/WETableMatrix.m A sope-appserver/WEExtensions/WETableMatrixContent.api A sope-appserver/WEExtensions/WETableMatrixContent.m A sope-appserver/WEExtensions/WETableMatrixLabel.api A sope-appserver/WEExtensions/WETableMatrixLabel.m A sope-appserver/WEExtensions/WETableView/GNUmakefile A sope-appserver/WEExtensions/WETableView/GNUmakefile.preamble A sope-appserver/WEExtensions/WETableView/README A sope-appserver/WEExtensions/WETableView/WETableCell.h A sope-appserver/WEExtensions/WETableView/WETableCell.m A sope-appserver/WEExtensions/WETableView/WETableData.api A sope-appserver/WEExtensions/WETableView/WETableData.m A sope-appserver/WEExtensions/WETableView/WETableHeader.api A sope-appserver/WEExtensions/WETableView/WETableHeader.m A sope-appserver/WEExtensions/WETableView/WETableView+Grouping.h A sope-appserver/WEExtensions/WETableView/WETableView+Grouping.m A sope-appserver/WEExtensions/WETableView/WETableView.api A sope-appserver/WEExtensions/WETableView/WETableView.h A sope-appserver/WEExtensions/WETableView/WETableView.m A sope-appserver/WEExtensions/WETableView/WETableViewButtonMode.m A sope-appserver/WEExtensions/WETableView/WETableViewColorConfig.h A sope-appserver/WEExtensions/WETableView/WETableViewColorConfig.m A sope-appserver/WEExtensions/WETableView/WETableViewConfigObject.h A sope-appserver/WEExtensions/WETableView/WETableViewConfigObject.m A sope-appserver/WEExtensions/WETableView/WETableViewDefines.h A sope-appserver/WEExtensions/WETableView/WETableViewFooterMode.m A sope-appserver/WEExtensions/WETableView/WETableViewGroupMode.m A sope-appserver/WEExtensions/WETableView/WETableViewIconConfig.h A sope-appserver/WEExtensions/WETableView/WETableViewIconConfig.m A sope-appserver/WEExtensions/WETableView/WETableViewInfo.h A sope-appserver/WEExtensions/WETableView/WETableViewLabelConfig.h A sope-appserver/WEExtensions/WETableView/WETableViewLabelConfig.m A sope-appserver/WEExtensions/WETableView/WETableViewState.h A sope-appserver/WEExtensions/WETableView/WETableViewState.m A sope-appserver/WEExtensions/WETableView/WETableViewTitleMode.m A sope-appserver/WEExtensions/WETableView/common.h A sope-appserver/WEExtensions/WETimeField.api A sope-appserver/WEExtensions/WETimeField.m A sope-appserver/WEExtensions/WETreeContextKeys.h A sope-appserver/WEExtensions/WETreeData.api A sope-appserver/WEExtensions/WETreeData.m A sope-appserver/WEExtensions/WETreeHeader.api A sope-appserver/WEExtensions/WETreeHeader.m A sope-appserver/WEExtensions/WETreeMatrixElement.h A sope-appserver/WEExtensions/WETreeMatrixElement.m A sope-appserver/WEExtensions/WETreeView.api A sope-appserver/WEExtensions/WETreeView.m A sope-appserver/WEExtensions/WEVSpanTableMatrix.api A sope-appserver/WEExtensions/WEWeekColumnView.api A sope-appserver/WEExtensions/WEWeekColumnView.m A sope-appserver/WEExtensions/WEWeekOverview.api A sope-appserver/WEExtensions/WEWeekOverview.m A sope-appserver/WEExtensions/WExCalElemBuilder.m A sope-appserver/WEExtensions/WExDnDElemBuilder.m A sope-appserver/WEExtensions/WExExtElemBuilder.m A sope-appserver/WEExtensions/bundle-info.plist A sope-appserver/WEExtensions/calendar.js A sope-appserver/WEExtensions/calendar.jsm A sope-appserver/WEExtensions/calendar.m A sope-appserver/WEExtensions/common.h A sope-appserver/WEExtensions/doc/JSClipboard.3 A sope-appserver/WEExtensions/doc/JSMenu.3 A sope-appserver/WEExtensions/doc/JSMenuItem.3 A sope-appserver/WEExtensions/doc/JSShiftClick.3 A sope-appserver/WEExtensions/doc/Makefile A sope-appserver/WEExtensions/doc/WEBrowser.3 A sope-appserver/WEExtensions/doc/WECalendarField.3 A sope-appserver/WEExtensions/doc/WECase.3 A sope-appserver/WEExtensions/doc/WECollapsibleComponentContent.3 A sope-appserver/WEExtensions/doc/WEComponentValue.3 A sope-appserver/WEExtensions/doc/WEContextConditional.3 A sope-appserver/WEExtensions/doc/WEContextKey.3 A sope-appserver/WEExtensions/doc/WEDateField.3 A sope-appserver/WEExtensions/doc/WEDragContainer.3 A sope-appserver/WEExtensions/doc/WEDropContainer.3 A sope-appserver/WEExtensions/doc/WEEpozEditor.3 A sope-appserver/WEExtensions/doc/WEHSpanTableMatrix.3 A sope-appserver/WEExtensions/doc/WEMonthLabel.3 A sope-appserver/WEExtensions/doc/WEMonthOverview.3 A sope-appserver/WEExtensions/doc/WEPageItem.3 A sope-appserver/WEExtensions/doc/WEPageLink.3 A sope-appserver/WEExtensions/doc/WEPageView.3 A sope-appserver/WEExtensions/doc/WEQualifierConditional.3 A sope-appserver/WEExtensions/doc/WERedirect.3 A sope-appserver/WEExtensions/doc/WERichString.3 A sope-appserver/WEExtensions/doc/WESwitch.3 A sope-appserver/WEExtensions/doc/WETabItem.3 A sope-appserver/WEExtensions/doc/WETabView.3 A sope-appserver/WEExtensions/doc/WETableData.3 A sope-appserver/WEExtensions/doc/WETableHeader.3 A sope-appserver/WEExtensions/doc/WETableMatrix.3 A sope-appserver/WEExtensions/doc/WETableMatrixContent.3 A sope-appserver/WEExtensions/doc/WETableMatrixLabel.3 A sope-appserver/WEExtensions/doc/WETableView.3 A sope-appserver/WEExtensions/doc/WETimeField.3 A sope-appserver/WEExtensions/doc/WETreeData.3 A sope-appserver/WEExtensions/doc/WETreeHeader.3 A sope-appserver/WEExtensions/doc/WETreeView.3 A sope-appserver/WEExtensions/doc/WEVSpanTableMatrix.3 A sope-appserver/WEExtensions/doc/WEWeekColumnView.3 A sope-appserver/WEExtensions/doc/WEWeekOverview.3 A sope-appserver/WEExtensions/dummy.m A sope-appserver/WEExtensions/fhs.make A sope-appserver/WEExtensions/js2m.sh A sope-appserver/WEPrototype/COPYING A sope-appserver/WEPrototype/COPYRIGHT A sope-appserver/WEPrototype/ChangeLog A sope-appserver/WEPrototype/GNUmakefile A sope-appserver/WEPrototype/GNUmakefile.postamble A sope-appserver/WEPrototype/GNUmakefile.preamble A sope-appserver/WEPrototype/README A sope-appserver/WEPrototype/Version A sope-appserver/WEPrototype/WELiveLink.m A sope-appserver/WEPrototype/WEPrototype-Info.plist A sope-appserver/WEPrototype/WEPrototype.xcodeproj/project.pbxproj A sope-appserver/WEPrototype/WEPrototypeBundle.m A sope-appserver/WEPrototype/WEPrototypeElemBuilder.m A sope-appserver/WEPrototype/WEPrototypeScript.api A sope-appserver/WEPrototype/WEPrototypeScript.h A sope-appserver/WEPrototype/WEPrototypeScript.jsm A sope-appserver/WEPrototype/WEPrototypeScript.m A sope-appserver/WEPrototype/WEPrototypeScriptAction.m A sope-appserver/WEPrototype/bundle-info.plist A sope-appserver/WEPrototype/common.h A sope-appserver/WEPrototype/doc/GNUmakefile A sope-appserver/WEPrototype/doc/WEPrototypeScript.3 A sope-appserver/WEPrototype/fhs.make A sope-appserver/WEPrototype/js2m.sh A sope-appserver/WEPrototype/prototype/AUTHORS A sope-appserver/WEPrototype/prototype/LICENSE A sope-appserver/WEPrototype/prototype/README A sope-appserver/WEPrototype/prototype/THANKS A sope-appserver/WEPrototype/prototype/prototype.js A sope-appserver/WEPrototype/scriptaculous/CHANGELOG A sope-appserver/WEPrototype/scriptaculous/MIT-LICENSE A sope-appserver/WEPrototype/scriptaculous/README A sope-appserver/WEPrototype/scriptaculous/controls.js A sope-appserver/WEPrototype/scriptaculous/dragdrop.js A sope-appserver/WEPrototype/scriptaculous/effects.js A sope-appserver/WOExtensions/COPYING A sope-appserver/WOExtensions/COPYRIGHT A sope-appserver/WOExtensions/ChangeLog A sope-appserver/WOExtensions/GNUmakefile A sope-appserver/WOExtensions/GNUmakefile.postamble A sope-appserver/WOExtensions/GNUmakefile.preamble A sope-appserver/WOExtensions/JSAlertPanel.api A sope-appserver/WOExtensions/JSAlertPanel.m A sope-appserver/WOExtensions/JSConfirmPanel.api A sope-appserver/WOExtensions/JSConfirmPanel.m A sope-appserver/WOExtensions/JSImageFlyover.api A sope-appserver/WOExtensions/JSImageFlyover.m A sope-appserver/WOExtensions/JSKeyHandler.m A sope-appserver/WOExtensions/JSModalWindow.api A sope-appserver/WOExtensions/JSModalWindow.m A sope-appserver/WOExtensions/JSTextFlyover.api A sope-appserver/WOExtensions/JSTextFlyover.m A sope-appserver/WOExtensions/JSValidatedField.api A sope-appserver/WOExtensions/JSValidatedField.m A sope-appserver/WOExtensions/Version A sope-appserver/WOExtensions/WOCheckBoxMatrix.api A sope-appserver/WOExtensions/WOCheckBoxMatrix.m A sope-appserver/WOExtensions/WOCollapsibleComponentContent.api A sope-appserver/WOExtensions/WOCollapsibleComponentContent.m A sope-appserver/WOExtensions/WODictionaryRepetition.api A sope-appserver/WOExtensions/WODictionaryRepetition.m A sope-appserver/WOExtensions/WOExtensions-Info.plist A sope-appserver/WOExtensions/WOExtensions.h A sope-appserver/WOExtensions/WOExtensions.xcodeproj/project.pbxproj A sope-appserver/WOExtensions/WOExtensionsBuilderModule.m A sope-appserver/WOExtensions/WOKeyValueConditional.api A sope-appserver/WOExtensions/WOKeyValueConditional.m A sope-appserver/WOExtensions/WORadioButtonMatrix.api A sope-appserver/WOExtensions/WORadioButtonMatrix.m A sope-appserver/WOExtensions/WORedirect.api A sope-appserver/WOExtensions/WORedirect.h A sope-appserver/WOExtensions/WORedirect.m A sope-appserver/WOExtensions/WOTabPanel.api A sope-appserver/WOExtensions/WOTabPanel.m A sope-appserver/WOExtensions/WOTable.api A sope-appserver/WOExtensions/WOTable.m A sope-appserver/WOExtensions/WOThresholdColoredNumber.api A sope-appserver/WOExtensions/WOThresholdColoredNumber.m A sope-appserver/WOExtensions/WOxExtElemBuilder.m A sope-appserver/WOExtensions/bundle-info.plist A sope-appserver/WOExtensions/common.h A sope-appserver/WOExtensions/compat.m A sope-appserver/WOExtensions/doc/JSAlertPanel.3 A sope-appserver/WOExtensions/doc/JSConfirmPanel.3 A sope-appserver/WOExtensions/doc/JSImageFlyover.3 A sope-appserver/WOExtensions/doc/JSModalWindow.3 A sope-appserver/WOExtensions/doc/JSTextFlyover.3 A sope-appserver/WOExtensions/doc/JSValidatedField.3 A sope-appserver/WOExtensions/doc/Makefile A sope-appserver/WOExtensions/doc/WOCheckBoxMatrix.3 A sope-appserver/WOExtensions/doc/WOCollapsibleComponentContent.3 A sope-appserver/WOExtensions/doc/WODictionaryRepetition.3 A sope-appserver/WOExtensions/doc/WOKeyValueConditional.3 A sope-appserver/WOExtensions/doc/WORadioButtonMatrix.3 A sope-appserver/WOExtensions/doc/WORedirect.3 A sope-appserver/WOExtensions/doc/WOTabPanel.3 A sope-appserver/WOExtensions/doc/WOTable.3 A sope-appserver/WOExtensions/doc/WOThresholdColoredNumber.3 A sope-appserver/WOExtensions/dummy.m A sope-appserver/WOExtensions/fhs.make A sope-appserver/WOXML/COPYING A sope-appserver/WOXML/COPYRIGHT A sope-appserver/WOXML/ChangeLog A sope-appserver/WOXML/GNUmakefile A sope-appserver/WOXML/GNUmakefile.preamble A sope-appserver/WOXML/README A sope-appserver/WOXML/Version A sope-appserver/WOXML/WOXML-Info.plist A sope-appserver/WOXML/WOXML.h A sope-appserver/WOXML/WOXMLDecoder.h A sope-appserver/WOXML/WOXMLDecoder.m A sope-appserver/WOXML/WOXMLMapDecoder.h A sope-appserver/WOXML/WOXMLMapDecoder.m A sope-appserver/WOXML/WOXMLMappingEntity.h A sope-appserver/WOXML/WOXMLMappingEntity.m A sope-appserver/WOXML/WOXMLMappingModel.h A sope-appserver/WOXML/WOXMLMappingModel.m A sope-appserver/WOXML/WOXMLMappingProperty.h A sope-appserver/WOXML/WOXMLMappingProperty.m A sope-appserver/WOXML/WOXMLSaxModelHandler.h A sope-appserver/WOXML/WOXMLSaxModelHandler.m A sope-appserver/WOXML/common.h A sope-appserver/WOXML/fhs.make A sope-appserver/WOXML/samples/slashdot/GNUmakefile A sope-appserver/WOXML/samples/slashdot/SlashDotStory.m A sope-appserver/WOXML/samples/slashdot/slashdot.xmlmodel A sope-appserver/WOXML/samples/slashdot/woslash.m A sope-appserver/common.make A sope-appserver/dummy.c A sope-appserver/mod_ngobjweb-apache2/500mod_ngobjweb.info A sope-appserver/mod_ngobjweb-apache2/CHANGES A sope-appserver/mod_ngobjweb-apache2/COPYRIGHT A sope-appserver/mod_ngobjweb-apache2/ChangeLog A sope-appserver/mod_ngobjweb-apache2/GNUmakefile A sope-appserver/mod_ngobjweb-apache2/NGBufferedDescriptor.c A sope-appserver/mod_ngobjweb-apache2/NGBufferedDescriptor.h A sope-appserver/mod_ngobjweb-apache2/README A sope-appserver/mod_ngobjweb-apache2/apversion.sh A sope-appserver/mod_ngobjweb-apache2/common.h A sope-appserver/mod_ngobjweb-apache2/config.c A sope-appserver/mod_ngobjweb-apache2/globals.c A sope-appserver/mod_ngobjweb-apache2/handler.c A sope-appserver/mod_ngobjweb-apache2/httpd.conf A sope-appserver/mod_ngobjweb-apache2/mod_ngobjweb.xcodeproj/project.pbxproj A sope-appserver/mod_ngobjweb-apache2/ngobjweb.load A sope-appserver/mod_ngobjweb-apache2/ngobjweb_module.c A sope-appserver/mod_ngobjweb-apache2/scanhttp.c A sope-appserver/mod_ngobjweb-apache2/skyrix.conf A sope-appserver/mod_ngobjweb-apache2/sns.c A sope-appserver/mod_ngobjweb/500mod_ngobjweb.info A sope-appserver/mod_ngobjweb/CHANGES A sope-appserver/mod_ngobjweb/COPYRIGHT A sope-appserver/mod_ngobjweb/ChangeLog A sope-appserver/mod_ngobjweb/GNUmakefile A sope-appserver/mod_ngobjweb/NGBufferedDescriptor.c A sope-appserver/mod_ngobjweb/NGBufferedDescriptor.h A sope-appserver/mod_ngobjweb/README A sope-appserver/mod_ngobjweb/apversion.sh A sope-appserver/mod_ngobjweb/common.h A sope-appserver/mod_ngobjweb/config.c A sope-appserver/mod_ngobjweb/globals.c A sope-appserver/mod_ngobjweb/handler.c A sope-appserver/mod_ngobjweb/httpd.conf A sope-appserver/mod_ngobjweb/mod_ngobjweb.xcodeproj/project.pbxproj A sope-appserver/mod_ngobjweb/ngobjweb.load A sope-appserver/mod_ngobjweb/ngobjweb_module.c A sope-appserver/mod_ngobjweb/scanhttp.c A sope-appserver/mod_ngobjweb/skyrix.conf A sope-appserver/mod_ngobjweb/sns.c A sope-appserver/samples/BasicAuthSession/Application.m A sope-appserver/samples/BasicAuthSession/GNUmakefile A sope-appserver/samples/BasicAuthSession/Main.m A sope-appserver/samples/BasicAuthSession/Main.wo/Main.html A sope-appserver/samples/BasicAuthSession/Main.wo/Main.wod A sope-appserver/samples/BasicAuthSession/NSString+BasicAuth.h A sope-appserver/samples/BasicAuthSession/NSString+BasicAuth.m A sope-appserver/samples/BasicAuthSession/README A sope-appserver/samples/BasicAuthSession/common.h A sope-appserver/samples/COPYING A sope-appserver/samples/ChangeLog A sope-appserver/samples/CoreDataBlog/BlogDemo_DataModel.xcdatamodel/elements A sope-appserver/samples/CoreDataBlog/BlogDemo_DataModel.xcdatamodel/layout A sope-appserver/samples/CoreDataBlog/ChangeLog A sope-appserver/samples/CoreDataBlog/CoreDataBlog.conf A sope-appserver/samples/CoreDataBlog/CoreDataBlog.m A sope-appserver/samples/CoreDataBlog/Defaults.plist A sope-appserver/samples/CoreDataBlog/GNUmakefile A sope-appserver/samples/CoreDataBlog/GNUmakefile.postamble A sope-appserver/samples/CoreDataBlog/GNUmakefile.preamble A sope-appserver/samples/CoreDataBlog/Main.m A sope-appserver/samples/CoreDataBlog/Main.wo/Main.html A sope-appserver/samples/CoreDataBlog/Main.wo/Main.wod A sope-appserver/samples/CoreDataBlog/Main.wo/Main.woo A sope-appserver/samples/CoreDataBlog/MonthPage.m A sope-appserver/samples/CoreDataBlog/MonthPage.wo/MonthPage.html A sope-appserver/samples/CoreDataBlog/MonthPage.wo/MonthPage.wod A sope-appserver/samples/CoreDataBlog/MonthPage.wo/MonthPage.woo A sope-appserver/samples/CoreDataBlog/README A sope-appserver/samples/CoreDataBlog/RSS10.m A sope-appserver/samples/CoreDataBlog/RSS10.wo/RSS10.html A sope-appserver/samples/CoreDataBlog/RSS10.wo/RSS10.wod A sope-appserver/samples/CoreDataBlog/RSS10.wo/RSS10.woo A sope-appserver/samples/CoreDataBlog/Session.m A sope-appserver/samples/CoreDataBlog/WOCoreDataApplication.h A sope-appserver/samples/CoreDataBlog/WOCoreDataApplication.m A sope-appserver/samples/CoreDataBlog/WOSession+CoreData.h A sope-appserver/samples/CoreDataBlog/WOSession+CoreData.m A sope-appserver/samples/CoreDataBlog/common.h A sope-appserver/samples/CoreDataBlog/mulle-nat.rdf A sope-appserver/samples/GNUmakefile A sope-appserver/samples/HelloForm/ChangeLog A sope-appserver/samples/HelloForm/GNUmakefile A sope-appserver/samples/HelloForm/GNUmakefile.preamble A sope-appserver/samples/HelloForm/HelloForm.m A sope-appserver/samples/HelloForm/Main.css A sope-appserver/samples/HelloForm/Main.m A sope-appserver/samples/HelloForm/Main.wo/Main.html A sope-appserver/samples/HelloForm/Main.wo/Main.wod A sope-appserver/samples/HelloForm/common.h A sope-appserver/samples/HelloWorld/ChangeLog A sope-appserver/samples/HelloWorld/GNUmakefile A sope-appserver/samples/HelloWorld/GNUmakefile.preamble A sope-appserver/samples/HelloWorld/HelloWorld.m A sope-appserver/samples/HelloWorld/Main.m A sope-appserver/samples/HelloWorld/Main.wo/Main.html A sope-appserver/samples/HelloWorld/Main.wo/Main.wod A sope-appserver/samples/HelloWorld/common.h A sope-appserver/samples/README A sope-appserver/samples/SoCookieAuth/Application.m A sope-appserver/samples/SoCookieAuth/ChangeLog A sope-appserver/samples/SoCookieAuth/GNUmakefile A sope-appserver/samples/SoCookieAuth/GNUmakefile.preamble A sope-appserver/samples/SoCookieAuth/Main.m A sope-appserver/samples/SoCookieAuth/README A sope-appserver/samples/SoCookieAuth/common.h A sope-appserver/samples/TestPages/ChangeLog A sope-appserver/samples/TestPages/FormDisplay.m A sope-appserver/samples/TestPages/FormDisplay.wo/FormDisplay.html A sope-appserver/samples/TestPages/FormDisplay.wo/FormDisplay.wod A sope-appserver/samples/TestPages/GNUmakefile A sope-appserver/samples/TestPages/GNUmakefile.preamble A sope-appserver/samples/TestPages/Main.m A sope-appserver/samples/TestPages/Main.wo/Main.html A sope-appserver/samples/TestPages/Main.wo/Main.wod A sope-appserver/samples/TestPages/TestPages.m A sope-appserver/samples/TestPages/TwoForms.m A sope-appserver/samples/TestPages/TwoForms.wo/TwoForms.html A sope-appserver/samples/TestPages/TwoForms.wo/TwoForms.wod A sope-appserver/samples/TestPages/common.h A sope-appserver/samples/TestPrototype/ChangeLog A sope-appserver/samples/TestPrototype/GNUmakefile A sope-appserver/samples/TestPrototype/GNUmakefile.preamble A sope-appserver/samples/TestPrototype/Main.m A sope-appserver/samples/TestPrototype/Main.wo/Main.html A sope-appserver/samples/TestPrototype/Main.wo/Main.wod A sope-appserver/samples/TestPrototype/TestPrototype.m A sope-appserver/samples/TestPrototype/common.h A sope-appserver/samples/TestSite/.sope.plist A sope-appserver/samples/TestSite/ChangeLog A sope-appserver/samples/TestSite/Debug.xtmpl A sope-appserver/samples/TestSite/Main.xtmpl A sope-appserver/samples/TestSite/Projects/Main.xtmpl A sope-appserver/samples/TestSite/Projects/OGoLogo.gif A sope-appserver/samples/TestSite/Projects/blogstyle.css A sope-appserver/samples/TestSite/Projects/index.wox A sope-appserver/samples/TestSite/Projects/projectcard.wox A sope-appserver/samples/TestSite/Projects/stylesheet.css A sope-appserver/samples/TestSite/README A sope-appserver/samples/TestSite/accept.gif A sope-appserver/samples/TestSite/embed.wox A sope-appserver/samples/TestSite/favicon.ico A sope-appserver/samples/TestSite/htpasswd A sope-appserver/samples/TestSite/images/banner-new.gif A sope-appserver/samples/TestSite/images/banner.gif A sope-appserver/samples/TestSite/images/banner_back.gif A sope-appserver/samples/TestSite/images/banner_left.gif A sope-appserver/samples/TestSite/images/banner_right.gif A sope-appserver/samples/TestSite/index.html A sope-appserver/samples/TestSite/plisttest/Main.xtmpl A sope-appserver/samples/TestSite/plisttest/MyNews1.plist A sope-appserver/samples/TestSite/plisttest/MyNews2.plist A sope-appserver/samples/TestSite/plisttest/index.wox A sope-appserver/samples/TestSite/plone/Main.xtmpl A sope-appserver/samples/TestSite/plone/NOTES.txt A sope-appserver/samples/TestSite/plone/index.wox A sope-appserver/samples/TestSite/plone/linkOpaque.gif A sope-appserver/samples/TestSite/plone/linkTransparent.gif A sope-appserver/samples/TestSite/plone/loggedin.html A sope-appserver/samples/TestSite/plone/plone.css A sope-appserver/samples/TestSite/plone/ploneCustom.css A sope-appserver/samples/TestSite/plone/ploneNS4.css A sope-appserver/samples/TestSite/plone/plonePresentation.css A sope-appserver/samples/TestSite/plone/plonePrint.css A sope-appserver/samples/TestSite/plone/plone_formtooltip.js A sope-appserver/samples/TestSite/plone/plone_javascripts.js A sope-appserver/samples/TestSite/plone/required.gif A sope-appserver/samples/TestSite/plone/searchbox.wox A sope-appserver/samples/TestSite/stylesheet.css A sope-appserver/samples/TestSite/subdir/index.wox A sope-appserver/samples/TestSite/test.wox A sope-appserver/samples/TestSite/webfolders.xhtml A sope-appserver/samples/WOxExtTest/AlertPanel.m A sope-appserver/samples/WOxExtTest/AlertPanel.wox A sope-appserver/samples/WOxExtTest/Browser.m A sope-appserver/samples/WOxExtTest/Browser.wox A sope-appserver/samples/WOxExtTest/CalendarField.m A sope-appserver/samples/WOxExtTest/CalendarField.wox A sope-appserver/samples/WOxExtTest/ChangeLog A sope-appserver/samples/WOxExtTest/CheckBoxMatrix.m A sope-appserver/samples/WOxExtTest/CheckBoxMatrix.wox A sope-appserver/samples/WOxExtTest/CollapsibleContent.m A sope-appserver/samples/WOxExtTest/CollapsibleContent.wox A sope-appserver/samples/WOxExtTest/CollapsibleContentExt.m A sope-appserver/samples/WOxExtTest/CollapsibleContentExt.wox A sope-appserver/samples/WOxExtTest/ConfirmPanel.m A sope-appserver/samples/WOxExtTest/ConfirmPanel.wox A sope-appserver/samples/WOxExtTest/DateField.m A sope-appserver/samples/WOxExtTest/DateField.wox A sope-appserver/samples/WOxExtTest/DictionaryRepetition.m A sope-appserver/samples/WOxExtTest/DictionaryRepetition.wox A sope-appserver/samples/WOxExtTest/DirectAction.m A sope-appserver/samples/WOxExtTest/DnD.m A sope-appserver/samples/WOxExtTest/DnD.wox A sope-appserver/samples/WOxExtTest/Frame.m A sope-appserver/samples/WOxExtTest/Frame.wox A sope-appserver/samples/WOxExtTest/GNUmakefile A sope-appserver/samples/WOxExtTest/GNUmakefile.preamble A sope-appserver/samples/WOxExtTest/ImageFlyover.m A sope-appserver/samples/WOxExtTest/ImageFlyover.wox A sope-appserver/samples/WOxExtTest/KeyValueConditional.m A sope-appserver/samples/WOxExtTest/KeyValueConditional.wox A sope-appserver/samples/WOxExtTest/Lori.icns A sope-appserver/samples/WOxExtTest/Main.m A sope-appserver/samples/WOxExtTest/Main.wox A sope-appserver/samples/WOxExtTest/ModalWindow.m A sope-appserver/samples/WOxExtTest/ModalWindow.wox A sope-appserver/samples/WOxExtTest/MonthOverview.m A sope-appserver/samples/WOxExtTest/MonthOverview.wox A sope-appserver/samples/WOxExtTest/PageView.m A sope-appserver/samples/WOxExtTest/PageView.wox A sope-appserver/samples/WOxExtTest/PanelContent.m A sope-appserver/samples/WOxExtTest/PanelContent.wox A sope-appserver/samples/WOxExtTest/QualifierConditional.m A sope-appserver/samples/WOxExtTest/QualifierConditional.wox A sope-appserver/samples/WOxExtTest/RadioButtonMatrix.m A sope-appserver/samples/WOxExtTest/RadioButtonMatrix.wox A sope-appserver/samples/WOxExtTest/Resources/Dictionary.plist A sope-appserver/samples/WOxExtTest/Resources/TableView.plist A sope-appserver/samples/WOxExtTest/Resources/TreeView.plist A sope-appserver/samples/WOxExtTest/Resources/appointments.plist A sope-appserver/samples/WOxExtTest/RichString.m A sope-appserver/samples/WOxExtTest/RichString.wox A sope-appserver/samples/WOxExtTest/ShiftClick.m A sope-appserver/samples/WOxExtTest/ShiftClick.wox A sope-appserver/samples/WOxExtTest/Switch.m A sope-appserver/samples/WOxExtTest/Switch.wox A sope-appserver/samples/WOxExtTest/TabPanel.m A sope-appserver/samples/WOxExtTest/TabPanel.wox A sope-appserver/samples/WOxExtTest/TabView.m A sope-appserver/samples/WOxExtTest/TabView.wox A sope-appserver/samples/WOxExtTest/Table.m A sope-appserver/samples/WOxExtTest/Table.wox A sope-appserver/samples/WOxExtTest/TableMatrix.m A sope-appserver/samples/WOxExtTest/TableMatrix.wox A sope-appserver/samples/WOxExtTest/TableView.m A sope-appserver/samples/WOxExtTest/TableView.wox A sope-appserver/samples/WOxExtTest/TextFlyover.m A sope-appserver/samples/WOxExtTest/TextFlyover.wox A sope-appserver/samples/WOxExtTest/ThresholdColoredNumber.m A sope-appserver/samples/WOxExtTest/ThresholdColoredNumber.wox A sope-appserver/samples/WOxExtTest/TimeField.m A sope-appserver/samples/WOxExtTest/TimeField.wox A sope-appserver/samples/WOxExtTest/TreeView.m A sope-appserver/samples/WOxExtTest/TreeView.wox A sope-appserver/samples/WOxExtTest/ValidatedField.m A sope-appserver/samples/WOxExtTest/ValidatedField.wox A sope-appserver/samples/WOxExtTest/VarString.wox A sope-appserver/samples/WOxExtTest/WOxExtTest.m A sope-appserver/samples/WOxExtTest/WebServerResources/OGoLogo.gif A sope-appserver/samples/WOxExtTest/WebServerResources/collapsed.gif A sope-appserver/samples/WOxExtTest/WebServerResources/corner_left.gif A sope-appserver/samples/WOxExtTest/WebServerResources/corner_right.gif A sope-appserver/samples/WOxExtTest/WebServerResources/downward_sorted.gif A sope-appserver/samples/WOxExtTest/WebServerResources/expanded.gif A sope-appserver/samples/WOxExtTest/WebServerResources/first.gif A sope-appserver/samples/WOxExtTest/WebServerResources/first_blind.gif A sope-appserver/samples/WOxExtTest/WebServerResources/folder_closed.gif A sope-appserver/samples/WOxExtTest/WebServerResources/folder_opened.gif A sope-appserver/samples/WOxExtTest/WebServerResources/last.gif A sope-appserver/samples/WOxExtTest/WebServerResources/last_blind.gif A sope-appserver/samples/WOxExtTest/WebServerResources/menu_email.gif A sope-appserver/samples/WOxExtTest/WebServerResources/menu_email_inactive.gif A sope-appserver/samples/WOxExtTest/WebServerResources/next.gif A sope-appserver/samples/WOxExtTest/WebServerResources/next_blind.gif A sope-appserver/samples/WOxExtTest/WebServerResources/non_sorted.gif A sope-appserver/samples/WOxExtTest/WebServerResources/previous.gif A sope-appserver/samples/WOxExtTest/WebServerResources/previous_blind.gif A sope-appserver/samples/WOxExtTest/WebServerResources/tab_.gif A sope-appserver/samples/WOxExtTest/WebServerResources/tab_left.gif A sope-appserver/samples/WOxExtTest/WebServerResources/tab_news.gif A sope-appserver/samples/WOxExtTest/WebServerResources/tab_news_left.gif A sope-appserver/samples/WOxExtTest/WebServerResources/tab_news_selected.gif A sope-appserver/samples/WOxExtTest/WebServerResources/tab_persons.gif A sope-appserver/samples/WOxExtTest/WebServerResources/tab_persons_left.gif A sope-appserver/samples/WOxExtTest/WebServerResources/tab_persons_selected.gif A sope-appserver/samples/WOxExtTest/WebServerResources/tab_projects.gif A sope-appserver/samples/WOxExtTest/WebServerResources/tab_projects_left.gif A sope-appserver/samples/WOxExtTest/WebServerResources/tab_projects_selected.gif A sope-appserver/samples/WOxExtTest/WebServerResources/tab_selected.gif A sope-appserver/samples/WOxExtTest/WebServerResources/treeview_corner.gif A sope-appserver/samples/WOxExtTest/WebServerResources/treeview_corner_minus.gif A sope-appserver/samples/WOxExtTest/WebServerResources/treeview_corner_plus.gif A sope-appserver/samples/WOxExtTest/WebServerResources/treeview_junction.gif A sope-appserver/samples/WOxExtTest/WebServerResources/treeview_leaf.gif A sope-appserver/samples/WOxExtTest/WebServerResources/treeview_leaf_corner.gif A sope-appserver/samples/WOxExtTest/WebServerResources/treeview_line.gif A sope-appserver/samples/WOxExtTest/WebServerResources/treeview_minus.gif A sope-appserver/samples/WOxExtTest/WebServerResources/treeview_plus.gif A sope-appserver/samples/WOxExtTest/WebServerResources/treeview_space.gif A sope-appserver/samples/WOxExtTest/WebServerResources/upward_sorted.gif A sope-appserver/samples/WOxExtTest/WeekColumnView.m A sope-appserver/samples/WOxExtTest/WeekColumnView.wox A sope-appserver/samples/WOxExtTest/WeekOverview.m A sope-appserver/samples/WOxExtTest/WeekOverview.wox A sope-appserver/samples/WOxExtTest/common.h A sope-appserver/samples/WOxExtTest/favicon.ico A sope-appserver/samples/WOxExtTest/site.css A sope-appserver/samples/davpropget/GNUmakefile A sope-appserver/samples/davpropget/GNUmakefile.preamble A sope-appserver/samples/davpropget/NOTES A sope-appserver/samples/davpropget/README A sope-appserver/samples/davpropget/common.h A sope-appserver/samples/davpropget/davpropget.m A sope-appserver/samples/iCalPortal/COPYING A sope-appserver/samples/iCalPortal/COPYRIGHT A sope-appserver/samples/iCalPortal/ChangeLog A sope-appserver/samples/iCalPortal/DirectAction.m A sope-appserver/samples/iCalPortal/English.lproj/back.gif A sope-appserver/samples/iCalPortal/English.lproj/back_menu.gif A sope-appserver/samples/iCalPortal/English.lproj/back_menu2.gif A sope-appserver/samples/iCalPortal/English.lproj/back_seite.gif A sope-appserver/samples/iCalPortal/English.lproj/banner_a.gif A sope-appserver/samples/iCalPortal/English.lproj/banner_b.gif A sope-appserver/samples/iCalPortal/English.lproj/banner_c.gif A sope-appserver/samples/iCalPortal/English.lproj/banner_d.gif A sope-appserver/samples/iCalPortal/English.lproj/banner_deutsch.gif A sope-appserver/samples/iCalPortal/English.lproj/banner_e.gif A sope-appserver/samples/iCalPortal/English.lproj/favicon.ico A sope-appserver/samples/iCalPortal/English.lproj/feedback.gif A sope-appserver/samples/iCalPortal/English.lproj/free_hosting.gif A sope-appserver/samples/iCalPortal/English.lproj/line.gif A sope-appserver/samples/iCalPortal/English.lproj/main.strings A sope-appserver/samples/iCalPortal/English.lproj/pixel.gif A sope-appserver/samples/iCalPortal/English.lproj/powered_by_publisher.gif A sope-appserver/samples/iCalPortal/English.lproj/search.gif A sope-appserver/samples/iCalPortal/English.lproj/sidesmiley.gif A sope-appserver/samples/iCalPortal/English.lproj/site.css A sope-appserver/samples/iCalPortal/English.lproj/small.gif A sope-appserver/samples/iCalPortal/English.lproj/submit.gif A sope-appserver/samples/iCalPortal/English.lproj/tab_.gif A sope-appserver/samples/iCalPortal/English.lproj/tab_left.gif A sope-appserver/samples/iCalPortal/English.lproj/tab_selected.gif A sope-appserver/samples/iCalPortal/English.lproj/wp_config.gif A sope-appserver/samples/iCalPortal/English.lproj/wp_create.gif A sope-appserver/samples/iCalPortal/English.lproj/wp_faq.gif A sope-appserver/samples/iCalPortal/English.lproj/wp_feedback.gif A sope-appserver/samples/iCalPortal/English.lproj/wp_info.gif A sope-appserver/samples/iCalPortal/GNUmakefile A sope-appserver/samples/iCalPortal/GNUmakefile.preamble A sope-appserver/samples/iCalPortal/German.lproj/main.strings A sope-appserver/samples/iCalPortal/Pages/GNUmakefile A sope-appserver/samples/iCalPortal/Pages/iCalPortalBaseFrame.m A sope-appserver/samples/iCalPortal/Pages/iCalPortalBaseFrame.wox A sope-appserver/samples/iCalPortal/Pages/iCalPortalBox.m A sope-appserver/samples/iCalPortal/Pages/iCalPortalBox.wox A sope-appserver/samples/iCalPortal/Pages/iCalPortalCalTabs.m A sope-appserver/samples/iCalPortal/Pages/iCalPortalCalTabs.wox A sope-appserver/samples/iCalPortal/Pages/iCalPortalDayOverview.m A sope-appserver/samples/iCalPortal/Pages/iCalPortalDayOverview.wox A sope-appserver/samples/iCalPortal/Pages/iCalPortalFeedbackPage.m A sope-appserver/samples/iCalPortal/Pages/iCalPortalFeedbackPage.wox A sope-appserver/samples/iCalPortal/Pages/iCalPortalFrame.m A sope-appserver/samples/iCalPortal/Pages/iCalPortalFrame.wox A sope-appserver/samples/iCalPortal/Pages/iCalPortalHomePage.m A sope-appserver/samples/iCalPortal/Pages/iCalPortalHomePage.wox A sope-appserver/samples/iCalPortal/Pages/iCalPortalLeftMenu.m A sope-appserver/samples/iCalPortal/Pages/iCalPortalLeftMenu.wox A sope-appserver/samples/iCalPortal/Pages/iCalPortalLicensePage.m A sope-appserver/samples/iCalPortal/Pages/iCalPortalLicensePage.wox A sope-appserver/samples/iCalPortal/Pages/iCalPortalMonthView.m A sope-appserver/samples/iCalPortal/Pages/iCalPortalMonthView.wox A sope-appserver/samples/iCalPortal/Pages/iCalPortalProfilePage.m A sope-appserver/samples/iCalPortal/Pages/iCalPortalProfilePage.wox A sope-appserver/samples/iCalPortal/Pages/iCalPortalRegistrationPage.m A sope-appserver/samples/iCalPortal/Pages/iCalPortalRegistrationPage.wox A sope-appserver/samples/iCalPortal/Pages/iCalPortalRightMenu.m A sope-appserver/samples/iCalPortal/Pages/iCalPortalRightMenu.wox A sope-appserver/samples/iCalPortal/Pages/iCalPortalToDoView.m A sope-appserver/samples/iCalPortal/Pages/iCalPortalToDoView.wox A sope-appserver/samples/iCalPortal/Pages/iCalPortalWeekOverview.m A sope-appserver/samples/iCalPortal/Pages/iCalPortalWeekOverview.wox A sope-appserver/samples/iCalPortal/Pages/iCalPortalWelcomePage.m A sope-appserver/samples/iCalPortal/Pages/iCalPortalWelcomePage.wox A sope-appserver/samples/iCalPortal/README A sope-appserver/samples/iCalPortal/WebDAV/GNUmakefile A sope-appserver/samples/iCalPortal/WebDAV/iCalAction.h A sope-appserver/samples/iCalPortal/WebDAV/iCalAction.m A sope-appserver/samples/iCalPortal/WebDAV/iCalDeleteAction.h A sope-appserver/samples/iCalPortal/WebDAV/iCalDeleteAction.m A sope-appserver/samples/iCalPortal/WebDAV/iCalGetAction.h A sope-appserver/samples/iCalPortal/WebDAV/iCalGetAction.m A sope-appserver/samples/iCalPortal/WebDAV/iCalLockAction.h A sope-appserver/samples/iCalPortal/WebDAV/iCalLockAction.m A sope-appserver/samples/iCalPortal/WebDAV/iCalOptionsAction.h A sope-appserver/samples/iCalPortal/WebDAV/iCalOptionsAction.m A sope-appserver/samples/iCalPortal/WebDAV/iCalPublishAction.h A sope-appserver/samples/iCalPortal/WebDAV/iCalPublishAction.m A sope-appserver/samples/iCalPortal/WebDAV/iCalRequestHandler.h A sope-appserver/samples/iCalPortal/WebDAV/iCalRequestHandler.m A sope-appserver/samples/iCalPortal/common.h A sope-appserver/samples/iCalPortal/db/account.tmpl A sope-appserver/samples/iCalPortal/db/donald/.account.plist A sope-appserver/samples/iCalPortal/db/donald/korg.ics A sope-appserver/samples/iCalPortal/db/donald/mozcal-clean.ics A sope-appserver/samples/iCalPortal/db/donald/mozcal.ics A sope-appserver/samples/iCalPortal/db/donald/shire-cal1.ics A sope-appserver/samples/iCalPortal/db/donald/skytest1.ics A sope-appserver/samples/iCalPortal/db/donald/skytest2.ics A sope-appserver/samples/iCalPortal/iCalDayView.h A sope-appserver/samples/iCalPortal/iCalDayView.m A sope-appserver/samples/iCalPortal/iCalPortal.h A sope-appserver/samples/iCalPortal/iCalPortal.m A sope-appserver/samples/iCalPortal/iCalPortalCalendar.h A sope-appserver/samples/iCalPortal/iCalPortalCalendar.m A sope-appserver/samples/iCalPortal/iCalPortalDatabase.h A sope-appserver/samples/iCalPortal/iCalPortalDatabase.m A sope-appserver/samples/iCalPortal/iCalPortalPage.h A sope-appserver/samples/iCalPortal/iCalPortalPage.m A sope-appserver/samples/iCalPortal/iCalPortalUser.h A sope-appserver/samples/iCalPortal/iCalPortalUser.m A sope-appserver/samples/iCalPortal/iCalView.h A sope-appserver/samples/iCalPortal/iCalView.m A sope-appserver/samples/iCalPortal/iCalWeekView.h A sope-appserver/samples/iCalPortal/iCalWeekView.m A sope-appserver/samples/iCalPortal/icons.make A sope-appserver/samples/iCalPortal/mkpage.sh A sope-appserver/samples/parsedav/DAVParserTest.h A sope-appserver/samples/parsedav/DAVParserTest.m A sope-appserver/samples/parsedav/GNUmakefile A sope-appserver/samples/parsedav/GNUmakefile.preamble A sope-appserver/samples/parsedav/README A sope-appserver/samples/parsedav/common.h A sope-appserver/samples/parsedav/data/propupt1.xml A sope-appserver/samples/parsedav/parsedav.m A sope-appserver/samples/xmlrpc/GNUmakefile A sope-appserver/samples/xmlrpc/NGBloggerClient.h A sope-appserver/samples/xmlrpc/NGBloggerClient.m A sope-appserver/samples/xmlrpc/blogger_zidestore.m A sope-appserver/samples/xmlrpc/common.h A sope-appserver/samples/xmlrpc/meerkat_xml_channels.m A sope-appserver/sope-appserver.xcodeproj/project.pbxproj A sope-appserver/umbrella.make A sope-core/COPYING A sope-core/COPYRIGHT A sope-core/ChangeLog A sope-core/EOControl/COPYING A sope-core/EOControl/COPYRIGHT A sope-core/EOControl/ChangeLog A sope-core/EOControl/EOAndQualifier.m A sope-core/EOControl/EOArrayDataSource.h A sope-core/EOControl/EOArrayDataSource.m A sope-core/EOControl/EOClassDescription.h A sope-core/EOControl/EOClassDescription.m A sope-core/EOControl/EOControl-Info.plist A sope-core/EOControl/EOControl.h A sope-core/EOControl/EOControl.xcodeproj/project.pbxproj A sope-core/EOControl/EOControlDecls.h A sope-core/EOControl/EODataSource.h A sope-core/EOControl/EODataSource.m A sope-core/EOControl/EODetailDataSource.h A sope-core/EOControl/EODetailDataSource.m A sope-core/EOControl/EOFetchSpecification.h A sope-core/EOControl/EOFetchSpecification.m A sope-core/EOControl/EOGenericRecord.h A sope-core/EOControl/EOGenericRecord.m A sope-core/EOControl/EOGlobalID.h A sope-core/EOControl/EOGlobalID.m A sope-core/EOControl/EOKeyComparisonQualifier.m A sope-core/EOControl/EOKeyGlobalID.h A sope-core/EOControl/EOKeyGlobalID.m A sope-core/EOControl/EOKeyValueArchiver.h A sope-core/EOControl/EOKeyValueArchiver.m A sope-core/EOControl/EOKeyValueCoding.h A sope-core/EOControl/EOKeyValueCoding.m A sope-core/EOControl/EOKeyValueQualifier.m A sope-core/EOControl/EONotQualifier.m A sope-core/EOControl/EONull.h A sope-core/EOControl/EONull.m A sope-core/EOControl/EOObserver.h A sope-core/EOControl/EOObserver.m A sope-core/EOControl/EOOrQualifier.m A sope-core/EOControl/EOQualifier.h A sope-core/EOControl/EOQualifier.m A sope-core/EOControl/EOQualifierParser.m A sope-core/EOControl/EOQualifierVariable.m A sope-core/EOControl/EOSQLParser.h A sope-core/EOControl/EOSQLParser.m A sope-core/EOControl/EOSortOrdering.h A sope-core/EOControl/EOSortOrdering.m A sope-core/EOControl/EOValidation.m A sope-core/EOControl/GNUmakefile A sope-core/EOControl/GNUmakefile.preamble A sope-core/EOControl/NSArray+EOQualifier.m A sope-core/EOControl/NSObject+EOQualifierOps.m A sope-core/EOControl/NSObject+QualDesc.m A sope-core/EOControl/README A sope-core/EOControl/SxCore-EOControl.graffle A sope-core/EOControl/TODO A sope-core/EOControl/Version A sope-core/EOControl/common.h A sope-core/EOControl/fhs.make A sope-core/EOControl/libEOControl.def A sope-core/EOCoreData/COPYING A sope-core/EOCoreData/COPYRIGHT A sope-core/EOCoreData/ChangeLog A sope-core/EOCoreData/EOCompoundQualifiers.m A sope-core/EOCoreData/EOCoreData-Info.plist A sope-core/EOCoreData/EOCoreData.h A sope-core/EOCoreData/EOCoreData.xcodeproj/project.pbxproj A sope-core/EOCoreData/EOCoreDataSource.h A sope-core/EOCoreData/EOCoreDataSource.m A sope-core/EOCoreData/EOFetchSpecification+CoreData.h A sope-core/EOCoreData/EOFetchSpecification+CoreData.m A sope-core/EOCoreData/EOKeyComparisonQualifier+CoreData.m A sope-core/EOCoreData/EOKeyValueQualifier+CoreData.m A sope-core/EOCoreData/EOQualifier+CoreData.h A sope-core/EOCoreData/EOQualifier+CoreData.m A sope-core/EOCoreData/EOSortOrdering+CoreData.h A sope-core/EOCoreData/EOSortOrdering+CoreData.m A sope-core/EOCoreData/GNUmakefile A sope-core/EOCoreData/GNUmakefile.preamble A sope-core/EOCoreData/NSAttributeDescription+EO.h A sope-core/EOCoreData/NSAttributeDescription+EO.m A sope-core/EOCoreData/NSEntityDescription+EO.h A sope-core/EOCoreData/NSEntityDescription+EO.m A sope-core/EOCoreData/NSExpression+EO.h A sope-core/EOCoreData/NSExpression+EO.m A sope-core/EOCoreData/NSManagedObject+KVC.m A sope-core/EOCoreData/NSPredicate+EO.h A sope-core/EOCoreData/NSPredicate+EO.m A sope-core/EOCoreData/NSRelationshipDescription+EO.h A sope-core/EOCoreData/NSRelationshipDescription+EO.m A sope-core/EOCoreData/NSString+CoreData.m A sope-core/EOCoreData/README.txt A sope-core/EOCoreData/Version A sope-core/EOCoreData/common.h A sope-core/EOCoreData/fhs.make A sope-core/GNUmakefile A sope-core/NGExtensions/COPYING A sope-core/NGExtensions/COPYRIGHT A sope-core/NGExtensions/ChangeLog A sope-core/NGExtensions/EOExt.subproj/EOCacheDataSource.m A sope-core/NGExtensions/EOExt.subproj/EOCompoundDataSource.m A sope-core/NGExtensions/EOExt.subproj/EODataSource+NGExtensions.m A sope-core/NGExtensions/EOExt.subproj/EOFetchSpecification+plist.m A sope-core/NGExtensions/EOExt.subproj/EOFilterDataSource.m A sope-core/NGExtensions/EOExt.subproj/EOGlobalID+Ext.m A sope-core/NGExtensions/EOExt.subproj/EOGrouping.m A sope-core/NGExtensions/EOExt.subproj/EOGroupingSet.m A sope-core/NGExtensions/EOExt.subproj/EOKeyGrouping.m A sope-core/NGExtensions/EOExt.subproj/EOKeyMapDataSource.m A sope-core/NGExtensions/EOExt.subproj/EOQualifier+CtxEval.m A sope-core/NGExtensions/EOExt.subproj/EOQualifier+plist.m A sope-core/NGExtensions/EOExt.subproj/EOQualifierGrouping.m A sope-core/NGExtensions/EOExt.subproj/EOSortOrdering+plist.m A sope-core/NGExtensions/EOExt.subproj/EOTrueQualifier.m A sope-core/NGExtensions/EOExt.subproj/GNUmakefile A sope-core/NGExtensions/EOExt.subproj/NSArray+EOGrouping.m A sope-core/NGExtensions/EOExt.subproj/README.txt A sope-core/NGExtensions/EOExt.subproj/common.h A sope-core/NGExtensions/FdExt.subproj/GNUmakefile A sope-core/NGExtensions/FdExt.subproj/NGPropertyListParser.m A sope-core/NGExtensions/FdExt.subproj/NSArray+enumerator.m A sope-core/NGExtensions/FdExt.subproj/NSAutoreleasePool+misc.m A sope-core/NGExtensions/FdExt.subproj/NSBundle+misc.m A sope-core/NGExtensions/FdExt.subproj/NSCalendarDate+matrix.m A sope-core/NGExtensions/FdExt.subproj/NSCalendarDate+misc.m A sope-core/NGExtensions/FdExt.subproj/NSData+gzip.m A sope-core/NGExtensions/FdExt.subproj/NSData+misc.m A sope-core/NGExtensions/FdExt.subproj/NSDictionary+misc.m A sope-core/NGExtensions/FdExt.subproj/NSEnumerator+misc.m A sope-core/NGExtensions/FdExt.subproj/NSException+misc.m A sope-core/NGExtensions/FdExt.subproj/NSFileManager+Extensions.m A sope-core/NGExtensions/FdExt.subproj/NSMethodSignature+misc.m A sope-core/NGExtensions/FdExt.subproj/NSNull+misc.m A sope-core/NGExtensions/FdExt.subproj/NSObject+Logs.m A sope-core/NGExtensions/FdExt.subproj/NSObject+Values.m A sope-core/NGExtensions/FdExt.subproj/NSProcessInfo+misc.m A sope-core/NGExtensions/FdExt.subproj/NSRunLoop+FileObjects.m A sope-core/NGExtensions/FdExt.subproj/NSSet+enumerator.m A sope-core/NGExtensions/FdExt.subproj/NSString+Encoding.m A sope-core/NGExtensions/FdExt.subproj/NSString+Escaping.m A sope-core/NGExtensions/FdExt.subproj/NSString+Ext.m A sope-core/NGExtensions/FdExt.subproj/NSString+Formatting.m A sope-core/NGExtensions/FdExt.subproj/NSString+German.m A sope-core/NGExtensions/FdExt.subproj/NSString+HTMLEscaping.m A sope-core/NGExtensions/FdExt.subproj/NSString+URLEscaping.m A sope-core/NGExtensions/FdExt.subproj/NSString+XMLEscaping.m A sope-core/NGExtensions/FdExt.subproj/NSString+misc.m A sope-core/NGExtensions/FdExt.subproj/NSURL+misc.m A sope-core/NGExtensions/FdExt.subproj/common.h A sope-core/NGExtensions/FileObjectHolder.m A sope-core/NGExtensions/GNUmakefile A sope-core/NGExtensions/GNUmakefile.preamble A sope-core/NGExtensions/NGBase64Coding.m A sope-core/NGExtensions/NGBitSet.m A sope-core/NGExtensions/NGBundleManager.m A sope-core/NGExtensions/NGCalendarDateRange.m A sope-core/NGExtensions/NGCustomFileManager.m A sope-core/NGExtensions/NGDirectoryEnumerator.m A sope-core/NGExtensions/NGExtensions-Info.plist A sope-core/NGExtensions/NGExtensions.m A sope-core/NGExtensions/NGExtensions.xcodeproj/project.pbxproj A sope-core/NGExtensions/NGExtensions/AutoDefines.h A sope-core/NGExtensions/NGExtensions/DOMNode+EOQualifier.h A sope-core/NGExtensions/NGExtensions/EOCacheDataSource.h A sope-core/NGExtensions/NGExtensions/EOCompoundDataSource.h A sope-core/NGExtensions/NGExtensions/EODataSource+NGExtensions.h A sope-core/NGExtensions/NGExtensions/EOFetchSpecification+plist.h A sope-core/NGExtensions/NGExtensions/EOFilterDataSource.h A sope-core/NGExtensions/NGExtensions/EOGrouping.h A sope-core/NGExtensions/NGExtensions/EOGroupingSet.h A sope-core/NGExtensions/NGExtensions/EOKeyGrouping.h A sope-core/NGExtensions/NGExtensions/EOKeyMapDataSource.h A sope-core/NGExtensions/NGExtensions/EOQualifier+CtxEval.h A sope-core/NGExtensions/NGExtensions/EOQualifier+plist.h A sope-core/NGExtensions/NGExtensions/EOQualifierGrouping.h A sope-core/NGExtensions/NGExtensions/EOSortOrdering+plist.h A sope-core/NGExtensions/NGExtensions/EOTrueQualifier.h A sope-core/NGExtensions/NGExtensions/FileObjectHolder.h A sope-core/NGExtensions/NGExtensions/IndexFunc.h A sope-core/NGExtensions/NGExtensions/NGBase64Coding.h A sope-core/NGExtensions/NGExtensions/NGBaseTypes.h A sope-core/NGExtensions/NGExtensions/NGBitSet.h A sope-core/NGExtensions/NGExtensions/NGBundleManager.h A sope-core/NGExtensions/NGExtensions/NGCalendarDateRange.h A sope-core/NGExtensions/NGExtensions/NGCharBuffers.h A sope-core/NGExtensions/NGExtensions/NGCustomFileManager.h A sope-core/NGExtensions/NGExtensions/NGDirectoryEnumerator.h A sope-core/NGExtensions/NGExtensions/NGExtensions.h A sope-core/NGExtensions/NGExtensions/NGExtensionsDecls.h A sope-core/NGExtensions/NGExtensions/NGFileFolderInfoDataSource.h A sope-core/NGExtensions/NGExtensions/NGFileManager.h A sope-core/NGExtensions/NGExtensions/NGFileManagerURL.h A sope-core/NGExtensions/NGExtensions/NGHashMap.h A sope-core/NGExtensions/NGExtensions/NGLogAppender.h A sope-core/NGExtensions/NGExtensions/NGLogEvent.h A sope-core/NGExtensions/NGExtensions/NGLogEventFormatter.h A sope-core/NGExtensions/NGExtensions/NGLogFileHandleAppender.h A sope-core/NGExtensions/NGExtensions/NGLogLevel.h A sope-core/NGExtensions/NGExtensions/NGLogSyslogAppender.h A sope-core/NGExtensions/NGExtensions/NGLogger.h A sope-core/NGExtensions/NGExtensions/NGLoggerManager.h A sope-core/NGExtensions/NGExtensions/NGLogging.h A sope-core/NGExtensions/NGExtensions/NGMemoryAllocation.h A sope-core/NGExtensions/NGExtensions/NGMerging.h A sope-core/NGExtensions/NGExtensions/NGObjCRuntime.h A sope-core/NGExtensions/NGExtensions/NGObjectMacros.h A sope-core/NGExtensions/NGExtensions/NGPropertyListParser.h A sope-core/NGExtensions/NGExtensions/NGQuotedPrintableCoding.h A sope-core/NGExtensions/NGExtensions/NGResourceLocator.h A sope-core/NGExtensions/NGExtensions/NGRule.h A sope-core/NGExtensions/NGExtensions/NGRuleAssignment.h A sope-core/NGExtensions/NGExtensions/NGRuleContext.h A sope-core/NGExtensions/NGExtensions/NGRuleEngine.h A sope-core/NGExtensions/NGExtensions/NGRuleModel.h A sope-core/NGExtensions/NGExtensions/NGStack.h A sope-core/NGExtensions/NGExtensions/NGStringScanEnumerator.h A sope-core/NGExtensions/NGExtensions/NSArray+enumerator.h A sope-core/NGExtensions/NGExtensions/NSAutoreleasePool+misc.h A sope-core/NGExtensions/NGExtensions/NSBundle+misc.h A sope-core/NGExtensions/NGExtensions/NSCalendarDate+misc.h A sope-core/NGExtensions/NGExtensions/NSData+gzip.h A sope-core/NGExtensions/NGExtensions/NSData+misc.h A sope-core/NGExtensions/NGExtensions/NSDictionary+misc.h A sope-core/NGExtensions/NGExtensions/NSEnumerator+misc.h A sope-core/NGExtensions/NGExtensions/NSException+misc.h A sope-core/NGExtensions/NGExtensions/NSFileManager+Extensions.h A sope-core/NGExtensions/NGExtensions/NSMethodSignature+misc.h A sope-core/NGExtensions/NGExtensions/NSNull+misc.h A sope-core/NGExtensions/NGExtensions/NSObject+Logs.h A sope-core/NGExtensions/NGExtensions/NSObject+Values.h A sope-core/NGExtensions/NGExtensions/NSProcessInfo+misc.h A sope-core/NGExtensions/NGExtensions/NSRunLoop+FileObjects.h A sope-core/NGExtensions/NGExtensions/NSSet+enumerator.h A sope-core/NGExtensions/NGExtensions/NSString+Encoding.h A sope-core/NGExtensions/NGExtensions/NSString+Escaping.h A sope-core/NGExtensions/NGExtensions/NSString+Ext.h A sope-core/NGExtensions/NGExtensions/NSString+Formatting.h A sope-core/NGExtensions/NGExtensions/NSString+German.h A sope-core/NGExtensions/NGExtensions/NSString+misc.h A sope-core/NGExtensions/NGExtensions/NSURL+misc.h A sope-core/NGExtensions/NGFileFolderInfoDataSource.m A sope-core/NGExtensions/NGFileManager+JS.m A sope-core/NGExtensions/NGFileManager.m A sope-core/NGExtensions/NGFileManagerURL.m A sope-core/NGExtensions/NGHashMap.m A sope-core/NGExtensions/NGLogging.subproj/ChangeLog A sope-core/NGExtensions/NGLogging.subproj/GNUmakefile A sope-core/NGExtensions/NGLogging.subproj/NGLogAppender.m A sope-core/NGExtensions/NGLogging.subproj/NGLogEvent.m A sope-core/NGExtensions/NGLogging.subproj/NGLogEventDetailedFormatter.m A sope-core/NGExtensions/NGLogging.subproj/NGLogEventFormatter.m A sope-core/NGExtensions/NGLogging.subproj/NGLogFileHandleAppender.m A sope-core/NGExtensions/NGLogging.subproj/NGLogStderrAppender.m A sope-core/NGExtensions/NGLogging.subproj/NGLogStdoutAppender.m A sope-core/NGExtensions/NGLogging.subproj/NGLogSyslogAppender.m A sope-core/NGExtensions/NGLogging.subproj/NGLogger.m A sope-core/NGExtensions/NGLogging.subproj/NGLoggerManager.m A sope-core/NGExtensions/NGLogging.subproj/README A sope-core/NGExtensions/NGLogging.subproj/common.h A sope-core/NGExtensions/NGMerging.m A sope-core/NGExtensions/NGObjCRuntime.m A sope-core/NGExtensions/NGQuotedPrintableCoding.m A sope-core/NGExtensions/NGResourceLocator.m A sope-core/NGExtensions/NGRuleEngine.subproj/GNUmakefile A sope-core/NGExtensions/NGRuleEngine.subproj/NGRule.m A sope-core/NGExtensions/NGRuleEngine.subproj/NGRuleAssignment.m A sope-core/NGExtensions/NGRuleEngine.subproj/NGRuleContext.m A sope-core/NGExtensions/NGRuleEngine.subproj/NGRuleModel.m A sope-core/NGExtensions/NGRuleEngine.subproj/NGRuleParser.h A sope-core/NGExtensions/NGRuleEngine.subproj/NGRuleParser.m A sope-core/NGExtensions/NGRuleEngine.subproj/README A sope-core/NGExtensions/NGRuleEngine.subproj/common.h A sope-core/NGExtensions/NGStack.m A sope-core/NGExtensions/SxCore-NGExtensions.graffle A sope-core/NGExtensions/TODO A sope-core/NGExtensions/Version A sope-core/NGExtensions/XmlExt.subproj/DOMNode+EOQualifier.m A sope-core/NGExtensions/XmlExt.subproj/GNUmakefile A sope-core/NGExtensions/common.h A sope-core/NGExtensions/fhs.make A sope-core/NGExtensions/libNGExtensions.def A sope-core/NGStreams/COPYING A sope-core/NGStreams/COPYRIGHT A sope-core/NGStreams/ChangeLog A sope-core/NGStreams/DESIGN A sope-core/NGStreams/GNUmakefile A sope-core/NGStreams/GNUmakefile.postamble A sope-core/NGStreams/GNUmakefile.preamble A sope-core/NGStreams/NGActiveSSLSocket.m A sope-core/NGStreams/NGActiveSocket+serialization.m A sope-core/NGStreams/NGActiveSocket.m A sope-core/NGStreams/NGBase64Stream.m A sope-core/NGStreams/NGBufferedStream.m A sope-core/NGStreams/NGByteBuffer.m A sope-core/NGStreams/NGByteCountStream.m A sope-core/NGStreams/NGCTextStream.m A sope-core/NGStreams/NGCharBuffer.m A sope-core/NGStreams/NGConcreteStreamFileHandle.m A sope-core/NGStreams/NGDataStream.m A sope-core/NGStreams/NGDatagramPacket.m A sope-core/NGStreams/NGDatagramSocket.m A sope-core/NGStreams/NGDescriptorFunctions.m A sope-core/NGStreams/NGFileStream.m A sope-core/NGStreams/NGFilterStream.m A sope-core/NGStreams/NGFilterTextStream.m A sope-core/NGStreams/NGGZipStream.m A sope-core/NGStreams/NGInternetSocketAddress.m A sope-core/NGStreams/NGInternetSocketDomain.m A sope-core/NGStreams/NGLocalSocketAddress.m A sope-core/NGStreams/NGLocalSocketDomain.m A sope-core/NGStreams/NGLockingStream.m A sope-core/NGStreams/NGNetUtilities.m A sope-core/NGStreams/NGPassiveSocket.m A sope-core/NGStreams/NGSocket+private.h A sope-core/NGStreams/NGSocket.m A sope-core/NGStreams/NGSocketExceptions.m A sope-core/NGStreams/NGStream+serialization.m A sope-core/NGStreams/NGStream.m A sope-core/NGStreams/NGStreamCoder.m A sope-core/NGStreams/NGStreamExceptions.m A sope-core/NGStreams/NGStreamPipe.m A sope-core/NGStreams/NGStreams-Info.plist A sope-core/NGStreams/NGStreams.m A sope-core/NGStreams/NGStreams.xcodeproj/project.pbxproj A sope-core/NGStreams/NGStreams/NGActiveSSLSocket.h A sope-core/NGStreams/NGStreams/NGActiveSocket+serialization.h A sope-core/NGStreams/NGStreams/NGActiveSocket.h A sope-core/NGStreams/NGStreams/NGBase64Stream.h A sope-core/NGStreams/NGStreams/NGBufferedStream.h A sope-core/NGStreams/NGStreams/NGByteBuffer.h A sope-core/NGStreams/NGStreams/NGByteCountStream.h A sope-core/NGStreams/NGStreams/NGCTextStream.h A sope-core/NGStreams/NGStreams/NGCharBuffer.h A sope-core/NGStreams/NGStreams/NGConcreteStreamFileHandle.h A sope-core/NGStreams/NGStreams/NGDataStream.h A sope-core/NGStreams/NGStreams/NGDatagramPacket.h A sope-core/NGStreams/NGStreams/NGDatagramSocket.h A sope-core/NGStreams/NGStreams/NGDescriptorFunctions.h A sope-core/NGStreams/NGStreams/NGFileStream.h A sope-core/NGStreams/NGStreams/NGFilterStream.h A sope-core/NGStreams/NGStreams/NGFilterTextStream.h A sope-core/NGStreams/NGStreams/NGGZipStream.h A sope-core/NGStreams/NGStreams/NGInternetSocketAddress.h A sope-core/NGStreams/NGStreams/NGInternetSocketDomain.h A sope-core/NGStreams/NGStreams/NGLocalSocketAddress.h A sope-core/NGStreams/NGStreams/NGLocalSocketDomain.h A sope-core/NGStreams/NGStreams/NGLockingStream.h A sope-core/NGStreams/NGStreams/NGNet.h A sope-core/NGStreams/NGStreams/NGNetDecls.h A sope-core/NGStreams/NGStreams/NGNetUtilities.h A sope-core/NGStreams/NGStreams/NGPassiveSocket.h A sope-core/NGStreams/NGStreams/NGSocket.h A sope-core/NGStreams/NGStreams/NGSocketExceptions.h A sope-core/NGStreams/NGStreams/NGSocketProtocols.h A sope-core/NGStreams/NGStreams/NGStream+serialization.h A sope-core/NGStreams/NGStreams/NGStream.h A sope-core/NGStreams/NGStreams/NGStreamCoder.h A sope-core/NGStreams/NGStreams/NGStreamExceptions.h A sope-core/NGStreams/NGStreams/NGStreamPipe.h A sope-core/NGStreams/NGStreams/NGStreamProtocols.h A sope-core/NGStreams/NGStreams/NGStreams.h A sope-core/NGStreams/NGStreams/NGStreamsDecls.h A sope-core/NGStreams/NGStreams/NGStringTextStream.h A sope-core/NGStreams/NGStreams/NGTaskStream.h A sope-core/NGStreams/NGStreams/NGTerminalSupport.h A sope-core/NGStreams/NGStreams/NGTextStream.h A sope-core/NGStreams/NGStreams/NGTextStreamProtocols.h A sope-core/NGStreams/NGStreams/NGUrlChars.h A sope-core/NGStreams/NGStringTextStream.m A sope-core/NGStreams/NGTaskStream.m A sope-core/NGStreams/NGTerminalSupport.m A sope-core/NGStreams/NGTextStream.m A sope-core/NGStreams/README A sope-core/NGStreams/SxCore-NGStreams.graffle A sope-core/NGStreams/TODO A sope-core/NGStreams/Version A sope-core/NGStreams/common.h A sope-core/NGStreams/config.guess A sope-core/NGStreams/config.guess.upstream A sope-core/NGStreams/config.h.in A sope-core/NGStreams/config.sub A sope-core/NGStreams/config.sub.upstream A sope-core/NGStreams/configure A sope-core/NGStreams/configure.in A sope-core/NGStreams/fhs.make A sope-core/NGStreams/install-sh A sope-core/NGStreams/libNGStreams.def A sope-core/NGStreams/macosx/config.h A sope-core/NGStreams/powerpc/linux-gnu/config.h A sope-core/NGStreams/ppc/linux-gnu/config.h A sope-core/PROJECTLEAD A sope-core/README A sope-core/README-OSX.txt A sope-core/Version A sope-core/common.make A sope-core/dummy.c A sope-core/samples/COPYING A sope-core/samples/ChangeLog A sope-core/samples/EOQualTool.h A sope-core/samples/EOQualTool.m A sope-core/samples/EncodingTool.h A sope-core/samples/EncodingTool.m A sope-core/samples/GNUmakefile A sope-core/samples/GNUmakefile.preamble A sope-core/samples/README A sope-core/samples/bmlookup.m A sope-core/samples/common.h A sope-core/samples/encoding.m A sope-core/samples/eoqual.m A sope-core/samples/fhs.make A sope-core/samples/fmdls.m A sope-core/samples/httpu_notify.m A sope-core/samples/ngcal.m A sope-core/samples/parserule.m A sope-core/samples/sope-rsrclookup.m A sope-core/samples/subclassing.m A sope-core/samples/testdirenum.m A sope-core/samples/testsock.m A sope-core/samples/testurl.m A sope-core/sope-core.xcodeproj/project.pbxproj A sope-core/umbrella.make A sope-gdl1/COPYING.LIB A sope-gdl1/FrontBase2/COPYING.LIB A sope-gdl1/FrontBase2/ChangeLog A sope-gdl1/FrontBase2/EOAttribute+FB.h A sope-gdl1/FrontBase2/EOAttribute+FB.m A sope-gdl1/FrontBase2/English.lproj/InfoPlist.strings A sope-gdl1/FrontBase2/FBAdaptor+Types.m A sope-gdl1/FrontBase2/FBBlobHandle.h A sope-gdl1/FrontBase2/FBBlobHandle.m A sope-gdl1/FrontBase2/FBChannel+Model.h A sope-gdl1/FrontBase2/FBChannel+Model.m A sope-gdl1/FrontBase2/FBChannel.h A sope-gdl1/FrontBase2/FBChannel.m A sope-gdl1/FrontBase2/FBContext.h A sope-gdl1/FrontBase2/FBContext.m A sope-gdl1/FrontBase2/FBException.h A sope-gdl1/FrontBase2/FBException.m A sope-gdl1/FrontBase2/FBHeaders.h A sope-gdl1/FrontBase2/FBSQLExpression.h A sope-gdl1/FrontBase2/FBSQLExpression.m A sope-gdl1/FrontBase2/FBValues.h A sope-gdl1/FrontBase2/FBValues.m A sope-gdl1/FrontBase2/FrontBase2Adaptor.h A sope-gdl1/FrontBase2/FrontBase2Adaptor.m A sope-gdl1/FrontBase2/GNUmakefile A sope-gdl1/FrontBase2/GNUmakefile.preamble A sope-gdl1/FrontBase2/Info.plist A sope-gdl1/FrontBase2/NSString+FB.h A sope-gdl1/FrontBase2/NSString+FB.m A sope-gdl1/FrontBase2/README A sope-gdl1/FrontBase2/Version A sope-gdl1/FrontBase2/cancompile.sh A sope-gdl1/FrontBase2/common.h A sope-gdl1/FrontBase2/condict.plist A sope-gdl1/FrontBase2/fbtest.m A sope-gdl1/FrontBase2/fbtest.py A sope-gdl1/FrontBase2/test.eomodel A sope-gdl1/GDLAccess/COPYING.LIB A sope-gdl1/GDLAccess/ChangeLog A sope-gdl1/GDLAccess/EOAdaptor.h A sope-gdl1/GDLAccess/EOAdaptor.m A sope-gdl1/GDLAccess/EOAdaptorChannel+Attributes.h A sope-gdl1/GDLAccess/EOAdaptorChannel+Attributes.m A sope-gdl1/GDLAccess/EOAdaptorChannel.h A sope-gdl1/GDLAccess/EOAdaptorChannel.m A sope-gdl1/GDLAccess/EOAdaptorContext.h A sope-gdl1/GDLAccess/EOAdaptorContext.m A sope-gdl1/GDLAccess/EOAdaptorDataSource.h A sope-gdl1/GDLAccess/EOAdaptorDataSource.m A sope-gdl1/GDLAccess/EOAdaptorGlobalID.h A sope-gdl1/GDLAccess/EOAdaptorGlobalID.m A sope-gdl1/GDLAccess/EOAdaptorOperation.h A sope-gdl1/GDLAccess/EOAdaptorOperation.m A sope-gdl1/GDLAccess/EOAndQualifier+SQL.m A sope-gdl1/GDLAccess/EOArrayProxy.h A sope-gdl1/GDLAccess/EOArrayProxy.m A sope-gdl1/GDLAccess/EOAttribute.h A sope-gdl1/GDLAccess/EOAttribute.m A sope-gdl1/GDLAccess/EOAttributeOrdering.h A sope-gdl1/GDLAccess/EOAttributeOrdering.m A sope-gdl1/GDLAccess/EOCustomValues.h A sope-gdl1/GDLAccess/EOCustomValues.m A sope-gdl1/GDLAccess/EODatabase.h A sope-gdl1/GDLAccess/EODatabase.m A sope-gdl1/GDLAccess/EODatabaseChannel.h A sope-gdl1/GDLAccess/EODatabaseChannel.m A sope-gdl1/GDLAccess/EODatabaseContext.h A sope-gdl1/GDLAccess/EODatabaseContext.m A sope-gdl1/GDLAccess/EODatabaseFault.h A sope-gdl1/GDLAccess/EODatabaseFault.m A sope-gdl1/GDLAccess/EODatabaseFaultResolver.h A sope-gdl1/GDLAccess/EODatabaseFaultResolver.m A sope-gdl1/GDLAccess/EODelegateResponse.h A sope-gdl1/GDLAccess/EOEntity+Factory.h A sope-gdl1/GDLAccess/EOEntity+Factory.m A sope-gdl1/GDLAccess/EOEntity.h A sope-gdl1/GDLAccess/EOEntity.m A sope-gdl1/GDLAccess/EOEntityClassDescription.m A sope-gdl1/GDLAccess/EOExpressionArray.h A sope-gdl1/GDLAccess/EOExpressionArray.m A sope-gdl1/GDLAccess/EOFExceptions.h A sope-gdl1/GDLAccess/EOFExceptions.m A sope-gdl1/GDLAccess/EOFault.h A sope-gdl1/GDLAccess/EOFault.m A sope-gdl1/GDLAccess/EOFaultHandler.h A sope-gdl1/GDLAccess/EOFaultHandler.m A sope-gdl1/GDLAccess/EOGenericRecord.h A sope-gdl1/GDLAccess/EOGenericRecord.m A sope-gdl1/GDLAccess/EOJoinTypes.h A sope-gdl1/GDLAccess/EOKeyComparisonQualifier+SQL.m A sope-gdl1/GDLAccess/EOKeySortOrdering.h A sope-gdl1/GDLAccess/EOKeySortOrdering.m A sope-gdl1/GDLAccess/EOKeyValueQualifier+SQL.m A sope-gdl1/GDLAccess/EOModel.h A sope-gdl1/GDLAccess/EOModel.m A sope-gdl1/GDLAccess/EOModelGroup.h A sope-gdl1/GDLAccess/EOModelGroup.m A sope-gdl1/GDLAccess/EONotQualifier+SQL.m A sope-gdl1/GDLAccess/EONull.h A sope-gdl1/GDLAccess/EOObjectUniquer.h A sope-gdl1/GDLAccess/EOObjectUniquer.m A sope-gdl1/GDLAccess/EOOrQualifier+SQL.m A sope-gdl1/GDLAccess/EOPrimaryKeyDictionary.h A sope-gdl1/GDLAccess/EOPrimaryKeyDictionary.m A sope-gdl1/GDLAccess/EOQualifier+SQL.m A sope-gdl1/GDLAccess/EOQualifierScanner.h A sope-gdl1/GDLAccess/EOQualifierScanner.m A sope-gdl1/GDLAccess/EOQuotedExpression.h A sope-gdl1/GDLAccess/EOQuotedExpression.m A sope-gdl1/GDLAccess/EORecordDictionary.h A sope-gdl1/GDLAccess/EORecordDictionary.m A sope-gdl1/GDLAccess/EORelationship.h A sope-gdl1/GDLAccess/EORelationship.m A sope-gdl1/GDLAccess/EOSQLExpression.h A sope-gdl1/GDLAccess/EOSQLExpression.m A sope-gdl1/GDLAccess/EOSQLQualifier.h A sope-gdl1/GDLAccess/EOSQLQualifier.m A sope-gdl1/GDLAccess/EOSelectSQLExpression.m A sope-gdl1/GDLAccess/English.lproj/InfoPlist.strings A sope-gdl1/GDLAccess/FoundationExt/COPYING A sope-gdl1/GDLAccess/FoundationExt/COPYRIGHT A sope-gdl1/GDLAccess/FoundationExt/DefaultScannerHandler.h A sope-gdl1/GDLAccess/FoundationExt/DefaultScannerHandler.m A sope-gdl1/GDLAccess/FoundationExt/FormatScanner.h A sope-gdl1/GDLAccess/FoundationExt/FormatScanner.m A sope-gdl1/GDLAccess/FoundationExt/GNUmakefile A sope-gdl1/GDLAccess/FoundationExt/LICENSE A sope-gdl1/GDLAccess/FoundationExt/PrintfFormatScanner.h A sope-gdl1/GDLAccess/FoundationExt/PrintfFormatScanner.m A sope-gdl1/GDLAccess/GDLAccess-Info.plist A sope-gdl1/GDLAccess/GDLAccess.h A sope-gdl1/GDLAccess/GDLAccess.xcodeproj/project.pbxproj A sope-gdl1/GDLAccess/GNUmakefile A sope-gdl1/GDLAccess/GNUmakefile.preamble A sope-gdl1/GDLAccess/NSObject+EONullInit.h A sope-gdl1/GDLAccess/NSObject+EONullInit.m A sope-gdl1/GDLAccess/README A sope-gdl1/GDLAccess/TODO A sope-gdl1/GDLAccess/Version A sope-gdl1/GDLAccess/common.h A sope-gdl1/GDLAccess/connect-EOAdaptor.m A sope-gdl1/GDLAccess/eoaccess.m A sope-gdl1/GDLAccess/fhs.make A sope-gdl1/GDLAccess/libGDLAccess.def A sope-gdl1/GDLAccess/load-EOAdaptor.m A sope-gdl1/GDLAccess/test.py A sope-gdl1/GNUmakefile A sope-gdl1/MySQL/COPYING.LIB A sope-gdl1/MySQL/ChangeLog A sope-gdl1/MySQL/EOAttribute+MySQL4.h A sope-gdl1/MySQL/EOAttribute+MySQL4.m A sope-gdl1/MySQL/GNUmakefile A sope-gdl1/MySQL/GNUmakefile.preamble A sope-gdl1/MySQL/MySQL4Adaptor.h A sope-gdl1/MySQL/MySQL4Adaptor.m A sope-gdl1/MySQL/MySQL4Channel+Model.h A sope-gdl1/MySQL/MySQL4Channel+Model.m A sope-gdl1/MySQL/MySQL4Channel.h A sope-gdl1/MySQL/MySQL4Channel.m A sope-gdl1/MySQL/MySQL4Context.h A sope-gdl1/MySQL/MySQL4Context.m A sope-gdl1/MySQL/MySQL4Exception.h A sope-gdl1/MySQL/MySQL4Exception.m A sope-gdl1/MySQL/MySQL4Expression.h A sope-gdl1/MySQL/MySQL4Expression.m A sope-gdl1/MySQL/MySQL4Values.h A sope-gdl1/MySQL/MySQL4Values.m A sope-gdl1/MySQL/NSCalendarDate+MySQL4Val.m A sope-gdl1/MySQL/NSData+MySQL4Val.m A sope-gdl1/MySQL/NSNumber+MySQL4Val.m A sope-gdl1/MySQL/NSString+MySQL4.h A sope-gdl1/MySQL/NSString+MySQL4.m A sope-gdl1/MySQL/NSString+MySQL4Val.m A sope-gdl1/MySQL/README A sope-gdl1/MySQL/Version A sope-gdl1/MySQL/common.h A sope-gdl1/MySQL/condict.plist A sope-gdl1/MySQL/fhs.make A sope-gdl1/MySQL/gdltest.m A sope-gdl1/MySQL/test.eomodel A sope-gdl1/Oracle8/COPYING.LIB A sope-gdl1/Oracle8/ChangeLog A sope-gdl1/Oracle8/EOAttribute+Oracle.h A sope-gdl1/Oracle8/EOAttribute+Oracle.m A sope-gdl1/Oracle8/GNUmakefile A sope-gdl1/Oracle8/OracleAdaptor.h A sope-gdl1/Oracle8/OracleAdaptor.m A sope-gdl1/Oracle8/OracleAdaptorChannel.h A sope-gdl1/Oracle8/OracleAdaptorChannel.m A sope-gdl1/Oracle8/OracleAdaptorChannelController.h A sope-gdl1/Oracle8/OracleAdaptorChannelController.m A sope-gdl1/Oracle8/OracleAdaptorContext.h A sope-gdl1/Oracle8/OracleAdaptorContext.m A sope-gdl1/Oracle8/OracleSQLExpression.h A sope-gdl1/Oracle8/OracleSQLExpression.m A sope-gdl1/Oracle8/OracleValues.h A sope-gdl1/Oracle8/OracleValues.m A sope-gdl1/Oracle8/README A sope-gdl1/Oracle8/Version A sope-gdl1/Oracle8/condict.plist A sope-gdl1/Oracle8/err.h A sope-gdl1/Oracle8/err.m A sope-gdl1/Oracle8/obj/EOAttribute+Oracle.d A sope-gdl1/Oracle8/obj/OracleAdaptor.d A sope-gdl1/Oracle8/obj/OracleAdaptorChannel.d A sope-gdl1/Oracle8/obj/OracleAdaptorChannelController.d A sope-gdl1/Oracle8/obj/OracleAdaptorContext.d A sope-gdl1/Oracle8/obj/OracleSQLExpression.d A sope-gdl1/Oracle8/obj/OracleValues.d A sope-gdl1/Oracle8/obj/err.d A sope-gdl1/Oracle8/otest.m A sope-gdl1/PostgreSQL/COPYING A sope-gdl1/PostgreSQL/COPYING.LIB A sope-gdl1/PostgreSQL/ChangeLog A sope-gdl1/PostgreSQL/EOAttribute+PostgreSQL72.h A sope-gdl1/PostgreSQL/EOAttribute+PostgreSQL72.m A sope-gdl1/PostgreSQL/EOKeyGlobalID+PGVal.m A sope-gdl1/PostgreSQL/GNUmakefile A sope-gdl1/PostgreSQL/GNUmakefile.preamble A sope-gdl1/PostgreSQL/NSCalendarDate+PGVal.m A sope-gdl1/PostgreSQL/NSData+PGVal.m A sope-gdl1/PostgreSQL/NSNull+PGVal.m A sope-gdl1/PostgreSQL/NSNumber+ExprValue.m A sope-gdl1/PostgreSQL/NSNumber+PGVal.m A sope-gdl1/PostgreSQL/NSString+PGVal.m A sope-gdl1/PostgreSQL/NSString+PostgreSQL72.h A sope-gdl1/PostgreSQL/NSString+PostgreSQL72.m A sope-gdl1/PostgreSQL/PGConnection.h A sope-gdl1/PostgreSQL/PGConnection.m A sope-gdl1/PostgreSQL/PGResultSet.m A sope-gdl1/PostgreSQL/PostgreSQL-Info.plist A sope-gdl1/PostgreSQL/PostgreSQL.xcodeproj/project.pbxproj A sope-gdl1/PostgreSQL/PostgreSQL72Adaptor.h A sope-gdl1/PostgreSQL/PostgreSQL72Adaptor.m A sope-gdl1/PostgreSQL/PostgreSQL72Channel+Model.h A sope-gdl1/PostgreSQL/PostgreSQL72Channel+Model.m A sope-gdl1/PostgreSQL/PostgreSQL72Channel.h A sope-gdl1/PostgreSQL/PostgreSQL72Channel.m A sope-gdl1/PostgreSQL/PostgreSQL72Context.h A sope-gdl1/PostgreSQL/PostgreSQL72Context.m A sope-gdl1/PostgreSQL/PostgreSQL72DataTypeMappingException.m A sope-gdl1/PostgreSQL/PostgreSQL72Exception.h A sope-gdl1/PostgreSQL/PostgreSQL72Exception.m A sope-gdl1/PostgreSQL/PostgreSQL72Expression.h A sope-gdl1/PostgreSQL/PostgreSQL72Expression.m A sope-gdl1/PostgreSQL/PostgreSQL72Values.h A sope-gdl1/PostgreSQL/README A sope-gdl1/PostgreSQL/TODO A sope-gdl1/PostgreSQL/Version A sope-gdl1/PostgreSQL/common.h A sope-gdl1/PostgreSQL/condict.plist A sope-gdl1/PostgreSQL/fhs.make A sope-gdl1/PostgreSQL/gdltest.m A sope-gdl1/PostgreSQL/pgconfig.h A sope-gdl1/PostgreSQL/postgres_types.h A sope-gdl1/PostgreSQL/test.eomodel A sope-gdl1/PostgreSQL/types.psql A sope-gdl1/README-OSX.txt A sope-gdl1/SQLite3/COPYING.LIB A sope-gdl1/SQLite3/ChangeLog A sope-gdl1/SQLite3/EOAttribute+SQLite.h A sope-gdl1/SQLite3/EOAttribute+SQLite.m A sope-gdl1/SQLite3/GNUmakefile A sope-gdl1/SQLite3/GNUmakefile.preamble A sope-gdl1/SQLite3/NSCalendarDate+SQLiteVal.m A sope-gdl1/SQLite3/NSData+SQLiteVal.m A sope-gdl1/SQLite3/NSNumber+SQLiteVal.m A sope-gdl1/SQLite3/NSString+SQLite.h A sope-gdl1/SQLite3/NSString+SQLite.m A sope-gdl1/SQLite3/NSString+SQLiteVal.m A sope-gdl1/SQLite3/README A sope-gdl1/SQLite3/SQLite3-Info.plist A sope-gdl1/SQLite3/SQLite3.xcodeproj/project.pbxproj A sope-gdl1/SQLite3/SQLiteAdaptor.h A sope-gdl1/SQLite3/SQLiteAdaptor.m A sope-gdl1/SQLite3/SQLiteChannel+Model.h A sope-gdl1/SQLite3/SQLiteChannel+Model.m A sope-gdl1/SQLite3/SQLiteChannel.h A sope-gdl1/SQLite3/SQLiteChannel.m A sope-gdl1/SQLite3/SQLiteContext.h A sope-gdl1/SQLite3/SQLiteContext.m A sope-gdl1/SQLite3/SQLiteException.h A sope-gdl1/SQLite3/SQLiteException.m A sope-gdl1/SQLite3/SQLiteExpression.h A sope-gdl1/SQLite3/SQLiteExpression.m A sope-gdl1/SQLite3/SQLiteValues.h A sope-gdl1/SQLite3/SQLiteValues.m A sope-gdl1/SQLite3/Version A sope-gdl1/SQLite3/common.h A sope-gdl1/SQLite3/condict.plist A sope-gdl1/SQLite3/fhs.make A sope-gdl1/SQLite3/gdltest.m A sope-gdl1/SQLite3/test.eomodel A sope-gdl1/Version A sope-gdl1/common.make A sope-gdl1/sope-gdl1.xcodeproj/project.pbxproj A sope-ical/ChangeLog A sope-ical/GNUmakefile A sope-ical/NGiCal/COPYING A sope-ical/NGiCal/COPYRIGHT A sope-ical/NGiCal/ChangeLog A sope-ical/NGiCal/GNUmakefile A sope-ical/NGiCal/GNUmakefile.postamble A sope-ical/NGiCal/GNUmakefile.preamble A sope-ical/NGiCal/IcalElements.m A sope-ical/NGiCal/IcalResponse.h A sope-ical/NGiCal/IcalResponse.m A sope-ical/NGiCal/NGICalSaxHandler.h A sope-ical/NGiCal/NGICalSaxHandler.m A sope-ical/NGiCal/NGVCard.h A sope-ical/NGiCal/NGVCard.m A sope-ical/NGiCal/NGVCardAddress.h A sope-ical/NGiCal/NGVCardAddress.m A sope-ical/NGiCal/NGVCardName.h A sope-ical/NGiCal/NGVCardName.m A sope-ical/NGiCal/NGVCardOrg.h A sope-ical/NGiCal/NGVCardOrg.m A sope-ical/NGiCal/NGVCardPhone.h A sope-ical/NGiCal/NGVCardPhone.m A sope-ical/NGiCal/NGVCardSaxHandler.h A sope-ical/NGiCal/NGVCardSaxHandler.m A sope-ical/NGiCal/NGVCardSimpleValue.h A sope-ical/NGiCal/NGVCardSimpleValue.m A sope-ical/NGiCal/NGVCardStrArrayValue.h A sope-ical/NGiCal/NGVCardStrArrayValue.m A sope-ical/NGiCal/NGVCardValue.h A sope-ical/NGiCal/NGVCardValue.m A sope-ical/NGiCal/NGiCal-Info.plist A sope-ical/NGiCal/NGiCal.h A sope-ical/NGiCal/NGiCal.xcodeproj/project.pbxproj A sope-ical/NGiCal/NGiCal.xmap A sope-ical/NGiCal/NSCalendarDate+ICal.h A sope-ical/NGiCal/NSCalendarDate+ICal.m A sope-ical/NGiCal/NSString+ICal.h A sope-ical/NGiCal/NSString+ICal.m A sope-ical/NGiCal/README A sope-ical/NGiCal/Version A sope-ical/NGiCal/common.h A sope-ical/NGiCal/fhs.make A sope-ical/NGiCal/iCalAlarm.h A sope-ical/NGiCal/iCalAlarm.m A sope-ical/NGiCal/iCalAttachment.h A sope-ical/NGiCal/iCalAttachment.m A sope-ical/NGiCal/iCalCalendar.h A sope-ical/NGiCal/iCalCalendar.m A sope-ical/NGiCal/iCalDailyRecurrenceCalculator.m A sope-ical/NGiCal/iCalDataSource.h A sope-ical/NGiCal/iCalDataSource.m A sope-ical/NGiCal/iCalDateHolder.h A sope-ical/NGiCal/iCalDateHolder.m A sope-ical/NGiCal/iCalDuration.h A sope-ical/NGiCal/iCalDuration.m A sope-ical/NGiCal/iCalEntityObject.h A sope-ical/NGiCal/iCalEntityObject.m A sope-ical/NGiCal/iCalEvent.h A sope-ical/NGiCal/iCalEvent.m A sope-ical/NGiCal/iCalEventChanges.h A sope-ical/NGiCal/iCalEventChanges.m A sope-ical/NGiCal/iCalFreeBusy.h A sope-ical/NGiCal/iCalFreeBusy.m A sope-ical/NGiCal/iCalJournal.h A sope-ical/NGiCal/iCalJournal.m A sope-ical/NGiCal/iCalMonthlyRecurrenceCalculator.m A sope-ical/NGiCal/iCalObject.h A sope-ical/NGiCal/iCalObject.m A sope-ical/NGiCal/iCalPerson.h A sope-ical/NGiCal/iCalPerson.m A sope-ical/NGiCal/iCalRecurrenceCalculator.h A sope-ical/NGiCal/iCalRecurrenceCalculator.m A sope-ical/NGiCal/iCalRecurrenceRule.h A sope-ical/NGiCal/iCalRecurrenceRule.m A sope-ical/NGiCal/iCalRenderer.h A sope-ical/NGiCal/iCalRenderer.m A sope-ical/NGiCal/iCalRepeatableEntityObject.h A sope-ical/NGiCal/iCalRepeatableEntityObject.m A sope-ical/NGiCal/iCalToDo.h A sope-ical/NGiCal/iCalToDo.m A sope-ical/NGiCal/iCalTrigger.h A sope-ical/NGiCal/iCalTrigger.m A sope-ical/NGiCal/iCalWeeklyRecurrenceCalculator.m A sope-ical/NGiCal/iCalYearlyRecurrenceCalculator.m A sope-ical/NGiCal/tests/NGiCalTests-Info.plist A sope-ical/NGiCal/tests/README A sope-ical/NGiCal/tests/common.h A sope-ical/NGiCal/tests/iCalRecurrenceCalculatorTests.m A sope-ical/README A sope-ical/README-OSX.txt A sope-ical/data/apple-fullrecord.vcf A sope-ical/data/chandler4979-trumba-tz1.ics A sope-ical/data/evo22-fullrecord.vcf A sope-ical/data/evo22-fulltask.ics A sope-ical/data/evo26-bug1714-wrapline-1.ics A sope-ical/data/evo26-multilinefields1-bug1714.ics A sope-ical/data/inv-simple1.vcf A sope-ical/data/kab41-vcard-full.vcf A sope-ical/data/kabc34-fullrecord.vcf A sope-ical/data/kde-vcard-bug1594.vcf A sope-ical/data/kde-vcard1.vcf A sope-ical/data/kde-vcard2-ns.vcf A sope-ical/data/kde-vcard3-moz.vcf A sope-ical/data/kde-vcard4-evo.vcf A sope-ical/data/kde-vcard5.vcf A sope-ical/data/kde-vcard6.vcf A sope-ical/data/kolab-contact-AWsUn40yOr.eml A sope-ical/data/kolab-event-libkcal-1899114701.872.eml A sope-ical/data/kolab-todo-libkcal-595002338.801.eml A sope-ical/data/korg-342-meeting.ics A sope-ical/data/korg-allday-bug1585.ics A sope-ical/data/korg34-fulltask.ics A sope-ical/data/outlook2002.vcf A sope-ical/data/synthesis-syncml1.xml A sope-ical/data/tb203-full-John_Doe.vcf A sope-ical/data/test-noodle1.ics A sope-ical/data/test1-libical.txt A sope-ical/data/test1.ics A sope-ical/data/test2-libical.txt A sope-ical/data/test2.vfb A sope-ical/data/test3-libical.txt A sope-ical/data/test3.ics A sope-ical/data/test4-libical.txt A sope-ical/data/test4.ics A sope-ical/data/test5-entourage.ics A sope-ical/data/test5-libical.txt A sope-ical/data/test6-appleical.ics A sope-ical/data/test6-libical.txt A sope-ical/samples/COPYING A sope-ical/samples/ChangeLog A sope-ical/samples/GNUmakefile A sope-ical/samples/GNUmakefile.preamble A sope-ical/samples/README A sope-ical/samples/common.h A sope-ical/samples/fhs.make A sope-ical/samples/icalds.m A sope-ical/samples/icalparsetest.m A sope-ical/samples/ievalrrule.m A sope-ical/samples/vcf2xml.m A sope-ical/samples/vcfparsetest.m A sope-ical/sope-ical.xcodeproj/project.pbxproj A sope-ical/versitSaxDriver/AUTHORS A sope-ical/versitSaxDriver/COPYING A sope-ical/versitSaxDriver/COPYRIGHT A sope-ical/versitSaxDriver/ChangeLog A sope-ical/versitSaxDriver/GNUmakefile A sope-ical/versitSaxDriver/GNUmakefile.postamble A sope-ical/versitSaxDriver/GNUmakefile.preamble A sope-ical/versitSaxDriver/README A sope-ical/versitSaxDriver/VSSaxDriver.h A sope-ical/versitSaxDriver/VSSaxDriver.m A sope-ical/versitSaxDriver/VSStringFormatter.h A sope-ical/versitSaxDriver/VSStringFormatter.m A sope-ical/versitSaxDriver/VSiCalSaxDriver.h A sope-ical/versitSaxDriver/VSiCalSaxDriver.m A sope-ical/versitSaxDriver/VSvCardSaxDriver.h A sope-ical/versitSaxDriver/VSvCardSaxDriver.m A sope-ical/versitSaxDriver/Version A sope-ical/versitSaxDriver/bundle-info.plist A sope-ical/versitSaxDriver/common.h A sope-ical/versitSaxDriver/fhs.make A sope-ical/versitSaxDriver/versitSaxDriver-Info.plist A sope-ical/versitSaxDriver/versitSaxDriver.xcodeproj/project.pbxproj A sope-ldap/GNUmakefile A sope-ldap/NGLdap/COPYING A sope-ldap/NGLdap/COPYRIGHT A sope-ldap/NGLdap/ChangeLog A sope-ldap/NGLdap/EOQualifier+LDAP.h A sope-ldap/NGLdap/EOQualifier+LDAP.m A sope-ldap/NGLdap/GNUmakefile A sope-ldap/NGLdap/GNUmakefile.preamble A sope-ldap/NGLdap/NGLdap-Info.plist A sope-ldap/NGLdap/NGLdap.h A sope-ldap/NGLdap/NGLdap.xcodeproj/project.pbxproj A sope-ldap/NGLdap/NGLdapAttribute.h A sope-ldap/NGLdap/NGLdapAttribute.m A sope-ldap/NGLdap/NGLdapConnection+Private.h A sope-ldap/NGLdap/NGLdapConnection.h A sope-ldap/NGLdap/NGLdapConnection.m A sope-ldap/NGLdap/NGLdapDataSource.h A sope-ldap/NGLdap/NGLdapDataSource.m A sope-ldap/NGLdap/NGLdapEntry.h A sope-ldap/NGLdap/NGLdapEntry.m A sope-ldap/NGLdap/NGLdapFileManager.h A sope-ldap/NGLdap/NGLdapFileManager.m A sope-ldap/NGLdap/NGLdapGlobalID.h A sope-ldap/NGLdap/NGLdapGlobalID.m A sope-ldap/NGLdap/NGLdapModification.h A sope-ldap/NGLdap/NGLdapModification.m A sope-ldap/NGLdap/NGLdapSearchResultEnumerator.h A sope-ldap/NGLdap/NGLdapSearchResultEnumerator.m A sope-ldap/NGLdap/NGLdapURL.h A sope-ldap/NGLdap/NGLdapURL.m A sope-ldap/NGLdap/NSString+DN.h A sope-ldap/NGLdap/NSString+DN.m A sope-ldap/NGLdap/README A sope-ldap/NGLdap/Version A sope-ldap/NGLdap/common.h A sope-ldap/NGLdap/fhs.make A sope-ldap/README-OSX.txt A sope-ldap/samples/COPYING A sope-ldap/samples/ChangeLog A sope-ldap/samples/GNUmakefile A sope-ldap/samples/GNUmakefile.preamble A sope-ldap/samples/README A sope-ldap/samples/common.h A sope-ldap/samples/fhs.make A sope-ldap/samples/ldap2dsml.m A sope-ldap/samples/ldapchkpwd.m A sope-ldap/samples/ldapls.m A sope-ldap/samples/pwd-check.m A sope-ldap/sope-ldap.xcodeproj/project.pbxproj A sope-mime/ChangeLog A sope-mime/GNUmakefile A sope-mime/GNUmakefile.preamble A sope-mime/NGImap4/COPYING A sope-mime/NGImap4/ChangeLog A sope-mime/NGImap4/EOQualifier+IMAPAdditions.m A sope-mime/NGImap4/EOSortOrdering+IMAPAdditions.m A sope-mime/NGImap4/GNUmakefile A sope-mime/NGImap4/GNUmakefile.preamble A sope-mime/NGImap4/NGImap4-Info.plist A sope-mime/NGImap4/NGImap4.h A sope-mime/NGImap4/NGImap4.m A sope-mime/NGImap4/NGImap4.xcodeproj/project.pbxproj A sope-mime/NGImap4/NGImap4Client.h A sope-mime/NGImap4/NGImap4Client.m A sope-mime/NGImap4/NGImap4Connection.h A sope-mime/NGImap4/NGImap4Connection.m A sope-mime/NGImap4/NGImap4ConnectionManager.h A sope-mime/NGImap4/NGImap4ConnectionManager.m A sope-mime/NGImap4/NGImap4Context.h A sope-mime/NGImap4/NGImap4Context.m A sope-mime/NGImap4/NGImap4DataSource.h A sope-mime/NGImap4/NGImap4DataSource.m A sope-mime/NGImap4/NGImap4Envelope.h A sope-mime/NGImap4/NGImap4Envelope.m A sope-mime/NGImap4/NGImap4EnvelopeAddress.h A sope-mime/NGImap4/NGImap4EnvelopeAddress.m A sope-mime/NGImap4/NGImap4FileManager.h A sope-mime/NGImap4/NGImap4FileManager.m A sope-mime/NGImap4/NGImap4Folder.h A sope-mime/NGImap4/NGImap4Folder.m A sope-mime/NGImap4/NGImap4FolderFlags.h A sope-mime/NGImap4/NGImap4FolderFlags.m A sope-mime/NGImap4/NGImap4FolderGlobalID.h A sope-mime/NGImap4/NGImap4FolderGlobalID.m A sope-mime/NGImap4/NGImap4FolderMailRegistry.h A sope-mime/NGImap4/NGImap4FolderMailRegistry.m A sope-mime/NGImap4/NGImap4Functions.h A sope-mime/NGImap4/NGImap4Functions.m A sope-mime/NGImap4/NGImap4MailboxInfo.h A sope-mime/NGImap4/NGImap4MailboxInfo.m A sope-mime/NGImap4/NGImap4Message+BodyStructure.h A sope-mime/NGImap4/NGImap4Message.h A sope-mime/NGImap4/NGImap4Message.m A sope-mime/NGImap4/NGImap4MessageGlobalID.h A sope-mime/NGImap4/NGImap4MessageGlobalID.m A sope-mime/NGImap4/NGImap4ResponseNormalizer.h A sope-mime/NGImap4/NGImap4ResponseNormalizer.m A sope-mime/NGImap4/NGImap4ResponseParser.h A sope-mime/NGImap4/NGImap4ResponseParser.m A sope-mime/NGImap4/NGImap4ServerGlobalID.h A sope-mime/NGImap4/NGImap4ServerGlobalID.m A sope-mime/NGImap4/NGImap4ServerRoot.h A sope-mime/NGImap4/NGImap4ServerRoot.m A sope-mime/NGImap4/NGImap4Support.h A sope-mime/NGImap4/NGImap4Support.m A sope-mime/NGImap4/NGSieveClient.h A sope-mime/NGImap4/NGSieveClient.m A sope-mime/NGImap4/NSString+Imap4.h A sope-mime/NGImap4/NSString+Imap4.m A sope-mime/NGImap4/README A sope-mime/NGImap4/SxCore-NGImap4Flow.graffle A sope-mime/NGImap4/TODO A sope-mime/NGImap4/imCommon.h A sope-mime/NGImap4/imTimeMacros.h A sope-mime/NGMail/COPYING A sope-mime/NGMail/ChangeLog A sope-mime/NGMail/GNUmakefile A sope-mime/NGMail/GNUmakefile.preamble A sope-mime/NGMail/NGMBoxReader.h A sope-mime/NGMail/NGMBoxReader.m A sope-mime/NGMail/NGMail-Info.plist A sope-mime/NGMail/NGMail.h A sope-mime/NGMail/NGMail.m A sope-mime/NGMail/NGMail.xcodeproj/project.pbxproj A sope-mime/NGMail/NGMailAddress.h A sope-mime/NGMail/NGMailAddress.m A sope-mime/NGMail/NGMailAddressList.h A sope-mime/NGMail/NGMailAddressList.m A sope-mime/NGMail/NGMailAddressParser.h A sope-mime/NGMail/NGMailAddressParser.m A sope-mime/NGMail/NGMailBase64Encoding.m A sope-mime/NGMail/NGMailDecls.h A sope-mime/NGMail/NGMimeMessage.h A sope-mime/NGMail/NGMimeMessage.m A sope-mime/NGMail/NGMimeMessageBodyGenerator.m A sope-mime/NGMail/NGMimeMessageGenerator.h A sope-mime/NGMail/NGMimeMessageGenerator.m A sope-mime/NGMail/NGMimeMessageMultipartBodyGenerator.m A sope-mime/NGMail/NGMimeMessageParser.h A sope-mime/NGMail/NGMimeMessageParser.m A sope-mime/NGMail/NGMimeMessageRfc822BodyGenerator.m A sope-mime/NGMail/NGMimeMessageTextBodyGenerator.m A sope-mime/NGMail/NGPop3Client.h A sope-mime/NGMail/NGPop3Client.m A sope-mime/NGMail/NGPop3Support.h A sope-mime/NGMail/NGPop3Support.m A sope-mime/NGMail/NGSendMail.h A sope-mime/NGMail/NGSendMail.m A sope-mime/NGMail/NGSmtpClient.h A sope-mime/NGMail/NGSmtpClient.m A sope-mime/NGMail/NGSmtpReplyCodes.h A sope-mime/NGMail/NGSmtpSupport.h A sope-mime/NGMail/NGSmtpSupport.m A sope-mime/NGMail/NSData+MimeQP.m A sope-mime/NGMail/README A sope-mime/NGMail/common.h A sope-mime/NGMail/libNGMail.def A sope-mime/NGMime/COPYING A sope-mime/NGMime/COPYRIGHT A sope-mime/NGMime/ChangeLog A sope-mime/NGMime/GNUmakefile A sope-mime/NGMime/GNUmakefile.preamble A sope-mime/NGMime/NGConcreteMimeType.h A sope-mime/NGMime/NGConcreteMimeType.m A sope-mime/NGMime/NGMime-Info.plist A sope-mime/NGMime/NGMime.h A sope-mime/NGMime/NGMime.m A sope-mime/NGMime/NGMime.xcodeproj/project.pbxproj A sope-mime/NGMime/NGMimeAddressHeaderFieldGenerator.m A sope-mime/NGMime/NGMimeBodyGenerator.h A sope-mime/NGMime/NGMimeBodyGenerator.m A sope-mime/NGMime/NGMimeBodyParser.h A sope-mime/NGMime/NGMimeBodyParser.m A sope-mime/NGMime/NGMimeBodyPart.h A sope-mime/NGMime/NGMimeBodyPart.m A sope-mime/NGMime/NGMimeBodyPartParser.h A sope-mime/NGMime/NGMimeBodyPartParser.m A sope-mime/NGMime/NGMimeContentDispositionHeaderFieldGenerator.m A sope-mime/NGMime/NGMimeContentDispositionHeaderFieldParser.m A sope-mime/NGMime/NGMimeContentLengthHeaderFieldGenerator.m A sope-mime/NGMime/NGMimeContentLengthHeaderFieldParser.m A sope-mime/NGMime/NGMimeContentTypeHeaderFieldGenerator.m A sope-mime/NGMime/NGMimeContentTypeHeaderFieldParser.m A sope-mime/NGMime/NGMimeDecls.h A sope-mime/NGMime/NGMimeExceptions.h A sope-mime/NGMime/NGMimeExceptions.m A sope-mime/NGMime/NGMimeFileData.h A sope-mime/NGMime/NGMimeFileData.m A sope-mime/NGMime/NGMimeGeneratorProtocols.h A sope-mime/NGMime/NGMimeHeaderFieldGenerator.h A sope-mime/NGMime/NGMimeHeaderFieldGenerator.m A sope-mime/NGMime/NGMimeHeaderFieldGeneratorSet.m A sope-mime/NGMime/NGMimeHeaderFieldParser.h A sope-mime/NGMime/NGMimeHeaderFieldParser.m A sope-mime/NGMime/NGMimeHeaderFieldParserSet.m A sope-mime/NGMime/NGMimeHeaderFields.h A sope-mime/NGMime/NGMimeHeaderFields.m A sope-mime/NGMime/NGMimeJoinedData.h A sope-mime/NGMime/NGMimeJoinedData.m A sope-mime/NGMime/NGMimeMultipartBody.h A sope-mime/NGMime/NGMimeMultipartBody.m A sope-mime/NGMime/NGMimeMultipartBodyGenerator.m A sope-mime/NGMime/NGMimeMultipartBodyParser.m A sope-mime/NGMime/NGMimePartGenerator.h A sope-mime/NGMime/NGMimePartGenerator.m A sope-mime/NGMime/NGMimePartParser.h A sope-mime/NGMime/NGMimePartParser.m A sope-mime/NGMime/NGMimeRFC822DateHeaderFieldGenerator.m A sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m A sope-mime/NGMime/NGMimeRfc822BodyGenerator.m A sope-mime/NGMime/NGMimeStringHeaderFieldGenerator.m A sope-mime/NGMime/NGMimeStringHeaderFieldParser.m A sope-mime/NGMime/NGMimeTextBodyGenerator.m A sope-mime/NGMime/NGMimeType.h A sope-mime/NGMime/NGMimeType.m A sope-mime/NGMime/NGMimeUtilities.h A sope-mime/NGMime/NGMimeUtilities.m A sope-mime/NGMime/NGPart.h A sope-mime/NGMime/NGPart.m A sope-mime/NGMime/NSCalendarDate+RFC822.m A sope-mime/NGMime/README A sope-mime/NGMime/SxCore-NGMime.graffle A sope-mime/NGMime/TODO A sope-mime/NGMime/common.h A sope-mime/NGMime/libNGMime.def A sope-mime/NGMime/timeMacros.h A sope-mime/README-OSX.txt A sope-mime/Version A sope-mime/fhs.make A sope-mime/samples/COPYING A sope-mime/samples/ChangeLog A sope-mime/samples/GNUmakefile A sope-mime/samples/GNUmakefile.preamble A sope-mime/samples/ImapListTool.h A sope-mime/samples/ImapListTool.m A sope-mime/samples/ImapQuotaTool.h A sope-mime/samples/ImapQuotaTool.m A sope-mime/samples/ImapTool.h A sope-mime/samples/ImapTool.m A sope-mime/samples/Mime2XmlTool.h A sope-mime/samples/Mime2XmlTool.m A sope-mime/samples/README A sope-mime/samples/data/bug883_at205.mail A sope-mime/samples/fhs.make A sope-mime/samples/imap_tool.m A sope-mime/samples/imapacl.m A sope-mime/samples/imapcontest.m A sope-mime/samples/imapls.m A sope-mime/samples/imapquota.m A sope-mime/samples/mime2xml.m A sope-mime/samples/sievetool.m A sope-mime/samples/test_qpdecode.m A sope-mime/sope-mime.xcodeproj/project.pbxproj A sope-xml/COPYING A sope-xml/COPYRIGHT A sope-xml/ChangeLog A sope-xml/ChangeLogSaxDriver/AUTHORS A sope-xml/ChangeLogSaxDriver/COPYING A sope-xml/ChangeLogSaxDriver/COPYRIGHT A sope-xml/ChangeLogSaxDriver/ChangeLog A sope-xml/ChangeLogSaxDriver/ChangeLogSaxDriver.h A sope-xml/ChangeLogSaxDriver/ChangeLogSaxDriver.m A sope-xml/ChangeLogSaxDriver/ChangeLogSaxDriver.xcodeproj/project.pbxproj A sope-xml/ChangeLogSaxDriver/GNUmakefile A sope-xml/ChangeLogSaxDriver/GNUmakefile.postamble A sope-xml/ChangeLogSaxDriver/GNUmakefile.preamble A sope-xml/ChangeLogSaxDriver/Info.plist A sope-xml/ChangeLogSaxDriver/NSCalendarDate+Extensions.h A sope-xml/ChangeLogSaxDriver/NSCalendarDate+Extensions.m A sope-xml/ChangeLogSaxDriver/NSString+Extensions.h A sope-xml/ChangeLogSaxDriver/NSString+Extensions.m A sope-xml/ChangeLogSaxDriver/README A sope-xml/ChangeLogSaxDriver/Version A sope-xml/ChangeLogSaxDriver/bundle-info.plist A sope-xml/ChangeLogSaxDriver/common.h A sope-xml/ChangeLogSaxDriver/default.locale A sope-xml/ChangeLogSaxDriver/fhs.make A sope-xml/ChangeLogSaxDriver/version.plist A sope-xml/DOM/COPYING A sope-xml/DOM/COPYRIGHT A sope-xml/DOM/ChangeLog A sope-xml/DOM/DOM+JS.m A sope-xml/DOM/DOM-Info.plist A sope-xml/DOM/DOM.h A sope-xml/DOM/DOM.xcodeproj/project.pbxproj A sope-xml/DOM/DOMAttribute.h A sope-xml/DOM/DOMAttribute.m A sope-xml/DOM/DOMBuilder.h A sope-xml/DOM/DOMBuilderFactory.h A sope-xml/DOM/DOMBuilderFactory.m A sope-xml/DOM/DOMCDATASection.h A sope-xml/DOM/DOMCDATASection.m A sope-xml/DOM/DOMCharacterData.h A sope-xml/DOM/DOMCharacterData.m A sope-xml/DOM/DOMComment.h A sope-xml/DOM/DOMComment.m A sope-xml/DOM/DOMDocument+factory.m A sope-xml/DOM/DOMDocument.h A sope-xml/DOM/DOMDocument.m A sope-xml/DOM/DOMDocumentBuilder.h A sope-xml/DOM/DOMDocumentFragment.h A sope-xml/DOM/DOMDocumentFragment.m A sope-xml/DOM/DOMDocumentType.h A sope-xml/DOM/DOMDocumentType.m A sope-xml/DOM/DOMElement.h A sope-xml/DOM/DOMElement.m A sope-xml/DOM/DOMEntity.h A sope-xml/DOM/DOMEntity.m A sope-xml/DOM/DOMEntityReference.h A sope-xml/DOM/DOMEntityReference.m A sope-xml/DOM/DOMImplementation.h A sope-xml/DOM/DOMImplementation.m A sope-xml/DOM/DOMNamedNodeMap.h A sope-xml/DOM/DOMNode+Enum.h A sope-xml/DOM/DOMNode+Enum.m A sope-xml/DOM/DOMNode+QPEval.m A sope-xml/DOM/DOMNode+QueryPath.h A sope-xml/DOM/DOMNode+QueryPath.m A sope-xml/DOM/DOMNode.h A sope-xml/DOM/DOMNode.m A sope-xml/DOM/DOMNodeFilter.h A sope-xml/DOM/DOMNodeFilter.m A sope-xml/DOM/DOMNodeIterator.h A sope-xml/DOM/DOMNodeIterator.m A sope-xml/DOM/DOMNodeWalker.h A sope-xml/DOM/DOMNodeWalker.m A sope-xml/DOM/DOMNodeWithChildren.m A sope-xml/DOM/DOMNotation.h A sope-xml/DOM/DOMNotation.m A sope-xml/DOM/DOMPYXOutputter.h A sope-xml/DOM/DOMPYXOutputter.m A sope-xml/DOM/DOMProcessingInstruction.h A sope-xml/DOM/DOMProcessingInstruction.m A sope-xml/DOM/DOMProtocols.h A sope-xml/DOM/DOMQueryPathExpression.h A sope-xml/DOM/DOMQueryPathExpression.m A sope-xml/DOM/DOMSaxBuilder.h A sope-xml/DOM/DOMSaxBuilder.m A sope-xml/DOM/DOMSaxHandler.h A sope-xml/DOM/DOMSaxHandler.m A sope-xml/DOM/DOMText.h A sope-xml/DOM/DOMText.m A sope-xml/DOM/DOMTreeWalker.h A sope-xml/DOM/DOMTreeWalker.m A sope-xml/DOM/DOMXMLOutputter.h A sope-xml/DOM/DOMXMLOutputter.m A sope-xml/DOM/EDOM.h A sope-xml/DOM/GNUmakefile A sope-xml/DOM/GNUmakefile.preamble A sope-xml/DOM/NSObject+DOM.m A sope-xml/DOM/NSObject+QPEval.h A sope-xml/DOM/NSObject+QPEval.m A sope-xml/DOM/NSObject+StringValue.h A sope-xml/DOM/NSObject+StringValue.m A sope-xml/DOM/README A sope-xml/DOM/SxXML-DOM.graffle A sope-xml/DOM/TODO A sope-xml/DOM/Version A sope-xml/DOM/common.h A sope-xml/DOM/fhs.make A sope-xml/GNUmakefile A sope-xml/PROJECTLEAD A sope-xml/README A sope-xml/README-OSX.txt A sope-xml/STXSaxDriver/COPYING.LIB A sope-xml/STXSaxDriver/COPYRIGHT A sope-xml/STXSaxDriver/ChangeLog A sope-xml/STXSaxDriver/ExtraSTX/COPYRIGHT A sope-xml/STXSaxDriver/ExtraSTX/GNUmakefile A sope-xml/STXSaxDriver/ExtraSTX/NSString+STX.h A sope-xml/STXSaxDriver/ExtraSTX/NSString+STX.m A sope-xml/STXSaxDriver/ExtraSTX/README A sope-xml/STXSaxDriver/ExtraSTX/StructuredLine.h A sope-xml/STXSaxDriver/ExtraSTX/StructuredLine.m A sope-xml/STXSaxDriver/ExtraSTX/StructuredStack.h A sope-xml/STXSaxDriver/ExtraSTX/StructuredStack.m A sope-xml/STXSaxDriver/ExtraSTX/StructuredText.h A sope-xml/STXSaxDriver/ExtraSTX/StructuredText.m A sope-xml/STXSaxDriver/ExtraSTX/StructuredTextRenderingDelegate.h A sope-xml/STXSaxDriver/ExtraSTX/StructuredText_XHTML.h A sope-xml/STXSaxDriver/ExtraSTX/StructuredText_XHTML.m A sope-xml/STXSaxDriver/ExtraSTX/common.h A sope-xml/STXSaxDriver/GNUmakefile A sope-xml/STXSaxDriver/GNUmakefile.postamble A sope-xml/STXSaxDriver/GNUmakefile.preamble A sope-xml/STXSaxDriver/Model/COPYRIGHT A sope-xml/STXSaxDriver/Model/GNUmakefile A sope-xml/STXSaxDriver/Model/README A sope-xml/STXSaxDriver/Model/StructuredTextBodyElement.h A sope-xml/STXSaxDriver/Model/StructuredTextBodyElement.m A sope-xml/STXSaxDriver/Model/StructuredTextDocument.h A sope-xml/STXSaxDriver/Model/StructuredTextDocument.m A sope-xml/STXSaxDriver/Model/StructuredTextHeader.h A sope-xml/STXSaxDriver/Model/StructuredTextHeader.m A sope-xml/STXSaxDriver/Model/StructuredTextList.h A sope-xml/STXSaxDriver/Model/StructuredTextList.m A sope-xml/STXSaxDriver/Model/StructuredTextListItem.h A sope-xml/STXSaxDriver/Model/StructuredTextListItem.m A sope-xml/STXSaxDriver/Model/StructuredTextLiteralBlock.h A sope-xml/STXSaxDriver/Model/StructuredTextLiteralBlock.m A sope-xml/STXSaxDriver/Model/StructuredTextParagraph.h A sope-xml/STXSaxDriver/Model/StructuredTextParagraph.m A sope-xml/STXSaxDriver/Model/common.h A sope-xml/STXSaxDriver/README A sope-xml/STXSaxDriver/STXSaxDriver-Info.plist A sope-xml/STXSaxDriver/STXSaxDriver.h A sope-xml/STXSaxDriver/STXSaxDriver.m A sope-xml/STXSaxDriver/STXSaxDriver.xcodeproj/project.pbxproj A sope-xml/STXSaxDriver/StructuredTextBodyElement+SAX.m A sope-xml/STXSaxDriver/TODO A sope-xml/STXSaxDriver/Version A sope-xml/STXSaxDriver/bundle-info.plist A sope-xml/STXSaxDriver/common.h A sope-xml/STXSaxDriver/data/extra_test1-expect.pyx A sope-xml/STXSaxDriver/data/extra_test1.stx A sope-xml/STXSaxDriver/data/extra_test2-expect.pyx A sope-xml/STXSaxDriver/data/extra_test2.stx A sope-xml/STXSaxDriver/data/hhtest1-expect.pyx A sope-xml/STXSaxDriver/data/hhtest1.stx A sope-xml/STXSaxDriver/data/hhtest2.stx A sope-xml/STXSaxDriver/data/hhtest3-expect.pyx A sope-xml/STXSaxDriver/data/hhtest3.stx A sope-xml/STXSaxDriver/data/znektest1.stx A sope-xml/STXSaxDriver/fhs.make A sope-xml/SaxObjC/COPYING A sope-xml/SaxObjC/COPYRIGHT A sope-xml/SaxObjC/ChangeLog A sope-xml/SaxObjC/GNUmakefile A sope-xml/SaxObjC/GNUmakefile.preamble A sope-xml/SaxObjC/README A sope-xml/SaxObjC/SaxAttributeList.h A sope-xml/SaxObjC/SaxAttributeList.m A sope-xml/SaxObjC/SaxAttributes.h A sope-xml/SaxObjC/SaxAttributes.m A sope-xml/SaxObjC/SaxContentHandler.h A sope-xml/SaxObjC/SaxDTDHandler.h A sope-xml/SaxObjC/SaxDeclHandler.h A sope-xml/SaxObjC/SaxDefaultHandler+NSXML.m A sope-xml/SaxObjC/SaxDefaultHandler.h A sope-xml/SaxObjC/SaxDefaultHandler.m A sope-xml/SaxObjC/SaxDocumentHandler.h A sope-xml/SaxObjC/SaxEntityResolver.h A sope-xml/SaxObjC/SaxErrorHandler.h A sope-xml/SaxObjC/SaxException.h A sope-xml/SaxObjC/SaxException.m A sope-xml/SaxObjC/SaxHandlerBase.h A sope-xml/SaxObjC/SaxHandlerBase.m A sope-xml/SaxObjC/SaxLexicalHandler.h A sope-xml/SaxObjC/SaxLocator.h A sope-xml/SaxObjC/SaxLocator.m A sope-xml/SaxObjC/SaxMethodCallHandler.h A sope-xml/SaxObjC/SaxMethodCallHandler.m A sope-xml/SaxObjC/SaxNamespaceSupport.h A sope-xml/SaxObjC/SaxNamespaceSupport.m A sope-xml/SaxObjC/SaxObjC-Info.plist A sope-xml/SaxObjC/SaxObjC.h A sope-xml/SaxObjC/SaxObjC.xcodeproj/project.pbxproj A sope-xml/SaxObjC/SaxObjectDecoder.h A sope-xml/SaxObjC/SaxObjectDecoder.m A sope-xml/SaxObjC/SaxObjectModel.h A sope-xml/SaxObjC/SaxObjectModel.m A sope-xml/SaxObjC/SaxXMLFilter.h A sope-xml/SaxObjC/SaxXMLFilter.m A sope-xml/SaxObjC/SaxXMLReader.h A sope-xml/SaxObjC/SaxXMLReaderFactory.h A sope-xml/SaxObjC/SaxXMLReaderFactory.m A sope-xml/SaxObjC/SxXML-SaxObjC.graffle A sope-xml/SaxObjC/TODO A sope-xml/SaxObjC/Version A sope-xml/SaxObjC/XMLNamespaces.h A sope-xml/SaxObjC/common.h A sope-xml/SaxObjC/fhs.make A sope-xml/SaxObjC/libSAXObjC.def A sope-xml/SaxObjC/shared_debug_obj/SaxAttributeList.d A sope-xml/SaxObjC/shared_debug_obj/SaxAttributes.d A sope-xml/SaxObjC/shared_debug_obj/SaxDefaultHandler.d A sope-xml/SaxObjC/shared_debug_obj/SaxException.d A sope-xml/SaxObjC/shared_debug_obj/SaxHandlerBase.d A sope-xml/SaxObjC/shared_debug_obj/SaxLocator.d A sope-xml/SaxObjC/shared_debug_obj/SaxMethodCallHandler.d A sope-xml/SaxObjC/shared_debug_obj/SaxNamespaceSupport.d A sope-xml/SaxObjC/shared_debug_obj/SaxObjectDecoder.d A sope-xml/SaxObjC/shared_debug_obj/SaxObjectModel.d A sope-xml/SaxObjC/shared_debug_obj/SaxXMLFilter.d A sope-xml/SaxObjC/shared_debug_obj/SaxXMLReaderFactory.d A sope-xml/SaxObjC/shared_debug_obj/libSaxObjC.so.4.7 A sope-xml/SaxObjC/shared_debug_obj/libSaxObjC.so.4.7.66 A sope-xml/TODO A sope-xml/Version A sope-xml/XmlRpc/COPYING A sope-xml/XmlRpc/COPYRIGHT A sope-xml/XmlRpc/ChangeLog A sope-xml/XmlRpc/GNUmakefile A sope-xml/XmlRpc/GNUmakefile.preamble A sope-xml/XmlRpc/NSArray+XmlRpcCoding.m A sope-xml/XmlRpc/NSData+XmlRpcCoding.m A sope-xml/XmlRpc/NSDate+XmlRpcCoding.m A sope-xml/XmlRpc/NSDictionary+XmlRpcCoding.m A sope-xml/XmlRpc/NSException+XmlRpcCoding.m A sope-xml/XmlRpc/NSHost+XmlRpcCoding.m A sope-xml/XmlRpc/NSMutableString+XmlRpcDecoder.m A sope-xml/XmlRpc/NSNotification+XmlRpcCoding.m A sope-xml/XmlRpc/NSNumber+XmlRpcCoding.m A sope-xml/XmlRpc/NSObject+XmlRpc.h A sope-xml/XmlRpc/NSObject+XmlRpc.m A sope-xml/XmlRpc/NSString+XmlRpcCoding.m A sope-xml/XmlRpc/NSURL+XmlRpcCoding.m A sope-xml/XmlRpc/SxXML-XmlRpc.graffle A sope-xml/XmlRpc/Version A sope-xml/XmlRpc/XmlRpc-Info.plist A sope-xml/XmlRpc/XmlRpc.h A sope-xml/XmlRpc/XmlRpc.xcodeproj/project.pbxproj A sope-xml/XmlRpc/XmlRpcCoder.h A sope-xml/XmlRpc/XmlRpcDecoder.m A sope-xml/XmlRpc/XmlRpcEncoder.m A sope-xml/XmlRpc/XmlRpcMethodCall.h A sope-xml/XmlRpc/XmlRpcMethodCall.m A sope-xml/XmlRpc/XmlRpcMethodResponse.h A sope-xml/XmlRpc/XmlRpcMethodResponse.m A sope-xml/XmlRpc/XmlRpcRequestDecoder.m A sope-xml/XmlRpc/XmlRpcRequestEncoder.m A sope-xml/XmlRpc/XmlRpcResponseDecoder.m A sope-xml/XmlRpc/XmlRpcResponseEncoder.m A sope-xml/XmlRpc/XmlRpcSaxHandler.h A sope-xml/XmlRpc/XmlRpcSaxHandler.m A sope-xml/XmlRpc/XmlRpcValue.h A sope-xml/XmlRpc/XmlRpcValue.m A sope-xml/XmlRpc/common.h A sope-xml/XmlRpc/fhs.make A sope-xml/common.make A sope-xml/dummy.c A sope-xml/libxmlSAXDriver/COPYING A sope-xml/libxmlSAXDriver/COPYRIGHT A sope-xml/libxmlSAXDriver/ChangeLog A sope-xml/libxmlSAXDriver/GNUmakefile A sope-xml/libxmlSAXDriver/GNUmakefile.postamble A sope-xml/libxmlSAXDriver/GNUmakefile.preamble A sope-xml/libxmlSAXDriver/README A sope-xml/libxmlSAXDriver/TableCallbacks.h A sope-xml/libxmlSAXDriver/TableCallbacks.m A sope-xml/libxmlSAXDriver/Version A sope-xml/libxmlSAXDriver/bundle-info.plist A sope-xml/libxmlSAXDriver/common.h A sope-xml/libxmlSAXDriver/fhs.make A sope-xml/libxmlSAXDriver/libxmlDocSAXDriver.h A sope-xml/libxmlSAXDriver/libxmlDocSAXDriver.m A sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.h A sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.m A sope-xml/libxmlSAXDriver/libxmlSAXDriver-Info.plist A sope-xml/libxmlSAXDriver/libxmlSAXDriver.h A sope-xml/libxmlSAXDriver/libxmlSAXDriver.m A sope-xml/libxmlSAXDriver/libxmlSAXDriver.xcodeproj/project.pbxproj A sope-xml/libxmlSAXDriver/libxmlSAXLocator.h A sope-xml/libxmlSAXDriver/libxmlSAXLocator.m A sope-xml/libxmlSAXDriver/unicode.h A sope-xml/pyxSAXDriver/COPYING A sope-xml/pyxSAXDriver/ChangeLog A sope-xml/pyxSAXDriver/GNUmakefile A sope-xml/pyxSAXDriver/GNUmakefile.postamble A sope-xml/pyxSAXDriver/GNUmakefile.preamble A sope-xml/pyxSAXDriver/README A sope-xml/pyxSAXDriver/bundle-info.plist A sope-xml/pyxSAXDriver/fhs.make A sope-xml/pyxSAXDriver/pyxSAXDriver-Info.plist A sope-xml/pyxSAXDriver/pyxSAXDriver.h A sope-xml/pyxSAXDriver/pyxSAXDriver.m A sope-xml/pyxSAXDriver/slashdot.pyx A sope-xml/samples/ChangeLog A sope-xml/samples/GNUmakefile A sope-xml/samples/GNUmakefile.preamble A sope-xml/samples/PlistSaxDriver/GNUmakefile A sope-xml/samples/PlistSaxDriver/PlistSaxDriver.m A sope-xml/samples/PlistSaxDriver/README A sope-xml/samples/PlistSaxDriver/bundle-info.plist A sope-xml/samples/README A sope-xml/samples/common.h A sope-xml/samples/data/Main.xtmpl A sope-xml/samples/data/skyrix-xml.xml A sope-xml/samples/data/slashdot.rss A sope-xml/samples/data/test-digit.xml A sope-xml/samples/domxml.m A sope-xml/samples/fhs.make A sope-xml/samples/rss2plist1.m A sope-xml/samples/rss2plist2.m A sope-xml/samples/rssparse.m A sope-xml/samples/rssparse.xmap A sope-xml/samples/saxxml.m A sope-xml/samples/testqp.m A sope-xml/samples/xmln.m A sope-xml/sope-xml.xcodeproj/project.pbxproj A sope-xml/umbrella.make A sopex/COPYING A sopex/COPYRIGHT A sopex/ChangeLog A sopex/GNUmakefile A sopex/PROJECTLEAD A sopex/README A sopex/README-WebObjects A sopex/SOPEX/CHANGES A sopex/SOPEX/COPYING A sopex/SOPEX/COPYRIGHT A sopex/SOPEX/ChangeLog A sopex/SOPEX/Clean.tiff A sopex/SOPEX/English.lproj/InfoPlist.strings A sopex/SOPEX/English.lproj/Localizable.strings A sopex/SOPEX/English.lproj/SOPEXBrowserController.nib/classes.nib A sopex/SOPEX/English.lproj/SOPEXBrowserController.nib/info.nib A sopex/SOPEX/English.lproj/SOPEXBrowserController.nib/keyedobjects.nib A sopex/SOPEX/English.lproj/SOPEXConsole.nib/classes.nib A sopex/SOPEX/English.lproj/SOPEXConsole.nib/info.nib A sopex/SOPEX/English.lproj/SOPEXConsole.nib/keyedobjects.nib A sopex/SOPEX/English.lproj/SOPEXConsole.toolbar A sopex/SOPEX/English.lproj/SOPEXStatisticsNatLang.plist A sopex/SOPEX/English.lproj/SOPEXStats.nib/classes.nib A sopex/SOPEX/English.lproj/SOPEXStats.nib/info.nib A sopex/SOPEX/English.lproj/SOPEXStats.nib/keyedobjects.nib A sopex/SOPEX/English.lproj/SOPEXWebUI.toolbar A sopex/SOPEX/GNUmakefile A sopex/SOPEX/GNUmakefile.preamble A sopex/SOPEX/Info.plist A sopex/SOPEX/Lori.icns A sopex/SOPEX/NSBundle+Ext.h A sopex/SOPEX/NSBundle+Ext.m A sopex/SOPEX/NSString+Ext.h A sopex/SOPEX/NSString+Ext.m A sopex/SOPEX/PROJECTLEAD A sopex/SOPEX/README A sopex/SOPEX/Reload.tiff A sopex/SOPEX/SOPEX.h A sopex/SOPEX/SOPEX.xcodeproj/project.pbxproj A sopex/SOPEX/SOPEXAppController.h A sopex/SOPEX/SOPEXAppController.m A sopex/SOPEX/SOPEXAuthPanel.h A sopex/SOPEX/SOPEXAuthPanel.m A sopex/SOPEX/SOPEXBrowserController.h A sopex/SOPEX/SOPEXBrowserController.m A sopex/SOPEX/SOPEXBrowserWindow.h A sopex/SOPEX/SOPEXBrowserWindow.m A sopex/SOPEX/SOPEXConsole.h A sopex/SOPEX/SOPEXConsole.m A sopex/SOPEX/SOPEXConsoleAppender.m A sopex/SOPEX/SOPEXConsoleEventFormatter.m A sopex/SOPEX/SOPEXConstants.h A sopex/SOPEX/SOPEXConstants.m A sopex/SOPEX/SOPEXContentValidator.h A sopex/SOPEX/SOPEXContentValidator.m A sopex/SOPEX/SOPEXDocument.h A sopex/SOPEX/SOPEXDocument.m A sopex/SOPEX/SOPEXMain.h A sopex/SOPEX/SOPEXMain.m A sopex/SOPEX/SOPEXRangeUtilities.h A sopex/SOPEX/SOPEXRangeUtilities.m A sopex/SOPEX/SOPEXSheetRunner.h A sopex/SOPEX/SOPEXSheetRunner.m A sopex/SOPEX/SOPEXStatisticsController.h A sopex/SOPEX/SOPEXStatisticsController.m A sopex/SOPEX/SOPEXTextView.h A sopex/SOPEX/SOPEXTextView.m A sopex/SOPEX/SOPEXToolbarController.h A sopex/SOPEX/SOPEXToolbarController.m A sopex/SOPEX/SOPEXWODocument.h A sopex/SOPEX/SOPEXWODocument.m A sopex/SOPEX/SOPEXWOXDocument.h A sopex/SOPEX/SOPEXWOXDocument.m A sopex/SOPEX/SOPEXWebConnection.h A sopex/SOPEX/SOPEXWebConnection.m A sopex/SOPEX/SOPEXWebMetaParser.h A sopex/SOPEX/SOPEXWebMetaParser.m A sopex/SOPEX/TODO A sopex/SOPEX/Version A sopex/SOPEX/WebView+Ext.h A sopex/SOPEX/WebView+Ext.m A sopex/SOPEX/common.h A sopex/SOPEX/version.plist A sopex/Samples/ChangeLog A sopex/Samples/WOxExtTest/AlertPanel.m A sopex/Samples/WOxExtTest/AlertPanel.wox A sopex/Samples/WOxExtTest/Application.h A sopex/Samples/WOxExtTest/Application.m A sopex/Samples/WOxExtTest/Browser.m A sopex/Samples/WOxExtTest/Browser.wox A sopex/Samples/WOxExtTest/CalendarField.m A sopex/Samples/WOxExtTest/CalendarField.wox A sopex/Samples/WOxExtTest/CheckBoxMatrix.m A sopex/Samples/WOxExtTest/CheckBoxMatrix.wox A sopex/Samples/WOxExtTest/CollapsibleContent.m A sopex/Samples/WOxExtTest/CollapsibleContent.wox A sopex/Samples/WOxExtTest/CollapsibleContentExt.m A sopex/Samples/WOxExtTest/CollapsibleContentExt.wox A sopex/Samples/WOxExtTest/ConfirmPanel.m A sopex/Samples/WOxExtTest/ConfirmPanel.wox A sopex/Samples/WOxExtTest/DateField.m A sopex/Samples/WOxExtTest/DateField.wox A sopex/Samples/WOxExtTest/Dictionary.plist A sopex/Samples/WOxExtTest/DictionaryRepetition.m A sopex/Samples/WOxExtTest/DictionaryRepetition.wox A sopex/Samples/WOxExtTest/DirectAction.h A sopex/Samples/WOxExtTest/DirectAction.m A sopex/Samples/WOxExtTest/DnD.m A sopex/Samples/WOxExtTest/DnD.wox A sopex/Samples/WOxExtTest/English.lproj/InfoPlist.strings A sopex/Samples/WOxExtTest/English.lproj/MainMenu.nib/classes.nib A sopex/Samples/WOxExtTest/English.lproj/MainMenu.nib/info.nib A sopex/Samples/WOxExtTest/English.lproj/MainMenu.nib/keyedobjects.nib A sopex/Samples/WOxExtTest/Frame.m A sopex/Samples/WOxExtTest/Frame.wox A sopex/Samples/WOxExtTest/ImageFlyover.m A sopex/Samples/WOxExtTest/ImageFlyover.wox A sopex/Samples/WOxExtTest/Info.plist A sopex/Samples/WOxExtTest/KeyValueConditional.m A sopex/Samples/WOxExtTest/KeyValueConditional.wox A sopex/Samples/WOxExtTest/Lori.icns A sopex/Samples/WOxExtTest/Main.m A sopex/Samples/WOxExtTest/Main.wox A sopex/Samples/WOxExtTest/ModalWindow.m A sopex/Samples/WOxExtTest/ModalWindow.wox A sopex/Samples/WOxExtTest/MonthOverview.m A sopex/Samples/WOxExtTest/MonthOverview.wox A sopex/Samples/WOxExtTest/PageView.m A sopex/Samples/WOxExtTest/PageView.wox A sopex/Samples/WOxExtTest/QualifierConditional.m A sopex/Samples/WOxExtTest/QualifierConditional.wox A sopex/Samples/WOxExtTest/README A sopex/Samples/WOxExtTest/RadioButtonMatrix.m A sopex/Samples/WOxExtTest/RadioButtonMatrix.wox A sopex/Samples/WOxExtTest/RichString.m A sopex/Samples/WOxExtTest/RichString.wox A sopex/Samples/WOxExtTest/Session.h A sopex/Samples/WOxExtTest/Session.m A sopex/Samples/WOxExtTest/ShiftClick.m A sopex/Samples/WOxExtTest/ShiftClick.wox A sopex/Samples/WOxExtTest/Switch.m A sopex/Samples/WOxExtTest/Switch.wox A sopex/Samples/WOxExtTest/TabPanel.m A sopex/Samples/WOxExtTest/TabPanel.wox A sopex/Samples/WOxExtTest/TabView.m A sopex/Samples/WOxExtTest/TabView.wox A sopex/Samples/WOxExtTest/Table.m A sopex/Samples/WOxExtTest/Table.wox A sopex/Samples/WOxExtTest/TableMatrix.m A sopex/Samples/WOxExtTest/TableMatrix.wox A sopex/Samples/WOxExtTest/TableView.m A sopex/Samples/WOxExtTest/TableView.plist A sopex/Samples/WOxExtTest/TableView.wox A sopex/Samples/WOxExtTest/TextFlyover.m A sopex/Samples/WOxExtTest/TextFlyover.wox A sopex/Samples/WOxExtTest/ThresholdColoredNumber.m A sopex/Samples/WOxExtTest/ThresholdColoredNumber.wox A sopex/Samples/WOxExtTest/TimeField.m A sopex/Samples/WOxExtTest/TimeField.wox A sopex/Samples/WOxExtTest/TreeView.m A sopex/Samples/WOxExtTest/TreeView.plist A sopex/Samples/WOxExtTest/TreeView.wox A sopex/Samples/WOxExtTest/ValidatedField.m A sopex/Samples/WOxExtTest/ValidatedField.wox A sopex/Samples/WOxExtTest/VarString.wox A sopex/Samples/WOxExtTest/WOExtTest.xcodeproj/project.pbxproj A sopex/Samples/WOxExtTest/WOExtTest_main.m A sopex/Samples/WOxExtTest/WebServerResources/OGoLogo.gif A sopex/Samples/WOxExtTest/WebServerResources/collapsed.gif A sopex/Samples/WOxExtTest/WebServerResources/corner_left.gif A sopex/Samples/WOxExtTest/WebServerResources/corner_right.gif A sopex/Samples/WOxExtTest/WebServerResources/downward_sorted.gif A sopex/Samples/WOxExtTest/WebServerResources/expanded.gif A sopex/Samples/WOxExtTest/WebServerResources/favicon.ico A sopex/Samples/WOxExtTest/WebServerResources/first.gif A sopex/Samples/WOxExtTest/WebServerResources/first_blind.gif A sopex/Samples/WOxExtTest/WebServerResources/folder_closed.gif A sopex/Samples/WOxExtTest/WebServerResources/folder_opened.gif A sopex/Samples/WOxExtTest/WebServerResources/last.gif A sopex/Samples/WOxExtTest/WebServerResources/last_blind.gif A sopex/Samples/WOxExtTest/WebServerResources/menu_email.gif A sopex/Samples/WOxExtTest/WebServerResources/menu_email_inactive.gif A sopex/Samples/WOxExtTest/WebServerResources/next.gif A sopex/Samples/WOxExtTest/WebServerResources/next_blind.gif A sopex/Samples/WOxExtTest/WebServerResources/non_sorted.gif A sopex/Samples/WOxExtTest/WebServerResources/previous.gif A sopex/Samples/WOxExtTest/WebServerResources/previous_blind.gif A sopex/Samples/WOxExtTest/WebServerResources/site.css A sopex/Samples/WOxExtTest/WebServerResources/tab_.gif A sopex/Samples/WOxExtTest/WebServerResources/tab_left.gif A sopex/Samples/WOxExtTest/WebServerResources/tab_news.gif A sopex/Samples/WOxExtTest/WebServerResources/tab_news_left.gif A sopex/Samples/WOxExtTest/WebServerResources/tab_news_selected.gif A sopex/Samples/WOxExtTest/WebServerResources/tab_persons.gif A sopex/Samples/WOxExtTest/WebServerResources/tab_persons_left.gif A sopex/Samples/WOxExtTest/WebServerResources/tab_persons_selected.gif A sopex/Samples/WOxExtTest/WebServerResources/tab_projects.gif A sopex/Samples/WOxExtTest/WebServerResources/tab_projects_left.gif A sopex/Samples/WOxExtTest/WebServerResources/tab_projects_selected.gif A sopex/Samples/WOxExtTest/WebServerResources/tab_selected.gif A sopex/Samples/WOxExtTest/WebServerResources/treeview_corner.gif A sopex/Samples/WOxExtTest/WebServerResources/treeview_corner_minus.gif A sopex/Samples/WOxExtTest/WebServerResources/treeview_corner_plus.gif A sopex/Samples/WOxExtTest/WebServerResources/treeview_junction.gif A sopex/Samples/WOxExtTest/WebServerResources/treeview_leaf.gif A sopex/Samples/WOxExtTest/WebServerResources/treeview_leaf_corner.gif A sopex/Samples/WOxExtTest/WebServerResources/treeview_line.gif A sopex/Samples/WOxExtTest/WebServerResources/treeview_minus.gif A sopex/Samples/WOxExtTest/WebServerResources/treeview_plus.gif A sopex/Samples/WOxExtTest/WebServerResources/treeview_space.gif A sopex/Samples/WOxExtTest/WebServerResources/upward_sorted.gif A sopex/Samples/WOxExtTest/WeekColumnView.m A sopex/Samples/WOxExtTest/WeekColumnView.wox A sopex/Samples/WOxExtTest/WeekOverview.m A sopex/Samples/WOxExtTest/WeekOverview.wox A sopex/Samples/WOxExtTest/appointments.plist A sopex/Samples/WOxExtTest/common.h A sopex/Samples/WOxExtTest/version.plist A sopex/Templates/ChangeLog A sopex/Templates/File Templates/SOPE/Web Component (wo).pbfiletemplate/TemplateInfo.plist A sopex/Templates/File Templates/SOPE/Web Component (wo).pbfiletemplate/wo.h A sopex/Templates/File Templates/SOPE/Web Component (wo).pbfiletemplate/wo.html A sopex/Templates/File Templates/SOPE/Web Component (wo).pbfiletemplate/wo.m A sopex/Templates/File Templates/SOPE/Web Component (wo).pbfiletemplate/wo.wod A sopex/Templates/File Templates/SOPE/Web Component (wox).pbfiletemplate/TemplateInfo.plist A sopex/Templates/File Templates/SOPE/Web Component (wox).pbfiletemplate/wox.h A sopex/Templates/File Templates/SOPE/Web Component (wox).pbfiletemplate/wox.m A sopex/Templates/File Templates/SOPE/Web Component (wox).pbfiletemplate/wox.wox A sopex/Templates/Project Templates/SOPE/Web Application (WOx)/Application.h A sopex/Templates/Project Templates/SOPE/Web Application (WOx)/Application.m A sopex/Templates/Project Templates/SOPE/Web Application (WOx)/COPYING A sopex/Templates/Project Templates/SOPE/Web Application (WOx)/COPYRIGHT A sopex/Templates/Project Templates/SOPE/Web Application (WOx)/ChangeLog A sopex/Templates/Project Templates/SOPE/Web Application (WOx)/DirectAction.h A sopex/Templates/Project Templates/SOPE/Web Application (WOx)/DirectAction.m A sopex/Templates/Project Templates/SOPE/Web Application (WOx)/English.lproj/InfoPlist.strings A sopex/Templates/Project Templates/SOPE/Web Application (WOx)/English.lproj/MainMenu.nib/classes.nib A sopex/Templates/Project Templates/SOPE/Web Application (WOx)/English.lproj/MainMenu.nib/info.nib A sopex/Templates/Project Templates/SOPE/Web Application (WOx)/English.lproj/MainMenu.nib/keyedobjects.nib A sopex/Templates/Project Templates/SOPE/Web Application (WOx)/GNUmakefile A sopex/Templates/Project Templates/SOPE/Web Application (WOx)/GNUmakefile.postamble A sopex/Templates/Project Templates/SOPE/Web Application (WOx)/GNUmakefile.preamble A sopex/Templates/Project Templates/SOPE/Web Application (WOx)/Info.plist A sopex/Templates/Project Templates/SOPE/Web Application (WOx)/Lori.icns A sopex/Templates/Project Templates/SOPE/Web Application (WOx)/Main.m A sopex/Templates/Project Templates/SOPE/Web Application (WOx)/Main.wox A sopex/Templates/Project Templates/SOPE/Web Application (WOx)/NOTES A sopex/Templates/Project Templates/SOPE/Web Application (WOx)/PROJECTLEAD A sopex/Templates/Project Templates/SOPE/Web Application (WOx)/README A sopex/Templates/Project Templates/SOPE/Web Application (WOx)/Session.h A sopex/Templates/Project Templates/SOPE/Web Application (WOx)/Session.m A sopex/Templates/Project Templates/SOPE/Web Application (WOx)/TODO A sopex/Templates/Project Templates/SOPE/Web Application (WOx)/Version A sopex/Templates/Project Templates/SOPE/Web Application (WOx)/WebApp.xcode/TemplateInfo.plist A sopex/Templates/Project Templates/SOPE/Web Application (WOx)/WebApp.xcode/project.pbxproj A sopex/Templates/Project Templates/SOPE/Web Application (WOx)/WebApp_main.m A sopex/Templates/Project Templates/SOPE/Web Application (WOx)/WebServerResources/favicon.ico A sopex/Templates/Project Templates/SOPE/Web Application (WOx)/common.h A sopex/Templates/Project Templates/SOPE/Web Application (WOx)/version.plist A sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/Application.h A sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/Application.m A sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/COPYING A sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/COPYRIGHT A sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/ChangeLog A sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/DirectAction.h A sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/DirectAction.m A sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/English.lproj/InfoPlist.strings A sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/English.lproj/MainMenu.nib/classes.nib A sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/English.lproj/MainMenu.nib/info.nib A sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/English.lproj/MainMenu.nib/keyedobjects.nib A sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/GNUmakefile A sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/GNUmakefile.postamble A sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/GNUmakefile.preamble A sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/Info.plist A sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/Lori.icns A sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/Main.m A sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/Main.wo/Main.api A sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/Main.wo/Main.html A sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/Main.wo/Main.wod A sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/Main.wo/Main.woo A sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/NOTES A sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/PROJECTLEAD A sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/README A sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/Session.h A sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/Session.m A sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/TODO A sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/Version A sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/WebApp.xcode/TemplateInfo.plist A sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/WebApp.xcode/project.pbxproj A sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/WebApp_main.m A sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/WebServerResources/favicon.ico A sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/common.h A sopex/Templates/Project Templates/SOPE/Web Application (Wrapper)/version.plist A sopex/Templates/README A sopex/WebObjects/COPYING A sopex/WebObjects/COPYRIGHT A sopex/WebObjects/ChangeLog A sopex/WebObjects/English.lproj/InfoPlist.strings A sopex/WebObjects/GNUmakefile A sopex/WebObjects/INSTALL A sopex/WebObjects/Info.plist A sopex/WebObjects/PROJECTLEAD A sopex/WebObjects/README A sopex/WebObjects/Version A sopex/WebObjects/WebObjects.h A sopex/WebObjects/WebObjects.xcodeproj/project.pbxproj A sopex/WebObjects/main.c A sopex/WebObjects/version.plist A xcconfig/Common.xcconfig A xcconfig/Development.xcconfig A xcconfig/Wrapper.xcconfig A xmlrpc_call/ChangeLog A xmlrpc_call/GNUmakefile A xmlrpc_call/GNUmakefile.preamble A xmlrpc_call/HandleCredentialsClient.h A xmlrpc_call/HandleCredentialsClient.m A xmlrpc_call/NSObject+Printing.m A xmlrpc_call/README A xmlrpc_call/XmlRpcClientTool.h A xmlrpc_call/XmlRpcClientTool.m A xmlrpc_call/common.h A xmlrpc_call/fhs.make A xmlrpc_call/xmlrpc_call.m A xmlrpc_call/xmlrpc_call.xcodeproj/project.pbxproj A xmlrpc_call/xmlrpc_call.xcodeproj/znek.perspective SOPE/maintenance/0000755000000000000000000000000012242733417012611 5ustar rootrootSOPE/maintenance/dummytool.c0000644000000000000000000000016212242733417015005 0ustar rootroot// Note: do not remove, used by ../configure #include int main(int argc, char **argv) { return 0; } SOPE/sope-appserver/0000755000000000000000000000000012242733417013302 5ustar rootrootSOPE/sope-appserver/GNUmakefile0000644000000000000000000000113212242733417015351 0ustar rootroot# GNUstep makefile include ../config.make include $(GNUSTEP_MAKEFILES)/common.make PACKAGE_NAME=sope-appserver VERSION=4.5.0 SUBPROJECTS += \ NGObjWeb \ WEExtensions \ WOExtensions ifeq ($(frameworks),yes) include umbrella.make endif # project makefiles -include $(GNUSTEP_MAKEFILES)/GNUmakefile.preamble ifneq ($(only_umbrella),yes) include $(GNUSTEP_MAKEFILES)/aggregate.make endif ifeq ($(frameworks),yes) include $(GNUSTEP_MAKEFILES)/framework.make endif -include $(GNUSTEP_MAKEFILES)/GNUmakefile.postamble # package macosx-pkg :: all ../maintenance/make-osxpkg.sh $(PACKAGE_NAME) SOPE/sope-appserver/SOPE-Info.plist0000644000000000000000000000116412242733417016020 0ustar rootroot CFBundleDevelopmentRegion English CFBundleExecutable SOPE (Wrapper Umbrella) CFBundleIdentifier org.OpenGroupware.SOPE CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType FMWK CFBundleSignature ???? CFBundleVersion 4.2 SOPE/sope-appserver/COPYING0000644000000000000000000006130312242733417014340 0ustar rootroot GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 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. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] 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 Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, 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 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 a program 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. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, 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 companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. 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, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library 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 compile 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) 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. c) 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. d) 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 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. 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 to 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 Library 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 Appendix: 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 Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library 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! SOPE/sope-appserver/NGObjWeb/0000755000000000000000000000000012242733417014677 5ustar rootrootSOPE/sope-appserver/NGObjWeb/WOCoreApplication+Bundle.m0000644000000000000000000001204012242733417021601 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include "common.h" @implementation WOCoreApplication(Bundle) + (BOOL)didLoadDaemonBundle:(NSBundle *)_bundle { return YES; } + (int)loadApplicationBundle:(NSString *)_bundleName domainPath:(NSString *)_domain { // TODO: is this actually used somewhere? NSFileManager *fm; NSString *bp; NSBundle *bundle; NSMutableArray *chkPathes; NSEnumerator *e; fm = [NSFileManager defaultManager]; if ([[_bundleName pathExtension] length] == 0) _bundleName = [_bundleName stringByAppendingPathExtension:@"sxa"]; chkPathes = [NSMutableArray arrayWithCapacity:16]; if ([_bundleName isAbsolutePath]) { [chkPathes addObject:_bundleName]; } else { [chkPathes addObject:@"."]; #if COCOA_FRAMEWORK NSDictionary *env; env = [[NSProcessInfo processInfo] environment]; bp = [env objectForKey:@"HOME"]; bp = [bp stringByAppendingPathComponent:@"Library"]; bp = [bp stringByAppendingPathComponent:_domain]; [chkPathes addObject:bp]; bp = @"/Library"; bp = [bp stringByAppendingPathComponent:_domain]; [chkPathes addObject:bp]; bp = @"/System/Library"; bp = [bp stringByAppendingPathComponent:_domain]; [chkPathes addObject:bp]; #elif GNUSTEP_BASE_LIBRARY NSEnumerator *libraryPaths; NSString *directory; libraryPaths = [NSStandardLibraryPaths() objectEnumerator]; while ((directory = [libraryPaths nextObject])) { directory = [directory stringByAppendingPathComponent:_domain]; if ([chkPathes containsObject:directory]) continue; [chkPathes addObject:directory]; } #else NSDictionary *env; env = [[NSProcessInfo processInfo] environment]; NSEnumerator *e; id tmp; if ((tmp = [env objectForKey:@"GNUSTEP_PATHPREFIX_LIST"]) == nil) tmp = [env objectForKey:@"GNUSTEP_PATHLIST"]; tmp = [tmp componentsSeparatedByString:@":"]; e = [tmp objectEnumerator]; while ((tmp = [e nextObject])) { bp = [tmp stringByAppendingPathComponent:@"Library"]; bp = [bp stringByAppendingPathComponent:_domain]; if ([chkPathes containsObject:bp]) continue; [chkPathes addObject:bp]; } #endif } e = [chkPathes objectEnumerator]; while ((bp = [e nextObject])) { BOOL isDir; bp = [bp stringByAppendingPathComponent:_bundleName]; if (![fm fileExistsAtPath:bp isDirectory:&isDir]) continue; if (!isDir) continue; break; /* found */ } if ([bp length] == 0) { [self debugWithFormat: @"%s: did not find the bundle '%@' in search list %@", __PRETTY_FUNCTION__, _bundleName, chkPathes]; return 1; } if ((bundle = [NGBundle bundleWithPath:bp]) == nil) { [self debugWithFormat:@"%s: did not find %@ at %@ ...", __PRETTY_FUNCTION__, _bundleName, bp]; //return 1; } if (![bundle load]) { [self errorWithFormat:@"%s: could not load %@ %@ (path=%@)...", __PRETTY_FUNCTION__, _bundleName, bundle, bp]; //return 2; } if (![self didLoadDaemonBundle:bundle]) { //return 3; } [self debugWithFormat:@"hosting bundle: %@", [bundle bundleName]]; return 0; } + (int)runApplicationBundle:(NSString *)_bundleName domainPath:(NSString *)_p arguments:(void *)_argv count:(int)_argc { NSAutoreleasePool *pool = nil; int rc; NSString *appClassName, *bundleName; pool = [[NSAutoreleasePool alloc] init]; #if LIB_FOUNDATION_LIBRARY { extern char **environ; [NSProcessInfo initializeWithArguments:_argv count:_argc environment:environ]; } #endif if ((rc = [self loadApplicationBundle:_bundleName domainPath:_p]) != 0) exit(rc); bundleName = [_bundleName lastPathComponent]; bundleName = [bundleName stringByDeletingPathExtension]; appClassName = [bundleName stringByAppendingString:@"Application"]; rc = WOWatchDogApplicationMain(appClassName, _argc, _argv); RELEASE(pool); pool = nil; return rc; } + (int)runApplicationBundle:(NSString *)_bundleName arguments:(void *)_args count:(int)_argc { return [self runApplicationBundle:_bundleName domainPath:@"SxApps" arguments:_args count:_argc]; } @end /* WOApplication */ SOPE/sope-appserver/NGObjWeb/DAVPropMap.plist0000644000000000000000000002416512242733417017675 0ustar rootroot{ NGObjWeb_doc_ = "default WebDAV property mappings for NGObjWeb"; /* DAV */ "{DAV:}iscollection" = "davIsCollection"; "{DAV:}ishidden" = "davIsHidden"; "{DAV:}uid" = "davUid"; "{DAV:}href" = "davURL"; "{DAV:}getlastmodified" = "davLastModified"; "{DAV:}creationdate" = "davCreationDate"; "{DAV:}getcontentlength" = "davContentLength"; "{DAV:}getcontenttype" = "davContentType"; "{DAV:}getetag" = "davEntityTag"; "{DAV:}displayname" = "davDisplayName"; "{DAV:}hassubs" = "davHasSubFolders"; "{DAV:}nosubs " = "davDenySubFolders"; "{DAV:}childcount" = "davChildCount"; "{DAV:}objectcount" = "davObjectCount"; "{DAV:}visiblecount" = "davVisibleCount"; "{DAV:}isfolder" = "davIsFolder"; "{DAV:}resourcetype" = "davResourceType"; "{DAV:}contentclass" = "davContentClass"; "{DAV:}isstructureddocument" = "davIsStructuredDocument"; "{DAV:}status" = "davStatus"; "{DAV:}resource-id" = "davResourceId"; "{http://apache.org/dav/props/}executable" = "davIsExecutable"; /* RFC 3253 - Versioning Extensions to WebDAV (DeltaV) */ "{DAV:}comment" = "davComment"; "{DAV:}creator-displayname" = "davCreatorDisplayName"; "{DAV:}supported-method-set" = "davSupportedMethodSet"; "{DAV:}supported-live-property-set" = "davSupportedLivePropertySet"; "{DAV:}supported-report-set" = "davSupportedReportSet"; /* used with Apple WebDAV */ "{DAV:}quota" = davQuota; "{DAV:}quotaused" = davQuotaUsed; "{http://www.apple.com/webdav_fs/props/}appledoubleheader"=appleDoubleHeader; /* Novell NetDrive */ "{DAV:}locktoken" = davLockToken; "{DAV:}activelock" = davActiveLock; // TODO: non-standard?, also used by WebDrive "{DAV:}collection" = davNetDriveCollection; /* new in current WebFolders */ "{DAV:}defaultdocument" = davDefaultDocument; "{DAV:}getcontentlanguage" = davContentLanguage; "{DAV:}isreadonly" = davIsReadOnly; "{DAV:}isroot" = davIsRoot; "{DAV:}lastaccessed" = davLastAccessed; "{DAV:}name" = davName; "{DAV:}parentname" = davParentName; /* new in Cadaver 0.21.0 */ "{DAV:}checked-in" = davCheckedIn; "{DAV:}checked-out" = davCheckedOut; /* WebDrive 7.10.1475 */ "{DAV:}srt_creationtime" = davWebDriveCreationTime; "{DAV:}srt_modifiedtime" = davWebDriveModificationTime; "{DAV:}srt_proptimestamp" = davWebDrivePropTimestamp; "{DAV:}srt_lastaccesstime" = davWebDriveLastAccessTime; "{DAV:}SRT_fileattributes" = davWebDriveFileAttributes; "{DAV:}BSI_isreadonly" = davIsReadOnly; /* Nautilus DAV support */ "{http://services.eazel.com/namespaces}nautilus-treat-as-directory" = "davIsFolder"; /* Konqueror */ "{DAV:}source" = davSourceURL; "{DAV:}executable" = davIsExecutable; "{DAV:}supportedlock" = davSupportedLock; "{DAV:}lockdiscovery" = davLockDiscovery; /* HotMail (TM) */ "{http://schemas.microsoft.com/hotmail/}adbar" = "hotmailAdbarInfo"; "{http://schemas.microsoft.com/hotmail/}maxpoll" = "hotmailMaxPollInterval"; "{http://schemas.microsoft.com/hotmail/}sig" = "hotmailSignature"; /* HTTP-Mail folders */ "{urn:schemas:httpmail:}calendar" = "calendarFolderURL"; "{urn:schemas:httpmail:}contacts" = "contactsFolderURL"; "{urn:schemas:httpmail:}deleteditems" = "trashFolderURL"; "{urn:schemas:httpmail:}msgfolderroot" = "accountRootURL"; "{urn:schemas:httpmail:}drafts" = "draftsFolderURL"; "{urn:schemas:httpmail:}inbox" = "inboxFolderURL"; "{urn:schemas:httpmail:}journal" = "journalFolderURL"; "{urn:schemas:httpmail:}notes" = "notesFolderURL"; "{urn:schemas:httpmail:}outbox" = "outboxFolderURL"; "{urn:schemas:httpmail:}sendmsg" = "mtaURL"; "{urn:schemas:httpmail:}sentitems" = "sentFolderURL"; "{urn:schemas:httpmail:}tasks" = "tasksFolderURL"; "{urn:schemas:httpmail:}junkemail" = "junkFolderURL"; /* HTTP-Mail fields */ "{urn:schemas:httpmail:}date" = "date"; "{urn:schemas:httpmail:}hasattachment" = "hasAttachment"; "{urn:schemas:httpmail:}read" = "read"; "{urn:schemas:httpmail:}textdescription" = "textDescription"; "{urn:schemas:httpmail:}unreadcount" = "unreadCount"; "{urn:schemas:mailheader:}cc" = "cc"; "{urn:schemas:mailheader:}date" = "date"; "{urn:schemas:mailheader:}from" = "from"; "{urn:schemas:mailheader:}in-reply-to" = "inReplyTo"; "{urn:schemas:mailheader:}message-id" = "messageId"; "{urn:schemas:mailheader:}received" = "received"; "{urn:schemas:mailheader:}references" = "references"; "{urn:schemas:mailheader:}subject" = "davDisplayName"; "{urn:schemas:mailheader:}to" = "to"; /* Exchange 2000 (TM) */ "{http://schemas.microsoft.com/exchange/}outlookfolderclass" = "outlookFolderClass"; "{http://schemas.microsoft.com/exchange/}outlookmessageclass" = "outlookMessageClass"; /* OpenOffice.org */ "{http://ucb.openoffice.org/dav/props/}IsReadOnly" = davIsReadOnly; "{http://ucb.openoffice.org/dav/props/}BaseURI" = davBaseURI; // TODO "{http://ucb.openoffice.org/dav/props/}IsCompactDisc" = isOOoCompactDisc; "{http://ucb.openoffice.org/dav/props/}IsFloppy" = isOOoFloppy; "{http://ucb.openoffice.org/dav/props/}IsHidden" = davIsHidden; "{http://ucb.openoffice.org/dav/props/}IsRemote" = isOOoRemote; "{http://ucb.openoffice.org/dav/props/}IsRemoveable" = isOOoRemoveable; "{http://ucb.openoffice.org/dav/props/}IsVolume" = isOOoVolume; "{http://ucb.openoffice.org/dav/props/}TargetURL" = davOOoTargetURL; /* WebDAV ACL */ "{DAV:}owner" = davOwner; "{DAV:}group" = davGroup; "{DAV:}supported-privilege-set" = davSupportedPrivilegeSet; "{DAV:}principal-collection-set" = davPrincipalCollectionSet; "{DAV:}acl" = davAcl; "{DAV:}acl-restrictions" = davAclRestrictions; "{DAV:}current-user-privilege-set" = davCurrentUserPrivilegeSet; "{DAV:}current-user-principal" = davCurrentUserPrincipal; "{DAV:}inherited-acl-set" = davInheritedAclSet; "{DAV:}principal-URL" = davPrincipalURL; "{DAV:}alternate-URI-set" = davAlternateURISet; "{DAV:}group-member-set" = davGroupMemberSet; "{DAV:}group-membership" = davGroupMembership; /* CalDAV */ "{urn:ietf:params:xml:ns:caldav}calendar-data" = davCalendarData; "{urn:ietf:params:xml:ns:caldav}calendar-description" = davDescription; "{urn:ietf:params:xml:ns:caldav}calendar-home-set" = davCalendarHomeSet; "{urn:ietf:params:xml:ns:caldav}calendar-user-address-set" = davCalendarUserAddressSet; "{urn:ietf:params:xml:ns:caldav}calendar-free-busy-set" = davCalendarFreeBusySet; "{urn:ietf:params:xml:ns:caldav}schedule-inbox-URL" = davCalendarScheduleInboxURL; "{urn:ietf:params:xml:ns:caldav}schedule-outbox-URL" = davCalendarScheduleOutboxURL; "{urn:ietf:params:xml:ns:caldav}supported-calendar-component-set" = davCalendarComponentSet; "{urn:ietf:params:xml:ns:caldav}supported-calendar-data" = davSupportedCalendarDataTypes; "{urn:ietf:params:xml:ns:caldav}calendar-description" = davDescription; "{urn:ietf:params:xml:ns:caldav}calendar-timezone" = davCalendarTimeZone; "{urn:ietf:params:xml:ns:caldav}schedule-default-calendar-URL" = davScheduleDefaultCalendarURL; "{urn:ietf:params:xml:ns:caldav}schedule-calendar-transp" = davScheduleCalendarTransparency; "{urn:ietf:params:xml:ns:caldav}calendar-user-type" = davCalendarUserType; /* CardDAV */ "{urn:ietf:params:xml:ns:carddav}address-data" = davAddressData; "{urn:ietf:params:xml:ns:carddav}addressbook-home-set" = davAddressbookHomeSet; "{urn:ietf:params:xml:ns:carddav}supported-address-data" = davSupportedAddressDataTypes; "{urn:ietf:params:xml:ns:carddav}addressbook-description" = davDescription; "{urn:ietf:params:xml:ns:carddav}directory-gateway" = davDirectoryGateway; /* Apple CalServer */ "{http://calendarserver.org/ns/}dropbox-home-URL" = davDropboxHomeURL; "{http://calendarserver.org/ns/}notifications-URL" = davNotificationsURL; "{http://calendarserver.org/ns/}getctag" = davCollectionTag; "{http://calendarserver.org/ns/}calendar-proxy-read-for" = davCalendarProxyReadFor; "{http://calendarserver.org/ns/}calendar-proxy-write-for" = davCalendarProxyWriteFor; "{http://calendarserver.org/ns/}allowed-sharing-modes" = davAllowedSharingModes; "{http://calendarserver.org/ns/}first-name" = davFirstName; "{http://calendarserver.org/ns/}last-name" = davLastName; "{http://calendarserver.org/ns/}email-address-set" = davEmailAddressSet; "{http://calendarserver.org/ns/}record-type" = davRecordType; /* Apple extensions */ "{http://apple.com/ns/ical/}calendar-color" = davCalendarColor; "{http://apple.com/ns/ical/}calendar-order" = davCalendarOrder; /* GroupDAV */ "{http://www.groupdav.org/}component-set" = gdavComponentSet; "{http://groupdav.org/}component-set" = gdavComponentSet; /* Inverse */ "{urn:inverse:params:xml:ns:inverse-dav}contacts-categories" = davContactsCategories; "{urn:inverse:params:xml:ns:inverse-dav}events-default-classification" = davEventsDefaultClassification; "{urn:inverse:params:xml:ns:inverse-dav}tasks-default-classification" = davTasksDefaultClassification; "{urn:inverse:params:xml:ns:inverse-dav}calendar-show-alarms" = davCalendarShowAlarms; "{urn:inverse:params:xml:ns:inverse-dav}notify-on-personal-modifications" = davNotifyOnPersonalModifications; "{urn:inverse:params:xml:ns:inverse-dav}notify-on-external-modifications" = davNotifyOnExternalModifications; "{urn:inverse:params:xml:ns:inverse-dav}notify-user-on-personal-modifications" = davNotifyUserOnPersonalModifications; "{urn:inverse:params:xml:ns:inverse-dav}notified-user-on-personal-modifications" = davNotifiedUserOnPersonalModifications; "{urn:inverse:params:xml:ns:inverse-dav}mails-labels" = davMailsLabels; } SOPE/sope-appserver/NGObjWeb/SoCoreProduct.m0000644000000000000000000000177412242733417017621 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import /* Note: do not include that file in the subproject, it is linked in the product bundle */ @interface SoCoreProduct : NSObject @end @implementation SoCoreProduct @end /* SoCoreProduct */ SOPE/sope-appserver/NGObjWeb/sope-ngobjweb-defaults.50000644000000000000000000003162112242733417021336 0ustar rootroot.TH sope-ngobjweb 5 "October 2004" "SOPE" "User Manuals" .\" Copyright (c) 2004 Helge Hess. All rights reserved. .\" ==================================================================== .\" .\" Copyright (c) 2004 Helge Hess. All rights reserved. .\" .\" Check the COPYING file for further information. .\" .\" Created with the help of: .\" http://www.schweikhardt.net/man_page_howto.html .\" .SH NAME sope-ngobjweb \- Defaults for the libNGObjWeb library (part of SOPE) .SH DESCRIPTION The .B sope-ngobjweb library implements the core web application server of SOPE. NGObjWeb provides a lot of defaults to configure operation and logging of SOPE based applications. .SH BUGS SOPE related bugs are collected in the OpenGroupware.org Bugzilla: http://bugzilla.opengroupware.org/ .SH Application Defaults This section describes defaults which are related to general application setup. .IP "-WOApplicationBaseURL url (empty)" Select a different base URL. Do not touch this option unless you know what you are doing. It is overridden by the application URL set by mod_ngobjweb. .IP "-WOApplicationSuffix suffix (.woa)" The default selects the extension of the application wrapper. If you use a different application extension (eg .app), you need to properly configure this default. .IP "-WOAutoOpenInBrowser YES|NO (NO)" WOAutoOpenInBrowser is a WO compatibility default and does not do anything on non MacOSX platforms. .IP "-WOCGIAdaptorURL url (empty)" WOCGIAdaptorURL is a WO compatibility default and does not do anything in combination with SOPE. SOPE does not require those URLs because it is always in "direct connect mode". .IP "-WOContactSNS YES|NO (NO)" Whether the application should register with a snsd load balancing server. .IP "-WOCoreOnApplicationException YES|NO (NO)" If enabled, the application will call the system abort() function in case an uncatched exception occures. Abort will generate a coredump, so that you can analyze the cause for an exception. Only enable in development environments! .IP "-WODebuggingEnabled YES|NO (NO)" Enable NGObjWeb debug logs. .IP "-WODefaultSessionTimeOut duration (3600)" Use this option to set the default session timeout. The duration value is in specified seconds. .IP "-WODefaultLanguages array-of-language-codes" The language array specifies for what languages resource lookups are performed. .IP "-WOExpirationTimeInterval seconds (120)" Sets the interval in which session stores check whether sessions are expired and need to be shut down. .IP "-WOFrameworksBaseURL url (/WebObjects/Frameworks)" WOFrameworksBaseURL is a WO compatibility default and currently does not do anything in SOPE. .IP "-WOGenerateMissingResourceLinks YES|NO (NO)" If a resource (eg a filename in WOImage) could not be found, SOPE will generate a replacement URL. .IP "-WOLogDefaultsOnStartup YES|NO (NO)" When enabled, a SOPE will print all configured defaults to stdout on startup. .IP "-WOLogPageCache YES|NO (NO)" Print log messages when pages are stored or retrieved from the session page cache. .IP "-WONoProxySuffixes array-of-strings (empty array)" .IP "-WOPageCacheSize number (30)" .IP "-WOPageRefreshOnBacktrack YES|NO (YES)" .IP "-WOPermanentPageCacheSize number (30)" .IP "-WOProjectSearchPath array-of-pathes (empty array)" .IP "-WOSMTPHost hostname (mail)" .IP "-WOSendMail path (/usr/lib/sendmail)" .IP "-WOSessionStore classname (WOServerSessionStore)" .IP "-WOStatsStylesheetName string (WOStats.xsl)" .SH Component Defaults This section describes component and template related defaults. .IP "-WOCachingEnabled YES|NO (YES)" If this default is enabled SOPE will cache all templates and won't check for changes. So you might want to disable caching during development but you definitely should leaved that enabled for deployments or get a huge performance hit. .IP "-WOComponentExtensions array-of-exts ( (wo) )" The option specifies what directory extensions will be treated as wrapper components extensions. .IP "-WOComponentLoadWOOFiles YES|NO (NO)" Component wrappers can contained serialized objects like datasources in so called .woo files. This options enables the loading of those serialized files at a minor speed hit. .IP "-WOCompoundElementPool YES|NO (NO)" Wrap each rendering of a compound template element in an NSAutoreleasePool. This can help to find memory bugs hidden in templates. You might also want to enable double release checks in the NSAutoreleasePool when using this option .IP "-WOCoreOnAwakeComponentInCtxDealloc YES|NO (NO)" This default can be used to debug situations where a context is being deallocated but a component is still awake. In such a situation the framework will trigger a coredump using abort() which can be used to investigate. Never enable in deployments! .IP "-WOCoreOnRecursiveSubcomponents YES|NO (NO)" When enabled, the framework will generate a coredump if a component makes a recursive call to itself. Note that this is not necessarily a bug. .IP "-WODebugActions YES|NO (NO)" .IP "-WODebugComponentAwake YES|NO (NO)" .IP "-WODebugComponentDefinition YES|NO (NO)" .IP "-WODebugComponentLookup YES|NO (NO)" .IP "-WODebugCursor YES|NO (NO)" .IP "-WODebugKeyPathAssociation YES|NO (NO)" .IP "-WODebugResourceLookup YES|NO (NO)" .IP "-WODebugStaticLinkProcessing YES|NO (NO)" .IP "-WODebugTakeValues YES|NO (NO)" .IP "-WODescriptiveElementIDs YES|NO (NO)" .IP "-WOEnableComponentsWithoutClasses YES|NO (NO)" When enabled SOPE will not print a warning if it finds a template but no matching Objective-C class or script. .IP "-WOFormAlwaysPassDown YES|NO (YES)" Disable this option if the WOForm dynamic element should only run the take values phase on its child elements if the form URI or element id matches the request. This might confuse dynamic elements which are not form elements but nevertheless want to take values from the request (like the DnD elements). .IP "-WOLogComponents YES|NO (NO)" When enabled, the WOContext will log when a component enters or leaves the component stack. This is useful to debug how components are activated. .IP "-WONoSelectionString string (WONoSelectionString)" The string to be used for empty selections in the WOPopUpButton dynamic element. .IP "-WOParsersUseUTF8 YES|NO (NO)" Only affects wrapper templates (XML templates use XML to specify the charset). When enabled, .html and .wod files will always be parsed in the UTF-8 encoding, otherwise the Foundation system (cstring) encoding will be used. .IP "-WOResourceURLAssociationDebugEnabled YES|NO (NO)" .IP "-WOUseRelativeURLs YES|NO (YES)" .IP "-WOKeyPathAssociationsCacheSize number (200)" .IP "-WOValueAssociationsCacheSize number (200)" .IP "-WOxFileExtensions array-of-strings ( wox, xtmpl, xhtml )" An array of the extensions for files which are to be loaded as WOx (XML based) templates. .IP "-WOxElemBuilder_LogAssociationMapping YES|NO (NO)" .IP "-WOxElemBuilder_LogAssociationCreation YES|NO (NO)" .IP "-WOxComponentElemBuilderDebugEnabled YES|NO (NO)" .IP "-WOxLogBuilderQueue YES|NO (NO)" .IP "-WOxBuilderClasses - array-of-classnames" .IP "-WOxAssociationClassMapping - dict-of-uri-to-classnam" .SH Request Handler Defaults .IP "-WOComponentRequestHandlerKey string (wo)" The name to be used in the URL for component request handler URLs (action binding URLs). .IP "-WODirectActionRequestHandlerKey string (x)" The name to be used in the URL for direct action request handler URLs. You may want to set this option to 'wa' for improved WO compatibility. .IP "-WOResourceRequestHandlerKey string (y)" The name to be used in the URL for resource request handler URLs. .IP "-WOPageRequestHandlerDebugEnabled YES|NO (NO)" Enable/disable debug logs in the page request handler. .SH SoObjects Defaults .IP "-WOIsRedirectionEnabled YES|NO (NO)" .IP "-SoClassRegistryDebugEnabled YES|NO (NO)" .IP "-SoDebugKeyLookup YES|NO (NO)" .IP "-SoDebugTraversal YES|NO (NO)" .IP "-SoDebugProductLoading YES|NO (NO)" .IP "-SoDebugProductRegistry YES|NO (NO)" .IP "-SoDebugRequestClassification YES|NO (NO)" .IP "-SoLogSecurityDeclarations YES|NO (NO)" .IP "-SoOFSDebugFactory YES|NO (NO)" .IP "-SoOFSDebugPlistObject YES|NO (NO)" .IP "-SoOFSDebugRestore YES|NO (NO)" .IP "-SoOFSDebugNegotiate YES|NO (NO)" .IP "-SoOFSDebugAuthLookup YES|NO (NO)" .IP "-SoOFSWebMethodDebugEnabled YES|NO (NO)" .IP "-SoOFSResourceManagerDebugEnabled YES|NO (NO)" .IP "-SoObjCClassDebugEnabled YES|NO (NO)" .IP "-SoObjectSOAPDispatcherDebugEnabled YES|NO (NO)" .IP "-SoObjectDataSourceDebugEnabled YES|NO (NO)" .IP "-SoObjectRequestHandlerDebugEnabled YES|NO (NO)" .IP "-SoObjectMethodDispatcherDebugEnabled YES|NO (NO)" .IP "-SoPageInvocationDebugEnabled YES|NO (NO)" .IP "-SoProductResourceManagerDebugEnabled YES|NO (NO)" .IP "-SoRendererDebugEnabled YES|NO (NO)" .IP "-SoRedirectToDefaultMethods YES|NO (YES)" .IP "-SoSecurityManagerDebugEnabled YES|NO (NO)" .IP "-SoRequestDispatcherRules rules-array" .SH XML-RPC Subsystem Defaults .IP "-WOCoreOnXmlRpcFault YES|NO (NO)" .IP "-WOLogXmlRpcSelectorMapping YES|NO (NO)" .IP "-SoObjectXmlRpcDispatcherDebugEnabled YES|NO (NO)" .SH WebDAV Subsystem Defaults .IP "-SoObjectDAVDispatcherDebugEnabled YES|NO (NO)" .IP "-SoPreferredNamespacePrefixes dict-of-uri-to-name" .IP "-SoDefaultWebDAVPropertyNames array-of-fqn" .IP "-SoWebDAVFormatOutput YES|NO (NO)" .IP "-DAVParserDebugProp YES|NO (NO)" .IP "-SoWebDAVDefaultAllowMethods array-of-http-mehtods (GET, HEAD, ...)" .IP "-SoWebDAVDetectionMethods array-of-http-methods (OPTIONS,MKCOL, ...)" .SH Adaptor Defaults The NGObjWeb adaptor accepts requests from the outside and turns them into events in the SOPE application server. Do not mix up the NGObjWeb adaptor (which is a class inside the SOPE based server) with the mod_ngobjweb Apache module. .IP "-WOAdaptor classname (WOHttpAdaptor)" This argument selects the SOPE adaptor class used to receive requests from the outside. The only adaptor provided by SOPE itself is WOHttpAdaptor. .IP "-WOAdaptorLogPath path (empty)" Using this option you can select a path where all SOPE HTTP transactions are logged to. .IP "-WOAdditionalAdaptors array-of-strings (empty)" While -WOAdaptor selects the primary adaptor SOPE applications will receive input from, this option allows for any number of additional input ports. .IP "-WOCoreOnHTTPAdaptorException YES|NO (NO)" .IP "-WODebugHttpTransaction YES|NO (NO)" .IP "-WODebugZipResponse YES|NO (NO)" .IP "-WODontZipResponse YES|NO (NO)" In the default configuration SOPE compresses all responses if the browser supports that. Enable this option to disable compression which can be useful in combination with WOHttpAdaptor_LogStream. .IP "-WOHttpAdaptorReceiveTimeout = 120" .IP "-WOHttpAdaptorSendTimeout = 120" .IP "-WOHttpAdaptor_LogStream YES|NO (NO)" Log the complete HTTP transaction on stdout. You might also want to set WODontZipResponse to disable zip compression (otherwise you will only see 'scrambled' output) .IP "-WOHttpAllowHost hostname|array-of-hostnames (localhost)" SOPE checks the IP of the client prior accepting a connection. Per default it only allows connects from localhost. In deployments you should always connect applications through Apache/mod_ngobjweb and keep the client restriction. .IP "-WOHttpTransactionUseSimpleParser YES|NO (NO)" Select whether the more complex/slow MIME parser or the new lightweight HTTP parser ('simple parser') should be used. The latter doesn't support all features required for HTML forms processing and should only be used for WebDAV and XML-RPC clients. .IP "-WOIncludeCommentsInResponse YES|NO (YES)" When disabled, HTML comments will be stripped from .html wrapper templates prior delivery to the client (WOx templates always strip comments). This might clash with JavaScript tags in your templates and is therefore enabled per default. .IP "-WOListenQueueSize number (5)" This parameter configures the backlog size of the socket listen queue. See the listen (2) call for further information. .IP "-WOOutputValidationEnabled YES|NO (NO)" .IP "-WOPort number (20000)" The port the SOPE application will listen on. .IP "-WORunMultithreaded YES|NO (NO)" Enable/disable multi threading in SOPE. Note that SOPE 4.5 is not considered thread safe. .IP "-WOWorkerThreadCount number (0)" Configures the number of worker threads which are used to receive/send requests and responses in parallel to the application processing. This is currently unsupported by the SOPE WOHttpAdaptor. .IP "-WOSimpleHTTPParserDebugEnabled YES|NO (NO)" .IP "-WOSimpleHTTPParserFileIOBoundary number (16384)" .IP "-WOSimpleHTTPParserHeavyDebugEnabled YES|NO (NO)" .IP "-WOSimpleHTTPParserMaxUploadSizeInKB number (262144)" .SH Profiling Defaults .IP "-WOProfileApplication YES|NO (NO)" .IP "-WOProfileComponents YES|NO (NO)" .IP "-WOProfileDirectActionRequestHandler YES|NO (NO)" .IP "-WOProfileElements YES|NO (NO)" .IP "-WOProfileHttpAdaptor YES|NO (NO)" .IP "-WOProfileLoading YES|NO (NO)" .IP "-WOProfileResponse YES|NO (NO)" .SH Deprecated Defaults .IP "-WOLogScriptDealloc YES|NO (NO)" .IP "-WOLogScriptInit YES|NO (NO)" .IP "-WOLogScriptKVC YES|NO (NO)" .SH AUTHOR Helge Hess .SH SEE ALSO .BR httpd (8), .BR Defaults (5). SOPE/sope-appserver/NGObjWeb/WORequest.m0000644000000000000000000004560712242733417016767 0ustar rootroot/* Copyright (C) 2000-2007 SKYRIX Software AG Copyright (C) 2007 Helge Hess This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include "NGHttp+WO.h" #include #include #include "common.h" #if APPLE_FOUNDATION_LIBRARY || NeXT_Foundation_LIBRARY @interface NSObject(Miss) - (id)notImplemented:(SEL)cmd; @end #endif NGObjWeb_DECLARE NSString *WORequestValueData = @"wodata"; NGObjWeb_DECLARE NSString *WORequestValueInstance = @"woinst"; NGObjWeb_DECLARE NSString *WORequestValuePageName = @"wopage"; NGObjWeb_DECLARE NSString *WORequestValueContextID = @"_c"; NGObjWeb_DECLARE NSString *WORequestValueSenderID = @"_i"; NGObjWeb_DECLARE NSString *WORequestValueSessionID = @"wosid"; NGObjWeb_DECLARE NSString *WORequestValueFragmentID = @"wofid"; NGObjWeb_DECLARE NSString *WONoSelectionString = @"WONoSelectionString"; @interface WOCoreApplication(Resources) + (NSString *)findNGObjWebResource:(NSString *)_name ofType:(NSString *)_ext; @end @implementation WORequest static BOOL debugOn = NO; + (void)initialize { static BOOL isInitialized = NO; NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; NSDictionary *langMap; NSString *apath; if (isInitialized) return; isInitialized = YES; debugOn = [WOApplication isDebuggingEnabled]; /* apply defaults on some globals ... */ apath = [ud stringForKey:@"WORequestValueSessionID"]; if ([apath isNotEmpty]) WORequestValueSessionID = [apath copy]; apath = [ud stringForKey:@"WORequestValueInstance"]; if ([apath isNotEmpty]) WORequestValueInstance = [apath copy]; apath = [ud stringForKey:@"WONoSelectionString"]; if ([apath isNotEmpty]) WONoSelectionString = [apath copy]; /* load language mappings */ apath = [WOApplication findNGObjWebResource:@"Languages" ofType:@"plist"]; if (apath == nil) { [self errorWithFormat:@"cannot find Languages.plist resource " @"of NGObjWeb library !"]; langMap = nil; } else langMap = [NSDictionary dictionaryWithContentsOfFile:apath]; if (langMap != nil) { NSDictionary *defs; defs = [NSDictionary dictionaryWithObject:langMap forKey:@"WOBrowserLanguageMappings"]; [ud registerDefaults:defs]; } else [self warnWithFormat: @"did not register browser language mappings: %@", apath]; } /* parse URI */ - (void)_parseURI { unsigned uriLen; char *uriBuf; char *uri; NSString *serverUrl; // TBD: do not use cString ... uriLen = [self->_uri cStringLength]; uriBuf = uri = malloc(uriLen + 4 /* some extra safety ;-) */); [self->_uri getCString:uriBuf]; uriBuf[uriLen] = '\0'; /* determine adaptor prefix */ if ((serverUrl = [self headerForKey:@"x-webobjects-adaptor-prefix"]) != nil) self->adaptorPrefix = [serverUrl copyWithZone:NULL]; if (self->adaptorPrefix == nil) self->adaptorPrefix = @""; /* new parse */ if (uri != NULL) { const char *start = NULL; /* skip adaptor prefix */ if (self->adaptorPrefix) uri += [self->adaptorPrefix cStringLength]; if (*uri == '\0') goto done; /* parse application name */ uri++; // skip '/' start = uri; while ((*uri != '\0') && (*uri != '/') && (*uri != '.')) uri++; if (*uri == '\0') { self->appName = [[NSString alloc] initWithCString:start length:(uri - start)]; goto done; } else if (*uri == '.') { self->appName = [[NSString alloc] initWithCString:start length:(uri - start)]; // skip appname trailer (eg .woa) while ((*uri != '\0') && (*uri != '/')) uri++; if (*uri == '\0') goto done; uri++; // skip '/' } else if (*uri == '/') { self->appName = [[NSString alloc] initWithCString:start length:(uri - start)]; uri++; // skip '/' } else goto done; // invalid state ! if (*uri == '\0') goto done; /* parse request handler key */ start = uri; while ((*uri != '\0') && (*uri != '/') && (*uri != '?')) uri++; self->requestHandlerKey = [[NSString alloc] initWithCString:start length:(uri - start)]; if (*uri == '\0') goto done; if(*uri == '/'){ uri++; // skip '/' /* parse request handler path */ start = uri; while (*uri != '\0' && (*uri != '?')) uri++; self->requestHandlerPath = [[NSString alloc] initWithCString:start length:(uri - start)]; } /* parsing done (found '\0') */ done: ; // required for MacOSX-S if (uriBuf != NULL) free(uriBuf); } } - (id)initWithMethod:(NSString *)_method uri:(NSString *)__uri httpVersion:(NSString *)_version headers:(NSDictionary *)_headers content:(NSData *)_body userInfo:(NSDictionary *)_userInfo { if ((self = [super init]) != nil) { self->_uri = [__uri copy]; self->method = [_method copy]; [self _parseURI]; /* WOMessage */ [self setHTTPVersion:_version]; [self setContent:_body]; [self setUserInfo:_userInfo]; [self setHeaders:_headers]; } return self; } - (void)dealloc { [self->browserLanguages release]; [self->startDate release]; [self->startStatistics release]; [self->method release]; [self->_uri release]; [self->adaptorPrefix release]; [self->requestHandlerKey release]; [self->requestHandlerPath release]; [self->appName release]; [self->formContent release]; [self->request release]; [super dealloc]; } /* privates */ - (void)_setHttpRequest:(NGHttpRequest *)_request { ASSIGN(self->request, _request); } - (NGHttpRequest *)httpRequest { if (self->request == nil) { /* construct request 'on-demand' */ self->request = [[NSClassFromString(@"NGHttpRequest") alloc] initWithWORequest:self]; } return self->request; } /* request handler */ - (void)setRequestHandlerKey:(NSString *)_key { ASSIGNCOPY(self->requestHandlerKey, _key); } - (NSString *)requestHandlerKey { // new in WO4 if ([self isProxyRequest]) return @"proxy"; return self->requestHandlerKey; } - (void)setRequestHandlerPath:(NSString *)_path { ASSIGNCOPY(self->requestHandlerPath, _path); } - (NSString *)requestHandlerPath { // new in WO4 return self->requestHandlerPath; } - (NSArray *)requestHandlerPathArray { // new in WO4 NSMutableArray *array = nil; unsigned clen; char *cstrBuf; register char *cstr; clen = [self->requestHandlerPath cStringLength]; if (clen == 0) return nil; cstrBuf = cstr = malloc(clen + 1); [self->requestHandlerPath getCString:cstrBuf]; cstrBuf[clen] = '\0'; do { NSString *component = nil; register char *tmp = cstr; while ((*tmp != '\0') && (*tmp != '?') && (*tmp != '/')) tmp++; component = ((tmp - cstr) == 0) ? (id)@"" : [[NSString alloc] initWithCString:cstr length:(tmp - cstr)]; if (component) { if (array == nil) array = [NSMutableArray arrayWithCapacity:64]; [array addObject:component]; [component release]; component = nil; } cstr = tmp; if (*cstr == '/') cstr++; // skip '/' } while ((*cstr != '\0') && (*cstr != '?')); free(cstrBuf); return [[array copy] autorelease]; } /* WO methods */ - (BOOL)isFromClientComponent { return NO; } - (NSString *)sessionID { // deprecated in WO4 return [self cookieValueForKey:self->appName]; } - (NSString *)senderID { // deprecated in WO4 IS_DEPRECATED; return [[[WOApplication application] context] senderID]; } - (NSString *)contextID { return [[[WOApplication application] context] contextID]; //return self->contextID; } - (NSString *)applicationName { return self->appName; } - (NSString *)applicationHost { return [[NSHost currentHost] name]; } - (NSString *)adaptorPrefix { return self->adaptorPrefix; } - (NSString *)method { return self->method; } - (void)_hackSetURI:(NSString *)_vuri { /* be careful, used by the WebDAV dispatcher for ZideLook range queries */ ASSIGNCOPY(self->_uri, _vuri); } - (NSString *)uri { return self->_uri; } - (BOOL)isProxyRequest { return [[self uri] isAbsoluteURL]; } - (void)setStartDate:(NSCalendarDate *)_startDate { ASSIGNCOPY(self->startDate, _startDate); } - (NSCalendarDate *)startDate { return self->startDate; } - (id)startStatistics { return self->startStatistics; } /* forms */ - (NSStringEncoding)formValueEncoding { return NSUTF8StringEncoding; } - (void)setDefaultFormValueEncoding:(NSStringEncoding)_enc { if (_enc != NSUTF8StringEncoding || _enc != NSASCIIStringEncoding) [self notImplemented:_cmd]; } - (NSStringEncoding)defaultFormValueEncoding { return NSUTF8StringEncoding; } - (void)setFormValueEncodingDetectionEnabled:(BOOL)_flag { if (_flag) [self notImplemented:_cmd]; } - (BOOL)isFormValueEncodingDetectionEnabled { return NO; } - (void)_parseQueryParameters:(NSString *)_s intoMap:(NGMutableHashMap *)_map { NSEnumerator *e; NSString *part; e = [[_s componentsSeparatedByString:@"&"] objectEnumerator]; while ((part = [e nextObject])) { NSRange r; NSString *key, *value; r = [part rangeOfString:@"="]; if (r.length == 0) { /* missing value of query parameter */ key = [part stringByUnescapingURL]; value = @"1"; } else { key = [[part substringToIndex:r.location] stringByUnescapingURL]; value = [[part substringFromIndex:(r.location + r.length)] stringByUnescapingURL]; } [self->formContent addObject:value forKey:key]; } } - (NGHashMap *)_getFormParameters { if (self->formContent != nil) return self->formContent; if (self->request != nil) { self->formContent = [[self->request formParameters] retain]; return self->formContent; } { /* TODO: add parsing of form values contained in URL: a/blah?name=login&pwd=j contained in body: Content-Type: application/x-www-form-urlencoded browserconfig=%7BisJavaScriptEnabled%3DYES%3B%7D&login=r&button=login */ NSRange r; NSString *query; NSString *ctype; BOOL isMultiPartContent = NO, isFormContent = NO; r = [self->_uri rangeOfString:@"?"]; query = (r.length > 0) ? [self->_uri substringFromIndex:(r.location + r.length)] : (NSString *)nil; if ((ctype = [self headerForKey:@"content-type"]) != nil) { isFormContent = [ctype hasPrefix:@"application/x-www-form-urlencoded"]; if (!isFormContent) isMultiPartContent = [ctype hasPrefix:@"multipart/form-data"]; } if (query != nil || isFormContent || isMultiPartContent) { NSAutoreleasePool *pool; pool = [[NSAutoreleasePool alloc] init]; self->formContent = [[NGMutableHashMap alloc] init]; /* parse query string */ if (query) [self _parseQueryParameters:query intoMap:self->formContent]; /* parse content (if form content) */ if (isFormContent) { [self _parseQueryParameters:[self contentAsString] intoMap:self->formContent]; } else if (isMultiPartContent) { [self errorWithFormat:@"missing NGHttpRequest, cannot parse multipart"]; } [pool release]; } else self->formContent = [[NGHashMap alloc] init]; } return self->formContent; } - (NSArray *)formValueKeys { id paras = [self _getFormParameters]; if ([paras respondsToSelector:@selector(allKeys)]) return [paras allKeys]; return nil; } - (NSString *)formValueForKey:(NSString *)_key { NSString *value; id paras; value = nil; paras = [self _getFormParameters]; if ([paras respondsToSelector:@selector(objectForKey:)]) value = [(NSDictionary *)paras objectForKey:_key]; return value; } - (NSArray *)formValuesForKey:(NSString *)_key { id paras = [self _getFormParameters]; return [paras respondsToSelector:@selector(objectsForKey:)] ? [paras objectsForKey:_key] : (NSArray *)nil; } - (NSDictionary *)formValues { id paras; if ((paras = [self _getFormParameters]) == nil) return nil; /* check class, could change with different HTTP adaptor */ if ([paras isKindOfClass:[NGHashMap class]]) return [paras asDictionaryWithArraysForValues]; if ([paras isKindOfClass:[NSDictionary class]]) return paras; [self errorWithFormat:@"(%s): don't know how to deal with form object: %@", paras]; return nil; } // ******************** Headers ****************** - (NSString *)languageForBrowserLanguageCode:(NSString *)_e { static NSDictionary *langMap = nil; NSString *le, *lang; if (_e == nil) return nil; if (langMap == nil) { NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; langMap = [[ud dictionaryForKey:@"WOBrowserLanguageMappings"] copy]; if (langMap == nil) { [self warnWithFormat:@"did not find browser language mappings!"]; } } le = [_e lowercaseString]; lang = [langMap objectForKey:le]; if (lang == nil && [le length] > 2) { /* process constructs like 'de-ch' */ if ([le characterAtIndex:2] == '-') { NSString *ek; ek = [le substringToIndex:2]; lang = [langMap objectForKey:ek]; } else { /* check if the code is actually the language (ex: Danish) */ NSArray *codes; codes = [langMap allKeysForObject: _e]; if ([codes count]) lang = _e; } } if (lang == nil && ![_e isEqualToString:@"*"]) { [self debugWithFormat:@"did not find '%@' in map: %@", _e, [[langMap allKeys] componentsJoinedByString:@", "]]; } return lang; } - (NSString *)_languageFromUserAgent { /* user-agent sometimes stores the browser-language, eg: Opera/5.0 (Linux 2.2.18 i686; U) [en] */ NSString *ua; NSRange rng; NSString *tmp; if ((ua = [self headerForKey:@"user-agent"]) == nil) return nil; rng = [ua rangeOfString:@"["]; if (rng.length == 0) return nil; tmp = [ua substringFromIndex:(rng.location + rng.length)]; rng = [tmp rangeOfString:@"]"]; if (rng.length > 0) tmp = [tmp substringToIndex:rng.location]; return [self languageForBrowserLanguageCode:tmp]; } - (NSArray *)browserLanguages { /* new in WO4 */ static NSArray *defLangs = nil; NSString *hheader; NSEnumerator *e; NSString *language; NSString *tmp; if (!browserLanguages) { browserLanguages = [NSMutableArray new]; e = [[self headersForKey:@"accept-language"] objectEnumerator]; while ((hheader = [e nextObject]) != nil) { NSEnumerator *le; le = [[hheader componentsSeparatedByString:@","] objectEnumerator]; while ((language = [le nextObject]) != nil) { NSString *tmp; NSRange r; /* split off the quality (eg 'en;0.96') */ r = [language rangeOfString:@";"]; if (r.length > 0) language = [language substringToIndex:r.location]; language = [language stringByTrimmingSpaces]; if ([language length] == 0) continue; /* check in map */ if ((tmp = [self languageForBrowserLanguageCode:language])) language = tmp; if ([browserLanguages containsObject:language]) continue; [browserLanguages addObject:language]; } } if ((tmp = [self _languageFromUserAgent])) [browserLanguages addObject:tmp]; if (defLangs == nil) { NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; defLangs = [[ud arrayForKey:@"WODefaultLanguages"] copy]; } [browserLanguages addObjectsFromArray:defLangs]; } //[self debugWithFormat:@"languages: %@", languages]; return browserLanguages; } /* cookies */ - (NSArray *)cookieValuesForKey:(NSString *)_key { NSEnumerator *ecookies; NSMutableArray *values; WOCookie *cookie; values = [NSMutableArray arrayWithCapacity:8]; ecookies = [[self cookies] objectEnumerator]; while ((cookie = [ecookies nextObject])) { if ([_key isEqualToString:[cookie name]]) [values addObject:[cookie value]]; } return values; } - (NSString *)cookieValueForKey:(NSString *)_key { NSEnumerator *ecookies; WOCookie *cookie; ecookies = [[self cookies] objectEnumerator]; while ((cookie = [ecookies nextObject])) { if ([_key isEqualToString:[cookie name]]) return [cookie value]; } return nil; } - (NSDictionary *)cookieValues { NSEnumerator *ecookies; NSMutableDictionary *values; WOCookie *cookie; values = [NSMutableDictionary dictionaryWithCapacity:8]; ecookies = [[self cookies] objectEnumerator]; while ((cookie = [ecookies nextObject])) { NSString *name; NSMutableArray *vArray; name = [cookie name]; vArray = [values objectForKey:name]; if (vArray == nil) { vArray = [[NSMutableArray alloc] initWithCapacity:8]; [values setObject:vArray forKey:name]; [vArray release]; } [vArray addObject:[cookie value]]; } return values; } /* SOPE extensions */ - (NSString *)fragmentID { NSString *v; v = [self formValueForKey:WORequestValueFragmentID]; if (v == nil) return nil; v = [v stringByTrimmingWhiteSpaces]; return [v isNotEmpty] ? v : (NSString *)nil; } - (BOOL)isFragmentIDInRequest { return [self fragmentID] != nil ? YES : NO; } /* logging */ - (BOOL)isDebuggingEnabled { return debugOn; } - (NSString *)loggingPrefix { return [NSString stringWithFormat:@"|Rq:%@ 0x%p|", [self method], self]; } /* description */ - (NSString *)description { NSMutableString *str; str = [NSMutableString stringWithCapacity:256]; [str appendFormat:@"<%@[0x%p]:", NSStringFromClass([self class]), self]; [str appendFormat:@" method=%@", [self method]]; [str appendFormat:@" uri=%@", [self uri]]; [str appendFormat:@" app=%@", self->appName]; [str appendFormat:@" rqKey=%@", [self requestHandlerKey]]; [str appendFormat:@" rqPath=%@", [self requestHandlerPath]]; [str appendString:@">"]; return str; } @end /* WORequest */ SOPE/sope-appserver/NGObjWeb/fhs.make0000644000000000000000000000431612242733417016322 0ustar rootroot# postprocessing # FHS support (this is a hack and is going to be done by gstep-make!) ifneq ($(FHS_INSTALL_ROOT),) FHS_INCLUDE_DIR=$(FHS_INSTALL_ROOT)/include/ FHS_BIN_DIR=$(FHS_INSTALL_ROOT)/bin/ FHS_MAN_DIR=$(FHS_INSTALL_ROOT)/man ifeq ($(findstring _64, $(GNUSTEP_TARGET_CPU)), _64) FHS_LIB_DIR=$(FHS_INSTALL_ROOT)/lib64/ else FHS_LIB_DIR=$(FHS_INSTALL_ROOT)/lib/ endif FHS_SO_DIR=$(FHS_LIB_DIR)sope-$(MAJOR_VERSION).$(MINOR_VERSION)/products/ NONFHS_LIBDIR="$(GNUSTEP_LIBRARIES)/$(GNUSTEP_TARGET_LDIR)/" NONFHS_LIBNAME="$(LIBRARY_NAME)$(LIBRARY_NAME_SUFFIX)$(SHARED_LIBEXT)" NONFHS_BINDIR="$(GNUSTEP_TOOLS)/$(GNUSTEP_TARGET_LDIR)" fhs-header-dirs :: $(MKDIRS) $(FHS_INCLUDE_DIR)$(libNGObjWeb_HEADER_FILES_INSTALL_DIR) $(MKDIRS) $(FHS_INCLUDE_DIR)/NGHttp fhs-bin-dirs :: $(MKDIRS) $(FHS_BIN_DIR) fhs-man-dirs :: $(MKDIRS) $(FHS_MAN_DIR) fhs-products-dirs :: $(MKDIRS) $(FHS_SO_DIR) move-headers-to-fhs :: fhs-header-dirs @echo "moving headers to $(FHS_INCLUDE_DIR) .." mv -f $(GNUSTEP_HEADERS)$(libNGObjWeb_HEADER_FILES_INSTALL_DIR)/*.h \ $(FHS_INCLUDE_DIR)$(libNGObjWeb_HEADER_FILES_INSTALL_DIR)/ mv -f $(GNUSTEP_HEADERS)/NGHttp/*.h $(FHS_INCLUDE_DIR)/NGHttp/ move-libs-to-fhs :: @echo "moving libs to $(FHS_LIB_DIR) .." mv -f $(NONFHS_LIBDIR)/$(NONFHS_LIBNAME)* $(FHS_LIB_DIR)/ move-tools-to-fhs :: fhs-bin-dirs @echo "moving tools from $(NONFHS_BINDIR) to $(FHS_BIN_DIR) .." for i in $(TOOL_NAME); do \ mv -f "$(NONFHS_BINDIR)/$${i}" $(FHS_BIN_DIR); \ done move-bundles-to-fhs :: fhs-products-dirs @echo "moving bundles $(BUNDLE_INSTALL_DIR) to $(FHS_SO_DIR) .." for i in $(BUNDLE_NAME); do \ j="$(FHS_SO_DIR)/$${i}$(BUNDLE_EXTENSION)"; \ if test -d $$j; then rm -r $$j; fi; \ mv -f "$(BUNDLE_INSTALL_DIR)/$${i}$(BUNDLE_EXTENSION)" $$j; \ done move-to-fhs :: move-headers-to-fhs move-libs-to-fhs move-tools-to-fhs \ move-bundles-to-fhs install-fhs-manpages :: fhs-man-dirs @echo "installing manpages in $(FHS_MAN_DIR) ..." for i in $(FHS_MANPAGES); do \ msection="$(FHS_MAN_DIR)/man`echo -n $$i | tail -c 1`"; \ $(MKDIRS) $$msection; \ nroff -mandoc -Tascii $$i >/dev/null; \ $(INSTALL_DATA) $$i $$msection; \ done after-install :: install-fhs-manpages move-to-fhs endif SOPE/sope-appserver/NGObjWeb/README0000644000000000000000000000437312242733417015566 0ustar rootrootNGObjWeb Library Part of the SKYRiX Object Publishing Environment Copyright (C) 2000-2005 SKYRIX Software AG - http://www.skyrix.com/ Subprojects =========== - DynamicElements - Associations - Templates - NGHttp - WOHttpAdaptor - NGXmlRpc - SoObjects - WebDAV - SoOFS UserDefaults ============ Default | Type | Example Value ============================================================= WOAdaptor | String | WOHttpAdaptor WOCachingEnabled | bool | NO WODebuggingEnabled | bool | YES WODefaultSessionTimeOut | int | 3600 WOIsRedirectionEnabled | bool | NO WOPort | String | "*:20000" WOResourcePrefix | String | "http://localhost:9000" WORunMultithreaded | bool | NO WOSendMail | String | /usr/lib/sendmail WOSMTPHost | String | mail SNSPort | String | "/tmp/.snsd" SNSPingInterval | int | 10 SNSLogActivity | bool | NO WORequestValueSessionID | string | wosid WORequestValueInstance | string | woinst WOProxyServer | string | WONoProxySuffixes | array | WODebugHttpTransaction | bool | WOHttpAdaptor_LogStream | bool | WOProjectDirectory | String | /Users/znek/Projects/Foo Class-Hierachy ============== NSObject WOApplication WOContext WOElement < OWResponder > WOComponent < WOActionResults > WODynamicElement WOAssociation WOKeyPathAssociation WOValueAssociation WORequest WOResponse < WOActionResults > WOResourceManager WOSession WOSessionStore WOServerSessionStore Categories Protocols OWResponder WOActionResults Log Topics Localization ============ From WO 3.5 to WO 4.0 the localization mechanism was changed. Prior 4.0 the language.lproj was stored inside the .wo wrapper. Afterwards its the other way around. http://developer.apple.com/documentation/LegacyTechnologies/WebObjects/ WebObjects_4.0/System/Documentation/Developer/WebObjects/DeltaDoc/ NewInWO4.051.html#28715 -- Helge Hess (helge.hess@skyrix.com) SKYRIX Software AG, 2003-01-06 SOPE/sope-appserver/NGObjWeb/wobundle-gs.make0000644000000000000000000002575612242733417020003 0ustar rootroot# # wobundle.make # # Makefile rules to build GNUstep web bundles. # # Copyright (C) 2002 Free Software Foundation, Inc. # # Author: Nicola Pero # # This file is part of the GNUstep Makefile Package. # # This library 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. # # You should have received a copy of the GNU General Public # License along with this library; see the file COPYING.LIB. # If not, write to the Free Software Foundation, # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ifeq ($(GNUSTEP_INSTANCE),) ifeq ($(RULES_MAKE_LOADED),) include $(GNUSTEP_MAKEFILES)/rules.make endif ifeq ($(strip $(WOBUNDLE_EXTENSION)),) WOBUNDLE_EXTENSION = .wobundle endif WOBUNDLE_NAME := $(strip $(WOBUNDLE_NAME)) internal-all:: $(WOBUNDLE_NAME:=.all.wobundle.variables) internal-install:: $(WOBUNDLE_NAME:=.install.wobundle.variables) internal-uninstall:: $(WOBUNDLE_NAME:=.uninstall.wobundle.variables) internal-clean:: $(WOBUNDLE_NAME:=.clean.wobundle.subprojects) rm -rf $(GNUSTEP_OBJ_DIR) \ $(addsuffix $(WOBUNDLE_EXTENSION),$(WOBUNDLE_NAME)) internal-distclean:: $(WOBUNDLE_NAME:=.distclean.wobundle.subprojects) rm -rf shared_obj static_obj shared_debug_obj shared_profile_obj \ static_debug_obj static_profile_obj shared_profile_debug_obj \ static_profile_debug_obj $(WOBUNDLE_NAME): @$(MAKE) -f $(MAKEFILE_NAME) --no-print-directory \ $@.all.wobundle.variables else ifeq ($(GNUSTEP_TYPE),wobundle) ifeq ($(RULES_MAKE_LOADED),) include $(GNUSTEP_MAKEFILES)/rules.make endif # FIXME - this file has not been updated to use Shared/bundle.make # because it is using symlinks rather than copying resources. COMPONENTS = $($(GNUSTEP_INSTANCE)_COMPONENTS) LANGUAGES = $($(GNUSTEP_INSTANCE)_LANGUAGES) WEBSERVER_RESOURCE_FILES = $($(GNUSTEP_INSTANCE)_WEBSERVER_RESOURCE_FILES) LOCALIZED_WEBSERVER_RESOURCE_FILES = $($(GNUSTEP_INSTANCE)_LOCALIZED_WEBSERVER_RESOURCE_FILES) WEBSERVER_RESOURCE_DIRS = $($(GNUSTEP_INSTANCE)_WEBSERVER_RESOURCE_DIRS) LOCALIZED_RESOURCE_FILES = $($(GNUSTEP_INSTANCE)_LOCALIZED_RESOURCE_FILES) RESOURCE_FILES = $($(GNUSTEP_INSTANCE)_RESOURCE_FILES) RESOURCE_DIRS = $($(GNUSTEP_INSTANCE)_RESOURCE_DIRS) include $(GNUSTEP_MAKEFILES)/Instance/Shared/headers.make ifeq ($(strip $(WOBUNDLE_EXTENSION)),) WOBUNDLE_EXTENSION = .wobundle endif WOBUNDLE_LD = $(BUNDLE_LD) WOBUNDLE_LDFLAGS = $(BUNDLE_LDFLAGS) ifeq ($(FOUNDATION_LIB),apple) WORSRCDIRINFIX:=Contents/Resources WORSRCLINKUP:=../../.. else WORSRCDIRINFIX:=Resources WORSRCLINKUP:=../.. endif ifeq ($(WOBUNDLE_INSTALL_DIR),) WOBUNDLE_INSTALL_DIR = $(GNUSTEP_WEB_APPS) endif # The name of the bundle is in the BUNDLE_NAME variable. # The list of languages the bundle is localized in are in xxx_LANGUAGES # The list of bundle resource file are in xxx_RESOURCE_FILES # The list of localized bundle resource file are in xxx_LOCALIZED_RESOURCE_FILES # The list of bundle resource directories are in xxx_RESOURCE_DIRS # The name of the principal class is xxx_PRINCIPAL_CLASS # The header files are in xxx_HEADER_FILES # The directory where the header files are located is xxx_HEADER_FILES_DIR # The directory where to install the header files inside the library # installation directory is xxx_HEADER_FILES_INSTALL_DIR # where xxx is the bundle name # xxx_WEBSERVER_RESOURCE_DIRS <== # The list of localized application web server resource directories are in # xxx_LOCALIZED_WEBSERVER_RESOURCE_DIRS # where xxx is the application name <== .PHONY: internal-wobundle-all_ \ internal-wobundle-install_ \ internal-wobundle-uninstall_ \ build-bundle-dir \ build-bundle \ wobundle-components \ wobundle-resource-files \ wobundle-localized-resource-files \ wobundle-webresource-dir \ wobundle-webresource-files \ wobundle-localized-webresource-files # On Solaris we don't need to specifies the libraries the bundle needs. # How about the rest of the systems? ALL_BUNDLE_LIBS is temporary empty. TALL_WOBUNDLE_LIBS = $(ADDITIONAL_WO_LIBS) $(AUXILIARY_WO_LIBS) $(WO_LIBS) \ $(ADDITIONAL_BUNDLE_LIBS) $(AUXILIARY_BUNDLE_LIBS) \ $(FND_LIBS) $(ADDITIONAL_OBJC_LIBS) $(AUXILIARY_OBJC_LIBS) \ $(OBJC_LIBS) $(SYSTEM_LIBS) $(TARGET_SYSTEM_LIBS) #ALL_WOBUNDLE_LIBS = ifeq ($(WHICH_LIB_SCRIPT),) ALL_WOBUNDLE_LIBS = $(ALL_LIB_DIRS) $(TALL_WOBUNDLE_LIBS) else ALL_WOBUNDLE_LIBS = \ $(shell $(WHICH_LIB_SCRIPT) $(ALL_LIB_DIRS) $(TALL_WOBUNDLE_LIBS) \ debug=$(debug) profile=$(profile) shared=$(shared) libext=$(LIBEXT) \ shared_libext=$(SHARED_LIBEXT)) endif # order is important # GNUSTEP_OBJ_INSTANCE_DIR, OBJ_DIRS_TO_CREATE required for gnustep-make >= 2.2 # GNUSTEP_OBJ_DIR required for gnustep-make < 2.2 internal-wobundle-all_:: $(GNUSTEP_OBJ_INSTANCE_DIR) \ $(OBJ_DIRS_TO_CREATE) \ $(GNUSTEP_OBJ_DIR) \ build-bundle-dir \ build-bundle WOBUNDLE_DIR_NAME = $(GNUSTEP_INSTANCE:=$(WOBUNDLE_EXTENSION)) WOBUNDLE_FILE = \ $(WOBUNDLE_DIR_NAME)/$(GNUSTEP_TARGET_LDIR)/$(GNUSTEP_INSTANCE) WOBUNDLE_RESOURCE_DIRS = $(foreach d, $(RESOURCE_DIRS), $(WOBUNDLE_DIR_NAME)/$(WORSRCDIRINFIX)/$(d)) WOBUNDLE_WEBSERVER_RESOURCE_DIRS = $(foreach d, $(WEBSERVER_RESOURCE_DIRS), $(WOBUNDLE_DIR_NAME)/Resources/WebServer/$(d)) ifeq ($(strip $(LANGUAGES)),) LANGUAGES="English" endif build-bundle-dir:: $(WOBUNDLE_DIR_NAME)/$(WORSRCDIRINFIX) \ $(WOBUNDLE_DIR_NAME)/$(GNUSTEP_TARGET_LDIR) \ $(WOBUNDLE_RESOURCE_DIRS) $(WOBUNDLE_DIR_NAME)/$(GNUSTEP_TARGET_LDIR): @$(MKDIRS) $(WOBUNDLE_DIR_NAME)/$(GNUSTEP_TARGET_LDIR) $(WOBUNDLE_RESOURCE_DIRS): @$(MKDIRS) $(WOBUNDLE_RESOURCE_DIRS) build-bundle:: $(WOBUNDLE_FILE) \ wobundle-components \ wobundle-resource-files \ wobundle-localized-resource-files \ wobundle-localized-webresource-files \ wobundle-webresource-files $(WOBUNDLE_FILE) : $(OBJ_FILES_TO_LINK) $(WOBUNDLE_LD) $(WOBUNDLE_LDFLAGS) \ $(ALL_LDFLAGS) -o $(LDOUT)$(WOBUNDLE_FILE) \ $(OBJ_FILES_TO_LINK) \ $(ALL_WOBUNDLE_LIBS) wobundle-components :: $(WOBUNDLE_DIR_NAME) ifneq ($(strip $(COMPONENTS)),) @(echo "Linking components into the bundle wrapper..."; \ cd $(WOBUNDLE_DIR_NAME)/$(WORSRCDIRINFIX); \ for component in $(COMPONENTS); do \ if [ -d $(WORSRCLINKUP)/$$component ]; then \ $(LN_S) -f $(WORSRCLINKUP)/$$component ./;\ fi; \ done; \ echo "Linking localized components into the bundle wrapper..."; \ for l in $(LANGUAGES); do \ if [ -d $(WORSRCLINKUP)/$$l.lproj ]; then \ $(MKDIRS) $$l.lproj; \ cd $$l.lproj; \ for f in $(COMPONENTS); do \ if [ -d $(WORSRCLINKUP)/../$$l.lproj/$$f ]; then \ $(LN_S) -f $(WORSRCLINKUP)/../$$l.lproj/$$f .;\ fi;\ done;\ cd ..; \ fi;\ done) endif wobundle-resource-files:: $(WOBUNDLE_DIR_NAME)/bundle-info.plist \ $(WOBUNDLE_DIR_NAME)/$(WORSRCDIRINFIX)/Info-gnustep.plist ifneq ($(strip $(RESOURCE_FILES)),) @(echo "Linking resources into the bundle wrapper..."; \ cd $(WOBUNDLE_DIR_NAME)/$(WORSRCDIRINFIX)/; \ for ff in $(RESOURCE_FILES); do \ $(LN_S) -f $(WORSRCLINKUP)/$$ff .;\ done) endif wobundle-localized-resource-files:: $(WOBUNDLE_DIR_NAME)/$(WORSRCDIRINFIX)/Info-gnustep.plist ifneq ($(strip $(LOCALIZED_RESOURCE_FILES)),) @(echo "Linking localized resources into the bundle wrapper..."; \ cd $(WOBUNDLE_DIR_NAME)/$(WORSRCDIRINFIX); \ for l in $(LANGUAGES); do \ if [ -d $(WORSRCLINKUP)/$$l.lproj ]; then \ $(MKDIRS) $$l.lproj; \ cd $$l.lproj; \ for f in $(LOCALIZED_RESOURCE_FILES); do \ if [ -f $(WORSRCLINKUP)/../$$l.lproj/$$f ]; then \ $(LN_S) -f $(WORSRCLINKUP)/../$$l.lproj/$$f .;\ fi;\ done;\ cd ..;\ else\ echo "Warning - $$l.lproj not found - ignoring";\ fi;\ done) endif wobundle-webresource-dir:: @$(MKDIRS) $(WOBUNDLE_WEBSERVER_RESOURCE_DIRS) wobundle-webresource-files:: $(WOBUNDLE_DIR_NAME)/Resources/WebServer \ wobundle-webresource-dir ifneq ($(strip $(WEBSERVER_RESOURCE_FILES)),) @(echo "Linking webserver resources into the application wrapper..."; \ cd $(WOBUNDLE_DIR_NAME)/Resources/WebServer; \ for ff in $(WEBSERVER_RESOURCE_FILES); do \ $(LN_S) -f ../../WebServerResources/$$ff .;\ done) endif wobundle-localized-webresource-files:: $(WOBUNDLE_DIR_NAME)/Resources/WebServer \ wobundle-webresource-dir ifneq ($(strip $(LOCALIZED_WEBSERVER_RESOURCE_FILES)),) @(echo "Linking localized web resources into the application wrapper..."; \ cd $(WOBUNDLE_DIR_NAME)/Resources/WebServer; \ for l in $(LANGUAGES); do \ if [ -d ../../WebServerResources/$$l.lproj ]; then \ $(MKDIRS) $$l.lproj; \ cd $$l.lproj; \ for f in $(LOCALIZED_WEBSERVER_RESOURCE_FILES); do \ if [ -f ../../../WebServerResources/$$l.lproj/$$f ]; then \ if [ ! -r $$f ]; then \ $(LN_S) ../../../WebServerResources/$$l.lproj/$$f $$f;\ fi;\ fi;\ done;\ cd ..; \ else \ echo "Warning - WebServerResources/$$l.lproj not found - ignoring";\ fi;\ done) endif PRINCIPAL_CLASS = $(strip $($(GNUSTEP_INSTANCE)_PRINCIPAL_CLASS)) ifeq ($(PRINCIPAL_CLASS),) PRINCIPAL_CLASS = $(GNUSTEP_INSTANCE) endif $(WOBUNDLE_DIR_NAME)/bundle-info.plist: $(WOBUNDLE_DIR_NAME) @(cd $(WOBUNDLE_DIR_NAME); $(LN_S) -f ../bundle-info.plist .) HAS_WOCOMPONENTS = $($(GNUSTEP_INSTANCE)_HAS_WOCOMPONENTS) $(WOBUNDLE_DIR_NAME)/$(WORSRCDIRINFIX)/Info-gnustep.plist: $(WOBUNDLE_DIR_NAME)/$(WORSRCDIRINFIX) @(echo "{"; echo ' NOTE = "Automatically generated, do not edit!";'; \ echo " NSExecutable = \"$(GNUSTEP_INSTANCE)\";"; \ echo " NSPrincipalClass = \"$(PRINCIPAL_CLASS)\";"; \ if [ "$(HAS_WOCOMPONENTS)" != "" ]; then \ echo " HasWOComponents = \"$(HAS_WOCOMPONENTS)\";"; \ fi; \ echo "}") >$@ $(WOBUNDLE_DIR_NAME)/$(WORSRCDIRINFIX): @$(MKDIRS) $@ $(WOBUNDLE_DIR_NAME)/Resources/WebServer: @$(MKDIRS) $@ internal-wobundle-install_:: $(WOBUNDLE_INSTALL_DIR) shared-instance-headers-install # rm -rf $(WOBUNDLE_INSTALL_DIR)/$(WOBUNDLE_DIR_NAME); \ # $(TAR) chf - --exclude=CVS --exclude=.svn --to-stdout $(WOBUNDLE_DIR_NAME) | (cd $(WOBUNDLE_INSTALL_DIR); $(TAR) xf -) if [ -e $(WOBUNDLE_INSTALL_DIR)/$(WOBUNDLE_DIR_NAME) ]; then rm -rf $(WOBUNDLE_INSTALL_DIR)/$(WOBUNDLE_DIR_NAME); fi; \ cp -LR $(WOBUNDLE_DIR_NAME) $(WOBUNDLE_INSTALL_DIR) ifneq ($(CHOWN_TO),) $(CHOWN) -R $(CHOWN_TO) $(WOBUNDLE_INSTALL_DIR)/$(WOBUNDLE_DIR_NAME) endif ifeq ($(strip),yes) $(STRIP) $(WOBUNDLE_INSTALL_DIR)/$(WOBUNDLE_FILE) endif $(WOBUNDLE_INSTALL_DIR):: @$(MKINSTALLDIRS) $@ internal-wobundle-uninstall_:: shared-instance-headers-uninstall rm -rf $(WOBUNDLE_INSTALL_DIR)/$(WOBUNDLE_DIR_NAME) endif endif ## Local variables: ## mode: makefile ## End: SOPE/sope-appserver/NGObjWeb/TROUBLESHOOTING0000644000000000000000000000177212242733417017120 0ustar rootrootCollect "common" issues around NGObjWeb ... ___________________________________________________________________________ * Endless Recursion in sope -authenticatorInContext: sope coredump, endless recursion: -authenticatorInContext: ---snip--- #1038 0x00eda4c4 in -[OFSFolder authenticatorInContext:] (self=0x937b30, _cmd=0x3be4, _ctx=0x9387d0) at OFSFolder.m:747 #1039 0x00ed4074 in -[OFSBaseObject authenticatorInContext:] (self=0x943f30, _cmd=0x3be4, _ctx=0x9387d0) at OFSBaseObject.m:219 ---snap--- - this occures if htpasswd cannot be resolved as the authenticator - htpasswd will be returned as a regular file (OFSFile object) which leads to a recursion use: -SoOFSDebugAuthLookup YES to detect - htpasswd becomes an OFSFile instead of a OFSHttpPasswd because the core SoProducts (SoOFS.sxp) are not properly found! - mixed up on GNUstep on MacOSX use: SoProductRegistryDebugEnabled YES to detect ___________________________________________________________________________ SOPE/sope-appserver/NGObjWeb/WORequestHandler+private.h0000644000000000000000000000336012242733417021714 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGObjWeb_WORequestHandler_private_H__ #define __NGObjWeb_WORequestHandler_private_H__ #include #include @class WOSession, WOResponse, WOContext, WOComponent; @interface WORequestHandler(Cookies) - (void)addCookiesForSession:(WOSession *)_sn toResponse:(WOResponse *)_response inContext:(WOContext *)_ctx; @end @interface WORequest(DblClickBrowser) /* returns whether the user agent is one, which does two clicks per request */ - (BOOL)isDoubleClickBrowser; @end @interface WORequestHandler(SemiPrivate) - (WOResponse *)doubleClickResponseForContext:(WOContext *)_ctx; - (void)saveSession:(WOSession *)_session inContext:(WOContext *)_ctx withResponse:(WOResponse *)_response application:(WOApplication *)_app; - (WOResponse *)generateResponseForComponent:(WOComponent *)_component inContext:(WOContext *)_ctx application:(WOApplication *)_app; @end #endif /* __NGObjWeb_WORequestHandler_private_H__ */ SOPE/sope-appserver/NGObjWeb/ngobjweb.make0000644000000000000000000000117412242733417017336 0ustar rootroot# settings for NGObjWeb based applications WO_LDFLAGS = WO_DEFINE = -DNGObjWeb_LIBRARY=1 ifneq ($(frameworks),yes) WO_LIBS = -lNGObjWeb -lNGMime -lNGStreams -lNGExtensions ifeq ($(FOUNDATION_LIB),apple) WO_LIBS += \ -lNGMime -lNGStreams -lNGExtensions -lEOControl \ -lXmlRpc -lDOM -lSaxObjC endif else WO_LIBS = \ -framework NGObjWeb \ -framework NGMime \ -framework NGStreams \ -framework NGExtensions ifeq ($(FOUNDATION_LIB),apple) WO_LIBS += \ -framework NGMime \ -framework NGStreams -framework NGExtensions -framework EOControl \ -framework XmlRpc -framework DOM -framework SaxObjC endif endif SOPE/sope-appserver/NGObjWeb/GNUmakefile0000644000000000000000000001037612242733417016760 0ustar rootroot# GNUstep makefile include ../../config.make include ../common.make include ./Version ifneq ($(frameworks),yes) LIBRARY_NAME = libNGObjWeb else FRAMEWORK_NAME = NGObjWeb endif ifneq ($(frameworks),yes) RESOURCES_DIR = $(SOPE_NGOBJWEB)/ endif libNGObjWeb_PCH_FILE = common.h libNGObjWeb_INTERFACE_VERSION=$(MAJOR_VERSION).$(MINOR_VERSION) libNGObjWeb_INSTALL_DIR=$(SOPE_SYSLIBDIR) libNGObjWeb_VERSION=$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBMINOR_VERSION) libNGObjWeb_SUBPROJECTS = \ NGHttp \ Associations \ Templates \ DynamicElements \ WOHttpAdaptor \ SoObjects \ WebDAV \ libNGObjWeb_HEADER_FILES_DIR = NGObjWeb libNGObjWeb_HEADER_FILES_INSTALL_DIR = /NGObjWeb libNGObjWeb_RESOURCES = \ Defaults.plist \ Languages.plist \ DAVPropMap.plist FHS_MANPAGES += \ sope-ngobjweb-defaults.5 \ doc/*.3 libNGObjWeb_HEADER_FILES = \ NGObjWebDecls.h \ NGObjWeb.h \ OWResponder.h \ OWViewRequestHandler.h \ OWResourceManager.h \ WEClientCapabilities.h \ WOActionResults.h \ WOAdaptor.h \ WOApplication.h \ WOCoreApplication.h \ WOAssociation.h \ WOComponent.h \ WOContext.h \ WOCookie.h \ WODirectAction.h \ WODisplayGroup.h \ WODynamicElement.h \ WOElement.h \ WOHTTPConnection.h \ WOMailDelivery.h \ WOMessage.h \ WORequest.h \ WORequestHandler.h \ WOResourceManager.h \ WOResponse.h \ WOSession.h \ WOSessionStore.h \ WOStatisticsStore.h \ WOTemplateBuilder.h \ WOxElemBuilder.h \ WOTemplate.h \ WOComponentScript.h \ WOProxyRequestHandler.h \ WOPageGenerationContext.h \ WOElementTrackingContext.h \ WOComponentDefinition.h \ NSString+JavaScriptEscaping.h \ WOHTMLDynamicElement.h \ WOActionURL.h \ NGObjWebCore_OBJC_FILES = \ NSObject+WO.m \ WOApplication+defaults.m \ WOApplication.m \ WOCoreApplication.m \ WOComponent.m \ WOComponent+Sync.m \ WOComponentDefinition.m \ WOComponentFault.m \ WOContext.m \ WOElement.m \ WOMessage.m \ WORequest.m \ WOResourceManager.m \ WOResponse.m \ WORunLoop.m \ WOSession.m \ WOSessionStore.m \ WOStatisticsStore.m \ _WOStringTable.m \ WOElementID.m \ libNGObjWeb_OBJC_FILES = \ $(NGObjWebCore_OBJC_FILES) \ NGHttp+WO.m \ NGObjWeb.m \ OWViewRequestHandler.m \ OWResourceManager.m \ WEClientCapabilities.m \ WOAdaptor.m \ WOApplicationMain.m \ WOChildComponentReference.m \ WOComponentRequestHandler.m \ WOCookie.m \ WOCoreApplication+Bundle.m \ WODirectAction.m \ WODirectActionRequestHandler.m \ WODisplayGroup.m \ WODynamicElement.m \ WOFileSessionStore.m \ WOHTTPConnection.m \ WOHTTPURLHandle.m \ WOMailDelivery.m \ WOMessage+XML.m \ WOMessage+Validation.m \ WOPageRequestHandler.m \ WOProxyRequestHandler.m \ WORequestHandler.m \ WOResourceRequestHandler.m \ WOServerSessionStore.m \ WOSimpleHTTPParser.m \ WOStats.m \ NSString+JavaScriptEscaping.m \ ifeq ($(FOUNDATION_LIB),apple) libNGObjWeb_OBJC_FILES += WOWatchDogApplicationMainOSX.m else libNGObjWeb_OBJC_FILES += WOWatchDogApplicationMain.m endif ifeq ($(FOUNDATION_LIB),fd) NGObjWebCore_OBJC_FILES += WOServerDefaults.m endif # framework support NGObjWeb_PCH_FILE = $(libNGObjWeb_PCH_FILE) NGObjWeb_HEADER_FILES_DIR = NGObjWeb NGObjWeb_HEADER_FILES = $(libNGObjWeb_HEADER_FILES) NGObjWeb_OBJC_FILES = $(libNGObjWeb_OBJC_FILES) NGObjWeb_SUBPROJECTS = $(libNGObjWeb_SUBPROJECTS) NGObjWeb_RESOURCE_FILES = $(libNGObjWeb_RESOURCES) # ----- SoCore product for SOPE core registrations BUNDLE_NAME = SoCore BUNDLE_EXTENSION = .sxp BUNDLE_INSTALL_DIR = $(SOPE_PRODUCTS)/ SoCore_PCH_FILE = common.h SoCore_OBJC_FILES = SoCoreProduct.m SoCore_RESOURCE_FILES = SoObjects/product.plist Version SoCore_PRINCIPAL_CLASS = SoCoreProduct # ----- NGObjWeb tools TOOL_NAME = wod wod_PCH_FILE += common.h wod_OBJC_FILES += wod.m $(NGObjWebCore_OBJC_FILES) wod_SUBPROJECTS = Templates Associations # building -include GNUmakefile.preamble ifneq ($(FHS_INSTALL_ROOT),) GNUSTEP_HEADERS=$(DESTDIR)$(FHS_INSTALL_ROOT)/include endif ifneq ($(frameworks),yes) include $(GNUSTEP_MAKEFILES)/library.make else include $(GNUSTEP_MAKEFILES)/framework.make endif include $(GNUSTEP_MAKEFILES)/bundle.make include $(GNUSTEP_MAKEFILES)/tool.make -include GNUmakefile.postamble SOPE/sope-appserver/NGObjWeb/GNUmakefile.postamble0000644000000000000000000000225712242733417020744 0ustar rootroot# postprocessing # install library resources ifneq ($(frameworks),yes) $(RESOURCES_DIR) : $(MKDIRS) $(RESOURCES_DIR) ngobjweb-resources : $(RESOURCES_DIR) $(libNGObjWeb_RESOURCES) @(if [ "$(libNGObjWeb_RESOURCES)" != "" ]; then \ echo "Copying resources into install path ..."; \ for ff in $(libNGObjWeb_RESOURCES); do \ cp $$ff $(RESOURCES_DIR)/$$ff; \ done; \ fi) after-install :: ngobjweb-resources endif # install makefiles after-install :: $(DESTDIR)/$(GNUSTEP_MAKEFILES)/Additional/ngobjweb.make ifneq ($(GNUSTEP_MAKE_VERSION),1.3.0) after-install :: $(DESTDIR)/$(GNUSTEP_MAKEFILES)/woapp.make $(DESTDIR)/$(GNUSTEP_MAKEFILES)/wobundle.make endif $(DESTDIR)/$(GNUSTEP_MAKEFILES)/Additional/ngobjweb.make: ngobjweb.make $(MKDIRS) $(DESTDIR)/$(GNUSTEP_MAKEFILES)/Additional/ $(INSTALL_DATA) ngobjweb.make $(DESTDIR)/$(GNUSTEP_MAKEFILES)/Additional/ngobjweb.make $(DESTDIR)/$(GNUSTEP_MAKEFILES)/woapp.make: woapp-gs.make $(INSTALL_DATA) woapp-gs.make \ $(DESTDIR)/$(GNUSTEP_MAKEFILES)/woapp.make $(DESTDIR)/$(GNUSTEP_MAKEFILES)/wobundle.make: wobundle-gs.make $(INSTALL_DATA) wobundle-gs.make \ $(DESTDIR)/$(GNUSTEP_MAKEFILES)/wobundle.make SOPE/sope-appserver/NGObjWeb/WOFileSessionStore.m0000644000000000000000000001377712242733417020602 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include /* This store keeps all sessions as archived files inside of a directory. It provides session fail-over, but restoring/saving a session takes some time ... Storage format: session-directory/ sessionid.session sessionid.session The session-directory can be selected using the WOFileSessionPath default. Note: it doesn't provide session distribution between instances, since the store doesn't lock the session files. */ @class NSString, NSFileManager; @interface WOFileSessionStore : WOSessionStore { NSFileManager *fileManager; NSString *snPath; } @end #include #include #include #include "common.h" @implementation WOFileSessionStore static BOOL logExpire = YES; - (id)initWithSessionPath:(NSString *)_path { NSFileManager *fm; BOOL isDir; if ([_path length] == 0) { [self release]; return nil; } fm = [NSFileManager defaultManager]; if (![fm fileExistsAtPath:_path isDirectory:&isDir]) { if (![fm createDirectoryAtPath:_path attributes:nil]) { NSLog(@"%s: could not create a directory at path: %@", __PRETTY_FUNCTION__, _path); [self release]; return nil; } } else if (!isDir) { NSLog(@"%s: not a directory path: %@", __PRETTY_FUNCTION__, _path); [self release]; return nil; } if ((self = [super init])) { self->snPath = [_path copy]; self->fileManager = [fm retain]; } return self; } - (id)init { NSString *p; p = [[NSUserDefaults standardUserDefaults] stringForKey:@"WOFileSessionPath"]; return [self initWithSessionPath:p]; } - (void)dealloc { [self->fileManager release]; [self->snPath release]; [super dealloc]; } /* accessors */ - (int)activeSessionsCount { return 0; //return [[self->fileManager directoryContentsAtPath:self->snPath] count]; } /* store */ - (NSString *)pathForSessionID:(NSString *)_sid { return [self->snPath stringByAppendingPathComponent:_sid]; } - (void)saveSessionForContext:(WOContext *)_context { WOSession *sn; NSString *snp; if (![_context hasSession]) return; sn = [_context session]; snp = [self pathForSessionID:[sn sessionID]]; if ([sn isTerminating]) { sn = RETAIN(sn); // TODO: NOT IMPLEMENTED (serialized-session termination) //NSMapRemove(self->idToSession, [sn sessionID]); NSLog(@"session %@ terminated at %@ ..", [sn sessionID], [NSCalendarDate calendarDate]); [sn release]; } else { NSData *data; data = [NSArchiver archivedDataWithRootObject:sn]; if (data) { if (![data writeToFile:snp atomically:YES]) { [self logWithFormat: @"could not write data of session %@ to file: '%@'", sn, snp]; } } else [self logWithFormat:@"could not archive session: '%@'", sn]; } } - (id)restoreSessionWithID:(NSString *)_sid request:(WORequest *)_request { NSAutoreleasePool *pool; NSString *snp; WOSession *session = nil; if ([_sid length] == 0) return nil; if (![_sid isKindOfClass:[NSString class]]) { [self warnWithFormat:@"%s: got invalid session id (expected string !): %@", __PRETTY_FUNCTION__, _sid]; return nil; } if ([_sid isEqualToString:@"expired"]) return nil; pool = [[NSAutoreleasePool alloc] init]; { snp = [self pathForSessionID:_sid]; if ([self->fileManager fileExistsAtPath:snp]) { NSData *data; if ((data = [self->fileManager contentsAtPath:snp])) { session = [NSUnarchiver unarchiveObjectWithData:data]; // NSLog(@"unarchived session: %@", session); if (![session isKindOfClass:[WOSession class]]) { NSLog(@"object unarchived from %@ isn't a WOSession: %@ ...", snp, session); session = nil; } } else { [self logWithFormat:@"could not read sn file: '%@'", snp]; session = nil; } } else { [self logWithFormat:@"session file does not exist: '%@'", snp]; session = nil; } [session retain]; } [pool release]; if (logExpire) { if (session == nil) [self logWithFormat:@"session with id %@ expired.", _sid]; } return [session autorelease]; } /* termination */ - (void)sessionExpired:(NSString *)_sessionID { [self->lock lock]; { // TODO: NOT IMPLEMENTED (serialized session expiration) NSLog(@"%@ expired.", _sessionID); // NSMapRemove(self->idToSession, _sessionID); } [self->lock unlock]; } - (void)sessionTerminated:(WOSession *)_session { _session = RETAIN(_session); [self->lock lock]; { // TODO: NOT IMPLEMENTED (serialized session termination) NSLog(@"%@ terminated.", [_session sessionID]); // NSMapRemove(self->idToSession, [_session sessionID]); } [self->lock unlock]; RELEASE(_session); [[WOApplication application] logWithFormat: @"WOFileSessionStore: session %@ terminated.", [_session sessionID]]; } /* description */ - (NSString *)description { return [NSString stringWithFormat:@"<%@[0x%p]: path=%@>", NSStringFromClass([self class]), self, self->snPath]; } @end /* WOFileSessionStore */ SOPE/sope-appserver/NGObjWeb/_WOStringTable.m0000644000000000000000000001052512242733417017703 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "_WOStringTable.h" #include "common.h" @implementation _WOStringTable static NSStringEncoding stringFilesEncoding = NSUTF8StringEncoding; - (id)initWithPath:(NSString *)_path { if ((self = [super init])) { self->path = [_path copyWithZone:[self zone]]; } return self; } - (id)init { return [self initWithPath:nil]; } - (void)dealloc { [self->path release]; [self->lastRead release]; [self->data release]; [super dealloc]; } /* loading */ - (NSException *)_handlePropertyListParseException:(NSException *)_exception { [self logWithFormat:@"could not load strings file file '%@': %@", self->path, _exception]; self->data = nil; return nil; } - (void)checkState { NSString *tmp; NSDictionary *plist; NSData *sdata; if (self->data != nil) return; #if 0 #if Cocoa_FOUNDATION_LIBRARY /* potentially effects OGo ;-) */ /* For WO4.5 compatibility, we need first to try to open .strings file as a dictionary Dictionary must be either in UTF-8 or UTF-16 encoding. If we don't do that, then a dict in UTF-8 encoding will be opened as a dict using defaultCString encoding */ plist = [NSDictionary dictionaryWithContentsOfFile:self->path]; if (plist != nil) { self->data = [plist copy]; return; } #endif #endif /* If file was not a dictionary, then it's a standard strings file */ if ((sdata = [[NSData alloc] initWithContentsOfFile:self->path]) == nil) { [self errorWithFormat:@"could not read strings file: %@", self->path]; self->data = nil; return; } tmp = [[NSString alloc] initWithData:sdata encoding:stringFilesEncoding]; [sdata release]; sdata = nil; if (tmp == nil) { [self errorWithFormat:@"file is not in required encoding (%d): %@", stringFilesEncoding, self->path]; self->data = nil; return; } NS_DURING { if ((plist = [tmp propertyListFromStringsFileFormat]) == nil) { [self errorWithFormat:@"%s: could not load strings file '%@'", __PRETTY_FUNCTION__, self->path]; } [tmp release]; tmp = nil; self->data = [plist copy]; } NS_HANDLER { [tmp release]; tmp = nil; [[self _handlePropertyListParseException:localException] raise]; } NS_ENDHANDLER; } /* access */ - (NSString *)stringForKey:(NSString *)_key withDefaultValue:(NSString *)_def { NSString *value; [self checkState]; value = [self->data objectForKey:_key]; return value != nil ? value : _def; } /* fake being a dictionary */ - (NSEnumerator *)keyEnumerator { [self checkState]; return [self->data keyEnumerator]; } - (NSEnumerator *)objectEnumerator { [self checkState]; return [self->data objectEnumerator]; } - (id)objectForKey:(id)_key { [self checkState]; return [self->data objectForKey:_key]; } - (unsigned int)count { [self checkState]; return [self->data count]; } - (NSArray *)allKeys { [self checkState]; return [self->data allKeys]; } - (NSArray *)allValues { [self checkState]; return [self->data allValues]; } /* KVC */ - (id)valueForKey:(NSString *)_key { return [self objectForKey:_key]; } /* description */ - (NSString *)description { NSMutableString *ms; ms = [NSMutableString stringWithCapacity:128]; [ms appendFormat:@"<0x%p[%@]: ", self, NSStringFromClass([self class])]; if (self->path) [ms appendFormat:@" path='%@'", self->path]; if (self->data) [ms appendFormat:@" strings=#%d", [self->data count]]; if (self->lastRead) [ms appendFormat:@" loaddate=%@", self->lastRead]; [ms appendString:@">"]; return ms; } @end /* _WOStringTable */ SOPE/sope-appserver/NGObjWeb/woapi2man.py0000755000000000000000000001355312242733417017160 0ustar rootroot#!/usr/bin/python import sys, time, xml.dom.minidom # templates MANUAL="SOPE Dynamic Element Reference" COPYRIGHT="SKYRIX Software AG" HEADER=""".TH %(element)s %(section)i "%(month)s %(year)s" "SOPE" "%(manual)s" .\\" DO NOT EDIT: this file got autogenerated using woapi2man from: .\\" %(file)s .\\" .\\" Copyright (C) %(year)s %(copy)s. All rights reserved. .\\" ==================================================================== .\\" .\\" Copyright (C) %(year)s %(copy)s. All rights reserved. .\\" .\\" Check the COPYING file for further information. .\\" .\\" Created with the help of: .\\" http://www.schweikhardt.net/man_page_howto.html .\\" """ BUGS=""" .SH BUGS SOPE related bugs are collected in the OpenGroupware.org Bugzilla: http://bugzilla.opengroupware.org/ """ AUTHOR=""" .SH AUTHOR The SOPE community . """ SEEALSO=""" .SH SEE ALSO .BR sope-ngobjweb-defaults """ FOOTER="\n" PASSTHROUGHTEXT="This binding is a pass-through binding.\n" # Note: texts may not start with a single quote: ' DEFAULTSTEXT="Kind: %s\n" KINDTOTEXT={ 'Page Names': "The value of '%(name)s' will be used to lookup a WOComponent page.\n", 'Actions': "The '%(name)s' binding is evaluated as an action (a method which returns a WOComponent or other WOActionResults object).\n", 'Resources': "The value of '%(name)s' refers to a resource which will be looked up using the WOResourceManager.\n", 'YES/NO': "The value of '%(name)s' will be evaluated in a boolean context.\n", 'Frameworks': "The value of '%(name)s' must be the name of a framework or bundle to be used for resource lookups.\n", # 'Direct Actions': "The value of '%(name)s' refers to the name of a direct action method.\n", # 'Direct Action Classes': "The value of '%(name)s' refers to the name of a direct action class.\n" } # processing class DOMToManPage: def __init__(self, _path, _dom): self.path = _path self.dom = _dom self.out = sys.stdout def clear(self): self.path = None self.dom.unlink() self.dom = None def printManPageHeader(self, woroot): self.out.write(HEADER % { 'file': self.path, 'element': woroot.getAttribute('class'), 'section': 3, 'month': time.strftime("%B"), 'year': time.strftime("%Y"), 'manual': MANUAL, 'copy': COPYRIGHT }) def printManPageName(self, woroot): self.out.write("\n.SH NAME\n%s\n" % woroot.getAttribute('class')) def printManPageBugs(self, woroot): self.out.write(BUGS) def printManPageAuthor(self, woroot): self.out.write(AUTHOR) def printManPageSeeAlso(self, woroot): self.out.write(SEEALSO) def printManPageFooter(self, woroot): self.out.write(FOOTER) def printSynopsis(self, woroot): self.out.write("\n.SH SYNOPSIS\n") self.out.write(".B %s\n" % woroot.getAttribute('class')) self.out.write("{") for binding in woroot.getElementsByTagName("binding"): self.out.write(" %s; " % binding.getAttribute('name')) self.out.write("}\n") def escapeText(self, text): if text[0] == "'": return "\\" + text return text def getTextForBindingKind(self, binding, kind): if kind is None: return if len(kind) == 0: return if KINDTOTEXT.has_key(kind): info = { 'kind': kind, 'name': binding.getAttribute('name') } s = KINDTOTEXT[kind] s = s % info return s return DEFAULTSTEXT % ( kind, ) def printBindings(self, woroot): self.out.write("\n.SH BINDINGS\n") for binding in woroot.getElementsByTagName("binding"): self.out.write(".IP %s\n" % binding.getAttribute('name')) s = binding.getAttribute('passthrough') if (s and s == 'YES'): self.out.write(PASSTHROUGHTEXT) s = binding.getAttribute('defaults') if (s and len(s) > 0): self.out.write(self.getTextForBindingKind(binding, s)) def printValidation(self, woroot): vals = woroot.getElementsByTagName("validation") if (vals.length == 0): return self.out.write("\n.SH VALIDATION\n") for val in vals: m = val.getAttribute('message') if not m: continue if len(m) == 0: continue self.out.write("%s\n" % self.escapeText(m.capitalize())) def processDOM(self): woroot = self.dom.getElementsByTagName("wo")[0] self.printManPageHeader(woroot) self.printManPageName(woroot) self.printSynopsis(woroot) self.printValidation(woroot) self.printBindings(woroot) self.printManPageBugs(woroot) self.printManPageAuthor(woroot) self.printManPageSeeAlso(woroot) self.printManPageFooter(woroot) def processBinding(self, element): print " check binding", element.getAttribute('name') def processValidation(self, element): print " check validation:", element.getAttribute('message') def processWOTag(self, element): print "check element class", element.getAttribute('class') for binding in dom.getElementsByTagName("binding"): self.processBinding(binding) for subelem in dom.getElementsByTagName("validation"): self.processValidation(subelem) #class DOMToManPage # main function path = sys.argv[1] try: dom = xml.dom.minidom.parse(path) except IOError, e: sys.stderr.write("%s:0: %s\n" % ( path, e )) except xml.parsers.expat.ExpatError, xmle: sys.stderr.write("%s:%i: %s\n" % ( path, xmle.lineno, xmle )) if dom is None: sys.exit(1) cpu = DOMToManPage(path, dom) cpu.processDOM() cpu.clear() SOPE/sope-appserver/NGObjWeb/WOScriptedComponent.h0000644000000000000000000000217612242733417020764 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __WOScriptedComponent_H__ #define __WOScriptedComponent_H__ #include @class NGScriptLanguage; @class WOComponentScript, WOTemplate; @interface WOScriptedComponent : WOComponent { WOComponentScript *script; WOTemplate *template; NGScriptLanguage *language; id shadow; } @end #endif /* __WOScriptedComponent_H__ */ SOPE/sope-appserver/NGObjWeb/COPYING0000644000000000000000000006130312242733417015735 0ustar rootroot GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 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. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] 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 Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, 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 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 a program 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. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, 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 companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. 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, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library 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 compile 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) 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. c) 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. d) 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 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. 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 to 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 Library 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 Appendix: 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 Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library 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! SOPE/sope-appserver/NGObjWeb/WOComponentRequestHandler.m0000644000000000000000000002015612242733417022140 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Pulic License as published by the Free Software Foundation; either version 2, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "WOComponentRequestHandler.h" #include "WORequestHandler+private.h" #include "WOContext+private.h" #include #include #include #include #include #include "common.h" @interface WOApplication(Privates) - (WOSession *)_initializeSessionInContext:(WOContext *)_ctx; - (void)_setCurrentContext:(WOContext *)_ctx; @end @interface WORequestHandler(URI) - (BOOL)doesRejectFavicon; @end @implementation WOComponentRequestHandler - (WOResponse *)restoreSessionWithID:(NSString *)_sid inContext:(WOContext *)_ctx { WOApplication *app; WOSession *session; app = [WOApplication application]; if (_sid == nil) { // invalid session ID (or no session-ID ?!, which is no error ?) */ return [app handleSessionRestorationErrorInContext:_ctx]; } if ((session = [app restoreSessionWithID:_sid inContext:_ctx]) != nil) { /* awake restored session */ [_ctx setSession:session]; [session _awakeWithContext:_ctx]; [session awake]; return nil; } return [app handleSessionRestorationErrorInContext:_ctx]; } /* The request handler path of a component URI looks like this: sessionID/componentName/contextID/elementID/instance/server */ - (WOResponse *)handleRequest:(WORequest *)_request { // TODO: this should be integrated into the WORequestHandler default // mechanism NSString *sessionID = nil; WOApplication *application = nil; WOContext *context; WOResponse *response = nil; WOSession *session = nil; WOComponent *component = nil; BOOL isLocked = NO; NSString *handlerPath = nil; if (_request == nil) return nil; if ([self doesRejectFavicon] && [[_request uri] isNotNull]) { // TODO: code copied from WORequestHandler ... if ([@"/favicon.ico" isEqualToString:[_request uri]]) { response = [WOResponse responseWithRequest:_request]; [response setStatus:404 /* not found */]; [self debugWithFormat:@"rejected favicon request: %@", [_request uri]]; return response; } } application = [WOApplication application]; handlerPath = [_request requestHandlerPath]; #if 0 [self logWithFormat:@"[component request handler] path: '%@'", handlerPath]; #endif if (![application allowsConcurrentRequestHandling]) { [application lockRequestHandling]; isLocked = YES; } context = [WOContext contextWithRequest:_request]; [application _setCurrentContext:context]; /* parse handler path (URL) The format is: session/context.element-id */ if ([handlerPath isNotEmpty]) { NSArray *spath = [_request requestHandlerPathArray]; if ([spath count] > 1) [context setRequestSenderID:[spath objectAtIndex:1]]; if ([spath isNotEmpty]) sessionID = [spath objectAtIndex:0]; } if (![sessionID isNotEmpty]) sessionID = [application sessionIDFromRequest:_request]; #if 1 [self logWithFormat:@"%s: made context %@ (cid=%@, sn=%@) ..", __PRETTY_FUNCTION__, context, [context contextID], sessionID]; #endif [application awake]; /* restore or create session */ if ([sessionID isNotEmpty]) { if ((response = [self restoreSessionWithID:sessionID inContext:context])) session = nil; else { /* Note: this creates a _new_ session if the restoration handler did not return a response! We check that below by comparing the session IDs. */ session = [context session]; } [self debugWithFormat:@"restored session (id=%@): %@", sessionID, session]; if (session && (![sessionID isEqualToString:[session sessionID]])) { [self errorWithFormat:@"session-ids do not match (%@ vs %@)", sessionID, [session sessionID]]; } if ([session isNotNull]) { NSString *eid; /* only try to restore a page if we still have the same session and if the request contains an element-id (eg if we reconnect to the main URL we do not have an element-id */ eid = [context currentElementID]; if ([sessionID isEqualToString:[session sessionID]] && eid != nil) { /* awake stored page from "old" session */ component = [session restorePageForContextID:eid]; if (component == nil) { [self logWithFormat:@"could not restore component from session: %@", session]; response = [application handlePageRestorationErrorInContext:context]; } } else /* a new session was created (but no restore-error response ret.) */ component = [application pageWithName:nil inContext:context]; } else if (response == nil) { [[WOApplication application] warnWithFormat: @"got no session restoration error, " @"but missing session!"]; } } else { /* create new session */ session = [application _initializeSessionInContext:context]; if ([session isNotNull]) { /* awake created session */ [session awake]; component = [application pageWithName:nil inContext:context]; } else response = [application handleSessionCreationErrorInContext:context]; } if ((session != nil) && (component != nil) && (response == nil)) { WOComponent *newPage = nil; [[session retain] autorelease]; #if DEBUG NSAssert(application, @"missing application object .."); NSAssert(session, @"missing session object .."); #endif /* set request page in context */ [context setPage:component]; /* run take-values phase */ [application takeValuesFromRequest:_request inContext:context]; /* run invoke-action phase */ newPage = [application invokeActionForRequest:_request inContext:context]; /* process resulting page */ if (newPage == nil) { if ((newPage = [context page]) == nil) { newPage = [application pageWithName:nil inContext:context]; [context setPage:newPage]; } } else if ([newPage isKindOfClass:[WOComponent class]]) [context setPage:newPage]; [self debugWithFormat:@"%s: new page: %@", __PRETTY_FUNCTION__, newPage]; /* generate response */ response = [self generateResponseForComponent:[context page] inContext:context application:application]; } else { [self warnWithFormat:@"%s: did not enter request/response transaction ...", __PRETTY_FUNCTION__]; } /* tear down */ /* sleep objects */ [context sleepComponents]; [session sleep]; /* save objects */ if (session != nil) { if ([context savePageRequired]) [session savePage:[context page]]; [self debugWithFormat:@"saving session %@", [session sessionID]]; if ([session storesIDsInCookies]) { [self debugWithFormat:@"add cookie to session: %@", session]; [self addCookiesForSession:session toResponse:response inContext:context]; } #if 1 // TODO: explain that [application saveSessionForContext:context]; #else [self saveSession:session inContext:context withResponse:response application:application]; #endif } [application sleep]; /* locking */ if (isLocked) { [application unlockRequestHandling]; isLocked = NO; } [application _setCurrentContext:nil]; return response; } @end /* WOComponentRequestHandler */ SOPE/sope-appserver/NGObjWeb/WODirectActionRequestHandler.m0000644000000000000000000001600412242733417022543 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "WODirectActionRequestHandler.h" #include "WORequestHandler+private.h" #include "WOContext+private.h" #include #include #include #include #include #include #include #include #include "common.h" #if APPLE_RUNTIME || NeXT_RUNTIME # include #endif static BOOL usePool = NO; static BOOL perflog = NO; static BOOL debugOn = NO; static Class NSDateClass = Nil; @implementation WODirectActionRequestHandler + (void)initialize { NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; NSDateClass = [NSDate class]; perflog = [ud boolForKey:@"WOProfileDirectActionRequestHandler"]; } - (NSString *)loggingPrefix { return @"[da-handler]"; } /* The request handler part of a direct action URI looks like this: [actionClass/]actionName[?key=value&key=value&...] */ - (BOOL)isComponentClass:(Class)_clazz { if (_clazz == Nil) return NO; #if (defined(__GNU_LIBOBJC__) && (__GNU_LIBOBJC__ >= 20100911)) || defined(APPLE_RUNTIME) || defined(__GNUSTEP_RUNTIME__) while ((_clazz = class_getSuperclass(_clazz)) != Nil) { #else while ((_clazz = _clazz->super_class) != Nil) { #endif if (_clazz == [WOComponent class]) return YES; if (_clazz == [WODirectAction class]) return NO; if (_clazz == [NSObject class]) return NO; } return NO; } - (id)instantiateObjectForActionClass:(Class)actionClass inContext:(WOContext *)context application:(WOApplication *)app { WOComponent *component; if (actionClass == Nil) return nil; if (![self isComponentClass:actionClass]) { /* create direct action object */ id actionObject; if (![actionClass instancesRespondToSelector: @selector(initWithContext:)]) { [self logWithFormat:@"tried to use class '%@' as a direct-action class", NSStringFromClass(actionClass)]; return nil; } actionObject = [(WODirectAction *)[actionClass alloc] initWithContext:context]; actionObject = [actionObject autorelease]; return actionObject; } /* special initialization for WOComponents used as direct actions */ component = [app pageWithName:NSStringFromClass(actionClass) inContext:context]; [context setPage:(id)component]; if ([component shouldTakeValuesFromRequest:[context request] inContext:context]) [app takeValuesFromRequest:[context request] inContext:context]; return component; } - (WOResponse *)handleRequest:(WORequest *)_request inContext:(WOContext *)context session:(WOSession *)session application:(WOApplication *)app { NSAutoreleasePool *pool2; NSString *actionClassName; NSString *actionName; WOResponse *response; NSArray *handlerPath; Class actionClass = Nil; WODirectAction *actionObject = nil; id result = nil; pool2 = usePool ? [[NSAutoreleasePool alloc] init] : nil; *(&result) = nil; *(&response) = nil; *(&actionClassName) = nil; *(&actionName) = nil; *(&handlerPath) = nil; /* process path */ handlerPath = [_request requestHandlerPathArray]; if (debugOn) { [self debugWithFormat:@"path=%@ array=%@", [_request requestHandlerPath], handlerPath]; } // TODO: fix OGo bug #1028 switch ([handlerPath count]) { case 0: actionClassName = @"DirectAction"; actionName = @"default"; break; case 1: actionClassName = @"DirectAction"; actionName = [handlerPath objectAtIndex:0]; break; case 2: actionClassName = [handlerPath objectAtIndex:0]; actionName = [handlerPath objectAtIndex:1]; break; default: actionClassName = [handlerPath objectAtIndex:0]; actionName = [handlerPath objectAtIndex:1]; // TODO: set path info in ctx? if (debugOn) { [self logWithFormat:@"invalid direction action URL: %@", [_request requestHandlerPath]]; } break; } if ([actionName length] == 0) actionName = @"default"; if ((*(&actionClass) = NSClassFromString(actionClassName)) == Nil) { [self errorWithFormat:@"did not find direct action class %@", actionClassName]; actionClass = [WODirectAction class]; } if (debugOn) { [self debugWithFormat: @"[direct action request handler] class=%@ action=%@ ..", actionClassName, actionName]; } /* process request */ actionObject = [self instantiateObjectForActionClass:actionClass inContext:context application:app]; if (actionObject == nil) { [self errorWithFormat: @"could not create direct action object of class %@", actionClassName]; actionObject = nil; } else { static Class WOComponentClass = Nil; if (WOComponentClass == Nil) WOComponentClass = [WOComponent class]; result = [(id)[actionObject performActionNamed:actionName] retain]; if (result == nil) result = [[context page] retain]; if ([(id)result isKindOfClass:WOComponentClass]) { [(id)result _awakeWithContext:context]; [context setPage:(WOComponent *)result]; response = [self generateResponseForComponent:(WOComponent *)result inContext:context application:app]; if ([context hasSession]) { if ([context savePageRequired]) [[context session] savePage:(WOComponent *)result]; } response = [response retain]; } else { /* generate response */ response = [[result generateResponse] retain]; } [context sleepComponents]; [(id)result release]; result = nil; /* check whether a session was created */ if ((session == nil) && [context hasSession]) { session = [[[context session] retain] autorelease]; [session lock]; } if (usePool) { session = [session retain]; [pool2 release]; pool2 = nil; session = [session autorelease]; } response = [response autorelease]; } return response; } @end /* WODirectActionRequestHandler */ SOPE/sope-appserver/NGObjWeb/NGHttp+WO.h0000644000000000000000000000256112242733417016541 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGObjWeb_NGHttp_WO_H__ #define __NGObjWeb_NGHttp_WO_H__ #include @class NSString, NSData, NSArray; @class WORequest; @interface NGHttpRequest(WOSupport) /* transformation */ - (id)initWithWORequest:(WORequest *)_request; - (WORequest *)woRequest; /* headers */ - (NSArray *)woHeaderKeys; - (NSString *)woHeaderForKey:(NSString *)_key; - (NSArray *)woHeadersForKey:(NSString *)_key; /* cookies */ - (NSArray *)woCookies; /* content */ - (NSData *)woContent; /* form parameters */ - (NGHashMap *)formParameters; @end #endif /* __NGObjWeb_NGHttpRequest_WO_H__ */ SOPE/sope-appserver/NGObjWeb/DynamicElements/0000755000000000000000000000000012242733417017760 5ustar rootrootSOPE/sope-appserver/NGObjWeb/DynamicElements/WOQuickTime.m0000644000000000000000000001120412242733417022275 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include "WOElement+private.h" #include #include #include "decommon.h" /* A QuickTime movie, picture, ... The HTML tag attributes are described at: http://www.apple.com/quicktime/authoring/embed2.html */ @interface WOQuickTime : WOHTMLDynamicElement { // WODynamicElement: extraAttributes // WODynamicElement: otherTagString @protected WOElement *template; WOAssociation *filename; WOAssociation *framework; WOAssociation *src; WOAssociation *action; WOAssociation *href; WOAssociation *pageName; WOAssociation *prefixHost; WOAssociation *width; WOAssociation *height; WOAssociation *pluginsPage; WOAssociation *hotspotList; WOAssociation *selection; WOAssociation *bgcolor; WOAssociation *target; WOAssociation *volume; WOAssociation *pan; WOAssociation *tilt; WOAssociation *fov; WOAssociation *node; WOAssociation *correction; WOAssociation *cache; WOAssociation *autoplay; WOAssociation *hidden; WOAssociation *playEveryFrame; WOAssociation *controller; } @end /* WOQuickTime */ @interface WODynamicElement(UsedPrivates) - (id)_initWithName:(NSString *)_name associations:(NSDictionary *)_config template:(WOElement *)_t; @end @implementation WOQuickTime - (id)initWithName:(NSString *)_name associations:(NSDictionary *)_config template:(WOElement *)_t { if ((self = [super _initWithName:_name associations:_config template:_t])) { self->template = [_t retain]; self->filename = OWGetProperty(_config, @"filename"); self->framework = OWGetProperty(_config, @"framework"); self->src = OWGetProperty(_config, @"src"); self->action = OWGetProperty(_config, @"action"); self->href = OWGetProperty(_config, @"href"); self->pageName = OWGetProperty(_config, @"pageName"); self->prefixHost = OWGetProperty(_config, @"prefixHost"); self->width = OWGetProperty(_config, @"width"); self->height = OWGetProperty(_config, @"height"); self->pluginsPage = OWGetProperty(_config, @"pluginsPage"); self->hotspotList = OWGetProperty(_config, @"hotspotList"); self->selection = OWGetProperty(_config, @"selection"); self->bgcolor = OWGetProperty(_config, @"bgcolor"); self->target = OWGetProperty(_config, @"target"); self->volume = OWGetProperty(_config, @"volume"); self->pan = OWGetProperty(_config, @"pan"); self->tilt = OWGetProperty(_config, @"tilt"); self->fov = OWGetProperty(_config, @"fov"); self->node = OWGetProperty(_config, @"node"); self->correction = OWGetProperty(_config, @"correction"); self->cache = OWGetProperty(_config, @"cache"); self->autoplay = OWGetProperty(_config, @"autoplay"); self->hidden = OWGetProperty(_config, @"hidden"); self->playEveryFrame = OWGetProperty(_config, @"playEveryFrame"); self->controller = OWGetProperty(_config, @"controller"); } return self; } - (void)dealloc { RELEASE(self->template); RELEASE(self->filename); RELEASE(self->framework); RELEASE(self->src); RELEASE(self->action); RELEASE(self->href); RELEASE(self->pageName); RELEASE(self->prefixHost); RELEASE(self->width); RELEASE(self->height); RELEASE(self->pluginsPage); RELEASE(self->hotspotList); RELEASE(self->selection); RELEASE(self->bgcolor); RELEASE(self->target); RELEASE(self->volume); RELEASE(self->pan); RELEASE(self->tilt); RELEASE(self->fov); RELEASE(self->node); RELEASE(self->correction); RELEASE(self->cache); RELEASE(self->autoplay); RELEASE(self->hidden); RELEASE(self->playEveryFrame); RELEASE(self->controller); [super dealloc]; } /* event handling */ /* HTML generation */ /* description */ @end SOPE/sope-appserver/NGObjWeb/DynamicElements/WOImageButton.api0000644000000000000000000000331312242733417023137 0ustar rootroot SOPE/sope-appserver/NGObjWeb/DynamicElements/WOHTMLDynamicElement.h0000644000000000000000000000253012242733417023762 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGObjWeb_WOHTMLDynamicElement_H__ #define __NGObjWeb_WOHTMLDynamicElement_H__ #include @class NSDictionary; @class WOAssociation, WOContext; @interface WOHTMLDynamicElement : WODynamicElement { // WODynamicElement: extraAttributes // WODynamicElement: otherTagString } @end @interface WOHTMLDynamicElement(ActiveElement) - (id)executeAction:(WOAssociation *)_action inContext:(WOContext *)_ctx; @end /* private functions */ NSDictionary *OWExtractQueryParameters(NSDictionary *_set); #endif /* __NGObjWeb_WOHTMLDynamicElement_H__ */ SOPE/sope-appserver/NGObjWeb/DynamicElements/WOSubmitButton.api0000644000000000000000000000201712242733417023360 0ustar rootroot SOPE/sope-appserver/NGObjWeb/DynamicElements/WOEntity.m0000644000000000000000000000655712242733417021675 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include "WOElement+private.h" #include #include #include #include #include "decommon.h" @interface WOEntity : WOHTMLDynamicElement { // WODynamicElement: extraAttributes // WODynamicElement: otherTagString @protected WOAssociation *name; } @end /* WOEntity */ @implementation WOEntity - (id)initWithElement:(id)_element templateBuilder:(WOxElemBuilder *)_builder { NSString *tname; NSMutableDictionary *assocs; id attrs; unsigned count; tname = [_element tagName]; /* construct associations */ assocs = nil; attrs = [_element attributes]; if ((count = [attrs length]) > 0) assocs = [_builder associationsForAttributes:attrs]; if ([tname isEqualToString:@"nbsp"]) { WOAssociation *a; a = [_builder associationForValue:@"nbsp"]; if (assocs) [assocs setObject:a forKey:@"name"]; else assocs = [NSMutableDictionary dictionaryWithObject:a forKey:@"name"]; } /* construct child elements */ if ([_element hasChildNodes]) { [_builder logWithFormat:@"WARNING: element %@ has child-nodes (ignored)", _element]; } /* construct self ... */ self = [self initWithName:tname associations:assocs contentElements:nil]; [(id)self setExtraAttributes:assocs]; return self; } - (id)initWithName:(NSString *)_name associations:(NSDictionary *)_config template:(WOElement *)_tmpl { if ((self = [super initWithName:_name associations:_config template:_tmpl])) { if ((self->name = OWGetProperty(_config, @"name")) == nil) { NSLog(@"%s: missing 'name' binding for entity element %@ (assocs=%@)...", __PRETTY_FUNCTION__, _name, _config); RELEASE(self); return nil; } } return self; } #if !LIB_FOUNDATION_BOEHM_GC - (void)dealloc { RELEASE(self->name); [super dealloc]; } #endif // ******************** responder ******************** - (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx { NSString *s; if ([_ctx isRenderingDisabled] || [[_ctx request] isFromClientComponent]) return; s = [self->name stringValueInComponent:[_ctx component]]; if ([s length] == 0) return; WOResponse_AddChar(_response, '&'); WOResponse_AddString(_response, s); WOResponse_AddChar(_response, ';'); } /* description */ - (NSString *)associationDescription { return [NSString stringWithFormat:@" name=%@", self->name]; } @end /* WOEntity */ SOPE/sope-appserver/NGObjWeb/DynamicElements/README0000644000000000000000000000151212242733417020637 0ustar rootrootDynamicElements =============== Class-Hierachy ============== WOElement WODynamicElement WOComponentContent WOComponentReference WOCompoundElement WOConditional WOHTMLDynamicElement WOEntity WOForm WOInput WOCheckBox WOCheckBoxList WOFileUpload WOHiddenField WOImageButton WOPasswordField WOPopUpButton WOBrowser WORadioButton WORadioButtonList WOResetButton WOSubmitButton WOText WOTextField WOHyperlink WONestedList WOBody WOGenericElement WOGenericContainer WOImage WOString WORepetition -- 1999-03-30, hh SOPE/sope-appserver/NGObjWeb/DynamicElements/WOHTMLDynamicElement.m0000644000000000000000000000766712242733417024007 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include "WOElement+private.h" #include "decommon.h" @implementation WOHTMLDynamicElement static BOOL debugActionExecute = NO; + (void)initialize { NSUserDefaults *ud; ud = [NSUserDefaults standardUserDefaults]; debugActionExecute = [ud boolForKey:@"WODebugActions"]; } /* active element */ - (id)executeAction:(WOAssociation *)_action inContext:(WOContext *)_ctx { // TODO: I think this is deprectated? id object; SEL act; if (_action == nil) { if (debugActionExecute) { [self logWithFormat:@"%@(%@): got no action to execute ..", NSStringFromClass([self class]), _ctx]; } return nil; } if ((object = [_ctx component]) == nil) { if (debugActionExecute) { [self logWithFormat:@"%@(%@): got no object to execute action: %@", NSStringFromClass([self class]), _ctx, _action]; } return nil; } if (![_action isValueConstant]) { /* action specified like this: action = doIt; */ id result; result = [_action valueInComponent:object]; if (debugActionExecute) { [self logWithFormat:@"%@(%@): executed dynamic action, got: %@", NSStringFromClass([self class]), _ctx, result]; } if ([result respondsToSelector:@selector(ensureAwakeInContext:)]) { if (debugActionExecute) { [self logWithFormat:@"%@(%@): ensure result is awake in ctx", NSStringFromClass([self class]), _ctx]; } [result ensureAwakeInContext:_ctx]; } return result; } /* action specified like this: action = "doIt"; */ [[_ctx component] debugWithFormat:@"WARNING: %@ used with 'string' action !", self]; act = NSSelectorFromString([_action stringValueInComponent:object]); if ([object respondsToSelector:act]) return [object performSelector:act]; [[_ctx component] logWithFormat: @"%@[0x%p]: %@ does not respond to action @%@", NSStringFromClass([self class]), self, object, NSStringFromSelector(act)]; return nil; } @end /* WOHTMLDynamicElement */ NSDictionary *OWExtractQueryParameters(NSDictionary *_set) { NSMutableDictionary *paras = nil; NSMutableArray *paraKeys = nil; NSEnumerator *keys; NSString *key; /* locate query parameters */ keys = [_set keyEnumerator]; while ((key = [keys nextObject])) { if ([key hasPrefix:@"?"]) { WOAssociation *value; if ([key isEqualToString:@"?wosid"]) continue; value = [_set objectForKey:key]; if (paraKeys == nil) { paraKeys = [NSMutableArray arrayWithCapacity:8]; paras = [NSMutableDictionary dictionaryWithCapacity:8]; } [paraKeys addObject:key]; [paras setObject:value forKey:[key substringFromIndex:1]]; } } // remove query parameters if (paraKeys) { unsigned cnt, count; for (cnt = 0, count = [paraKeys count]; cnt < count; cnt++) { [(NSMutableDictionary *)_set removeObjectForKey: [paraKeys objectAtIndex:cnt]]; } } // assign parameters return [paras copy]; } SOPE/sope-appserver/NGObjWeb/DynamicElements/_WOTemporaryHyperlink.m0000644000000000000000000001112212242733417024410 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "WOHyperlink.h" #include "WOHyperlinkInfo.h" #include "WOCompoundElement.h" #include #include "decommon.h" @implementation _WOTemporaryHyperlink static Class _WOSimpleActionHyperlinkClass = Nil; static Class _WOSimpleStringActionHyperlinkClass = Nil; static Class _WOActionHyperlinkClass = Nil; static Class _WOPageHyperlinkClass = Nil; static Class _WOHrefHyperlinkClass = Nil; static Class _WOCommonStaticDAHyperlinkClass = Nil; static Class _WODirectActionHyperlinkClass = Nil; + (void)initialize { static BOOL didInit = NO; if (didInit) return; didInit = YES; _WOSimpleActionHyperlinkClass = NSClassFromString(@"_WOSimpleActionHyperlink"); _WOSimpleStringActionHyperlinkClass = NSClassFromString(@"_WOSimpleStringActionHyperlink"); _WOActionHyperlinkClass = NSClassFromString(@"_WOActionHyperlink"); _WOPageHyperlinkClass = NSClassFromString(@"_WOPageHyperlink"); _WOHrefHyperlinkClass = NSClassFromString(@"_WOHrefHyperlink"); _WOCommonStaticDAHyperlinkClass = NSClassFromString(@"_WOCommonStaticDAHyperlink"); _WODirectActionHyperlinkClass = NSClassFromString(@"_WODirectActionHyperlink"); } - (id)initWithName:(NSString *)_name associations:(NSDictionary *)_config template:(WOElement *)_t { WOHyperlinkInfo *info; Class linkClass = Nil; if ((info = [(WOHyperlinkInfo *)[WOHyperlinkInfo alloc] initWithConfig:(id)_config]) == nil) { return nil; } if (info->action) { if (info->assocCount == 0) linkClass = [_WOSimpleActionHyperlinkClass class]; else if ((info->assocCount == 1) && (info->string != nil)) linkClass = [_WOSimpleStringActionHyperlinkClass class]; else linkClass = [_WOActionHyperlinkClass class]; } else if (info->pageName) { linkClass = [_WOPageHyperlinkClass class]; } else if (info->href) { linkClass = [_WOHrefHyperlinkClass class]; } else if (info->directActionName) { linkClass = Nil; if (info->assocCount < 3) { if ([info->directActionName isValueConstant]) { if (info->actionClass == nil || ([info->actionClass isValueConstant])) { if (info->assocCount == 1) { if (info->queryParameters != nil || info->string != nil) linkClass = [_WOCommonStaticDAHyperlinkClass class]; } else if (info->assocCount == 2 && (info->queryParameters != nil) && (info->string != nil)) { linkClass = [_WOCommonStaticDAHyperlinkClass class]; } } } } if (linkClass == Nil) linkClass = [_WODirectActionHyperlinkClass class]; } else { NSLog(@"%s: found no setting for link named '%@', assocs %@", __PRETTY_FUNCTION__, _name, _config); return nil; } self = [[linkClass alloc] initWithName:_name hyperlinkInfo:info template:_t]; [info release]; info = nil; return self; } - (id)initWithName:(NSString *)_name associations:(NSDictionary *)_associations contentElements:(NSArray *)_contents { WOCompoundElement *template; int count; count = [_contents count]; if (count == 0) { template = nil; } else if (count == 1) { template = [_contents objectAtIndex:0]; } else { template = [[WOCompoundElement allocForCount:[_contents count] zone:[self zone]] initWithContentElements:_contents]; [template autorelease]; } return [self initWithName:_name associations:_associations template:template]; } - (void)dealloc { [self errorWithFormat:@"called dealloc on %@", self]; #if DEBUG abort(); #endif return; // make Tiger GCC / gcc 4.1 happy if (0) [super dealloc]; } @end /* _WOTemporaryHyperlink */ SOPE/sope-appserver/NGObjWeb/DynamicElements/WOFrame.m0000644000000000000000000003044312242733417021442 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "WOElement+private.h" #include #include #include #include #include "decommon.h" #define FRAME_TYPE_None 0 #define FRAME_TYPE_Page 1 #define FRAME_TYPE_Href 2 #define FRAME_TYPE_Value 3 #define FRAME_TYPE_DA 4 @interface WOFrame : WOHTMLDynamicElement { // WODynamicElement: extraAttributes // WODynamicElement: otherTagString @protected /* new in WO4 */ WOAssociation *queryDictionary; NSDictionary *queryParameters; /* associations beginning with ? */ } @end @interface _WOPageFrame : WOFrame { WOAssociation *pageName; } @end @interface _WOHrefFrame : WOFrame { WOAssociation *src; } @end @interface _WOValueFrame : WOFrame { WOAssociation *value; } @end @interface _WODirectActionFrame : WOFrame { WOAssociation *actionClass; WOAssociation *directActionName; BOOL sidInUrl; /* include session-id in wa URL ? */ } @end @interface WOFrame(PrivateMethods) - (id)_initWithName:(NSString *)_name associations:(NSDictionary *)_config template:(WOElement *)_t; - (NSString *)associationDescription; @end #if COCOA_Foundation_LIBRARY || NeXT_Foundation_LIBRARY @interface NSObject(Miss) - (void)subclassResponsibility:(SEL)_cmd; @end #endif @implementation WOFrame - (id)initWithName:(NSString *)_name associations:(NSDictionary *)_config template:(WOElement *)_t { Class frameClass = Nil; if ([_config objectForKey:@"value"]) frameClass = [_WOValueFrame class]; else if ([_config objectForKey:@"pageName"]) frameClass = [_WOPageFrame class]; else if ([_config objectForKey:@"src"]) frameClass = [_WOHrefFrame class]; else frameClass = [_WODirectActionFrame class]; [self release]; return [[frameClass alloc] initWithName:_name associations:_config template:_t]; } - (id)_initWithName:(NSString *)_name associations:(NSDictionary *)_config template:(WOElement *)_tmpl { if ((self = [super initWithName:_name associations:_config template:_tmpl])) { self->queryDictionary = OWGetProperty(_config, @"queryDictionary"); self->queryParameters = OWExtractQueryParameters(_config); } return self; } - (void)dealloc { RELEASE(self->queryDictionary); RELEASE(self->queryParameters); [super dealloc]; } // ******************** responder ******************** #define StrVal(__x__) [self->__x__ stringValueInComponent:sComponent] - (BOOL)_appendHrefToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx { [self subclassResponsibility:_cmd]; return NO; } - (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx { WOComponent *sComponent; NSString *queryString; if ([_ctx isRenderingDisabled] || [[_ctx request] isFromClientComponent]) return; sComponent = [_ctx component]; queryString = nil; WOResponse_AddCString(_response, "queryDictionary valueInComponent:sComponent] andQueryParameters:self->queryParameters inContext:_ctx]; } if (queryString) { [_response appendContentCharacter:'?']; WOResponse_AddString(_response, queryString); } WOResponse_AddChar(_response, '"'); [self appendExtraAttributesToResponse:_response inContext:_ctx]; if (self->otherTagString) { WOResponse_AddChar(_response, ' '); WOResponse_AddString(_response, [self->otherTagString stringValueInComponent: sComponent]); } WOResponse_AddEmptyCloseParens(_response, _ctx); } // description - (NSString *)associationDescription { return @""; } @end /* WOFrame */ @implementation _WOPageFrame - (id)initWithName:(NSString *)_name associations:(NSDictionary *)_config template:(WOElement *)_t { if ((self = [super _initWithName:_name associations:_config template:_t])) { self->pageName = OWGetProperty(_config, @"pageName"); if (self->pageName == nil) { NSLog(@"missing pageName association for WOFrame .."); RELEASE(self); return nil; } #if DEBUG if ([_config objectForKey:@"value"] || [_config objectForKey:@"src"] || [_config objectForKey:@"directActionName"] || [_config objectForKey:@"actionClass"]) { NSLog(@"WARNING: inconsistent association settings in WOFrame !" @" (assign only one of pageName, href, " @"directActionName or action)"); } #endif } return self; } #if !LIB_FOUNDATION_BOEHM_GC - (void)dealloc { RELEASE(self->pageName); [super dealloc]; } #endif /* value generation */ - (id)invokeActionForRequest:(WORequest *)_request inContext:(WOContext *)_ctx { NSString *name; WOComponent *page; name = [self->pageName stringValueInComponent:[_ctx component]]; page = [[WOApplication application] pageWithName:name inContext:_ctx]; [[_ctx component] debugWithFormat:@"deliver page %@", [page name]]; return page; } /* href generation */ - (BOOL)_appendHrefToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx { WOResponse_AddString(_response, [_ctx componentActionURL]); return YES; } /* description */ - (NSString *)associationDescription { NSMutableString *str = [NSMutableString stringWithCapacity:256]; [str appendFormat:@" pageName=%@", self->pageName]; [str appendString:[super associationDescription]]; return str; } @end /* _WOPageFrame */ @implementation _WOHrefFrame - (id)initWithName:(NSString *)_name associations:(NSDictionary *)_config template:(WOElement *)_t { if ((self = [super _initWithName:_name associations:_config template:_t])) { self->src = OWGetProperty(_config, @"src"); if (self->src == nil) { NSLog(@"missing src association for WOFrame .."); RELEASE(self); return nil; } #if DEBUG if ([_config objectForKey:@"value"] || [_config objectForKey:@"pageName"] || [_config objectForKey:@"directActionName"] || [_config objectForKey:@"actionClass"]) { NSLog(@"WARNING: inconsistent association settings in WOFrame !" @" (assign only one of pageName, src, directActionName or value)"); } #endif } return self; } #if !LIB_FOUNDATION_BOEHM_GC - (void)dealloc { RELEASE(self->src); [super dealloc]; } #endif /* URI generation */ - (BOOL)_appendHrefToResponse:(WOResponse *)_r inContext:(WOContext *)_ctx { WOResponse_AddString(_r, [self->src stringValueInComponent:[_ctx component]]); return YES; } /* description */ - (NSString *)associationDescription { NSMutableString *str = [NSMutableString stringWithCapacity:256]; [str appendFormat:@" src=%@", self->src]; [str appendString:[super associationDescription]]; return str; } @end /* _WOHrefFrame */ @implementation _WODirectActionFrame - (id)initWithName:(NSString *)_name associations:(NSDictionary *)_config template:(WOElement *)_t { if ((self = [super _initWithName:_name associations:_config template:_t])) { WOAssociation *sidInUrlAssoc; sidInUrlAssoc = OWGetProperty(_config, @"?wosid"); self->actionClass = OWGetProperty(_config, @"actionClass"); self->directActionName = OWGetProperty(_config, @"directActionName"); self->sidInUrl = (sidInUrlAssoc) ? [sidInUrlAssoc boolValueInComponent:nil] : YES; #if DEBUG if ([_config objectForKey:@"value"] || [_config objectForKey:@"src"] || [_config objectForKey:@"pageName"]) { NSLog(@"WARNING: inconsistent association settings in WOFrame !" @" (assign only one of value, src, directActionName or pageName)"); } #endif } return self; } #if !LIB_FOUNDATION_BOEHM_GC - (void)dealloc { RELEASE(self->actionClass); RELEASE(self->directActionName); [super dealloc]; } #endif /* href */ - (BOOL)_appendHrefToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx { WOComponent *sComponent; NSString *daClass; NSString *daName; NSMutableDictionary *qd; NSDictionary *tmp; sComponent = [_ctx component]; daClass = [self->actionClass stringValueInComponent:sComponent]; daName = [self->directActionName stringValueInComponent:sComponent]; if (daClass) { if (daName) { if (![daClass isEqualToString:@"DirectAction"]) daName = [NSString stringWithFormat:@"%@/%@", daClass, daName]; } else daName = daClass; } qd = [NSMutableDictionary dictionaryWithCapacity:16]; /* add query dictionary */ if (self->queryDictionary) { if ((tmp = [self->queryDictionary valueInComponent:sComponent])) [qd addEntriesFromDictionary:tmp]; } /* add ?style parameters */ if (self->queryParameters) { NSEnumerator *keys; NSString *key; keys = [self->queryParameters keyEnumerator]; while ((key = [keys nextObject])) { id assoc, value; assoc = [self->queryParameters objectForKey:key]; value = [assoc stringValueInComponent:sComponent]; [qd setObject:(value != nil ? value : (id)@"") forKey:key]; } } /* add session ID */ if (self->sidInUrl) { if ([_ctx hasSession]) { WOSession *sn = [_ctx session]; [qd setObject:[sn sessionID] forKey:WORequestValueSessionID]; if (![sn isDistributionEnabled]) { [qd setObject:[[WOApplication application] number] forKey:WORequestValueInstance]; } } } WOResponse_AddString(_response, [_ctx directActionURLForActionNamed:daName queryDictionary:qd]); return NO; } /* description */ - (NSString *)associationDescription { NSMutableString *str = [NSMutableString stringWithCapacity:256]; if (self->actionClass) [str appendFormat:@" actionClass=%@", self->actionClass]; if (self->directActionName) [str appendFormat:@" directAction=%@", self->directActionName]; [str appendString:[super associationDescription]]; return str; } @end /* _WODirectActionFrame */ @implementation _WOValueFrame - (id)initWithName:(NSString *)_name associations:(NSDictionary *)_config template:(WOElement *)_t { if ((self = [super _initWithName:_name associations:_config template:_t])) { self->value = OWGetProperty(_config, @"value"); if (self->value == nil) { NSLog(@"missing value association for WOFrame .."); RELEASE(self); return nil; } #if DEBUG if ([_config objectForKey:@"pageName"] || [_config objectForKey:@"href"] || [_config objectForKey:@"directActionName"] || [_config objectForKey:@"actionClass"]) { NSLog(@"WARNING: inconsistent association settings in WOFrame !" @" (assign only one of pageName, href, directActionName or value)"); } #endif } return self; } #if !LIB_FOUNDATION_BOEHM_GC - (void)dealloc { RELEASE(self->value); [super dealloc]; } #endif /* dynamic invocation */ - (id)invokeActionForRequest:(WORequest *)_request inContext:(WOContext *)_ctx { return [self->value valueInComponent:[_ctx component]]; } - (BOOL)_appendHrefToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx { WOResponse_AddString(_response, [_ctx componentActionURL]); return YES; } /* description */ - (NSString *)associationDescription { NSMutableString *str = [NSMutableString stringWithCapacity:256]; [str appendFormat:@" value=%@", self->value]; [str appendString:[super associationDescription]]; return str; } @end /* _WOValueFrame */ SOPE/sope-appserver/NGObjWeb/DynamicElements/WOPasswordField.api0000644000000000000000000000051712242733417023472 0ustar rootroot SOPE/sope-appserver/NGObjWeb/DynamicElements/WOxXULElemBuilder.m0000644000000000000000000000401112242733417023352 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import /* This builder builds all standard elements which are defined in the XUL namespace. Supported tags: - all other tags are represented using either WOGenericElement or WOGenericContainer, so this builder is "final destination" for all XUL related tags. "); } // description - (NSString *)associationDescription { return @""; } @end /* WOIFrame */ @implementation _WOPageIFrame - (id)initWithName:(NSString *)_name associations:(NSDictionary *)_config template:(WOElement *)_t { if ((self = [super _initWithName:_name associations:_config template:_t])) { self->pageName = OWGetProperty(_config, @"pageName"); if (self->pageName == nil) { NSLog(@"missing pageName association for WOIFrame .."); [self release]; return nil; } #if DEBUG if ([_config objectForKey:@"value"] || [_config objectForKey:@"src"] || [_config objectForKey:@"directActionName"] || [_config objectForKey:@"actionClass"]) { NSLog(@"WARNING: inconsistent association settings in WOIFrame !" @" (assign only one of pageName, href, " @"directActionName or action)"); } #endif } return self; } - (void)dealloc { [self->pageName release]; [super dealloc]; } /* value generation */ - (id)invokeActionForRequest:(WORequest *)_request inContext:(WOContext *)_ctx { NSString *name; WOComponent *page; name = [self->pageName stringValueInComponent:[_ctx component]]; page = [[WOApplication application] pageWithName:name inContext:_ctx]; [[_ctx component] debugWithFormat:@"deliver page %@", [page name]]; return page; } /* href generation */ - (BOOL)_appendHrefToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx { WOResponse_AddString(_response, [_ctx componentActionURL]); return YES; } /* description */ - (NSString *)associationDescription { NSMutableString *str = [NSMutableString stringWithCapacity:256]; [str appendFormat:@" pageName=%@", self->pageName]; [str appendString:[super associationDescription]]; return str; } @end /* _WOPageIFrame */ @implementation _WOHrefIFrame - (id)initWithName:(NSString *)_name associations:(NSDictionary *)_config template:(WOElement *)_t { if ((self = [super _initWithName:_name associations:_config template:_t])) { self->src = OWGetProperty(_config, @"src"); if (self->src == nil) { NSLog(@"missing src association for WOIFrame .."); [self release]; return nil; } #if DEBUG if ([_config objectForKey:@"value"] || [_config objectForKey:@"pageName"] || [_config objectForKey:@"directActionName"] || [_config objectForKey:@"actionClass"]) { NSLog(@"WARNING: inconsistent association settings in WOIFrame !" @" (assign only one of pageName, src, directActionName or value)"); } #endif } return self; } - (void)dealloc { [self->src release]; [super dealloc]; } /* URI generation */ - (BOOL)_appendHrefToResponse:(WOResponse *)_r inContext:(WOContext *)_ctx { WOResponse_AddString(_r, [self->src stringValueInComponent:[_ctx component]]); return YES; } /* description */ - (NSString *)associationDescription { NSMutableString *str = [NSMutableString stringWithCapacity:256]; [str appendFormat:@" src=%@", self->src]; [str appendString:[super associationDescription]]; return str; } @end /* _WOHrefIFrame */ @implementation _WODirectActionIFrame - (id)initWithName:(NSString *)_name associations:(NSDictionary *)_config template:(WOElement *)_t { if ((self = [super _initWithName:_name associations:_config template:_t])) { WOAssociation *sidInUrlAssoc; sidInUrlAssoc = OWGetProperty(_config, @"?wosid"); self->actionClass = OWGetProperty(_config, @"actionClass"); self->directActionName = OWGetProperty(_config, @"directActionName"); self->sidInUrl = (sidInUrlAssoc) ? [sidInUrlAssoc boolValueInComponent:nil] : YES; #if DEBUG if ([_config objectForKey:@"value"] || [_config objectForKey:@"src"] || [_config objectForKey:@"pageName"]) { NSLog(@"WARNING: inconsistent association settings in WOIFrame !" @" (assign only one of value, src, directActionName or pageName)"); } #endif } return self; } - (void)dealloc { [self->actionClass release]; [self->directActionName release]; [super dealloc]; } /* href */ - (BOOL)_appendHrefToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx { WOComponent *sComponent; NSString *daClass; NSString *daName; NSMutableDictionary *qd; NSDictionary *tmp; sComponent = [_ctx component]; daClass = [self->actionClass stringValueInComponent:sComponent]; daName = [self->directActionName stringValueInComponent:sComponent]; if (daClass) { if (daName) { if (![daClass isEqualToString:@"DirectAction"]) daName = [NSString stringWithFormat:@"%@/%@", daClass, daName]; } else daName = daClass; } qd = [NSMutableDictionary dictionaryWithCapacity:16]; /* add query dictionary */ if (self->queryDictionary) { if ((tmp = [self->queryDictionary valueInComponent:sComponent])) [qd addEntriesFromDictionary:tmp]; } /* add ?style parameters */ if (self->queryParameters != nil) { NSEnumerator *keys; NSString *key; keys = [self->queryParameters keyEnumerator]; while ((key = [keys nextObject])) { id assoc, value; assoc = [self->queryParameters objectForKey:key]; value = [assoc stringValueInComponent:sComponent]; [qd setObject:(value != nil ? value : (id)@"") forKey:key]; } } /* add session ID */ if (self->sidInUrl) { if ([_ctx hasSession]) { WOSession *sn = [_ctx session]; [qd setObject:[sn sessionID] forKey:WORequestValueSessionID]; if (![sn isDistributionEnabled]) { [qd setObject:[[WOApplication application] number] forKey:WORequestValueInstance]; } } } WOResponse_AddString(_response, [_ctx directActionURLForActionNamed:daName queryDictionary:qd]); return NO; } /* description */ - (NSString *)associationDescription { NSMutableString *str = [NSMutableString stringWithCapacity:256]; if (self->actionClass) [str appendFormat:@" actionClass=%@", self->actionClass]; if (self->directActionName) [str appendFormat:@" directAction=%@", self->directActionName]; [str appendString:[super associationDescription]]; return str; } @end /* _WODirectActionIFrame */ @implementation _WOValueIFrame - (id)initWithName:(NSString *)_name associations:(NSDictionary *)_config template:(WOElement *)_t { if ((self = [super _initWithName:_name associations:_config template:_t])) { self->value = OWGetProperty(_config, @"value"); self->filename = OWGetProperty(_config, @"filename"); if (self->value == nil) { NSLog(@"missing value association for WOIFrame .."); [self release]; return nil; } #if DEBUG if ([_config objectForKey:@"pageName"] || [_config objectForKey:@"href"] || [_config objectForKey:@"directActionName"] || [_config objectForKey:@"actionClass"]) { NSLog(@"WARNING: inconsistent association settings in WOIFrame !" @" (assign only one of pageName, href, directActionName or value)"); } #endif } return self; } - (void)dealloc { [self->filename release]; [self->value release]; [super dealloc]; } /* dynamic invocation */ - (id)invokeActionForRequest:(WORequest *)_request inContext:(WOContext *)_ctx { return [self->value valueInComponent:[_ctx component]]; } - (BOOL)_appendHrefToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx { NSString *uri, *fn; uri = [_ctx componentActionURL]; fn = [self->filename stringValueInComponent:[_ctx component]]; if ([fn length] > 0) { uri = [uri stringByAppendingString:@"/"]; uri = [uri stringByAppendingString:fn]; } WOResponse_AddString(_response, uri); return YES; } /* description */ - (NSString *)associationDescription { NSMutableString *str = [NSMutableString stringWithCapacity:256]; [str appendFormat:@" value=%@", self->value]; [str appendString:[super associationDescription]]; return str; } @end /* _WOValueIFrame */ SOPE/sope-appserver/NGObjWeb/DynamicElements/WOMetaRefresh.m0000644000000000000000000001733712242733417022624 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include "WOElement+private.h" #include #include #include #include #include #include #include "decommon.h" /* WOMetaRefresh associations: href | pageName | action | (directActionName & actionClass) fragmentIdentifier disabled timeout/seconds */ @interface WOMetaRefresh : WOHTMLDynamicElement { // WODynamicElement: extraAttributes // WODynamicElement: otherTagString @protected WOAssociation *action; WOAssociation *href; WOAssociation *pageName; WOAssociation *directActionName; WOAssociation *actionClass; WOAssociation *disabled; WOAssociation *fragmentIdentifier; WOAssociation *timeout; WOAssociation *queryDictionary; NSDictionary *queryParameters; /* associations beginning with ? */ BOOL sidInUrl; } @end @implementation WOMetaRefresh - (id)initWithName:(NSString *)_name associations:(NSDictionary *)_config template:(WOElement *)_t { if ((self = [super initWithName:_name associations:_config template:_t])) { WOAssociation *sidInUrlAssoc; sidInUrlAssoc = OWGetProperty(_config, @"?wosid"); self->action = OWGetProperty(_config, @"action"); self->href = OWGetProperty(_config, @"href"); self->pageName = OWGetProperty(_config, @"pageName"); self->fragmentIdentifier = OWGetProperty(_config, @"fragmentIdentifier"); self->disabled = OWGetProperty(_config, @"disabled"); self->timeout = OWGetProperty(_config, @"timeout"); self->directActionName = OWGetProperty(_config, @"directActionName"); self->actionClass = OWGetProperty(_config, @"actionClass"); self->sidInUrl = (sidInUrlAssoc) ? [sidInUrlAssoc boolValueInComponent:nil] : YES; if (self->timeout == nil) self->timeout = OWGetProperty(_config, @"seconds"); else if ([OWGetProperty(_config, @"seconds") autorelease] != nil) { [self logWithFormat: @"WARNING: got both, 'timeout' and 'seconds' bindings!"]; } self->queryDictionary = OWGetProperty(_config, @"queryDictionary"); self->queryParameters = OWExtractQueryParameters(_config); } return self; } - (void)dealloc { [self->queryParameters release]; [self->queryDictionary release]; [self->directActionName release]; [self->actionClass release]; [self->action release]; [self->href release]; [self->pageName release]; [self->fragmentIdentifier release]; [self->disabled release]; [self->timeout release]; [super dealloc]; } /* handling requests */ - (id)invokeActionForRequest:(WORequest *)_request inContext:(WOContext *)_ctx { if ([self->disabled boolValueInComponent:[_ctx component]]) return nil; if (self->action) return [self executeAction:self->action inContext:_ctx]; if (self->pageName) { NSString *name; WOComponent *page; name = [self->pageName stringValueInComponent:[_ctx component]]; page = [[_ctx application] pageWithName:name inContext:_ctx]; if (page == nil) { [[_ctx component] logWithFormat: @"%@[0x%p]: did not find page with name %@ !", NSStringFromClass([self class]), self, name]; } [self debugWithFormat:@"showing page %@", page]; return page; } [[_ctx component] logWithFormat:@"%@[0x%p]: no action/page set !", NSStringFromClass([self class]), self]; return nil; } /* generating response */ - (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx { WOComponent *sComponent; int to; NSString *url; NSString *queryString; BOOL addSID; if ([_ctx isRenderingDisabled] || [[_ctx request] isFromClientComponent]) return; sComponent = [_ctx component]; queryString = nil; to = [self->timeout intValueInComponent:sComponent]; WOResponse_AddCString(_response, "sidInUrl; } else { url = [_ctx componentActionURL]; addSID = NO; } WOResponse_AddString(_response, url); queryString = [self queryStringForQueryDictionary: [self->queryDictionary valueInComponent:sComponent] andQueryParameters:self->queryParameters inContext:_ctx]; if (addSID && [sComponent hasSession]) { WOSession *sn = [sComponent session]; if ([queryString length] == 0) { queryString = [NSString stringWithFormat:@"%@=%@", WORequestValueSessionID, [sn sessionID]]; } else { queryString = [queryString stringByAppendingFormat:@"&%@=%@", WORequestValueSessionID, [sn sessionID]]; } } if (self->fragmentIdentifier) { [_response appendContentCharacter:'#']; WOResponse_AddString(_response, [self->fragmentIdentifier stringValueInComponent: sComponent]); } if (queryString) { [_response appendContentCharacter:'?']; WOResponse_AddString(_response, queryString); } [_response appendContentCharacter:'"']; // close CONTENT attribute [self appendExtraAttributesToResponse:_response inContext:_ctx]; if (self->otherTagString) { WOResponse_AddChar(_response, ' '); WOResponse_AddString(_response, [self->otherTagString stringValueInComponent: [_ctx component]]); } WOResponse_AddEmptyCloseParens(_response, _ctx); } /* description */ - (NSString *)associationDescription { NSMutableString *str = [NSMutableString stringWithCapacity:256]; if (self->action) [str appendFormat:@" action=%@", self->action]; if (self->href) [str appendFormat:@" href=%@", self->href]; if (self->pageName) [str appendFormat:@" pageName=%@", self->pageName]; if (self->fragmentIdentifier) [str appendFormat:@" fragment=%@", self->fragmentIdentifier]; if (self->disabled) [str appendFormat:@" disabled=%@", self->disabled]; return str; } @end /* WOMetaRefresh */ SOPE/sope-appserver/NGObjWeb/DynamicElements/WOCheckBox.api0000644000000000000000000000161712242733417022414 0ustar rootroot SOPE/sope-appserver/NGObjWeb/DynamicElements/WOComponentContent.m0000644000000000000000000001266712242733417023715 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "WOComponentContent.h" #include "WOContext+private.h" #include #include #include "decommon.h" @interface WOContext(ComponentStackCount) - (unsigned)componentStackCount; @end @implementation WOComponentContent static int profileComponents = -1; static Class NSDateClass = Nil; + (void)initialize { if (profileComponents == -1) { profileComponents = [[[NSUserDefaults standardUserDefaults] objectForKey:@"WOProfileComponents"] boolValue] ? 1 : 0; } if (NSDateClass == Nil) NSDateClass = [NSDate class]; } // responder - (void)takeValuesFromRequest:(WORequest *)_request inContext:(WOContext *)_ctx { WOElement *content; content = [_ctx componentContent]; // content (valid in parent) if (content) { NSTimeInterval st = 0.0; WOComponent *component = [_ctx component]; // reusable component component = RETAIN(component); content = RETAIN(content); if (profileComponents) st = [[NSDateClass date] timeIntervalSince1970]; [_ctx leaveComponent:component]; [content takeValuesFromRequest:_request inContext:_ctx]; [_ctx enterComponent:component content:content]; if (profileComponents) { NSTimeInterval diff; int i; diff = [[NSDateClass date] timeIntervalSince1970] - st; for (i = [_ctx componentStackCount]; i >= 0; i--) printf(" "); printf("content: [%s %s]: %0.3fs\n", [[component name] cString], #if (defined(__GNU_LIBOBJC__) && (__GNU_LIBOBJC__ >= 20100911)) || defined(APPLE_RUNTIME) || defined(__GNUSTEP_RUNTIME__) sel_getName(_cmd), #else sel_get_name(_cmd), #endif diff); } [content release]; [component release]; } } - (id)invokeActionForRequest:(WORequest *)_request inContext:(WOContext *)_ctx { WOElement *content = [_ctx componentContent]; // content (valid in parent) if (content) { NSTimeInterval st = 0.0; WOComponent *component = [_ctx component]; // reusable component id result; component = [component retain]; content = [content retain]; if (profileComponents) st = [[NSDateClass date] timeIntervalSince1970]; [_ctx leaveComponent:component]; result = [content invokeActionForRequest:_request inContext:_ctx]; result = [result retain]; [_ctx enterComponent:component content:content]; if (profileComponents) { NSTimeInterval diff; int i; diff = [[NSDateClass date] timeIntervalSince1970] - st; for (i = [_ctx componentStackCount]; i >= 0; i--) printf(" "); printf("content: [%s %s]: %0.3fs\n", [[component name] cString], #if (defined(__GNU_LIBOBJC__) && (__GNU_LIBOBJC__ >= 20100911)) || defined(APPLE_RUNTIME) || defined(__GNUSTEP_RUNTIME__) sel_getName(_cmd), #else sel_get_name(_cmd), #endif diff); } [content release]; [component release]; return [result autorelease]; } return nil; } - (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx { WOElement *content; content = [_ctx componentContent]; // content (valid in parent) if (content) { NSTimeInterval st = 0.0; WOComponent *component; component = [_ctx component]; // reusable component component = [component retain]; content = [content retain]; #if DEBUG && 0 [_response appendContentHTMLString:@" Component:"]; [_response appendContentHTMLString:[component description]]; [_response appendContentHTMLString:@" Content:"]; [_response appendContentHTMLString:[content description]]; #endif if (profileComponents) st = [[NSDateClass date] timeIntervalSince1970]; [_ctx leaveComponent:component]; [content appendToResponse:_response inContext:_ctx]; [_ctx enterComponent:component content:content]; if (profileComponents) { NSTimeInterval diff; int i; diff = [[NSDateClass date] timeIntervalSince1970] - st; for (i = [_ctx componentStackCount]; i >= 0; i--) printf(" "); printf("content: [%s %s]: %0.3fs\n", [[component name] cString], #if (defined(__GNU_LIBOBJC__) && (__GNU_LIBOBJC__ >= 20100911)) || defined(APPLE_RUNTIME) || defined(__GNUSTEP_RUNTIME__) sel_getName(_cmd), #else sel_get_name(_cmd), #endif diff); } [content release]; [component release]; } else { #if DEBUG && 0 [_response appendContentHTMLString:@" Missing content in component: "]; [_response appendContentHTMLString:[[_ctx component] description]]; #endif } } @end /* WOComponentContent */ SOPE/sope-appserver/NGObjWeb/DynamicElements/decommon.h0000644000000000000000000000307112242733417021733 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGObjWeb_DynElem_common_H__ #define __NGObjWeb_DynElem_common_H__ #import #if !LIB_FOUNDATION_LIBRARY && !GNUSTEP_BASE_LIBRARY # import # import #endif /* NeXT_Foundation_LIBRARY */ #if COCOA_Foundation_LIBRARY || NeXT_Foundation_LIBRARY @interface NSObject(MethodsRequiredByDynamicElements) - (void)subclassResponsibility:(SEL)_cmd; @end #endif #include #include "WOResponse+private.h" #include static inline void WOResponse_AddEmptyCloseParens(WOResponse *r, WOContext *c) { if (c->wcFlags.xmlStyleEmptyElements) { WOResponse_AddCString(r, " />"); } else { WOResponse_AddChar(r, '>'); } } #endif /* __NGObjWeb_DynElem_common_H__ */ SOPE/sope-appserver/NGObjWeb/DynamicElements/WOActionURL.m0000644000000000000000000003012212242733417022202 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include "WOElement+private.h" #include #include #include "decommon.h" @interface _WOActionActionURL : WOActionURL { WOAssociation *action; } @end @interface _WOPageActionURL : WOActionURL { WOAssociation *pageName; } @end @interface _WODirectActionActionURL : WOActionURL { WOAssociation *actionClass; WOAssociation *directActionName; BOOL sidInUrl; /* include session-id in wa URL ? */ } @end @interface WOActionURL(PrivateMethods) - (id)_initWithName:(NSString *)_name associations:(NSDictionary *)_config template:(WOElement *)_t; - (NSString *)associationDescription; @end @implementation WOActionURL + (BOOL)containsLinkInAssociations:(NSDictionary *)_assocs { if (_assocs == nil) return NO; if ([_assocs objectForKey:@"href"]) return YES; if ([_assocs objectForKey:@"directActionName"]) return YES; if ([_assocs objectForKey:@"pageName"]) return YES; if ([_assocs objectForKey:@"action"]) return YES; if ([_assocs objectForKey:@"actionClass"]) return YES; return NO; } - (id)initWithName:(NSString *)_name associations:(NSDictionary *)_config template:(WOElement *)_t { Class linkClass = Nil; if ([_config objectForKey:@"action"]) linkClass = [_WOActionActionURL class]; else if ([_config objectForKey:@"pageName"]) linkClass = [_WOPageActionURL class]; else linkClass = [_WODirectActionActionURL class]; [self release]; return [[linkClass alloc] initWithName:_name associations:_config template:_t]; } - (id)_initWithName:(NSString *)_name associations:(NSDictionary *)_config template:(WOElement *)_t { if ((self = [super initWithName:_name associations:_config template:_t])) { self->fragmentIdentifier = OWGetProperty(_config, @"fragmentIdentifier"); self->queryDictionary = OWGetProperty(_config, @"queryDictionary"); self->queryParameters = OWExtractQueryParameters(_config); self->template = [_t retain]; self->containsForm = self->queryParameters ? YES : NO; } return self; } - (void)dealloc { [self->template release]; [self->queryDictionary release]; [self->queryParameters release]; [self->fragmentIdentifier release]; [super dealloc]; } /* accessors */ - (id)template { return self->template; } /* handling requests */ - (void)takeValuesFromRequest:(WORequest *)_req inContext:(WOContext *)_ctx { /* links can take form values !!!! (for query-parameters) */ if (self->queryParameters) { /* apply values to ?style parameters */ WOComponent *sComponent = [_ctx component]; NSEnumerator *keys; NSString *key; keys = [self->queryParameters keyEnumerator]; while ((key = [keys nextObject])) { id assoc, value; assoc = [self->queryParameters objectForKey:key]; value = [_req formValueForKey:key]; [assoc setValue:value inComponent:sComponent]; } } [self->template takeValuesFromRequest:_req inContext:_ctx]; } - (id)invokeActionForRequest:(WORequest *)_request inContext:(WOContext *)_ctx { [[_ctx session] logWithFormat:@"%@[0x%p]: no action/page set !", NSStringFromClass([self class]), self]; return nil; } - (BOOL)_appendHrefToResponse:(WOResponse *)_r inContext:(WOContext *)_ctx { #if APPLE_FOUNDATION_LIBRARY || NeXT_Foundation_LIBRARY || \ COCOA_Foundation_LIBRARY NSLog(@"subclass responsibility ..."); #else [self subclassResponsibility:_cmd]; #endif return NO; } /* generate response */ - (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx { WOComponent *sComponent; NSString *queryString = nil; if ([_ctx isRenderingDisabled] || [[_ctx request] isFromClientComponent]) { [self->template appendToResponse:_response inContext:_ctx]; return; } sComponent = [_ctx component]; if ([self _appendHrefToResponse:_response inContext:_ctx]) { queryString = [self queryStringForQueryDictionary: [self->queryDictionary valueInComponent:sComponent] andQueryParameters:self->queryParameters inContext:_ctx]; } if (self->fragmentIdentifier != nil) { [_response appendContentCharacter:'#']; WOResponse_AddString(_response, [self->fragmentIdentifier stringValueInComponent:sComponent]); } if (queryString != nil) { [_response appendContentCharacter:'?']; WOResponse_AddString(_response, queryString); } /* content */ [self->template appendToResponse:_response inContext:_ctx]; } /* description */ - (NSString *)associationDescription { NSMutableString *str = [NSMutableString stringWithCapacity:256]; if (self->fragmentIdentifier) [str appendFormat:@" fragment=%@", self->fragmentIdentifier]; return str; } @end /* WOActionURL */ @implementation _WOActionActionURL - (id)initWithName:(NSString *)_name associations:(NSDictionary *)_config template:(WOElement *)_t { if ((self = [super _initWithName:_name associations:_config template:_t])) { self->action = OWGetProperty(_config, @"action"); if (self->action == nil) { NSLog(@"missing action association for WOActionURL .."); RELEASE(self); return nil; } #if DEBUG if ([_config objectForKey:@"pageName"] || [_config objectForKey:@"href"] || [_config objectForKey:@"directActionName"] || [_config objectForKey:@"actionClass"]) { NSLog(@"WARNING: inconsistent association settings in WOActionURL !" @" (assign only one of pageName, href, " @"directActionName or action)"); } #endif } return self; } - (void)dealloc { [self->action release]; [super dealloc]; } /* dynamic invocation */ - (id)invokeActionForRequest:(WORequest *)_request inContext:(WOContext *)_ctx { /* link is active */ return [self executeAction:self->action inContext:_ctx]; } - (BOOL)_appendHrefToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx { WOResponse_AddString(_response, [_ctx componentActionURL]); return YES; } /* description */ - (NSString *)associationDescription { NSMutableString *str = [NSMutableString stringWithCapacity:256]; [str appendFormat:@" action=%@", self->action]; [str appendString:[super associationDescription]]; return str; } @end /* _WOActionActionURL */ @implementation _WOPageActionURL - (id)initWithName:(NSString *)_name associations:(NSDictionary *)_config template:(WOElement *)_t { if ((self = [super _initWithName:_name associations:_config template:_t])) { self->pageName = OWGetProperty(_config, @"pageName"); if (self->pageName == nil) { NSLog(@"missing pageName association for WOActionURL .."); RELEASE(self); return nil; } #if DEBUG if ([_config objectForKey:@"action"] || [_config objectForKey:@"href"] || [_config objectForKey:@"directActionName"] || [_config objectForKey:@"actionClass"]) { NSLog(@"WARNING: inconsistent association settings in WOActionURL !" @" (assign only one of pageName, href, " @"directActionName or action)"); } #endif } return self; } - (void)dealloc { [self->pageName release]; [super dealloc]; } /* actions */ - (id)invokeActionForRequest:(WORequest *)_request inContext:(WOContext *)_ctx { WOComponent *page = nil; NSString *name = nil; name = [self->pageName stringValueInComponent:[_ctx component]]; page = [[_ctx application] pageWithName:name inContext:_ctx]; if (page == nil) { [[_ctx session] logWithFormat: @"%@[0x%p]: did not find page with name %@ !", NSStringFromClass([self class]), self, name]; } return page; } - (BOOL)_appendHrefToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx { WOResponse_AddString(_response, [_ctx componentActionURL]); return YES; } /* description */ - (NSString *)associationDescription { NSMutableString *str = [NSMutableString stringWithCapacity:256]; [str appendFormat:@" pageName=%@", self->pageName]; [str appendString:[super associationDescription]]; return str; } @end /* _WOPageActionURL */ @implementation _WODirectActionActionURL - (id)initWithName:(NSString *)_name associations:(NSDictionary *)_config template:(WOElement *)_t { if ((self = [super _initWithName:_name associations:_config template:_t])) { WOAssociation *sidInUrlAssoc; sidInUrlAssoc = OWGetProperty(_config, @"?wosid"); self->actionClass = OWGetProperty(_config, @"actionClass"); self->directActionName = OWGetProperty(_config, @"directActionName"); self->sidInUrl = (sidInUrlAssoc) ? [sidInUrlAssoc boolValueInComponent:nil] : YES; #if DEBUG if ([_config objectForKey:@"action"] || [_config objectForKey:@"href"] || [_config objectForKey:@"pageName"]) { NSLog(@"WARNING: inconsistent association settings in WOActionURL !" @" (assign only one of pageName, href, " @"directActionName or action)"); } #endif } return self; } - (void)dealloc { [self->actionClass release]; [self->directActionName release]; [super dealloc]; } /* href */ - (BOOL)_appendHrefToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx { WOComponent *sComponent; NSString *daClass; NSString *daName; NSMutableDictionary *qd; NSDictionary *tmp; sComponent = [_ctx component]; daClass = [self->actionClass stringValueInComponent:sComponent]; daName = [self->directActionName stringValueInComponent:sComponent]; if (daClass) { if (daName) { if (![daClass isEqualToString:@"DirectAction"]) daName = [NSString stringWithFormat:@"%@/%@", daClass, daName]; } else daName = daClass; } qd = [NSMutableDictionary dictionaryWithCapacity:16]; /* add query dictionary */ if (self->queryDictionary) { if ((tmp = [self->queryDictionary valueInComponent:sComponent])) [qd addEntriesFromDictionary:tmp]; } /* add ?style parameters */ if (self->queryParameters) { NSEnumerator *keys; NSString *key; keys = [self->queryParameters keyEnumerator]; while ((key = [keys nextObject]) != nil) { id assoc, value; assoc = [self->queryParameters objectForKey:key]; value = [assoc stringValueInComponent:sComponent]; [qd setObject:(value != nil ? value : (id)@"") forKey:key]; } } /* add session ID */ if (self->sidInUrl) { if ([_ctx hasSession]) { WOSession *sn = [_ctx session]; [qd setObject:[sn sessionID] forKey:WORequestValueSessionID]; if (![sn isDistributionEnabled]) { [qd setObject:[[WOApplication application] number] forKey:WORequestValueInstance]; } } } WOResponse_AddString(_response, [_ctx directActionURLForActionNamed:daName queryDictionary:qd]); return NO; } /* description */ - (NSString *)associationDescription { NSMutableString *str = [NSMutableString stringWithCapacity:256]; if (self->actionClass != nil) [str appendFormat:@" actionClass=%@", self->actionClass]; if (self->directActionName != nil) [str appendFormat:@" directAction=%@", self->directActionName]; [str appendString:[super associationDescription]]; return str; } @end /* _WODirectActionActionURL */ SOPE/sope-appserver/NGObjWeb/DynamicElements/WOSwitchComponent.api0000644000000000000000000000030712242733417024045 0ustar rootroot SOPE/sope-appserver/NGObjWeb/WOWatchDogApplicationMain.m0000644000000000000000000006753612242733417022035 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG Copyright (C) 2009 Inverse inc. This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import /* for signal handlers */ static volatile int pendingSIGHUP = 0; static volatile BOOL shouldTerminate = NO; void handle_SIGINTTERM(int signum) { shouldTerminate = YES; } void handle_SIGHUP(int signum) { pendingSIGHUP++; } extern void handle_SIGPIPE(int signum); #if defined(__CYGWIN32__) || defined(__MINGW32__) int WOWatchDogApplicationMain (NSString *appName, int argc, const char *argv[]) { /* no watchdog support on Win* */ return WOApplicationMain(appName, argc, argv); } #else #include #include #include #include #include #define OUT_OF_CHILD_SLEEPTIME 250 /* ~0.25ms */ /* We sleep longer than that so the log interval is not very accurate. * Should be good enough to avoid spamming the logs */ #define OUT_OF_CHILD_LOG_INTERVAL (1000000 / OUT_OF_CHILD_SLEEPTIME) /* 1 sec */ static NSTimeInterval respawnDelay; /* seconds */ static const char *pidFile = NULL; NSInteger watchDogRequestTimeout; typedef enum { WOChildStatusDown = 0, WOChildStatusSpawning, WOChildStatusReady, WOChildStatusBusy, WOChildStatusExcessive, WOChildStatusTerminating, WOChildStatusMax } WOChildStatus; @class WOWatchDog; @interface WOWatchDogChild : NSObject { pid_t pid; int counter; NGActiveSocket *controlSocket; WOChildStatus status; NSTimer *killTimer; NSUInteger killTimerIteration; WOWatchDog *watchDog; NSCalendarDate *lastSpawn; BOOL loggedNotRespawn; } - (void) setWatchDog: (WOWatchDog *) newWatchDog; - (void) setPid: (int) newPid; - (int) pid; - (void) revokeKillTimer; - (void) handleProcessStatus: (int) status; - (void) setControlSocket: (NGActiveSocket *) newSocket; - (NGActiveSocket *) controlSocket; - (void) setStatus: (WOChildStatus) newStatus; - (WOChildStatus) status; - (void) setLastSpawn: (NSCalendarDate *) newLastSpawn; - (NSCalendarDate *) lastSpawn; - (NSCalendarDate *) nextSpawn; - (void) logNotRespawn; - (BOOL) readMessage; - (void) notify; - (void) terminate; @end @interface WOWatchDog : NSObject { NSString *appName; int argc; const char **argv; pid_t pid; NSTimer *loopTimer; BOOL terminate; BOOL willTerminate; NGPassiveSocket *listeningSocket; int numberOfChildren; NSMutableArray *children; NSMutableArray *readyChildren; NSMutableArray *downChildren; long outOfChildSleepCount; } + (id) sharedWatchDog; - (pid_t) pid; - (void) declareChildReady: (WOWatchDogChild *) readyChild; - (void) declareChildDown: (WOWatchDogChild *) readyChild; - (int) run: (NSString *) appName argc: (int) argc argv: (const char **) argv; @end @implementation WOWatchDogChild + (void) initialize { watchDogRequestTimeout = [[NSUserDefaults standardUserDefaults] integerForKey: @"WOWatchDogRequestTimeout"]; if (watchDogRequestTimeout > 0) [self logWithFormat: @"watchdog request timeout set to %d minutes", watchDogRequestTimeout]; else [self warnWithFormat: @"watchdog request timeout not set"]; } + (WOWatchDogChild *) watchDogChild { WOWatchDogChild *newChild; newChild = [self new]; [newChild autorelease]; return newChild; } - (id) init { if ((self = [super init])) { pid = -1; controlSocket = nil; status = WOChildStatusDown; killTimer = nil; killTimerIteration = 0; counter = 0; lastSpawn = nil; loggedNotRespawn = NO; } return self; } - (void) dealloc { // [self logWithFormat: @"-dealloc (pid: %d)", pid]; [killTimer invalidate]; [self setControlSocket: nil]; [lastSpawn release]; [super dealloc]; } - (void) setWatchDog: (WOWatchDog *) newWatchDog { watchDog = newWatchDog; } - (void) setPid: (int) newPid { pid = newPid; } - (int) pid { return pid; } - (void) revokeKillTimer { [killTimer invalidate]; killTimer = nil; } - (void) handleProcessStatus: (int) processStatus { int code; code = WEXITSTATUS (processStatus); if (code == 0) [self logWithFormat: @"child %d exited", pid]; else [self logWithFormat: @"child %d exited with code %i", pid, code]; if (WIFSIGNALED (processStatus)) [self logWithFormat: @" (terminated due to signal %i%@)", WTERMSIG (processStatus), WCOREDUMP (processStatus) ? @", coredump" : @""]; if (WIFSTOPPED (processStatus)) [self logWithFormat: @" (stopped due to signal %i)", WSTOPSIG (processStatus)]; [self setStatus: WOChildStatusDown]; [self setControlSocket: nil]; [self revokeKillTimer]; } - (void) setControlSocket: (NGActiveSocket *) newSocket { NSRunLoop *runLoop; runLoop = [NSRunLoop currentRunLoop]; if (controlSocket) [runLoop removeEvent: (void *) ((long) [controlSocket fileDescriptor]) type: ET_RDESC forMode: NSDefaultRunLoopMode all: YES]; [controlSocket close]; ASSIGN (controlSocket, newSocket); if (controlSocket) [runLoop addEvent: (void *) ((long) [controlSocket fileDescriptor]) type: ET_RDESC watcher: self forMode: NSDefaultRunLoopMode]; } - (NGActiveSocket *) controlSocket { return controlSocket; } - (void) setStatus: (WOChildStatus) newStatus { status = newStatus; } - (WOChildStatus) status { return status; } - (void) setLastSpawn: (NSCalendarDate *) newLastSpawn { ASSIGN (lastSpawn, newLastSpawn); loggedNotRespawn = NO; } - (NSCalendarDate *) lastSpawn { return lastSpawn; } - (NSCalendarDate *) nextSpawn { return [lastSpawn addYear: 0 month: 0 day: 0 hour: 0 minute: 0 second: respawnDelay]; } - (void) logNotRespawn { if (!loggedNotRespawn) { [self logWithFormat: @"avoiding to respawn child before %@", [self nextSpawn]]; loggedNotRespawn = YES; } } - (void) _safetyBeltIteration: (NSTimer *) aKillTimer { if ([watchDog pid] == getpid ()) { killTimerIteration++; if (killTimerIteration < watchDogRequestTimeout) { [self warnWithFormat: @"pid %d has been hanging in the same request for %d minutes", pid, killTimerIteration]; } else { if (status != WOChildStatusDown) { [self warnWithFormat: @"safety belt -- sending KILL signal to pid %d", pid]; kill (pid, SIGKILL); [self revokeKillTimer]; } } } else { [self errorWithFormat: @"messy processes: safety belt iteration occurring on child: %d", pid]; [self revokeKillTimer]; } } - (void) _kill { if (status != WOChildStatusDown) { [self logWithFormat: @"sending terminate signal to pid %d", pid]; status = WOChildStatusTerminating; kill (pid, SIGTERM); [self revokeKillTimer]; } } - (BOOL) readMessage { WOChildMessage message; BOOL rc; NSException *e; if ([controlSocket readBytes: &message count: sizeof (WOChildMessage)] == NGStreamError) { rc = NO; [self errorWithFormat: @"FAILURE receiving status for child %d", pid]; [self errorWithFormat: @" socket: %@", controlSocket]; e = [controlSocket lastException]; if (e) [self errorWithFormat: @" exception: %@", e]; [self _kill]; } else { rc = YES; [self revokeKillTimer]; if (message == WOChildMessageAccept) { status = WOChildStatusBusy; if (watchDogRequestTimeout > 0) { /* We schedule an X minutes grace period while the child is processing the request. This enables long requests to complete while providing a safety belt for children gone rogue. */ killTimer = [NSTimer scheduledTimerWithTimeInterval: 60 target: self selector: @selector (_safetyBeltIteration:) userInfo: nil repeats: YES]; killTimerIteration = 0; } } else if (message == WOChildMessageReady) { status = WOChildStatusReady; [watchDog declareChildReady: self]; } } return rc; } - (void) notify { WOChildMessage message; counter++; message = WOChildMessageAccept; if ([controlSocket writeBytes: &message count: sizeof (WOChildMessage)] == NGStreamError || ![self readMessage]) { [self errorWithFormat: @"FAILURE notifying child %d", pid]; [self _kill]; } } - (void) terminate { if (status == WOChildStatusDown) { [self logWithFormat: @"child is already down"]; } else { [self _kill]; } } - (void) receivedEvent: (void*)data type: (RunLoopEventType)type extra: (void*)extra forMode: (NSString*)mode { if ([controlSocket isAlive]) [self readMessage]; else { /* This happens when a socket has been closed by the child but the child has not terminated yet. */ [[NSRunLoop currentRunLoop] removeEvent: data type: ET_RDESC forMode: NSDefaultRunLoopMode all: YES]; [self setControlSocket: nil]; } } @end @implementation WOWatchDog + (id) sharedWatchDog { static WOWatchDog *sharedWatchDog = nil; if (!sharedWatchDog) sharedWatchDog = [self new]; return sharedWatchDog; } - (id) init { if ((self = [super init])) { listeningSocket = nil; terminate = NO; willTerminate = NO; shouldTerminate = NO; pendingSIGHUP = 0; outOfChildSleepCount = 0; numberOfChildren = 0; children = [[NSMutableArray alloc] initWithCapacity: 10]; readyChildren = [[NSMutableArray alloc] initWithCapacity: 10]; downChildren = [[NSMutableArray alloc] initWithCapacity: 10]; } return self; } - (void) _releaseListeningSocket { if (listeningSocket) { [[NSRunLoop currentRunLoop] removeEvent: (void *) ((long) [listeningSocket fileDescriptor]) type: ET_RDESC forMode: NSDefaultRunLoopMode all: YES]; [listeningSocket close]; [listeningSocket release]; listeningSocket = nil; } } - (void) dealloc { [self _releaseListeningSocket]; [appName release]; [children release]; [super dealloc]; } - (pid_t) pid { return pid; } - (void) _runChildWithControlSocket: (NGActiveSocket *) controlSocket { WOApplication *app; extern char **environ; [NSProcessInfo initializeWithArguments: (char **) argv count: argc environment: environ]; NGInitTextStdio(); app = [NSClassFromString(appName) new]; [app autorelease]; [app setListeningSocket: listeningSocket]; [app setControlSocket: controlSocket]; [app run]; } - (void) receivedEvent: (void*)data type: (RunLoopEventType)type extra: (void*)extra forMode: (NSString*)mode { int nextId; WOWatchDogChild *child; NSUInteger max; max = [readyChildren count]; if (max > 0) { outOfChildSleepCount = 0; nextId = max - 1; child = [readyChildren objectAtIndex: nextId]; [readyChildren removeObjectAtIndex: nextId]; [child notify]; } else { /* we're out of ready children, sleep a bit to avoid hogging the CPU */ usleep(OUT_OF_CHILD_SLEEPTIME); if (outOfChildSleepCount % OUT_OF_CHILD_LOG_INTERVAL == 0) { [self errorWithFormat: @"No child available to handle incoming request!"]; } outOfChildSleepCount++; } } - (void) _cleanupSignalAndEventHandlers { NSRunLoop *runLoop; signal(SIGHUP, SIG_DFL); signal(SIGINT, SIG_DFL); signal(SIGTERM, SIG_DFL); signal(SIGPIPE, SIG_DFL); [loopTimer invalidate]; loopTimer = nil; runLoop = [NSRunLoop currentRunLoop]; [runLoop removeEvent: (void *) ((long) [listeningSocket fileDescriptor]) type: ET_RDESC forMode: NSDefaultRunLoopMode all: YES]; } - (BOOL) _spawnChild: (WOWatchDogChild *) child { NGActiveSocket *pair[2]; BOOL isChild; int childPid; extern char **environ; isChild = NO; if ([NGActiveSocket socketPair: pair]) { childPid = fork (); if (childPid == 0) { setsid (); isChild = YES; [self _cleanupSignalAndEventHandlers]; [child retain]; [pair[0] retain]; [children makeObjectsPerformSelector: @selector (revokeKillTimer)]; [children release]; children = nil; [readyChildren release]; readyChildren = nil; [downChildren release]; downChildren = nil; [[NSAutoreleasePool currentPool] emptyPool]; [self _runChildWithControlSocket: pair[0]]; [pair[0] autorelease]; [child autorelease]; } else if (childPid > 0) { [self logWithFormat: @"child spawned with pid %d", childPid]; [child setPid: childPid]; [child setStatus: WOChildStatusSpawning]; [pair[1] setReceiveTimeout: 1.0]; [child setControlSocket: pair[1]]; [child setLastSpawn: [NSCalendarDate date]]; } else { perror ("fork"); } } return isChild; } - (void) _ensureNumberOfChildren { int currentNumber, delta, count, min, max; WOWatchDogChild *child; currentNumber = [children count]; if (currentNumber < numberOfChildren) { delta = numberOfChildren - currentNumber; for (count = 0; count < delta; count++) { child = [WOWatchDogChild watchDogChild]; [child setWatchDog: self]; [children addObject: child]; [downChildren addObject: child]; } [self logWithFormat: @"preparing %d children", delta]; } else if (currentNumber > numberOfChildren) { delta = currentNumber - numberOfChildren; max = [downChildren count]; if (max > delta) min = max - delta; else min = 0; for (count = max - 1; count >= min; count--) { child = [downChildren objectAtIndex: count]; [downChildren removeObjectAtIndex: count]; [children removeObject: child]; delta--; [self logWithFormat: @"%d processes purged from pool", delta]; } max = [readyChildren count]; if (max > delta) max -= delta; for (count = max - 1; count > -1; count--) { child = [readyChildren objectAtIndex: count]; [readyChildren removeObjectAtIndex: count]; [child terminate]; [child setStatus: WOChildStatusExcessive]; delta--; } [self logWithFormat: @"%d processes left to terminate", delta]; } } - (void) _noop { } - (BOOL) _ensureChildren { int count, max; WOWatchDogChild *child; BOOL isChild, delayed; NSCalendarDate *now, *nextSpawn; isChild = NO; if (!willTerminate) { [self _ensureNumberOfChildren]; max = [downChildren count]; for (count = max - 1; !isChild && count > -1; count--) { delayed = NO; child = [downChildren objectAtIndex: count]; if ([child status] == WOChildStatusExcessive) [children removeObject: child]; else { now = [NSCalendarDate date]; nextSpawn = [child nextSpawn]; if ([nextSpawn earlierDate: now] == nextSpawn) isChild = [self _spawnChild: child]; else { delayed = YES; [child logNotRespawn]; } } if (!(delayed || isChild)) [downChildren removeObjectAtIndex: count]; } } return isChild; } /* SOPE on GNUstep does not need to parse the argument line, since the arguments will be put in the NSArgumentDomain. I don't know about libFoundation but OSX is supposed to act the same way. */ - (NGInternetSocketAddress *) _listeningAddress { NGInternetSocketAddress *listeningAddress; NSUserDefaults *ud; id port, allow; static BOOL warnedAboutAllow = NO; listeningAddress = nil; ud = [NSUserDefaults standardUserDefaults]; port = [ud objectForKey:@"p"]; if (!port) { port = [ud objectForKey:@"WOPort"]; if (!port) port = @"auto"; } allow = [ud objectForKey:@"WOHttpAllowHost"]; if ([allow count] > 0 && !warnedAboutAllow) { [self warnWithFormat: @"'WOHttpAllowHost' is ignored in watchdog mode," @" use a real firewall instead"]; warnedAboutAllow = YES; } if ([port isKindOfClass: [NSString class]]) { if ([port isEqualToString: @"auto"]) { listeningAddress = [[NGInternetSocketAddress alloc] initWithPort:0 onHost:@"127.0.0.1"]; [listeningAddress autorelease]; } else if ([port rangeOfString: @":"].location == NSNotFound) { if (allow) listeningAddress = [NGInternetSocketAddress wildcardAddressWithPort:[port intValue]]; else port = [NSString stringWithFormat: @"127.0.0.1:%d", [port intValue]]; } } else { if (allow) listeningAddress = [NGInternetSocketAddress wildcardAddressWithPort:[port intValue]]; else { port = [NSString stringWithFormat: @"127.0.0.1:%@", port]; } } if (!listeningAddress) listeningAddress = (NGInternetSocketAddress *) NGSocketAddressFromString(port); return listeningAddress; } - (BOOL) _prepareListeningSocket { NGInternetSocketAddress *addr; NSString *address; BOOL rc; int backlog; addr = [self _listeningAddress]; NS_DURING { [listeningSocket release]; listeningSocket = [[NGPassiveSocket alloc] initWithDomain: [addr domain]]; [listeningSocket bindToAddress: addr]; backlog = [[NSUserDefaults standardUserDefaults] integerForKey: @"WOListenQueueSize"]; if (!backlog) backlog = 5; [listeningSocket listenWithBacklog: backlog]; address = [addr address]; if (!address) address = @"*"; [self logWithFormat: @"listening on %@:%d", address, [addr port]]; [[NSRunLoop currentRunLoop] addEvent: (void *) ((long) [listeningSocket fileDescriptor]) type: ET_RDESC watcher: self forMode: NSDefaultRunLoopMode]; rc = YES; } NS_HANDLER { rc = NO; } NS_ENDHANDLER; return rc; } - (WOWatchDogChild *) _childWithPID: (pid_t) childPid { WOWatchDogChild *currentChild, *child; int count; child = nil; for (count = 0; !child && count < numberOfChildren; count++) { currentChild = [children objectAtIndex: count]; if ([currentChild pid] == childPid) child = currentChild; } return child; } - (void) _setupSignals { signal(SIGHUP, handle_SIGHUP); signal(SIGINT, handle_SIGINTTERM); signal(SIGTERM, handle_SIGINTTERM); signal(SIGPIPE, handle_SIGPIPE); } - (void) declareChildReady: (WOWatchDogChild *) readyChild { [readyChildren addObject: readyChild]; } - (void) declareChildDown: (WOWatchDogChild *) downChild { if (![downChildren containsObject: downChild]) [downChildren addObject: downChild]; } - (void) _ensureWorkersCount { int newNumberOfChildren; NSUserDefaults *ud; ud = [NSUserDefaults standardUserDefaults]; [ud synchronize]; newNumberOfChildren = [ud integerForKey: @"WOHttpAdaptorForkCount"]; if (newNumberOfChildren) [self logWithFormat: @"user default 'WOHttpAdaptorForkCount' has been" " replaced with 'WOWorkersCount'"]; else newNumberOfChildren = [ud integerForKey: @"WOWorkersCount"]; if (newNumberOfChildren < 1) newNumberOfChildren = 1; numberOfChildren = newNumberOfChildren; } - (void) _handlePostTerminationSignal { WOWatchDogChild *child; int count; [self logWithFormat: @"Terminating with SIGINT or SIGTERM"]; [self _releaseListeningSocket]; for (count = 0; count < numberOfChildren; count++) { child = [children objectAtIndex: count]; if ([child status] != WOChildStatusDown && [child status] != WOChildStatusTerminating) [child terminate]; } if ([downChildren count] == numberOfChildren) { [self logWithFormat: @"all children exited. We now terminate."]; terminate = YES; } else willTerminate = YES; } - (void) _checkProcessesStatus { int status; pid_t childPid; WOWatchDogChild *child; while ((childPid = waitpid (-1, &status, WNOHANG)) > 0) { child = [self _childWithPID: childPid]; [child handleProcessStatus: status]; [self declareChildDown: child]; if (willTerminate && [downChildren count] == numberOfChildren) { [self logWithFormat: @"all children exited. We now terminate."]; terminate = YES; } } } - (int) run: (NSString *) newAppName argc: (int) newArgC argv: (const char **) newArgV { NSAutoreleasePool *pool; NSRunLoop *runLoop; NSDate *limitDate; BOOL listening; int retries; willTerminate = NO; ASSIGN (appName, newAppName); argc = newArgC; argv = newArgV; listening = NO; retries = 0; while (!listening && retries < 5) { listening = [self _prepareListeningSocket]; retries++; if (!listening) { [self warnWithFormat: @"listening socket: attempt %d failed", retries]; [NSThread sleepForTimeInterval: 1.0]; } } if (listening) { pid = getpid (); [self logWithFormat: @"watchdog process pid: %d", pid]; [self _setupSignals]; [self _ensureWorkersCount]; // NSLog (@"ready to process requests"); runLoop = [NSRunLoop currentRunLoop]; /* This timer ensures the looping of the runloop at reasonable intervals for correct processing of signal handlers. */ loopTimer = [NSTimer scheduledTimerWithTimeInterval: 0.5 target: self selector: @selector (_noop) userInfo: nil repeats: YES]; terminate = NO; while (!terminate) { pool = [NSAutoreleasePool new]; while (pendingSIGHUP) { [self logWithFormat: @"received SIGHUP"]; [self _ensureWorkersCount]; pendingSIGHUP--; } if (shouldTerminate && pidFile) unlink(pidFile); // [self logWithFormat: @"watchdog loop"]; NS_DURING { terminate = [self _ensureChildren]; if (!terminate) { limitDate = [runLoop limitDateForMode:NSDefaultRunLoopMode]; [runLoop runMode: NSDefaultRunLoopMode beforeDate: limitDate]; } } NS_HANDLER { terminate = YES; [self errorWithFormat: @"an exception occured in runloop %@", localException]; } NS_ENDHANDLER; if (!terminate) { if (shouldTerminate) [self _handlePostTerminationSignal]; [self _checkProcessesStatus]; } [pool release]; } [self _cleanupSignalAndEventHandlers]; } else [self errorWithFormat: @"unable to listen on specified port," @" check that no other process is already using it"]; return 0; } @end static BOOL _writePid(NSString *nsPidFile) { NSString *pid; BOOL rc; pid = [NSString stringWithFormat: @"%d", getpid()]; rc = [pid writeToFile: nsPidFile atomically: NO]; return rc; } int WOWatchDogApplicationMain (NSString *appName, int argc, const char *argv[]) { NSAutoreleasePool *pool; NSUserDefaults *ud; NSString *logFile, *nsPidFile; int rc, i; pid_t childPid; NSProcessInfo *processInfo; Class WOAppClass; pool = [[NSAutoreleasePool alloc] init]; #if LIB_FOUNDATION_LIBRARY || defined(GS_PASS_ARGUMENTS) { extern char **environ; [NSProcessInfo initializeWithArguments:(void*)argv count:argc environment:(void*)environ]; } #endif /* This invocation forces the class initialization of WOCoreApplication, which causes the NSUserDefaults to be initialized as well with Defaults.plist. */ WOAppClass = [NSClassFromString (appName) class]; ud = [NSUserDefaults standardUserDefaults]; processInfo = [NSProcessInfo processInfo]; logFile = [ud objectForKey: @"WOLogFile"]; if (!logFile) logFile = [NSString stringWithFormat: @"/var/log/%@/%@.log", [processInfo processName], [processInfo processName]]; /* Close all open file descriptors */ for (i = getdtablesize(); i >= 3; --i) close(i); freopen("/dev/null", "a", stdin); if (![logFile isEqualToString: @"-"]) { freopen([logFile cString], "a", stdout); freopen([logFile cString], "a", stderr); } if ([ud boolForKey: @"WONoDetach"]) childPid = 0; else childPid = fork(); if (childPid) { rc = 0; } else { nsPidFile = [ud objectForKey: @"WOPidFile"]; if (!nsPidFile) nsPidFile = [NSString stringWithFormat: @"/var/run/%@/%@.pid", [processInfo processName], [processInfo processName]]; pidFile = [nsPidFile UTF8String]; if (_writePid(nsPidFile)) { respawnDelay = [ud integerForKey: @"WORespawnDelay"]; if (!respawnDelay) respawnDelay = 5; if ([WOAppClass respondsToSelector: @selector (applicationWillStart)]) [WOAppClass applicationWillStart]; /* default is to use the watch dog! */ if ([ud objectForKey:@"WOUseWatchDog"] != nil && ![ud boolForKey:@"WOUseWatchDog"]) rc = WOApplicationMain(appName, argc, argv); else rc = [[WOWatchDog sharedWatchDog] run: appName argc: argc argv: argv]; } else { [ud errorWithFormat: @"unable to open pid file: %s", pidFile]; rc = -1; } } [pool release]; return rc; } #endif /* main function which initializes server defaults (usually in /etc) */ @interface NSUserDefaults(ServerDefaults) + (id)hackInServerDefaults:(NSUserDefaults *)_ud withAppDomainPath:(NSString *)_appDomainPath globalDomainPath:(NSString *)_globalDomainPath; @end int WOWatchDogApplicationMainWithServerDefaults (NSString *appName, int argc, const char *argv[], NSString *globalDomainPath, NSString *appDomainPath) { NSAutoreleasePool *pool; Class defClass; pool = [[NSAutoreleasePool alloc] init]; #if LIB_FOUNDATION_LIBRARY || defined(GS_PASS_ARGUMENTS) { extern char **environ; [NSProcessInfo initializeWithArguments:(void*)argv count:argc environment:(void*)environ]; } #endif if ((defClass = NSClassFromString(@"WOServerDefaults")) != nil) { NSUserDefaults *ud; ud = [NSUserDefaults standardUserDefaults]; [defClass hackInServerDefaults:ud withAppDomainPath:appDomainPath globalDomainPath:globalDomainPath]; #if 0 if (((sd == nil) || (sd == ud)) && (appDomainPath != nil)) { NSLog(@"Note: not using server defaults: '%@' " @"(not supported on this Foundation)", appDomainPath); } #endif } [pool release]; return WOWatchDogApplicationMain(appName, argc, argv); } SOPE/sope-appserver/NGObjWeb/WOChildComponentReference.h0000644000000000000000000000237012242733417022045 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGObjWeb_WOChildComponentReference_H__ #define __NGObjWeb_WOChildComponentReference_H__ #include /* This element is used to represent sub-components in templates. Eg if A: MyComponent { } The 'A' is turned into a WOChildComponentReference object. */ @interface WOChildComponentReference : WODynamicElement { @protected NSString *childName; WOElement *template; } @end #endif /* __NGObjWeb_WOChildComponentReference_H__ */ SOPE/sope-appserver/NGObjWeb/WOSimpleHTTPParser.m0000644000000000000000000006706312242733417020445 0ustar rootroot/* Copyright (C) 2000-2007 SKYRIX Software AG Copyright (C) 2007 Helge Hess This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "WOSimpleHTTPParser.h" #include #include #include #include "common.h" #include @implementation WOSimpleHTTPParser static Class NSStringClass = Nil; static BOOL debugOn = NO; static BOOL heavyDebugOn = NO; static int fileIOBoundary = 0; static int maxUploadSize = 0; + (void)initialize { NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; debugOn = [ud boolForKey:@"WOSimpleHTTPParserDebugEnabled"]; heavyDebugOn = [ud boolForKey:@"WOSimpleHTTPParserHeavyDebugEnabled"]; fileIOBoundary = [ud integerForKey:@"WOSimpleHTTPParserFileIOBoundary"]; maxUploadSize = [ud integerForKey:@"WOSimpleHTTPParserMaxUploadSizeInKB"]; if (maxUploadSize == 0) maxUploadSize = 256 * 1024; /* 256MB */ if (fileIOBoundary == 0) fileIOBoundary = 16384; if (debugOn) { NSLog(@"WOSimpleHTTPParser: max-upload-size: %dKB", maxUploadSize); NSLog(@"WOSimpleHTTPParser: file-IO boundary: %d", fileIOBoundary); } } - (id)initWithStream:(id)_stream { if (NSStringClass == Nil) NSStringClass = [NSString class]; if ((self = [super init])) { if ((self->io = [_stream retain]) == nil) { [self release]; return nil; } self->readBytes = (void *) [(NSObject *)self->io methodForSelector:@selector(readBytes:count:)]; if (self->readBytes == NULL) { [self warnWithFormat:@"(%s): got invalid stream object: %@", __PRETTY_FUNCTION__, self->io]; [self release]; return nil; } } return self; } - (void)dealloc { [self reset]; [self->io release]; [super dealloc]; } /* transient state */ - (void)reset { self->clen = -1; [self->content release]; self->content = nil; [self->lastException release]; self->lastException = nil; [self->httpVersion release]; self->httpVersion = nil; [self->headers removeAllObjects]; if (self->lineBuffer) { free(self->lineBuffer); self->lineBuffer = NULL; } self->lineBufSize = 0; } /* low-level reading */ - (unsigned int)defaultLineSize { return 512; } - (NSException *)readNextLine { unsigned i; if (self->lineBuffer == NULL) { self->lineBufSize = [self defaultLineSize]; self->lineBuffer = malloc(self->lineBufSize + 10); } for (i = 0; YES; i++) { register unsigned rc; unsigned char c; rc = self->readBytes(self->io, @selector(readBytes:count:), &c, 1); if (rc != 1) { if (debugOn) { [self debugWithFormat:@"got result %u, exception: %@", rc, [self->io lastException]]; } return [self->io lastException]; } /* check buffer capacity */ if ((i + 2) > self->lineBufSize) { static int reallocCount = 0; reallocCount++; if (reallocCount > 1000) { static BOOL didLog = NO; if (!didLog) { didLog = YES; [self warnWithFormat:@"(%s): reallocated the HTTP line buffer %i times, " @"consider increasing the default line buffer size!", __PRETTY_FUNCTION__, reallocCount]; } } if (self->lineBufSize > (56 * 1024)) { /* to avoid DOS attacks ... */ return [NSException exceptionWithName:@"HTTPParserHeaderSizeExceeded" reason: @"got a HTTP line of 100KB+ (DoS attack?)!" userInfo:nil]; } self->lineBufSize *= 2; self->lineBuffer = realloc(self->lineBuffer, self->lineBufSize + 10); } if (c == '\n') { /* found EOL */ break; } else if (c == '\r') { /* skip CR */ i--; continue; } else { /* store byte */ self->lineBuffer[i] = c; } } self->lineBuffer[i] = 0; /* 0-terminate buffer */ return nil /* nil means: everything OK */; } /* common HTTP parsing */ static NSString *ContentLengthHeaderName = @"content-length"; static NSString *stringForHeaderName(char *p) { /* Note: arg is _not_ const */ /* process header name we try to be smart to avoid creation of NSString objects ... */ register unsigned len; register char c1; if ((len = strlen(p)) == 0) return @""; c1 = *p; switch (len) { case 0: case 1: break; case 2: if (strcasecmp(p, "te") == 0) return @"te"; if (strcasecmp(p, "if") == 0) return @"if"; break; case 3: if (strcasecmp(p, "via") == 0) return @"via"; if (strcasecmp(p, "age") == 0) return @"age"; if (strcasecmp(p, "p3p") == 0) return @"p3p"; break; case 4: switch (c1) { case 'd': case 'D': if (strcasecmp(p, "date") == 0) return @"date"; break; case 'e': case 'E': if (strcasecmp(p, "etag") == 0) return @"etag"; break; case 'f': case 'F': if (strcasecmp(p, "from") == 0) return @"from"; break; case 'h': case 'H': if (strcasecmp(p, "host") == 0) return @"host"; break; case 'v': case 'V': if (strcasecmp(p, "vary") == 0) return @"vary"; break; } break; case 5: if (strcasecmp(p, "allow") == 0) return @"allow"; if (strcasecmp(p, "brief") == 0) return @"brief"; if (strcasecmp(p, "range") == 0) return @"range"; if (strcasecmp(p, "depth") == 0) return @"depth"; if (strcasecmp(p, "ua-os") == 0) return @"ua-os"; /* Entourage */ break; case 6: switch (c1) { case 'a': case 'A': if (strcasecmp(p, "accept") == 0) return @"accept"; break; case 'c': case 'C': if (strcasecmp(p, "cookie") == 0) return @"cookie"; break; case 'e': case 'E': if (strcasecmp(p, "expect") == 0) return @"expect"; break; case 'p': case 'P': if (strcasecmp(p, "pragma") == 0) return @"pragma"; break; case 's': case 'S': if (strcasecmp(p, "server") == 0) return @"server"; break; case 'u': case 'U': if (strcasecmp(p, "ua-cpu") == 0) return @"ua-cpu"; /* Entourage */ break; } break; default: switch (c1) { case 'a': case 'A': if (len > 10) { if (p[6] == '-') { if (strcasecmp(p, "accept-charset") == 0) return @"accept-charset"; if (strcasecmp(p, "accept-encoding") == 0) return @"accept-encoding"; if (strcasecmp(p, "accept-language") == 0) return @"accept-language"; if (strcasecmp(p, "accept-ranges") == 0) return @"accept-ranges"; } else if (strcasecmp(p, "authorization") == 0) return @"authorization"; } break; case 'c': case 'C': if (len > 8) { if (p[7] == '-') { if (strcasecmp(p, "content-length") == 0) return ContentLengthHeaderName; if (strcasecmp(p, "content-type") == 0) return @"content-type"; if (strcasecmp(p, "content-md5") == 0) return @"content-md5"; if (strcasecmp(p, "content-range") == 0) return @"content-range"; if (strcasecmp(p, "content-encoding") == 0) return @"content-encoding"; if (strcasecmp(p, "content-language") == 0) return @"content-language"; if (strcasecmp(p, "content-location") == 0) return @"content-location"; if (strcasecmp(p, "content-class") == 0) /* Entourage */ return @"content-class"; } else if (strcasecmp(p, "call-back") == 0) return @"call-back"; } if (strcasecmp(p, "connection") == 0) return @"connection"; if (strcasecmp(p, "cache-control") == 0) return @"cache-control"; break; case 'd': case 'D': if (strcasecmp(p, "destination") == 0) return @"destination"; if (strcasecmp(p, "destroy") == 0) return @"destroy"; break; case 'e': case 'E': if (strcasecmp(p, "expires") == 0) return @"expires"; if (strcasecmp(p, "extension") == 0) return @"extension"; /* Entourage */ break; case 'i': case 'I': if (strcasecmp(p, "if-modified-since") == 0) return @"if-modified-since"; if (strcasecmp(p, "if-none-match") == 0) /* Entourage */ return @"if-none-match"; if (strcasecmp(p, "if-match") == 0) return @"if-match"; break; case 'k': case 'K': if (strcasecmp(p, "keep-alive") == 0) return @"keep-alive"; break; case 'l': case 'L': if (strcasecmp(p, "last-modified") == 0) return @"last-modified"; if (strcasecmp(p, "location") == 0) return @"location"; if (strcasecmp(p, "lock-token") == 0) return @"lock-token"; break; case 'm': case 'M': if (strcasecmp(p, "ms-webstorage") == 0) return @"ms-webstorage"; if (strcasecmp(p, "max-forwards") == 0) return @"max-forwards"; break; case 'n': case 'N': if (len > 16) { if (p[12] == '-') { if (strcasecmp(p, "notification-delay") == 0) return @"notification-delay"; if (strcasecmp(p, "notification-type") == 0) return @"notification-type"; } } break; case 'o': case 'O': if (len == 9) { if (strcasecmp(p, "overwrite") == 0) return @"overwrite"; } break; case 'p': case 'P': if (len == 16) { if (strcasecmp(p, "proxy-connection") == 0) return @"proxy-connection"; } break; case 'r': case 'R': if (len == 7) { if (strcasecmp(p, "referer") == 0) return @"referer"; } break; case 's': case 'S': switch (len) { case 21: if (strcasecmp(p, "subscription-lifetime") == 0) return @"subscription-lifetime"; break; case 15: if (strcasecmp(p, "subscription-id") == 0) return @"subscription-id"; break; case 10: if (strcasecmp(p, "set-cookie") == 0) return @"set-cookie"; break; } break; case 't': case 'T': if (strcasecmp(p, "transfer-encoding") == 0) return @"transfer-encoding"; if (strcasecmp(p, "translate") == 0) return @"translate"; if (strcasecmp(p, "trailer") == 0) return @"trailer"; if (strcasecmp(p, "timeout") == 0) return @"timeout"; break; case 'u': case 'U': if (strcasecmp(p, "user-agent") == 0) return @"user-agent"; break; case 'w': case 'W': if (strcasecmp(p, "www-authenticate") == 0) return @"www-authenticate"; if (strcasecmp(p, "warning") == 0) return @"warning"; break; case 'x': case 'X': if ((p[2] == 'w') && (len > 22)) { if (strstr(p, "x-webobjects-") == (void *)p) { p += 13; /* skip x-webobjects- */ if (strcmp(p, "server-protocol") == 0) return @"x-webobjects-server-protocol"; else if (strcmp(p, "server-protocol") == 0) return @"x-webobjects-server-protocol"; else if (strcmp(p, "remote-addr") == 0) return @"x-webobjects-remote-addr"; else if (strcmp(p, "remote-host") == 0) return @"x-webobjects-remote-host"; else if (strcmp(p, "server-name") == 0) return @"x-webobjects-server-name"; else if (strcmp(p, "server-port") == 0) return @"x-webobjects-server-port"; else if (strcmp(p, "server-url") == 0) return @"x-webobjects-server-url"; } } if (len == 7) { if (strcasecmp(p, "x-cache") == 0) return @"x-cache"; } else if (len == 12) { if (strcasecmp(p, "x-powered-by") == 0) return @"x-powered-by"; } if (strcasecmp(p, "x-zidestore-name") == 0) return @"x-zidestore-name"; if (strcasecmp(p, "x-forwarded-for") == 0) return @"x-forwarded-for"; if (strcasecmp(p, "x-forwarded-host") == 0) return @"x-forwarded-host"; if (strcasecmp(p, "x-forwarded-server") == 0) return @"x-forwarded-server"; break; } } if (debugOn) NSLog(@"making custom header name '%s'!", p); /* make name lowercase (we own the buffer, so we can work on it) */ { unsigned char *t; for (t = (unsigned char *)p; *t != '\0'; t++) *t = tolower(*t); } return [[NSString alloc] initWithCString:p]; } - (NSException *)parseHeader { NSException *e = nil; while ((e = [self readNextLine]) == nil) { unsigned char *p, *v; unsigned int idx; NSString *headerName; NSString *headerValue; if (heavyDebugOn) printf("read header line: '%s'\n", self->lineBuffer); if (strlen((char *)self->lineBuffer) == 0) { /* found end of header */ break; } p = self->lineBuffer; if (*p == ' ' || *p == '\t') { // TODO: implement folding (remember last header-key, add string) [self errorWithFormat: @"(%s): got a folded HTTP header line, cannot process!", __PRETTY_FUNCTION__]; continue; } /* find key/value separator */ if ((v = (unsigned char *)index((char *)p, ':')) == NULL) { [self warnWithFormat:@"got malformed header line: '%s'", self->lineBuffer]; continue; } *v = '\0'; v++; /* now 'p' points to name and 'v' to value */ /* skip leading spaces */ while (*v != '\0' && (*v == ' ' || *v == '\t')) v++; if (*v != '\0') { /* trim trailing spaces */ for (idx = strlen((char *)v) - 1; idx >= 0; idx--) { if ((v[idx] != ' ' && v[idx] != '\t')) break; v[idx] = '\0'; } } headerName = stringForHeaderName((char *)p); headerValue = [[NSStringClass alloc] initWithCString:(char *)v]; if (headerName == ContentLengthHeaderName) self->clen = atoi((char *)v); if (headerName != nil || headerValue != nil) { if (self->headers == nil) self->headers = [[NSMutableDictionary alloc] initWithCapacity:32]; [self->headers setObject:headerValue forKey:headerName]; } [headerValue release]; [headerName release]; } return e; } - (NSException *)parseEntityOfMethod:(NSString *)_method { /* TODO: several cases are caught: a) content-length = 0 => empty data b) content-length small => read into memory c) content-length large => streamed into the filesystem to safe RAM d) content-length unknown => ?? */ if (self->clen == 0) { /* nothing to do */ } else if (self->clen < 0) { /* I think HTTP/1.1 requires a content-length header to be present ? */ if ([self->httpVersion isEqualToString:@"HTTP/1.0"] || [self->httpVersion isEqualToString:@"HTTP/0.9"]) { /* content-length unknown, read till EOF */ BOOL readToEOF = YES; if ([_method isEqualToString:@"HEAD"]) readToEOF = NO; else if ([_method isEqualToString:@"GET"]) readToEOF = NO; else if ([_method isEqualToString:@"DELETE"]) readToEOF = NO; if (readToEOF) { [self warnWithFormat: @"not processing entity of request without contentlen!"]; } } } else if (self->clen > maxUploadSize*1024) { /* entity is too large */ NSString *s; s = [NSString stringWithFormat:@"The maximum HTTP transaction size was " @"exceeded (%d vs %d)", self->clen, maxUploadSize * 1024]; return [NSException exceptionWithName:@"LimitException" reason:s userInfo:nil]; } else if (self->clen > fileIOBoundary) { /* we are streaming the content to a file and use a memory mapped data */ unsigned toGo; NSString *fn; char buf[4096]; BOOL ok = YES; int writeError = 0; FILE *t; [self debugWithFormat:@"streaming %i bytes into file ...", self->clen]; fn = [[NSProcessInfo processInfo] temporaryFileName]; if ((t = fopen([fn cString], "w")) == NULL) { [self errorWithFormat:@"could not open temporary file '%@'!", fn]; /* read into memory as a fallback ... */ self->content = [[(NGStream *)self->io safeReadDataOfLength:self->clen] retain]; if (self->content == nil) return [self->io lastException]; return nil; } for (toGo = self->clen; toGo > 0; ) { unsigned readCount, writeCount; /* read from socket */ readCount = [self->io readBytes:buf count:sizeof(buf)]; if (readCount == NGStreamError) { /* an error */ ok = NO; break; } toGo -= readCount; /* write to file */ if ((writeCount = fwrite(buf, readCount, 1, t)) != 1) { /* an error */ ok = NO; writeError = ferror(t); break; } } fclose(t); if (!ok) { unlink([fn cString]); /* delete temporary file */ if (writeError == 0) { return [NSException exceptionWithName:@"SystemWriteError" reason:@"failed to write data to upload file" userInfo:nil]; } return [self->io lastException]; } self->content = [[NSData alloc] initWithContentsOfMappedFile:fn]; unlink([fn cString]); /* if the mmap disappears, the storage is freed */ } else { /* content-length known and small */ //[self logWithFormat:@"reading %i bytes of the entity", self->clen]; self->content = [[(NGStream *)self->io safeReadDataOfLength:self->clen] retain]; if (self->content == nil) return [self->io lastException]; //[self logWithFormat:@"read %i bytes.", [self->content length]]; } return nil; } /* handling expectations */ - (BOOL)processContinueExpectation { // TODO: this should check the credentials of a request before accepting the // body. The current implementation is far from optimal and only added // for Mono compatibility (and actually produces the same behaviour // like with HTTP/1.0 ...) static char *contStatLine = "HTTP/1.0 100 Continue\r\n" "content-length: 0\r\n" "\r\n"; static char *failStatLine = "HTTP/1.0 417 Expectation Failed\r\n" "content-length: 0\r\n" "\r\n"; char *respline = NULL; BOOL ok = YES; [self debugWithFormat:@"process 100 continue on IO: %@", self->io]; if (self->clen > 0 && (self->clen > (maxUploadSize * 1024))) { // TODO: return a 417 expectation failed ok = NO; respline = failStatLine; } else { ok = YES; respline = contStatLine; } if (![self->io safeWriteBytes:respline count:strlen(respline)]) { ASSIGN(self->lastException, [self->io lastException]); return NO; } if (![self->io flush]) { ASSIGN(self->lastException, [self->io lastException]); return NO; } return ok; } /* parsing */ - (void)_fixupContentEncodingOfMessageBasedOnContentType:(WOMessage *)_msg { // DUP: NGHttp+WO.m NSStringEncoding enc = 0; NSString *ctype; NGMimeType *rqContentType; NSString *charset; if (![(ctype = [_msg headerForKey:@"content-type"]) isNotEmpty]) /* an HTTP message w/o a content type? */ return; if ((rqContentType = [NGMimeType mimeType:ctype]) == nil) { [self warnWithFormat:@"could not parse MIME type: '%@'", ctype]; return; } charset = [rqContentType valueOfParameter:@"charset"]; if ([charset isNotEmpty]) { enc = [NSString stringEncodingForEncodingNamed:charset]; } else if (rqContentType != nil) { /* process default charsets for content types */ NSString *majorType = [rqContentType type]; if ([majorType isEqualToString:@"text"]) { NSString *subType = [rqContentType subType]; if ([subType isEqualToString:@"calendar"]) { /* RFC2445, section 4.1.4 */ enc = NSUTF8StringEncoding; } } else if ([majorType isEqualToString:@"application"]) { NSString *subType = [rqContentType subType]; if ([subType isEqualToString:@"xml"]) { // TBD: we should look at the actual content! (lastException, e); return nil; } if (heavyDebugOn) printf("read request line: '%s'\n", self->lineBuffer); { /* sample line: "GET / HTTP/1.0" */ char *p, *t; /* parse method */ p = (char *)self->lineBuffer; if ((t = index(p, ' ')) == NULL) { [self logWithFormat:@"got broken request line '%s'", self->lineBuffer]; return nil; } *t = '\0'; switch (*p) { /* intended fall-throughs ! */ case 'b': case 'B': if (strcasecmp(p, "BPROPFIND") == 0) { method = @"BPROPFIND"; break; } if (strcasecmp(p, "BPROPPATCH") == 0) { method = @"BPROPPATCH"; break; } case 'c': case 'C': if (strcasecmp(p, "COPY") == 0) { method = @"COPY"; break; } if (strcasecmp(p, "CHECKOUT") == 0) { method = @"CHECKOUT"; break; } if (strcasecmp(p, "CHECKIN") == 0) { method = @"CHECKIN"; break; } case 'd': case 'D': if (strcasecmp(p, "DELETE") == 0) { method = @"DELETE"; break; } case 'h': case 'H': if (strcasecmp(p, "HEAD") == 0) { method = @"HEAD"; break; } case 'l': case 'L': if (strcasecmp(p, "LOCK") == 0) { method = @"LOCK"; break; } case 'g': case 'G': if (strcasecmp(p, "GET") == 0) { method = @"GET"; break; } case 'm': case 'M': if (strcasecmp(p, "MKCOL") == 0) { method = @"MKCOL"; break; } if (strcasecmp(p, "MOVE") == 0) { method = @"MOVE"; break; } case 'n': case 'N': if (strcasecmp(p, "NOTIFY") == 0) { method = @"NOTIFY"; break; } case 'o': case 'O': if (strcasecmp(p, "OPTIONS") == 0) { method = @"OPTIONS"; break; } case 'p': case 'P': if (strcasecmp(p, "PUT") == 0) { method = @"PUT"; break; } if (strcasecmp(p, "POST") == 0) { method = @"POST"; break; } if (strcasecmp(p, "PROPFIND") == 0) { method = @"PROPFIND"; break; } if (strcasecmp(p, "PROPPATCH") == 0) { method = @"PROPPATCH"; break; } if (strcasecmp(p, "POLL") == 0) { method = @"POLL"; break; } case 'r': case 'R': if (strcasecmp(p, "REPORT") == 0) { method = @"REPORT"; break; } case 's': case 'S': if (strcasecmp(p, "SEARCH") == 0) { method = @"SEARCH"; break; } if (strcasecmp(p, "SUBSCRIBE") == 0) { method = @"SUBSCRIBE"; break; } case 'u': case 'U': if (strcasecmp(p, "UNLOCK") == 0) { method = @"UNLOCK"; break; } if (strcasecmp(p, "UNSUBSCRIBE")== 0) { method = @"UNSUBSCRIBE"; break; } if (strcasecmp(p, "UNCHECKOUT") == 0) { method = @"UNCHECKOUT"; break; } case 'v': case 'V': if (strcasecmp(p, "VERSION-CONTROL") == 0) { method = @"VERSION-CONTROL"; break; } default: if (debugOn) [self debugWithFormat:@"making custom HTTP method name: '%s'", p]; method = [NSString stringWithCString:p]; break; } /* parse URI */ p = t + 1; /* skip space */ while (*p != '\0' && (*p == ' ' || *p == '\t')) /* skip spaces */ p++; if (*p == '\0') { [self logWithFormat:@"got broken request line '%s'", self->lineBuffer]; return nil; } if ((t = index(p, ' ')) == NULL) { /* the URI isn't followed by a HTTP version */ self->httpVersion = @"HTTP/0.9"; /* TODO: strip trailing spaces for better compliance */ uri = [NSString stringWithCString:p]; } else { *t = '\0'; uri = [NSString stringWithCString:p]; /* parse version */ p = t + 1; /* skip space */ while (*p != '\0' && (*p == ' ' || *p == '\t')) /* skip spaces */ p++; if (*p == '\0') self->httpVersion = @"HTTP/0.9"; else if (strcasecmp(p, "http/1.0") == 0) self->httpVersion = @"HTTP/1.0"; else if (strcasecmp(p, "http/1.1") == 0) self->httpVersion = @"HTTP/1.1"; else { /* TODO: strip trailing spaces */ self->httpVersion = [[NSString alloc] initWithCString:p]; } } } /* process header */ if ((e = [self parseHeader]) != nil) { ASSIGN(self->lastException, e); return nil; } if (heavyDebugOn) [self logWithFormat:@"parsed header: %@", self->headers]; /* check for expectations */ if ((expect = [self->headers objectForKey:@"expect"]) != nil) { if ([expect rangeOfString:@"100-continue" options:NSCaseInsensitiveSearch].length > 0) { if (![self processContinueExpectation]) return nil; } } /* process body */ if (clen != 0) { if ((e = [self parseEntityOfMethod:method])) { ASSIGN(self->lastException, e); return nil; } } if (heavyDebugOn) [self logWithFormat:@"HeavyDebug: got all .."]; r = [[WORequest alloc] initWithMethod:method uri:uri httpVersion:self->httpVersion headers:self->headers content:self->content userInfo:nil]; [self _fixupContentEncodingOfMessageBasedOnContentType:r]; [self reset]; if (heavyDebugOn) [self logWithFormat:@"HeavyDebug: request: %@", r]; return [r autorelease]; } - (WOResponse *)parseResponse { NSException *e = nil; int code = 200; WOResponse *r = nil; [self reset]; if (heavyDebugOn) [self logWithFormat:@"HeavyDebug: parsing response ..."]; /* process response line */ if ((e = [self readNextLine])) { ASSIGN(self->lastException, e); return nil; } if (heavyDebugOn) printf("read response line: '%s'\n", self->lineBuffer); { /* sample line: "HTTP/1.0 200 OK" */ char *p, *t; /* version */ p = (char *)self->lineBuffer; if ((t = index(p, ' ')) == NULL) { [self logWithFormat:@"got broken response line '%s'", self->lineBuffer]; return nil; } *t = '\0'; if (strcasecmp(p, "http/1.0") == 0) self->httpVersion = @"HTTP/1.0"; else if (strcasecmp(p, "http/1.1") == 0) self->httpVersion = @"HTTP/1.1"; else self->httpVersion = [[NSString alloc] initWithCString:p]; /* code */ p = t + 1; /* skip space */ while (*p != '\0' && (*p == ' ' || *p == '\t')) /* skip spaces */ p++; if (*p == '\0') { [self logWithFormat:@"got broken response line '%s'", self->lineBuffer]; return nil; } code = atoi(p); /* we don't need to parse a reason ... */ } /* process header */ if ((e = [self parseHeader])) { ASSIGN(self->lastException, e); return nil; } if (heavyDebugOn) [self logWithFormat:@"parsed header: %@", self->headers]; /* process body */ if (clen != 0) { if ((e = [self parseEntityOfMethod:nil /* parsing a response */])) { ASSIGN(self->lastException, e); return nil; } } if (heavyDebugOn) [self logWithFormat:@"HeavyDebug: got all .."]; r = [[[WOResponse alloc] init] autorelease]; [r setStatus:code]; [r setHTTPVersion:self->httpVersion]; [r setHeaders:self->headers]; [r setContent:self->content]; [self _fixupContentEncodingOfMessageBasedOnContentType:r]; [self reset]; if (heavyDebugOn) [self logWithFormat:@"HeavyDebug: response: %@", r]; return r; } - (NSException *)lastException { return self->lastException; } /* debugging */ - (BOOL)isDebuggingEnabled { return debugOn; } @end /* WOSimpleHTTPParser */ SOPE/sope-appserver/NGObjWeb/WOElementID.h0000644000000000000000000000360012242733417017123 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGObjWeb_WOElementID_H__ #define __NGObjWeb_WOElementID_H__ #import /* WOElementID This object is used to keep efficient representations of a NGObjWeb element-id. An element id is a "path" to an object kept in a tree. */ #define NGObjWeb_MAX_ELEMENT_ID_COUNT 126 @class NSString, NSMutableString; typedef struct { NSString *string; unsigned int number; NSString *fqn; } WOElementIDPart; @interface WOElementID : NSObject { @public WOElementIDPart elementId[NGObjWeb_MAX_ELEMENT_ID_COUNT + 1]; char elementIdCount; char idPos; /* keep a mutable string around ... */ NSMutableString *cs; IMP addStr; } - (id)initWithString:(NSString *)_s; /* methods */ - (NSString *)elementID; - (void)appendElementIDComponent:(NSString *)_eid; - (void)deleteAllElementIDComponents; - (void)appendZeroElementIDComponent; - (void)deleteLastElementIDComponent; - (void)incrementLastElementIDComponent; - (void)appendIntElementIDComponent:(int)_eid; /* request ID processing */ - (id)currentElementID; - (id)consumeElementID; @end #endif /* __NGObjWeb_WOElementID_H__ */ SOPE/sope-appserver/NGObjWeb/WOComponent.m0000644000000000000000000010270112242733417017266 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include "WOComponent+private.h" #include "NSObject+WO.h" #include #include "WOContext+private.h" #include "WOElement+private.h" #include #include #include #include #include "WOComponentFault.h" #include "common.h" #include #import #ifdef MULLE_EO_CONTROL #import #endif #include @interface WOContext(ComponentStackCount) - (unsigned)componentStackCount; @end #if APPLE_FOUNDATION_LIBRARY || NeXT_Foundation_LIBRARY @interface NSObject(Miss) - (id)notImplemented:(SEL)cmd; @end #endif #if !LIB_FOUNDATION_LIBRARY # define NG_USE_KVC_FALLBACK 1 #endif @implementation WOComponent static Class NSDateClass = Nil; static Class WOComponentClass = Nil; static NGLogger *perfLogger = nil; static BOOL debugOn = NO; static BOOL debugComponentAwake = NO; static BOOL debugTemplates = NO; static BOOL debugTakeValues = NO; static BOOL abortOnAwakeComponentInCtxDealloc = NO; static BOOL abortOnMissingCtx = NO; static BOOL wakeupPageOnCreation = NO; + (void)initialize { NSUserDefaults *ud; NGLoggerManager *lm; static BOOL didInit = NO; if (didInit) return; didInit = YES; ud = [NSUserDefaults standardUserDefaults]; lm = [NGLoggerManager defaultLoggerManager]; WOComponentClass = [WOComponent class]; NSDateClass = [NSDate class]; perfLogger = [lm loggerForDefaultKey:@"WOProfileElements"]; debugOn = [WOApplication isDebuggingEnabled]; debugComponentAwake = [ud boolForKey:@"WODebugComponentAwake"]; if ((debugTakeValues = [ud boolForKey:@"WODebugTakeValues"])) NSLog(@"WOComponent: WODebugTakeValues on."); abortOnAwakeComponentInCtxDealloc = [ud boolForKey:@"WOCoreOnAwakeComponentInCtxDealloc"]; } - (id)init { if ((self = [super init])) { NSNotificationCenter *nc; WOComponentDefinition *cdef; if ((cdef = (id)self->wocVariables)) { // HACK CD, see WOComponentDefinition self->wocVariables = nil; } if (self->wocName == nil) self->wocName = [NSStringFromClass([self class]) copy]; [self setCachingEnabled:[[self application] isCachingEnabled]]; /* finish initialization */ if (cdef) { [cdef _finishInitializingComponent:self]; [cdef release]; cdef = nil; } #if !APPLE_FOUNDATION_LIBRARY && !NeXT_Foundation_LIBRARY else { /* this is triggered by Publisher on MacOSX */ [self debugWithFormat: @"Note: got no component definition according to HACK CD"]; } #endif /* add to notification center */ nc = [NSNotificationCenter defaultCenter]; [nc addObserver:self selector:@selector(_sessionWillDealloc:) name:@"WOSessionWillDeallocate" object:nil]; [nc addObserver:self selector:@selector(_contextWillDealloc:) name:@"WOContextWillDeallocate" object:nil]; } return self; } - (id)initWithContext:(WOContext *)_ctx { [self _setContext:_ctx]; if ((self = [self init])) { if (self->context != nil) [self ensureAwakeInContext:self->context]; else { [self warnWithFormat: @"no context given to -initWithContext: ..."]; } } return self; } - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; [[self->subcomponents allValues] makeObjectsPerformSelector:@selector(setParent:) withObject:nil]; [self->subcomponents release]; [self->wocClientObject release]; [self->wocBindings release]; [self->wocVariables release]; [self->wocName release]; [self->wocBaseURL release]; [self->bundle release]; [super dealloc]; } static inline void _setExtraVar(WOComponent *self, NSString *_key, id _obj) { if (_obj) { if (self->wocVariables == nil) self->wocVariables = [[NSMutableDictionary alloc] initWithCapacity:16]; [self->wocVariables setObject:_obj forKey:_key]; } else [self->wocVariables removeObjectForKey:_key]; } static inline id _getExtraVar(WOComponent *self, NSString *_key) { return [self->wocVariables objectForKey:_key]; } /* observers */ - (void)_sessionWillDealloc:(NSNotification *)_notification { #if DEBUG NSAssert(_notification, @"missing valid session arg ..."); #endif if (self->session == nil) { /* component isn't interested in session anymore anyway ... */ return; } if (self->session != [_notification object]) /* not the component's context ... */ return; #if DEBUG && 0 [self debugWithFormat:@"resetting sn/ctx because session will dealloc .."]; #endif if (self->componentFlags.isAwake) { [self warnWithFormat: @"session will dealloc, but component 0x%p is awake (ctx=%@) !", self, self->context]; [self _sleepWithContext:self->context]; } self->session = nil; [self _setContext:nil]; } - (void)_contextWillDealloc:(NSNotification *)_notification { #if DEBUG NSAssert(_notification, @"missing valid notification arg ..."); #endif if (self->context == nil) /* component isn't interested in context anyway ... */ return; if (![[self->context contextID] isEqualToString:[_notification object]]) /* not the component's context ... */ return; #if DEBUG && 0 [self debugWithFormat:@"resetting sn/ctx because context will dealloc .."]; #endif if (self->componentFlags.isAwake) { /* Note: this is not necessarily a problem, no specific reason to log the event?! */ [self debugWithFormat: @"context %@ will dealloc, but component is awake in ctx %@!", [_notification object], [self->context contextID]]; if (abortOnAwakeComponentInCtxDealloc) abort(); [self _sleepWithContext:nil]; } [self _setContext:nil]; self->session = nil; } /* awake & sleep */ - (void)awake { } - (void)sleep { if (debugOn) { if (self->componentFlags.isAwake) { [self warnWithFormat: @"component should not be awake if sleep is called !"]; } if (self->context == nil) { [self warnWithFormat: @"context should not be nil if sleep is called !"]; } } self->componentFlags.isAwake = 0; [self _setContext:nil]; self->application = nil; self->session = nil; } - (void)ensureAwakeInContext:(WOContext *)_ctx { #if DEBUG NSAssert1(_ctx, @"missing context for awake (component=%@) ...", self); #endif if (debugComponentAwake) [self debugWithFormat:@"0x%p ensureAwakeInContext:0x%p", self, _ctx]; /* sanity check */ if (self->componentFlags.isAwake) { if (self->context == _ctx) { if (debugComponentAwake) [self debugWithFormat:@"0x%p already awake:0x%p", self, _ctx]; return; } } /* setup globals */ if (self->context == nil) [self _setContext:_ctx]; if (self->application == nil) self->application = [_ctx application]; if ((self->session == nil) && [_ctx hasSession]) self->session = [_ctx session]; self->componentFlags.isAwake = 1; [_ctx _addAwakeComponent:self]; /* ensure that sleep is called */ /* awake subcomponents */ { NSEnumerator *children; WOComponent *child; children = [self->subcomponents objectEnumerator]; while ((child = [children nextObject]) != nil) [child _awakeWithContext:_ctx]; } [self awake]; } - (void)_awakeWithContext:(WOContext *)_ctx { if (self->componentFlags.isAwake) return; [self ensureAwakeInContext:_ctx]; } - (void)_sleepWithContext:(WOContext *)_ctx { if (debugComponentAwake) [self debugWithFormat:@"0x%p _sleepWithContext:0x%p", self, _ctx]; if (_ctx != self->context) { if ((self->context != nil) && (_ctx != nil)) { /* component is active in different context ... */ [self warnWithFormat: @"sleep context mismatch (own=0x%p vs given=0x%p)", self->context, _ctx]; return; } } if (self->componentFlags.isAwake) { /* Sleep all child components, this is necessary to ensure some ordering in the sleep calls. All awake components are put to sleep in any case by the WOContext destructor. */ NSEnumerator *children; WOComponent *child; children = [self->subcomponents objectEnumerator]; self->componentFlags.isAwake = 0; while ((child = [children nextObject])) [child _sleepWithContext:_ctx]; [self sleep]; } [self _setContext:nil]; self->application = nil; self->session = nil; } /* accessors */ - (NSString *)name { return self->wocName; } - (NSBundle *)componentBundle { if (!self->bundle) { self->bundle = [NSBundle bundleForClass:[self class]]; [self->bundle retain]; } return self->bundle; } - (NSString *)frameworkName { NSBundle *cbundle; cbundle = [self componentBundle]; if (cbundle == [NSBundle mainBundle]) return nil; return [cbundle bundleName]; } - (NSString *)path { NSArray *languages = nil; #if 0 // the component might not yet be awake ! languages = [[self context] resourceLookupLanguages]; #endif return [[self resourceManager] pathToComponentNamed:[self name] inFramework:[self frameworkName] languages:languages]; } - (void)setBaseURL:(NSURL *)_url { ASSIGNCOPY(self->wocBaseURL, _url); } - (NSURL *)baseURL { NSURL *url; if (self->wocBaseURL) return self->wocBaseURL; url = [(WOApplication *)[self application] baseURL]; self->wocBaseURL = [[NSURL URLWithString:@"WebServerResources" relativeToURL:url] copy]; return self->wocBaseURL; } - (NSString *)componentActionURLForContext:(WOContext *)_ctx { return [@"/" stringByAppendingString:[self name]]; } - (id)application { if (self->application == nil) return (self->application = [WOApplication application]); return self->application; } - (id)existingSession { if (self->session != nil) return self->session; if ([[self context] hasSession]) return [self session]; return nil; } - (id)session { if (self->session == nil) { if ((self->session = [[self context] session]) == nil) { [self debugWithFormat:@"could not get session object from context %@", self->context]; } } if (self->session == nil) [self warnWithFormat:@"missing session for component!"]; return self->session; } - (void)_setContext:(WOContext *)_ctx { self->context = _ctx; } - (WOContext *)context { if (self->context != nil) return self->context; [self debugWithFormat: @"missing context in component 0x%p (component%s)", self, self->componentFlags.isAwake ? " is awake" : " is not awake"]; if (abortOnMissingCtx) { [self errorWithFormat:@"aborting, because ctx is missing !"]; abort(); } if (self->application == nil) self->application = [WOApplication application]; [self _setContext:[self->application context]]; if (self->context == nil) [self warnWithFormat:@"could not determine context object!"]; return self->context; } - (BOOL)hasSession { return [[self context] hasSession]; } - (void)setCachingEnabled:(BOOL)_flag { self->componentFlags.reloadTemplates = _flag ? 0 : 1; } - (BOOL)isCachingEnabled { return (!self->componentFlags.reloadTemplates) ? YES : NO; } - (id)pageWithName:(NSString *)_name { NSArray *languages; WOResourceManager *rm; WOComponent *component; languages = [[self context] resourceLookupLanguages]; rm = [self resourceManager]; /* Note: this API is somewhat broken since the component expects the -initWithContext: message for initialization yet we pass no context ... */ component = [rm pageWithName:_name languages:languages]; // Note: should we call ensureAwakeInContext or is this to early ? // probably the component should be woken up if it enters the ctx. // If we create a page but never render it, we may get a warning // that a context will dealloc but the page is active (yet not awake) // Note: awake is not the same like "has context"! A component can have a // context without being awake - maybe we need an additional method // to hook up a component but the awake list if (wakeupPageOnCreation) [component ensureAwakeInContext:[self context]]; return component; } - (NSString *)stringForKey:(NSString *)_key inTableNamed:(NSString *)_tableName withDefaultValue:(NSString *)_default { NSArray *langs; IS_DEPRECATED; langs = [[self context] resourceLookupLanguages]; return [[[self application] resourceManager] stringForKey:_key inTableNamed:_tableName withDefaultValue:_default languages:langs]; } - (void)setName:(NSString *)_name { if (![_name isNotNull]) [self warnWithFormat:@"setting 'nil' name on component!"]; ASSIGNCOPY(self->wocName, _name); } - (void)setBindings:(NSDictionary *)_bindings { // this is _very_ private and used by WOComponentReference ASSIGNCOPY(self->wocBindings, _bindings); } - (NSDictionary *)_bindings { // private method return self->wocBindings; } - (void)setSubComponents:(NSDictionary *)_dictionary { ASSIGNCOPY(self->subcomponents, _dictionary); } - (NSDictionary *)_subComponents { // private method return self->subcomponents; } - (void)setParent:(WOComponent *)_parent { self->parentComponent = _parent; } - (id)parent { return self->parentComponent; } /* language change */ - (void)languageArrayDidChange { } /* element name */ - (NSString *)elementID { return [self name]; } /* resources */ - (id)redirectToLocation:(id)_loc { WOContext *ctx = [self context]; WOResponse *r; NSString *target; if (_loc == nil) return nil; if ((r = [ctx response]) == nil) r = [[[WOResponse alloc] init] autorelease]; if ([_loc isKindOfClass:[NSURL class]]) target = [_loc absoluteString]; else { _loc = [_loc stringValue]; if ([_loc isAbsoluteURL]) target = _loc; else if ([_loc isAbsolutePath]) target = _loc; else { target = [[ctx request] uri]; // TODO: check whether the algorithm is correct if (![target hasSuffix:@"/"]) target = [target stringByDeletingLastPathComponent]; target = [target stringByAppendingPathComponent:_loc]; } } if (target == nil) return nil; [r setStatus:302 /* moved */]; [r setHeader:target forKey:@"location"]; return r; } - (void)setResourceManager:(WOResourceManager *)_rm { _setExtraVar(self, @"__worm", _rm); } - (WOResourceManager *)resourceManager { WOResourceManager *rm; WOComponent *p; if ((rm = _getExtraVar(self, @"__worm"))) return rm; /* ask parent component ... */ if ((p = [self parent])) { NSAssert2(p != self, @"parent component == component !!! (%@ vs %@)", p, self); if ((rm = [p resourceManager])) return rm; } /* ask application ... */ return [[self application] resourceManager]; } - (NSString *)pathForResourceNamed:(NSString *)_name ofType:(NSString *)_ext { NSFileManager *fm; NSEnumerator *languages; NSString *language; BOOL isDirectory = NO; NSString *cpath; if (_ext) _name = [_name stringByAppendingPathExtension:_ext]; if ((cpath = [self path]) == nil) { [self warnWithFormat:@"no path set in component %@", [self name]]; return nil; } fm = [NSFileManager defaultManager]; if (![fm fileExistsAtPath:cpath isDirectory:&isDirectory]) { [self warnWithFormat:@"component directory %@ does not exist !", cpath]; return nil; } if (!isDirectory) { [self warnWithFormat:@"component path %@ is not a directory !", cpath]; return nil; } /* check in language projects */ languages = [self hasSession] ? [[(WOSession *)[self session] languages] objectEnumerator] : [[[[self context] request] browserLanguages] objectEnumerator]; while ((language = [languages nextObject]) != nil) { language = [language stringByAppendingPathExtension:@"lproj"]; language = [cpath stringByAppendingPathComponent:language]; language = [language stringByAppendingPathExtension:_name]; if ([fm fileExistsAtPath:language]) return language; } /* check in component */ cpath = [cpath stringByAppendingPathComponent:_name]; if ([fm fileExistsAtPath:cpath]) return cpath; return nil; } /* template */ + (WOElement *)templateWithHTMLString:(NSString *)_html declarationString:(NSString *)_wod languages:(NSArray *)_languages { return [self notImplemented:_cmd]; } - (WOElement *)templateWithHTMLString:(NSString *)_html declarationString:(NSString *)_wod { IS_DEPRECATED; return [[self class] templateWithHTMLString:_html declarationString:_wod languages:[(WOSession *)[self session] languages]]; } - (WOElement *)templateWithName:(NSString *)_name { WOResourceManager *resourceManager; NSArray *languages; WOElement *tmpl; if ((resourceManager = [self resourceManager]) == nil) { [self errorWithFormat:@"%s: could not determine resource manager !", __PRETTY_FUNCTION__]; return nil; } languages = [[self context] resourceLookupLanguages]; tmpl = [resourceManager templateWithName:_name languages:languages]; if (debugTemplates) [self debugWithFormat:@"found template: %@", tmpl]; return tmpl; } - (void)setTemplate:(id)_template { /* WO has private API for this: - (void)setTemplate:(WOElement *)template; As mentioned in the OmniGroup WO mailing list ... */ _setExtraVar(self, @"__wotemplate", _template); } - (WOElement *)_woComponentTemplate { WOElement *element; // TODO: move to ivar? if ((element = _getExtraVar(self, @"__wotemplate")) != nil) return element; return [self templateWithName:[self name]]; } /* child components */ - (WOComponent *)childComponentWithName:(NSString *)_name { id child; child = [self->subcomponents objectForKey:_name]; if ([child isComponentFault]) { NSMutableDictionary *tmp; child = [child resolveWithParent:self]; if (child == nil) { [self warnWithFormat:@"Could not resolve component fault: %@", _name]; return nil; } tmp = [self->subcomponents mutableCopy]; [tmp setObject:child forKey:_name]; [self->subcomponents release]; self->subcomponents = nil; self->subcomponents = [tmp copy]; [tmp release]; tmp = nil; } return child; } - (BOOL)synchronizesVariablesWithBindings { return [self isStateless] ? NO : YES; } - (void)setValue:(id)_value forBinding:(NSString *)_name { WOComponent *parent; WOContext *ctx; WODynamicElement *content; ctx = [self context]; parent = [ctx parentComponent]; content = [ctx componentContent]; if (parent == nil) { parent = [self parent]; [self warnWithFormat:@"tried to set value of binding '%@' in component " @"'%@' without parent component (parent is '%@') !", _name, [self name], [parent name]]; } [[self retain] autorelease]; [[content retain] autorelease]; WOContext_leaveComponent(ctx, self); [[self->wocBindings objectForKey:_name] setValue:_value inComponent:parent]; WOContext_enterComponent(ctx, self, content); } - (id)valueForBinding:(NSString *)_name { WOComponent *parent; WOContext *ctx; WODynamicElement *content; id value; ctx = [self context]; parent = [ctx parentComponent]; content = [ctx componentContent]; if (parent == nil) { parent = [self parent]; [self warnWithFormat:@"tried to retrieve value of binding '%@' in" @" component '%@' without parent component (parent is '%@') !", _name, [self name], [parent name]]; } [[self retain] autorelease]; [[content retain] autorelease]; WOContext_leaveComponent(ctx, self); value = [[self->wocBindings objectForKey:_name] valueInComponent:parent]; WOContext_enterComponent(ctx, self, content); return value; } - (BOOL)hasBinding:(NSString *)_name { return ([self->wocBindings objectForKey:_name] != nil) ? YES : NO; } - (BOOL)canSetValueForBinding:(NSString *)_name { WOAssociation *binding; if ((binding = [self->wocBindings objectForKey:_name]) == nil) return NO; return [binding isValueSettable]; } - (BOOL)canGetValueForBinding:(NSString *)_name { WOAssociation *binding; if ((binding = [self->wocBindings objectForKey:_name]) == nil) return NO; return YES; } - (id)performParentAction:(NSString *)_name { WOContext *ctx; WOComponent *parent; WODynamicElement *content; SEL action; id result = nil; ctx = [self context]; parent = [ctx parentComponent]; content = [ctx componentContent]; action = NSSelectorFromString(_name); if (parent == nil) return nil; if (action == NULL) return nil; NSAssert(parent != self, @"parent component equals current component"); if (![parent respondsToSelector:action]) { [self debugWithFormat:@"parent %@ doesn't respond to %@", [parent name], _name]; return nil; } self = [self retain]; NS_DURING { WOContext_leaveComponent(ctx, self); *(&result) = [parent performSelector:action]; WOContext_enterComponent(ctx, self, content); } NS_HANDLER { [self release]; [localException raise]; } NS_ENDHANDLER; [self release]; return result; } /* OWResponder */ - (BOOL)shouldTakeValuesFromRequest:(WORequest *)_rq inContext:(WOContext*)_c { if (debugTakeValues) [self debugWithFormat:@"%s: default says no.", __PRETTY_FUNCTION__]; return NO; } - (void)takeValuesFromRequest:(WORequest *)_req inContext:(WOContext *)_ctx { WOElement *template = nil; if (debugTakeValues) [self debugWithFormat:@"take values from rq 0x%p", _req]; NSAssert1(self->componentFlags.isAwake, @"component %@ is not awake !", self); [self _setContext:_ctx]; template = [self _woComponentTemplate]; if (template == nil) { if (debugTakeValues) [self debugWithFormat:@"cannot take values, component has no template!"]; return; } if (template->takeValues) { template->takeValues(template, @selector(takeValuesFromRequest:inContext:), _req, _ctx); } else [template takeValuesFromRequest:_req inContext:_ctx]; } - (id)invokeActionForRequest:(WORequest *)_req inContext:(WOContext *)_ctx { WOElement *template = nil; id result = nil; NSAssert1(self->componentFlags.isAwake, @"component %@ is not awake!", self); [self _setContext:_ctx]; template = [self _woComponentTemplate]; result = [template invokeActionForRequest:_req inContext:_ctx]; return result; } - (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx { WOElement *template = nil; NSTimeInterval st = 0.0; NSAssert1(self->componentFlags.isAwake, @"component %@ is not awake !", self); if (debugOn) { if (self->context != _ctx) { [self debugWithFormat:@"%s: component ctx != ctx (%@ vs %@)", __PRETTY_FUNCTION__, self->context, _ctx]; } } [self _setContext:_ctx]; if ((template = [self _woComponentTemplate]) == nil) { if (debugOn) { [self debugWithFormat:@"component has no template (rm=%@).", [self resourceManager]]; } return; } if (perfLogger) st = [[NSDateClass date] timeIntervalSince1970]; if (template->appendResponse) { template->appendResponse(template, @selector(appendToResponse:inContext:), _response, _ctx); } else [template appendToResponse:_response inContext:_ctx]; if (perfLogger) { NSTimeInterval diff; int i; diff = [[NSDateClass date] timeIntervalSince1970] - st; #if 1 for (i = [_ctx componentStackCount]; i >= 0; i--) printf(" "); #endif [perfLogger logWithFormat:@"Template %@ (comp %@): %0.3fs\n", [_ctx elementID], [self name], diff]; } } /* WOActionResults */ - (WOResponse *)generateResponse { WOResponse *response = nil; WOContext *ctx = nil; NSString *ctxID; ctx = [self context]; ctxID = [ctx contextID]; response = [WOResponse responseWithRequest:[ctx request]]; if (ctxID == nil) { [self debugWithFormat:@"missing ctx-id for context %@", ctx]; ctxID = @"noctx"; } [ctx deleteAllElementIDComponents]; [ctx appendElementIDComponent:ctxID]; WOContext_enterComponent(ctx, self, nil); [self appendToResponse:response inContext:ctx]; WOContext_leaveComponent(ctx, self); [ctx deleteLastElementIDComponent]; ctx = nil; #if 0 if ([[[ctx request] method] isEqualToString:@"HEAD"]) [response setContent:[NSData data]]; #endif /* HTTP/1.1 caching directive, prevents browser from caching dynamic pages */ if ([[ctx application] isPageRefreshOnBacktrackEnabled]) [response disableClientCaching]; return response; } /* coding */ - (void)encodeWithCoder:(NSCoder *)_coder { BOOL doesReloadTemplates = self->componentFlags.reloadTemplates; [_coder encodeObject:self->wocBindings]; [_coder encodeObject:self->wocName]; [_coder encodeConditionalObject:self->parentComponent]; [_coder encodeObject:self->subcomponents]; [_coder encodeObject:self->wocVariables]; [_coder encodeConditionalObject:self->session]; [_coder encodeValueOfObjCType:@encode(BOOL) at:&doesReloadTemplates]; } - (id)initWithCoder:(NSCoder *)_decoder { if ((self = [super init])) { BOOL doesReloadTemplates = YES; self->wocBindings = [[_decoder decodeObject] retain]; self->wocName = [[_decoder decodeObject] retain]; self->parentComponent = [_decoder decodeObject]; // non-retained self->subcomponents = [[_decoder decodeObject] retain]; self->wocVariables = [[_decoder decodeObject] retain]; self->session = [_decoder decodeObject]; // non-retained [_decoder decodeValueOfObjCType:@encode(BOOL) at:&doesReloadTemplates]; [self setCachingEnabled:!doesReloadTemplates]; } return self; } /* component variables */ - (BOOL)isStateless { return NO; } - (void)reset { [self->wocVariables removeAllObjects]; } - (void)setObject:(id)_obj forKey:(NSString *)_key { _setExtraVar(self, _key, _obj); } - (id)objectForKey:(NSString *)_key { return _getExtraVar(self, _key); } - (NSDictionary *)variableDictionary { return self->wocVariables; } - (BOOL)logComponentVariableCreations { /* only if we have a subclass, we can store values in ivars ... */ return (self->isa != WOComponentClass) ? YES : NO; } #if !NG_USE_KVC_FALLBACK /* only override on libFoundation */ - (void)takeValue:(id)_value forKey:(NSString *)_key { if (WOSetKVCValueUsingMethod(self, _key, _value)) { // method is used return; } if (WOGetKVCGetMethod(self, _key) == NULL) { if (_value == nil) { #if 0 [self debugWithFormat: @"storing value in component variable %@", _key]; #endif if ([self->wocVariables objectForKey:_key]) [self setObject:nil forKey:_key]; return; } #if DEBUG if ([self logComponentVariableCreations]) { /* only if we have a subclass, we can store values in ivars ... */ if (![[self->wocVariables objectForKey:_key] isNotNull]) { [self debugWithFormat: @"Created component variable (class=%@): '%@'.", NSStringFromClass(self->isa), _key]; } } #endif [self setObject:_value forKey:_key]; return; } [self debugWithFormat: @"value %@ could not set via method or KVC " @"(self responds to %@: %s).", _key, _key, [self respondsToSelector:NSSelectorFromString(_key)] ? "yes" : "no"]; #if 0 return NO; #endif } - (id)valueForKey:(NSString *)_key { id value; if ((value = WOGetKVCValueUsingMethod(self, _key))) return value; #if DEBUG && 0 [self debugWithFormat:@"KVC: accessed the component variable %@", _key]; #endif if ((value = [self objectForKey:_key]) != nil) return value; return nil; } #else /* use fallback methods on other Foundation libraries */ - (void)setValue:(id)_value forUndefinedKey:(NSString *)_key { // Note: this is not used on libFoundation, insufficient KVC implementation #if DEBUG && 0 [self logWithFormat:@"KVC: set the component variable %@: %@",_key,_value]; #endif if (_value == nil) { #if 0 [self debugWithFormat: @"storing value in component variable %@", _key]; #endif if ([self->wocVariables objectForKey:_key] != nil) [self setObject:nil forKey:_key]; return; } #if DEBUG if ([self logComponentVariableCreations]) { /* only if we have a subclass, we can store values in ivars ... */ if (![[self->wocVariables objectForKey:_key] isNotNull]) { [self debugWithFormat:@"Created component variable (class=%@): '%@'.", NSStringFromClass(self->isa), _key]; } } #endif [self setObject:_value forKey:_key]; } - (id)valueForUndefinedKey:(NSString *)_key { // Note: this is not used on libFoundation, insufficient KVC implementation #if DEBUG && 0 [self debugWithFormat:@"KVC: accessed the component variable %@", _key]; #endif return [self objectForKey:_key]; } - (void)handleTakeValue:(id)_value forUnboundKey:(NSString *)_key { // deprecated: pre-Panther method [self setValue:_value forUndefinedKey:_key]; } - (id)handleQueryWithUnboundKey:(NSString *)_key { // deprecated: pre-Panther method return [self valueForUndefinedKey:_key]; } - (void)unableToSetNilForKey:(NSString *)_key { // TODO: should we call setValue:NSNull forKey? [self errorWithFormat:@"unable to set 'nil' for key: '%@'", _key]; } #endif /* KVC */ - (void)validationFailedWithException:(NSException *)_exception value:(id)_value keyPath:(NSString *)_keyPath { [self warnWithFormat: @"formatter failed for value %@ (keyPath=%@): %@", _value, _keyPath, [_exception reason]]; } /* logging */ - (BOOL)isEventLoggingEnabled { return YES; } - (BOOL)isDebuggingEnabled { return debugOn; } - (NSString *)loggingPrefix { NSString *n; n = [self name]; if ([n length] == 0) return @""; return n; } /* woo/plist unarchiving */ - (id)unarchiver:(EOKeyValueUnarchiver *)_archiver objectForReference:(id)_keyPath { /* This is used when a .woo file is unarchived. Eg datasources contain bindings in the archive: editingContext = session.defaultEditingContext; The binding will evaluate against the component during loading. */ return [self valueForKeyPath:_keyPath]; } /* NSCopying */ - (id)copyWithZone:(NSZone *)_zone { // TODO: find out who triggers this return [self retain]; } /* description */ - (NSString *)description { NSMutableString *str; id tmp; str = [NSMutableString stringWithCapacity:128]; [str appendFormat:@"<0x%p[%@]: name=%@", self, NSStringFromClass([self class]), [self name]]; if (self->parentComponent) [str appendFormat:@" parent=%@", [self->parentComponent name]]; if (self->subcomponents) [str appendFormat:@" #subs=%i", [self->subcomponents count]]; if (self->componentFlags.isAwake) [str appendFormat:@" awake=0x%p", self->context]; else if (self->context == nil) [str appendString:@" no-ctx"]; if ((tmp = _getExtraVar(self, @"__worm"))) [str appendFormat:@" rm=%@", tmp]; [str appendString:@">"]; return str; } /* Statistics */ - (NSString *)descriptionForResponse:(WOResponse *)_response inContext:(WOContext *)_context { return [self name]; } /* AdvancedBindingAccessors */ - (void)setUnsignedIntValue:(unsigned)_value forBinding:(NSString *)_name { [self setValue:[NSNumber numberWithUnsignedInt:_value] forBinding:_name]; } - (unsigned)unsignedIntValueForBinding:(NSString *)_name { return [[self valueForBinding:_name] unsignedIntValue]; } - (void)setIntValue:(int)_value forBinding:(NSString *)_name { [self setValue:[NSNumber numberWithInt:_value] forBinding:_name]; } - (int)intValueForBinding:(NSString *)_name { return [[self valueForBinding:_name] intValue]; } - (void)setBoolValue:(BOOL)_value forBinding:(NSString *)_name { [self setValue:[NSNumber numberWithBool:_value] forBinding:_name]; } - (BOOL)boolValueForBinding:(NSString *)_name { return [[self valueForBinding:_name] boolValue]; } #if !NG_USE_KVC_FALLBACK - (id)handleQueryWithUnboundKey:(NSString *)_key { [self logWithFormat:@"query for unbound key: %@", _key]; return [super handleQueryWithUnboundKey:_key]; } #endif @end /* WOComponent */ SOPE/sope-appserver/NGObjWeb/Languages.plist0000644000000000000000000001225012242733417017662 0ustar rootroot{ "__doc__" = " /* Browser Language-Mappings for NGObjWeb */ /* ISO 639 Language Codes from: http://www.stonehand.com/unicode/standard/iso639.html map ISO codes to OpenStep names. */"; "aa" = "Afar"; "ab" = "Abkhazian"; "af" = "Afrikaans"; "am" = "Amharic"; "ar" = "Arabic"; "as" = "Assamese"; "ay" = "Aymara"; "az" = "Azerbaijani"; "ba" = "Bashkir"; "be" = "Byelorussian"; "bg" = "Bulgarian"; "bh" = "Bihari"; "bi" = "Bislama"; "bn" = "Bengali"; "bo" = "Tibetan"; "br" = "Breton"; "ca" = "Catalan"; "co" = "Corsican"; "cs" = "Czech"; "cy" = "Welsh"; "da" = "Danish"; "da-dk" = "Danish"; "de" = "German"; "de-at" = "German"; "de-de" = "German"; "de-ch" = "German"; "de-lu" = "German"; // TODO: should be Luxembourgish? "dz" = "Bhutani"; "el" = "Greek"; "en" = "English"; "en-us" = "English"; "en-gb" = "English"; "eo" = "Esperanto"; "es" = "SpanishSpain"; "es-ar" = "SpanishArgentina"; "es-cl" = "Spanish"; "es-es" = "SpanishSpain"; "et" = "Estonian"; "eu" = "Basque"; "fa" = "Persian"; "fi" = "Finnish"; "fi-fi" = "Finnish"; "fj" = "Fiji"; "fo" = "Faeroese"; "fr" = "French"; "fr-fr" = "French"; "fr-be" = "French"; "fr-lu" = "French"; "fy" = "Frisian"; "ga" = "Irish"; "gd" = "ScotsGaelic"; "gl" = "Galician"; "gn" = "Guarani"; "gu" = "Gujarati"; "ha" = "Hausa"; "he" = "Hebrew"; "hi" = "Hindi"; "hr" = "Croatian"; "hu" = "Hungarian"; "hy" = "Armenian"; "ia" = "Interlingua"; "id" = "Indonesian"; "ie" = "Interlingue"; "ik" = "Inupiak"; "in" = "Indonesian"; "is" = "Icelandic"; "it" = "Italian"; "it-it" = "Italian"; "iu" = "Inuktitut"; "iw" = "Hebrew"; "ja" = "Japanese"; "ja-jp" = "Japanese"; "ji" = "Yiddish"; "jw" = "Javanese"; "ka" = "Georgian"; "kk" = "Kazakh"; "kl" = "Greenlandic"; "km" = "Cambodian"; "kn" = "Kannada"; "ko" = "Korean"; "ks" = "Kashmiri"; "ku" = "Kurdish"; "ky" = "Kirghiz"; "la" = "Latin"; "ln" = "Lingala"; "lo" = "Laothian"; "lt" = "Lithuanian"; "lv" = "Latvian"; "mg" = "Malagasy"; "mi" = "Maori"; "mk" = "Macedonian"; "ml" = "Malayalam"; "mn" = "Mongolian"; "mo" = "Moldavian"; "mr" = "Marathi"; "ms" = "Malay"; "mt" = "Maltese"; "my" = "Burmese"; "na" = "Nauru"; "nb" = "NorwegianBokmal"; "ne" = "Nepali"; "nl" = "Dutch"; "nl-nl" = "Dutch"; "nn" = "NorwegianNynorsk"; "nn-no" = "NorwegianNynorsk"; "no" = "Norwegian"; "no-no" = "Norwegian"; "oc" = "Occitan"; "om" = "Oromo"; "or" = "Oriya"; "pa" = "Punjabi"; "pl" = "Polish"; "ps" = "Pashto"; "pt" = "Portuguese"; "pt-br" = "ptBR"; "pt-pt" = "Portuguese"; "qu" = "Quechua"; "rm" = "RhaetoRomance"; "rn" = "Kirundi"; "ro" = "Romanian"; "ru" = "Russian"; "rw" = "Kinyarwanda"; "sa" = "Sanskrit"; "sd" = "Sindhi"; "sg" = "Sangro"; "sh" = "SerboCroatian"; "si" = "Singhalese"; "sk" = "Slovak"; "sl" = "Slovenian"; "sm" = "Samoan"; "sn" = "Shona"; "so" = "Somali"; "sq" = "Albanian"; "sr" = "Serbian"; "ss" = "Siswati"; "st" = "Sesotho"; "su" = "Sundanese"; "sv" = "Swedish"; "sv-se" = "Swedish"; "sw" = "Swahili"; "ta" = "Tamil"; "te" = "Tegulu"; "tg" = "Tajik"; "th" = "Thai"; "ti" = "Tigrinya"; "tk" = "Turkmen"; "tl" = "Tagalog"; "tn" = "Setswana"; "to" = "Tonga"; "tr" = "Turkish"; "ts" = "Tsonga"; "tt" = "Tatar"; "tw" = "Twi"; "ug" = "Uigur"; "uk" = "Ukrainian"; "ur" = "Urdu"; "uz" = "Uzbek"; "vi" = "Vietnamese"; "vo" = "Volapuk"; "wo" = "Wolof"; "xh" = "Xhosa"; "yi" = "Yiddish"; "yo" = "Yoruba"; "za" = "Zhuang"; "zh" = "Chinese"; "zu" = "Zulu"; } SOPE/sope-appserver/NGObjWeb/woapp-gs.make0000644000000000000000000003150512242733417017277 0ustar rootroot# # woapp.make # # Makefile rules to build GNUstep web based applications. # # Copyright (C) 2002 Free Software Foundation, Inc. # # Author: Nicola Pero # # This file is part of the GNUstep Makefile Package. # # This library 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. # # You should have received a copy of the GNU General Public # License along with this library; see the file COPYING.LIB. # If not, write to the Free Software Foundation, # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ifeq ($(GNUSTEP_INSTANCE),) ifeq ($(RULES_MAKE_LOADED),) include $(GNUSTEP_MAKEFILES)/rules.make endif # Determine the application directory extension WOAPP_EXTENSION=woa WOAPP_NAME := $(strip $(WOAPP_NAME)) internal-all:: $(WOAPP_NAME:=.all.woapp.variables) internal-install:: $(WOAPP_NAME:=.install.woapp.variables) internal-uninstall:: $(WOAPP_NAME:=.uninstall.woapp.variables) internal-clean:: $(WOAPP_NAME:=.clean.woapp.subprojects) rm -rf $(GNUSTEP_OBJ_DIR) ifeq ($(OBJC_COMPILER), NeXT) rm -f *.iconheader for f in *.$(WOAPP_EXTENSION); do \ rm -f $$f/`basename $$f .$(WOAPP_EXTENSION)`; \ done else ifeq ($(GNUSTEP_FLATTENED),) rm -rf *.$(WOAPP_EXTENSION)/$(GNUSTEP_TARGET_LDIR) else rm -rf *.$(WOAPP_EXTENSION) endif endif internal-distclean:: $(WOAPP_NAME:=.distclean.woapp.subprojects) rm -rf shared_obj static_obj shared_debug_obj shared_profile_obj \ static_debug_obj static_profile_obj shared_profile_debug_obj \ static_profile_debug_obj *.woa *.debug *.profile *.iconheader $(WOAPP_NAME): @$(MAKE) -f $(MAKEFILE_NAME) --no-print-directory \ $@.all.woapp.variables else ifeq ($(GNUSTEP_TYPE),woapp) ifeq ($(RULES_MAKE_LOADED),) include $(GNUSTEP_MAKEFILES)/rules.make endif # FIXME/TODO - this file has not been updated to use # Instance/Shared/bundle.make because it is linking resources instead of # copying them. # # The name of the application is in the WOAPP_NAME variable. # The list of languages the app is localized in are in xxx_LANGUAGES <== # The list of application resource file are in xxx_RESOURCE_FILES # The list of localized application resource file are in # xxx_LOCALIZED_RESOURCE_FILES <== # The list of application resource directories are in xxx_RESOURCE_DIRS # The list of application web server resource directories are in # xxx_WEBSERVER_RESOURCE_DIRS <== # The list of localized application web server resource directories are in # xxx_LOCALIZED_WEBSERVER_RESOURCE_DIRS # where xxx is the application name <== COMPONENTS = $($(GNUSTEP_INSTANCE)_COMPONENTS) LANGUAGES = $($(GNUSTEP_INSTANCE)_LANGUAGES) WEBSERVER_RESOURCE_FILES = $($(GNUSTEP_INSTANCE)_WEBSERVER_RESOURCE_FILES) LOCALIZED_WEBSERVER_RESOURCE_FILES = $($(GNUSTEP_INSTANCE)_LOCALIZED_WEBSERVER_RESOURCE_FILES) WEBSERVER_RESOURCE_DIRS = $($(GNUSTEP_INSTANCE)_WEBSERVER_RESOURCE_DIRS) LOCALIZED_RESOURCE_FILES = $($(GNUSTEP_INSTANCE)_LOCALIZED_RESOURCE_FILES) RESOURCE_FILES = $($(GNUSTEP_INSTANCE)_RESOURCE_FILES) RESOURCE_DIRS = $($(GNUSTEP_INSTANCE)_RESOURCE_DIRS) ifeq ($(FOUNDATION_LIB),apple) WORSRCDIRINFIX:=Contents/Resources WORSRCLINKUP:=../../.. else WORSRCDIRINFIX:=Resources WORSRCLINKUP:=../.. endif # Determine the application directory extension WOAPP_EXTENSION = woa GNUSTEP_WOAPPS = $(GNUSTEP_WEB_APPS) .PHONY: internal-woapp-all_ \ internal-woapp-install_ \ internal-woapp-uninstall_ \ woapp-components \ woapp-webresource-dir \ woapp-webresource-files \ woapp-localized-webresource-files \ woapp-resource-dir \ woapp-resource-files \ woapp-localized-resource-files # Libraries that go before the WO libraries ifndef WHICH_LIB_SCRIPT ALL_WO_LIBS = \ $(ALL_LIB_DIRS) \ $(ADDITIONAL_WO_LIBS) $(AUXILIARY_WO_LIBS) $(WO_LIBS) \ $(ADDITIONAL_TOOL_LIBS) $(AUXILIARY_TOOL_LIBS) \ $(FND_LIBS) $(ADDITIONAL_OBJC_LIBS) $(AUXILIARY_OBJC_LIBS) \ $(OBJC_LIBS) $(SYSTEM_LIBS) $(TARGET_SYSTEM_LIBS) else ALL_WO_LIBS = \ $(shell $(WHICH_LIB_SCRIPT) \ $(ALL_LIB_DIRS) \ $(ADDITIONAL_WO_LIBS) $(AUXILIARY_WO_LIBS) $(WO_LIBS) \ $(ADDITIONAL_TOOL_LIBS) $(AUXILIARY_TOOL_LIBS) \ $(FND_LIBS) $(ADDITIONAL_OBJC_LIBS) $(AUXILIARY_OBJC_LIBS) \ $(OBJC_LIBS) $(SYSTEM_LIBS) $(TARGET_SYSTEM_LIBS) \ debug=$(debug) profile=$(profile) shared=$(shared) \ libext=$(LIBEXT) shared_libext=$(SHARED_LIBEXT)) endif # Don't include these definitions the first time make is invoked. This part is # included when make is invoked the second time from the %.build rule (see # rules.make). WOAPP_DIR_NAME = $(GNUSTEP_INSTANCE:=.$(WOAPP_EXTENSION)) WOAPP_RESOURCE_DIRS = $(foreach d, $(RESOURCE_DIRS), $(WOAPP_DIR_NAME)/$(WORSRCDIRINFIX)/$(d)) WOAPP_WEBSERVER_RESOURCE_DIRS = $(foreach d, $(WEBSERVER_RESOURCE_DIRS), $(WOAPP_DIR_NAME)/WebServerResources/$(d)) ifeq ($(strip $(LANGUAGES)),) LANGUAGES="English" endif # Support building NeXT applications ifneq ($(OBJC_COMPILER), NeXT) WOAPP_FILE = \ $(WOAPP_DIR_NAME)/$(GNUSTEP_TARGET_LDIR)/$(GNUSTEP_INSTANCE)$(EXEEXT) else WOAPP_FILE = $(WOAPP_DIR_NAME)/$(GNUSTEP_INSTANCE)$(EXEEXT) endif # # Internal targets # $(WOAPP_FILE): $(OBJ_FILES_TO_LINK) $(LD) $(ALL_LDFLAGS) -o $(LDOUT)$@ $(OBJ_FILES_TO_LINK) \ $(ALL_WO_LIBS) ifeq ($(OBJC_COMPILER), NeXT) @$(TRANSFORM_PATHS_SCRIPT) $(subst -L,,$(ALL_LIB_DIRS)) \ >$(WOAPP_DIR_NAME)/library_paths.openapp # This is a hack for OPENSTEP systems to remove the iconheader file # automatically generated by the makefile package. rm -f $(GNUSTEP_INSTANCE).iconheader else @$(TRANSFORM_PATHS_SCRIPT) $(subst -L,,$(ALL_LIB_DIRS)) \ >$(WOAPP_DIR_NAME)/$(GNUSTEP_TARGET_LDIR)/library_paths.openapp endif # # Compilation targets # ifeq ($(OBJC_COMPILER), NeXT) internal-woapp-all_:: \ $(GNUSTEP_OBJ_DIR) $(WOAPP_DIR_NAME) $(WOAPP_FILE) \ woapp-components \ woapp-localized-webresource-files \ woapp-webresource-files \ woapp-localized-resource-files \ woapp-resource-files \ $(WOAPP_DIR_NAME)/$(GNUSTEP_INSTANCE).sh $(GNUSTEP_INSTANCE).iconheader: @(echo "F $(GNUSTEP_INSTANCE).$(WOAPP_EXTENSION) $(GNUSTEP_INSTANCE) $(WOAPP_EXTENSION)"; \ echo "F $(GNUSTEP_INSTANCE) $(GNUSTEP_INSTANCE) app") >$@ $(WOAPP_DIR_NAME): mkdir $@ else internal-woapp-all_:: \ $(GNUSTEP_OBJ_DIR) \ $(WOAPP_DIR_NAME)/$(GNUSTEP_TARGET_LDIR) $(WOAPP_FILE) \ woapp-components \ woapp-localized-webresource-files \ woapp-webresource-files \ woapp-localized-resource-files \ woapp-resource-files \ $(WOAPP_DIR_NAME)/$(GNUSTEP_INSTANCE).sh $(WOAPP_DIR_NAME)/$(GNUSTEP_TARGET_LDIR): @$(MKDIRS) $(WOAPP_DIR_NAME)/$(GNUSTEP_TARGET_LDIR) endif ifeq ($(GNUSTEP_INSTANCE)_GEN_SCRIPT,yes) #<== $(WOAPP_DIR_NAME)/$(GNUSTEP_INSTANCE).sh: $(WOAPP_DIR_NAME) @(echo "#!/bin/sh"; \ echo '# Automatically generated, do not edit!'; \ echo '$${GNUSTEP_HOST_LDIR}/$(GNUSTEP_INSTANCE) $$1 $$2 $$3 $$4 $$5 $$6 $$7 $$8') >$@ chmod +x $@ else $(WOAPP_DIR_NAME)/$(GNUSTEP_INSTANCE).sh: endif woapp-components:: $(WOAPP_DIR_NAME)/$(WORSRCDIRINFIX) ifneq ($(strip $(COMPONENTS)),) @ echo "Linking components into the application wrapper..."; \ cd $(WOAPP_DIR_NAME)/$(WORSRCDIRINFIX); \ for component in $(COMPONENTS); do \ if [ -d $(WORSRCLINKUP)/$$component ]; then \ $(LN_S) -f $(WORSRCLINKUP)/$$component ./;\ fi; \ done; \ echo "Linking localized components into the application wrapper..."; \ for l in $(LANGUAGES); do \ if [ -d $(WORSRCLINKUP)/$$l.lproj ]; then \ $(MKDIRS) $$l.lproj; \ cd $$l.lproj; \ for f in $(COMPONENTS); do \ if [ -d $(WORSRCLINKUP)/../$$l.lproj/$$f ]; then \ $(LN_S) -f $(WORSRCLINKUP)/../$$l.lproj/$$f .;\ fi;\ done;\ cd ..; \ fi;\ done endif # FIXME - this is behaving differently than in wobundle.make ! # It's also not behaving consistently with xxx_RESOURCE_DIRS woapp-webresource-dir:: $(WOAPP_WEBSERVER_RESOURCE_DIRS) ifneq ($(strip $(WEBSERVER_RESOURCE_DIRS)),) @ echo "Linking webserver Resource Dirs into the application wrapper..."; \ cd $(WOAPP_DIR_NAME)/$(WORSRCDIRINFIX); \ for dir in $(WEBSERVER_RESOURCE_DIRS); do \ if [ -d $(WORSRCLINKUP)/$$dir ]; then \ $(LN_S) -f $(WORSRCLINKUP)/$$dir ./;\ fi; \ done; endif $(WOAPP_WEBSERVER_RESOURCE_DIRS): #@$(MKDIRS) $(WOAPP_WEBSERVER_RESOURCE_DIRS) woapp-webresource-files:: $(WOAPP_DIR_NAME)/WebServerResources \ woapp-webresource-dir ifneq ($(strip $(WEBSERVER_RESOURCE_FILES)),) @echo "Linking webserver resources into the application wrapper..."; \ cd $(WOAPP_DIR_NAME)/WebServerResources; \ for ff in $(WEBSERVER_RESOURCE_FILES); do \ $(LN_S) -f ../../$$ff .;\ done endif woapp-localized-webresource-files:: $(WOAPP_DIR_NAME)/WebServerResources woapp-webresource-dir ifneq ($(strip $(LOCALIZED_WEBSERVER_RESOURCE_FILES)),) @ echo "Linking localized web resources into the application wrapper..."; \ cd $(WOAPP_DIR_NAME)/WebServerResources; \ for l in $(LANGUAGES); do \ if [ -d ../../WebServerResources/$$l.lproj ]; then \ $(MKDIRS) $$l.lproj;\ cd $$l.lproj; \ for f in $(LOCALIZED_WEBSERVER_RESOURCE_FILES); do \ if [ -f ../../../$$l.lproj/$$f ]; then \ if [ ! -r $$f ]; then \ $(LN_S) ../../../$$l.lproj/$$f $$f;\ fi;\ fi;\ done;\ cd ..; \ else\ echo "Warning - WebServerResources/$$l.lproj not found - ignoring";\ fi;\ done endif # This is not consistent with what other projects do ... so it can't stay # this way. Use COMPONENTS instead. woapp-resource-dir:: $(WOAPP_RESOURCE_DIRS) ifneq ($(strip $(RESOURCE_DIRS)),) @ echo "Linking Resource Dirs into the application wrapper..."; \ cd $(WOAPP_DIR_NAME)/$(WORSRCDIRINFIX); \ for dir in $(RESOURCE_DIRS); do \ if [ -d $(WORSRCLINKUP)/$$dir ]; then \ $(LN_S) -f $(WORSRCLINKUP)/$$dir ./;\ fi; \ done; endif $(WOAPP_RESOURCE_DIRS): #@$(MKDIRS) $(WOAPP_RESOURCE_DIRS) woapp-resource-files:: $(WOAPP_DIR_NAME)/$(WORSRCDIRINFIX)/Info-gnustep.plist \ woapp-resource-dir ifneq ($(strip $(RESOURCE_FILES)),) @ echo "Linking resources into the application wrapper..."; \ cd $(WOAPP_DIR_NAME)/$(WORSRCDIRINFIX)/; \ for ff in $(RESOURCE_FILES); do \ $(LN_S) -f $(WORSRCLINKUP)/$$ff .;\ done endif woapp-localized-resource-files:: $(WOAPP_DIR_NAME)/$(WORSRCDIRINFIX) \ woapp-resource-dir ifneq ($(strip $(LOCALIZED_RESOURCE_FILES)),) @ echo "Linking localized resources into the application wrapper..."; \ cd $(WOAPP_DIR_NAME)/$(WORSRCDIRINFIX); \ for l in $(LANGUAGES); do \ if [ -d $(WORSRCLINKUP)/$$l.lproj ]; then \ $(MKDIRS) $$l.lproj; \ cd $$l.lproj; \ for f in $(LOCALIZED_RESOURCE_FILES); do \ if [ -f $(WORSRCLINKUP)/../$$l.lproj/$$f ]; then \ $(LN_S) -f $(WORSRCLINKUP)/../$$l.lproj/$$f .;\ fi;\ done;\ cd ..; \ else \ echo "Warning - $$l.lproj not found - ignoring";\ fi;\ done endif PRINCIPAL_CLASS = $(strip $($(GNUSTEP_INSTANCE)_PRINCIPAL_CLASS)) ifeq ($(PRINCIPAL_CLASS),) PRINCIPAL_CLASS = $(GNUSTEP_INSTANCE) endif HAS_WOCOMPONENTS = $($(GNUSTEP_INSTANCE)_HAS_WOCOMPONENTS) WOAPP_INFO_PLIST = $($(GNUSTEP_INSTANCE)_WOAPP_INFO_PLIST) MAIN_MODEL_FILE = $(strip $(subst .gmodel,,$(subst .gorm,,$(subst .nib,,$($(GNUSTEP_INSTANCE)_MAIN_MODEL_FILE))))) $(WOAPP_DIR_NAME)/$(WORSRCDIRINFIX)/Info-gnustep.plist: $(WOAPP_DIR_NAME)/$(WORSRCDIRINFIX) @(echo "{"; echo ' NOTE = "Automatically generated, do not edit!";'; \ echo " NSExecutable = \"$(GNUSTEP_INSTANCE)\";"; \ echo " NSPrincipalClass = \"$(PRINCIPAL_CLASS)\";"; \ if [ "$(HAS_WOCOMPONENTS)" != "" ]; then \ echo " HasWOComponents = \"$(HAS_WOCOMPONENTS)\";"; \ fi; \ echo " NSMainNibFile = \"$(MAIN_MODEL_FILE)\";"; \ if [ -r "$(GNUSTEP_INSTANCE)Info.plist" ]; then \ cat $(GNUSTEP_INSTANCE)Info.plist; \ fi; \ if [ "$(WOAPP_INFO_PLIST)" != "" ]; then \ cat $(WOAPP_INFO_PLIST); \ fi; \ echo "}") >$@ $(WOAPP_DIR_NAME)/$(WORSRCDIRINFIX): @$(MKDIRS) $@ $(WOAPP_DIR_NAME)/WebServerResources: @$(MKDIRS) $@ internal-woapp-install_:: @($(MKINSTALLDIRS) $(GNUSTEP_WOAPPS); \ if [ -e $(GNUSTEP_WOAPPS)/$(WOAPP_DIR_NAME) ]; then rm -rf $(GNUSTEP_WOAPPS)/$(WOAPP_DIR_NAME); fi; \ # $(TAR) chf - --exclude=CVS --exclude=.svn --to-stdout $(WOAPP_DIR_NAME) | (cd $(GNUSTEP_WOAPPS); $(TAR) xf -)) cp -LR $(WOAPP_DIR_NAME) $(GNUSTEP_WOAPPS) ifneq ($(CHOWN_TO),) $(CHOWN) -R $(CHOWN_TO) $(GNUSTEP_WOAPPS)/$(WOAPP_DIR_NAME) endif ifeq ($(strip),yes) $(STRIP) $(GNUSTEP_WOAPPS)/$(WOAPP_FILE) endif internal-woapp-uninstall_:: (cd $(GNUSTEP_WOAPPS); rm -rf $(WOAPP_DIR_NAME)) endif endif ## Local variables: ## mode: makefile ## End: SOPE/sope-appserver/NGObjWeb/WOComponentDefinition.m0000644000000000000000000003707212242733417021307 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include "WOComponent+private.h" #include "WOComponentFault.h" #include "WONoContentElement.h" #include #include #include #include #include #include "common.h" #import #ifdef MULLE_EO_CONTROL #import #endif #include static Class StrClass = Nil; static Class DictClass = Nil; static Class AssocClass = Nil; static Class NumberClass = Nil; static Class DateClass = Nil; static NSNumber *yesNum = nil; static NSNumber *noNum = nil; @interface WOComponent(UsedPrivates) - (void)setBaseURL:(id)_url; @end @interface WOComponentDefinition(PrivateMethods) - (BOOL)load; @end #include #include #include /* TODO: WO's instantiation method is - componentInstanceInContext:forComponentReference: with the primary being - _componentInstanceInContext:forComponentReference: Maybe we should change to that. Currently this flow is a bit broken because the resourcemanager sits in the middle, though I'm pretty sure that some older WO used WOResourceManager just like we do in the moment. */ @implementation WOComponent(InfoSetup) - (Class)componentFaultClass { return [WOComponentFault class]; } - (NSMutableDictionary *)instantiateChildComponentsInTemplate:(WOTemplate *)_t languages:(NSArray *)_languages { NSMutableDictionary *childComponents = nil; WOTemplate *tmpl; NSEnumerator *keys; NSString *key; if ((tmpl = _t) == nil) return nil; if ([tmpl hasSubcomponentInfos] == 0) return nil; keys = [tmpl infoKeyEnumerator]; while ((key = [keys nextObject])) { WOSubcomponentInfo *childInfo = nil; WOComponentFault *child = nil; childInfo = [tmpl subcomponentInfoForKey:key]; child = [[WOComponentFault alloc] initWithResourceManager:nil //_rm pageName:[childInfo componentName] languages:_languages bindings:[childInfo bindings]]; if (child != nil) { if (childComponents == nil) childComponents = [NSMutableDictionary dictionaryWithCapacity:16]; [childComponents setObject:child forKey:key]; [child release]; } else { [self errorWithFormat: @"(%s): Could not instantiate child fault %@, component: '%@'", __PRETTY_FUNCTION__, key, [childInfo componentName]]; } } return childComponents; } - (id)initWithName:(NSString *)_cname template:(WOTemplate *)_template inContext:(WOContext *)_ctx { // Note: the _template can be nil and will then get looked up dynamically! [self setName:_cname]; if ((self = [self initWithContext:_ctx])) { NSMutableDictionary *childComponents; NSArray *langs; langs = [[self context] resourceLookupLanguages]; childComponents = [self instantiateChildComponentsInTemplate:_template languages:langs]; [self setSubComponents:childComponents]; [self setTemplate:_template]; } return self; } - (id)initWithComponentDefinition:(WOComponentDefinition *)_cdef inContext:(WOContext *)_ctx { /* HACK HACK HACK CD: We reuse the wocVariables ivar to pass over the component definition to the component which will then call -_finishInitializingComponent: on the definition for applying the .woo. Sideeffects: if a component subclass uses extra vars prior calling WOComponent -init, it will run into "issues". */ NSAssert(self->wocVariables == nil, @"extra variables dict is already set! cannot transfer component " @"definition in that variable (use the HACK)"); self->wocVariables = (id)[_cdef retain]; return [self initWithName:[_cdef componentName] template:[_cdef template] inContext:_ctx]; } @end /* WOComponent(InfoSetup) */ @implementation WOComponentDefinition static BOOL debugOn = NO; static BOOL profLoading = NO; static BOOL enableClassLessComponents = NO; static BOOL enableWOOFiles = NO; static NSArray *woxExtensions = nil; + (void)initialize { static BOOL isInitialized = NO; NSUserDefaults *ud; if (isInitialized) return; isInitialized = YES; ud = [NSUserDefaults standardUserDefaults]; StrClass = [NSString class]; DictClass = [NSMutableDictionary class]; AssocClass = [WOAssociation class]; NumberClass = [NSNumber class]; DateClass = [NSDate class]; yesNum = [[NumberClass numberWithBool:YES] retain]; noNum = [[NumberClass numberWithBool:NO] retain]; profLoading = [[ud objectForKey:@"WOProfileLoading"] boolValue]; enableClassLessComponents = [ud boolForKey:@"WOEnableComponentsWithoutClasses"]; enableWOOFiles = [ud boolForKey:@"WOComponentLoadWOOFiles"]; debugOn = [ud boolForKey:@"WODebugComponentDefinition"]; woxExtensions = [[ud arrayForKey:@"WOxFileExtensions"] copy]; } - (id)initWithName:(NSString *)_name path:(NSString *)_path baseURL:(NSURL *)_baseUrl frameworkName:(NSString *)_frameworkName { /* this method is usually called by WOResourceManager (_definitionWithName:...) */ if ((self = [super init])) { /* 'name' is the name of the component 'path' contains a string or a NSURL with the location of the directory containing the component - TODO: explain who calculates that! 'baseURL' contains a URL like /AppName/FrameworkName/Component/Eng.lProj (the external URL of the component, not sure whether this is actually used somewhere) */ NSZone *z = [self zone]; self->name = [_name copyWithZone:z]; self->path = [_path copyWithZone:z]; self->baseUrl = [_baseUrl copyWithZone:z]; self->frameworkName = [_frameworkName copyWithZone:z]; if (debugOn) { [self debugWithFormat: @"init: '%@' path='%@'\n URL='%@'\n framework='%@'", self->name, self->path, [self->baseUrl absoluteString], self->frameworkName]; } if (![self load]) { /* TODO: is this really required? */ [self release]; return nil; } } return self; } - (id)init { [self errorWithFormat:@"called -init on WOComponentDefinition!"]; [self release]; return nil; } - (void)dealloc { [self->template release]; [self->name release]; [self->path release]; [self->baseUrl release]; [self->frameworkName release]; [super dealloc]; } /* accessors */ - (Class)componentClassForScript:(WOComponentScript *)_script { return Nil; } - (void)setComponentClass:(Class)_class { self->componentClass = _class; } - (Class)componentClass { if (self->componentClass == Nil) self->componentClass = NSClassFromString(self->name); if (self->componentClass != Nil) return self->componentClass; if (self->name == nil) return Nil; if ([self->name isAbsolutePath]) ; else if ([self->name rangeOfString:@"."].length > 0) ; else if (enableClassLessComponents) ; else { [self logWithFormat:@"Note: did not find component class with name '%@'", self->name]; } return Nil; } - (NSString *)componentName { return self->name; } - (WOTemplate *)template { return self->template; } - (NSString *)path { return self->path; } - (NSURL *)baseURL { return self->baseUrl; } - (NSString *)frameworkName { return self->frameworkName; } /* caching */ - (void)touch { self->lastTouch = [DateClass timeIntervalSinceReferenceDate]; } - (NSTimeInterval)lastTouch { return self->lastTouch; } /* instantiation */ - (BOOL)_checkComponentClassValidity:(Class)cClass { #if 0 /* this make no sense, need -isSubclassOfClass: .., class instances are never isKindOfClass:WOElement ... */ { static Class WOElementClass = Nil; if (WOElementClass == Nil) WOElementClass = [WOElement class]; if (![cClass isKindOfClass:WOElementClass] && cClass != nil) { [self warnWithFormat:@"(%s:%i): " @"component class %@ is not a subclass of WOElement !", __PRETTY_FUNCTION__, __LINE__, NSStringFromClass(cClass)]; return NO; } } #endif return YES; } - (BOOL)_checkComponentValidity:(id)component class:(Class)cClass { if (![component isKindOfClass:cClass] && component != nil) { [self warnWithFormat:@"(%s:%i): component %@ is not a subclass of " @"component class %@ !", __PRETTY_FUNCTION__, __LINE__, component, NSStringFromClass(cClass)]; return NO; } return YES; } - (void)_applyWOOVariables:(NSDictionary *)_vars onComponent:(WOComponent *)_component { EOKeyValueUnarchiver *unarchiver; NSAutoreleasePool *pool; NSEnumerator *keys; NSString *key; pool = [[NSAutoreleasePool alloc] init]; unarchiver = [[[EOKeyValueUnarchiver alloc] initWithDictionary:_vars] autorelease]; [unarchiver setDelegate:_component]; keys = [_vars keyEnumerator]; while ((key = [keys nextObject]) != nil) { id object; object = [unarchiver decodeObjectForKey:key]; [_component takeValue:object forKey:key]; #if DEBUG_WOO [self logWithFormat:@"unarchived %@: %@", key, object]; #endif } [unarchiver finishInitializationOfObjects]; [unarchiver awakeObjects]; [pool release]; } - (void)_applyWOOVariablesOnComponent:(WOComponent *)_component { /* Note: we still need this, as components are not required to load the template at all! */ NSString *wooPath; NSDictionary *woo; wooPath = [[_component path] stringByAppendingPathExtension:@"woo"]; if (![[NSFileManager defaultManager] fileExistsAtPath:wooPath]) return; if ((woo = [NSDictionary dictionaryWithContentsOfFile:wooPath]) == nil) { [self errorWithFormat:@"could not load .woo-file: '%@'", wooPath]; return; } [self _applyWOOVariables:[woo objectForKey:@"variables"] onComponent:_component]; } - (void)_finishInitializingComponent:(WOComponent *)_component { if (self->baseUrl != nil) [_component setBaseURL:self->baseUrl]; if (enableWOOFiles) { if (self->template != nil) { [self _applyWOOVariables: [self->template keyValueArchivedTemplateVariables] onComponent:_component]; } else [self _applyWOOVariablesOnComponent:_component]; } } - (WOComponent *)instantiateWithResourceManager:(WOResourceManager *)_rm languages:(NSArray *)_languages { WOComponent *component = nil; Class cClass; WOComponentScript *script; cClass = ((script = [self->template componentScript]) != nil) ? NSClassFromString(@"WOScriptedComponent") : [self componentClass]; if (cClass == nil) { NSString *tmpPath; if (enableClassLessComponents) { [self debugWithFormat:@"Note: missing class for component: '%@'", [self componentName]]; } else { [self logWithFormat:@"Note: missing class for component: '%@'", [self componentName]]; } tmpPath = [self->name stringByAppendingPathExtension:@"html"]; tmpPath = [self->path stringByAppendingPathComponent:tmpPath]; if ([[NSFileManager defaultManager] fileExistsAtPath:tmpPath]) { cClass = [WOComponent class]; } else { [self debugWithFormat:@"Note: did not find .html template at path: '%@'", tmpPath]; } } if (![self _checkComponentClassValidity:cClass]) { [self logWithFormat:@"Component Class '%@' is not valid.", cClass]; return nil; } /* instantiate object (this will call _finishInitializingComponent) */ component = [[cClass alloc] initWithComponentDefinition:self inContext:[[WOApplication application] context]]; component = [component autorelease]; if (component == nil) return nil; /* check validity */ if (debugOn) [self _checkComponentValidity:component class:cClass]; if (debugOn) { if (![component isKindOfClass:cClass]) { [self warnWithFormat: @"(%s:%i): component '%@' is not a subclass of " @"component class '%@' !", __PRETTY_FUNCTION__, __LINE__, component, NSStringFromClass(cClass)]; } } return component; } /* templates */ - (WOTemplateBuilder *)templateBuilderForPath:(NSString *)_path { NSString *ext; if ([_path length] == 0) return nil; ext = [_path pathExtension]; if ([woxExtensions containsObject:ext]) { static WOTemplateBuilder *woxBuilder = nil; if (woxBuilder == nil) woxBuilder = [[NSClassFromString(@"WOxTemplateBuilder") alloc] init]; return woxBuilder; } { static WOTemplateBuilder *woBuilder = nil; if (woBuilder == nil) { woBuilder = [[NSClassFromString(@"WOWrapperTemplateBuilder") alloc] init]; } return woBuilder; } } - (WOTemplateBuilder *)templateBuilderForURL:(NSURL *)_url { if ([_url isFileURL]) return [self templateBuilderForPath:[_url path]]; [self logWithFormat:@"only supports file URLs: %@", _url]; return nil; } - (BOOL)load { WOTemplateBuilder *builder; NSURL *url; if (self->path == nil) /* a pathless component (a component without a template file) */ return YES; /* Note: the URL can either point directly to the .wo or .wox file entry or it can point to a .lproj inside a .wo (eg Main.wo/English.lproj) Note: actually the WOTemplateBuilder only supports file URLs in the moment, it just checks the path extension to select the proper builder. */ url = [self->path isKindOfClass:[NSURL class]] ? (id)self->path : [[[NSURL alloc] initFileURLWithPath:self->path] autorelease]; if (debugOn) [self debugWithFormat:@"url: %@", [url absoluteString]]; // TODO: maybe we should move the builder selection to the resource-manager builder = [self templateBuilderForURL:url]; if (debugOn) [self debugWithFormat:@"builder: %@", builder]; self->template = [builder buildTemplateAtURL:url]; if (debugOn) [self debugWithFormat:@"template: %@", self->template]; return self->template ? YES : NO; } /* debugging */ - (BOOL)isDebuggingEnabled { return debugOn; } /* description */ - (NSString *)description { NSMutableString *ms = [NSMutableString stringWithCapacity:64]; [ms appendFormat:@"<0x%p[%@]:", self, NSStringFromClass([self class])]; if (self->name) [ms appendFormat:@" name=%@", self->name]; if (self->path) [ms appendFormat:@" path=%@", self->path]; if (self->baseUrl) [ms appendFormat:@" base=%@", self->baseUrl]; if (self->frameworkName) [ms appendFormat:@" framework=%@", self->frameworkName]; if (!self->template) [ms appendString:@" no-template"]; [ms appendString:@">"]; return ms; } @end /* WOComponentDefinition */ SOPE/sope-appserver/NGObjWeb/NGObjWeb/0000755000000000000000000000000012242733417016274 5ustar rootrootSOPE/sope-appserver/NGObjWeb/NGObjWeb/WOProxyRequestHandler.h0000644000000000000000000000343212242733417022705 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGObjWeb_WOProxyRequestHandler_H__ #define __NGObjWeb_WOProxyRequestHandler_H__ #import @class WOHTTPConnection; /* This request-handler can be used to forward and debug HTTP requests. It can log requests/responses to stdout and it can perform some request manipulations: rewriteHost => change the host: header to match the destination connectionClose => replace the connection handler with connection: close */ @interface WOProxyRequestHandler : WORequestHandler { WOHTTPConnection *client; BOOL rawLogRequest; BOOL rawLogResponse; BOOL rewriteHost; BOOL connectionClose; NSString *logFilePrefix; int rqcount; } - (id)initWithHost:(NSString *)_hostName onPort:(unsigned int)_port; /* settings */ - (void)enableRawLogging; - (void)setLogFilePrefix:(NSString *)_p; /* fixups */ - (WORequest *)fixupRequest:(WORequest *)_request; - (WOResponse *)fixupResponse:(WOResponse *)_r; @end #endif /* __NGObjWeb_WOProxyRequestHandler_H__ */ SOPE/sope-appserver/NGObjWeb/NGObjWeb/WORequestHandler.h0000644000000000000000000000230212242733417021636 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGObjWeb_WORequestHandler_H__ #define __NGObjWeb_WORequestHandler_H__ #import #import @class NSRecursiveLock; @class WOSession, WORequest, WOResponse, WOContext, WOApplication; @interface WORequestHandler : NSObject < NSLocking > { @protected NSRecursiveLock *lock; } - (WOResponse *)handleRequest:(WORequest *)_request; @end #endif /* __NGObjWeb_WORequestHandler_H__ */ SOPE/sope-appserver/NGObjWeb/NGObjWeb/WOHTMLDynamicElement.h0000644000000000000000000000253012242733417022276 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGObjWeb_WOHTMLDynamicElement_H__ #define __NGObjWeb_WOHTMLDynamicElement_H__ #include @class NSDictionary; @class WOAssociation, WOContext; @interface WOHTMLDynamicElement : WODynamicElement { // WODynamicElement: extraAttributes // WODynamicElement: otherTagString } @end @interface WOHTMLDynamicElement(ActiveElement) - (id)executeAction:(WOAssociation *)_action inContext:(WOContext *)_ctx; @end /* private functions */ NSDictionary *OWExtractQueryParameters(NSDictionary *_set); #endif /* __NGObjWeb_WOHTMLDynamicElement_H__ */ SOPE/sope-appserver/NGObjWeb/NGObjWeb/WOStatisticsStore.h0000644000000000000000000000401312242733417022060 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGObjWeb_WOStatisticsStore_H__ #define __NGObjWeb_WOStatisticsStore_H__ #import #import #import @class NSString, NSDictionary, NSMutableDictionary; @class WOResponse, WOContext; @interface WOStatisticsStore : NSObject < NSLocking > { id lock; NSDate *startTime; NSMutableDictionary *pageStatistics; unsigned totalResponseCount; unsigned pageResponseCount; unsigned totalResponseSize; unsigned zippedResponsesCount; unsigned totalZippedSize; int smallestResponseSize; unsigned largestResponseSize; NSTimeInterval minimumDuration; NSTimeInterval maximumDuration; NSTimeInterval totalDuration; } /* query */ - (NSDictionary *)statistics; /* recording */ - (void)recordStatisticsForResponse:(WOResponse *)_response inContext:(WOContext *)_context; - (NSString *)descriptionForResponse:(WOResponse *)_response inContext:(WOContext *)_context; /* formatting */ - (NSString *)formatDescription:(NSString *)_description forResponse:(WOResponse *)_response inContext:(WOContext *)_context; /* NSLocking */ - (void)lock; - (void)unlock; @end #endif /* __NGObjWeb_WOStatisticsStore_H__ */ SOPE/sope-appserver/NGObjWeb/NGObjWeb/WOElementTrackingContext.h0000644000000000000000000000254612242733417023343 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGObjWeb_WOElementTrackingContext_H__ #define __NGObjWeb_WOElementTrackingContext_H__ #import @class NSString; @protocol WOElementTrackingContext - (NSString *)elementID; - (void)appendElementIDComponent:(NSString *)_eid; - (void)appendZeroElementIDComponent; - (void)deleteAllElementIDComponents; - (void)deleteLastElementIDComponent; - (void)incrementLastElementIDComponent; - (void)appendIntElementIDComponent:(int)_eid; /* advanced element IDs */ - (id)currentElementID; - (id)consumeElementID; @end #endif /* __NGObjWeb_WOElementTrackingContext_H__ */ SOPE/sope-appserver/NGObjWeb/NGObjWeb/WOActionResults.h0000644000000000000000000000200312242733417021505 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGObjWeb_WOActionResults_H__ #define __NGObjWeb_WOActionResults_H__ #import @class WOResponse; @protocol WOActionResults - (WOResponse *)generateResponse; @end #endif /* __NGObjWeb_WOActionResults_H__ */ SOPE/sope-appserver/NGObjWeb/NGObjWeb/OWResourceManager.h0000644000000000000000000000676312242733417022011 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGObjWeb_OWResourceManager_H__ #define __NGObjWeb_OWResourceManager_H__ // ATTENTION: this class is for OGo legacy, so that WO compatibility changes // to WOResourceManager do not break OGo. // So: do not use that class, its DEPRECATED! #import #import #import #import @class NSString, NSArray, NSData; @class WORequest, WOComponent, WOElement, WOSession; @interface OWResourceManager : NSObject < NSLocking > { @protected NSString *base; @private NSString *w3resources; NSString *resources; NSMapTable *componentDefinitions; // name.language => definition NSMapTable *stringTables; // path => tableinfo NSMapTable *existingPathes; NSMapTable *keyedResources; } - (BOOL)shouldLookupResourceInWebServerResources:(NSString *)_name; - (NSString *)pathForResourceNamed:(NSString *)_name inFramework:(NSString *)_frameworkName languages:(NSArray *)_languages; - (NSString *)urlForResourceNamed:(NSString *)_name inFramework:(NSString *)_frameworkName languages:(NSArray *)_languages request:(WORequest *)_request; /* string tables */ - (NSString *)stringForKey:(NSString *)_key inTableNamed:(NSString *)_tableName withDefaultValue:(NSString *)_default languages:(NSArray *)_languages; - (NSString *)stringForKey:(NSString *)_key inTableNamed:(NSString *)_tableName withDefaultValue:(NSString *)_defaultValue inFramework:(NSString *)_framework languages:(NSArray *)_languages; @end @interface OWResourceManager(KeyedData) /* keyed storage */ - (void)setData:(NSData *)_data forKey:(NSString *)_key mimeType:(NSString *)_type session:(WOSession *)_session; - (void)removeDataForKey:(NSString *)_key session:(WOSession *)_session; - (void)flushDataCache; @end @interface OWResourceManager(PrivateMethods) - (id)initWithPath:(NSString *)_path; + (void)setResourcePrefix:(NSString *)_prefix; - (WOElement *)templateWithName:(NSString *)_name languages:(NSArray *)_langs; - (id)pageWithName:(NSString *)_name languages:(NSArray *)_langs; - (NSString *)pathToComponentNamed:(NSString *)_name inFramework:(NSString *)_framework languages:(NSArray *)_langs; - (NSString *)pathToComponentNamed:(NSString *)_name inFramework:(NSString *)_framework; - (void)setCachingEnabled:(BOOL)_flag; - (BOOL)isCachingEnabled; @end @interface OWResourceManager(DeprecatedMethods) - (NSString *)pathForResourceNamed:(NSString *)_name; - (NSString *)pathForResourceNamed:(NSString *)_name ofType:(NSString *)_type; - (NSString *)urlForResourceNamed:(NSString *)_name; - (NSString *)urlForResourceNamed:(NSString *)_name ofType:(NSString *)_type; @end #endif /* __NGObjWeb_OWResourceManager_H__ */ SOPE/sope-appserver/NGObjWeb/NGObjWeb/NSString+JavaScriptEscaping.h0000644000000000000000000000234512242733417023674 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGObjWeb_NSString_JavaScriptEscaping_H__ #define __NGObjWeb_NSString_JavaScriptEscaping_H__ #import /* Escape a string according to JavaScript escaping rules. For more information about JS escaping: http://www.web-developer-india.com/web/jscript/ch02_05.html */ @interface NSString(JavaScriptEscaping) - (NSString *)stringByApplyingJavaScriptEscaping; @end #endif /* __NGObjWeb_NSString_JavaScriptEscaping_H__ */ SOPE/sope-appserver/NGObjWeb/NGObjWeb/WODynamicElement.h0000644000000000000000000000353112242733417021613 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGObjWeb_WODynamicElement_H__ #define __NGObjWeb_WODynamicElement_H__ #include @class NSArray, NSDictionary; @class WOElement, WOAssociation; struct _WOExtraAttrStruct; @interface WODynamicElement : WOElement { @private /* attribute mappings which aren't parsed */ struct _WOExtraAttrStruct *extraAttributes; @protected WOAssociation *otherTagString; /* new in WO4 */ BOOL containsForm; @private BOOL debug; /* new in WO4 */ } - (id)initWithName:(NSString *)_name associations:(NSDictionary *)_associations template:(WOElement *)_childElement; /* this method was discovered in the SSL example and might be private ! */ - (id)initWithName:(NSString *)_name associations:(NSDictionary *)_associations contentElements:(NSArray *)_children; @end @interface WODynamicElement(PrivateMethods) - (void)setExtraAttributes:(NSDictionary *)_extras; - (void)appendExtraAttributesToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx; - (id)template; @end #endif /* __NGObjWeb_WODynamicElement_H__ */ SOPE/sope-appserver/NGObjWeb/NGObjWeb/WOResourceManager.h0000644000000000000000000000644412242733417022005 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGObjWeb_WOResourceManager_H__ #define __NGObjWeb_WOResourceManager_H__ #import #import #import #import @class NSString, NSArray, NSData; @class WORequest, WOComponent, WOElement, WOSession; @interface WOResourceManager : NSObject < NSLocking > { @protected NSString *base; @private NSString *w3resources; NSString *resources; NSMapTable *componentDefinitions; // name.language => definition NSMapTable *stringTables; // path => tableinfo NSMapTable *existingPathes; NSMapTable *keyedResources; } - (NSString *)pathForResourceNamed:(NSString *)_name inFramework:(NSString *)_frameworkName languages:(NSArray *)_languages; - (NSString *)urlForResourceNamed:(NSString *)_name inFramework:(NSString *)_frameworkName languages:(NSArray *)_languages request:(WORequest *)_request; /* string tables */ - (NSString *)stringForKey:(NSString *)_key inTableNamed:(NSString *)_tableName withDefaultValue:(NSString *)_default languages:(NSArray *)_languages; - (NSString *)stringForKey:(NSString *)_key inTableNamed:(NSString *)_tableName withDefaultValue:(NSString *)_defaultValue inFramework:(NSString *)_framework languages:(NSArray *)_languages; @end @interface WOResourceManager(KeyedData) /* keyed storage */ - (void)setData:(NSData *)_data forKey:(NSString *)_key mimeType:(NSString *)_type session:(WOSession *)_session; - (void)removeDataForKey:(NSString *)_key session:(WOSession *)_session; - (void)flushDataCache; @end @interface WOResourceManager(PrivateMethods) - (id)initWithPath:(NSString *)_path; + (void)setResourcePrefix:(NSString *)_prefix; - (WOElement *)templateWithName:(NSString *)_name languages:(NSArray *)_langs; - (id)pageWithName:(NSString *)_name languages:(NSArray *)_langs; - (NSString *)pathToComponentNamed:(NSString *)_name inFramework:(NSString *)_framework languages:(NSArray *)_langs; - (void)setCachingEnabled:(BOOL)_flag; - (BOOL)isCachingEnabled; /* string tables */ - (id)stringTableWithName:(NSString *)_tableName inFramework:(NSString *)_framework languages:(NSArray *)_languages; @end @interface WOResourceManager(DeprecatedMethods) - (NSString *)pathForResourceNamed:(NSString *)_name; - (NSString *)pathForResourceNamed:(NSString *)_name ofType:(NSString *)_type; - (NSString *)urlForResourceNamed:(NSString *)_name; - (NSString *)urlForResourceNamed:(NSString *)_name ofType:(NSString *)_type; @end #endif /* __NGObjWeb_WOResourceManager_H__ */ SOPE/sope-appserver/NGObjWeb/NGObjWeb/WOxElemBuilder.h0000644000000000000000000001367112242733417021304 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __WOxElemBuilder_H__ #define __WOxElemBuilder_H__ #import #include @class NSString, NSArray, NSMutableDictionary, NSMutableArray; @class WOElement, WOAssociation, WOComponent, WOResourceManager; @class WOComponentScript, WOComponentScriptPart; /* Abstract class to build NGObjWeb WOElement templates from XML DOM structures. Template builders can be stacked in a processing queue, so that unknown elements are produced by the "nextBuilder". When processing is done using a stack, the first stack builder is called the "templateBuilder" and used to keep global state (eg the template builder must be used to create further elements if the same element set is required). WOxElemBuilder stacks are not thread-safe since the template builder stores subcomponent creation info in an instance variable. */ @interface WOxElemBuilder : NSObject { @protected WOxElemBuilder *nextBuilder; NSMutableArray *subcomponentInfos; NSMutableDictionary *nsToAssoc; NSMutableArray *scriptParts; WOComponentScript *script; } + (WOxElemBuilder *)createBuilderQueue:(NSArray *)_classNames; + (WOxElemBuilder *)createBuilderQueueV:(NSString *)_className, ...; /* building a template from a DOM structure */ - (WOElement *)buildTemplateFromDocument:(id)_document; /* node-type build dispatcher method ... */ - (WOElement *)buildNode:(id)_node templateBuilder:(id)_bld; - (NSArray *)buildNodes:(id)_node templateBuilder:(id)_bld; /* building parts of a DOM ... */ - (WOElement *)buildDocument:(id)_node templateBuilder:(id)_bld; - (WOElement *)buildElement:(id)_node templateBuilder:(id)_bld; - (WOElement *)buildCharacterData:(id)_node templateBuilder:(id)_builder; - (WOElement *)buildText:(id)_node templateBuilder:(id)_builder; - (WOElement *)buildCDATASection:(id)_node templateBuilder:(id)_builder; - (WOElement *)buildComment:(id)_node templateBuilder:(id)_builder; /* association callbacks */ - (WOAssociation *)associationForValue:(id)_value; - (WOAssociation *)associationForKeyPath:(NSString *)_path; - (WOAssociation *)associationForJavaScript:(NSString *)_js; // this one uses the attribute namespace to determine the association class - (WOAssociation *)associationForAttribute:(id)_attribute; // map the attribute names to dict keys and use the method above for the value // "_name" attributes are mapped to "?name" query keys - (NSMutableDictionary *)associationsForAttributes:(id)_attrs; - (void)registerAssociationClass:(Class)_class forNamespaceURI:(NSString *)_ns; - (Class)associationClassForNamespaceURI:(NSString *)_ns; /* creating unique IDs */ - (NSString *)uniqueIDForNode:(id)_node; /* logging */ #if 0 - (void)logWithFormat:(NSString *)_format, ...; - (void)debugWithFormat:(NSString *)_format, ...; #endif /* managing builder queues */ - (void)setNextBuilder:(WOxElemBuilder *)_builder; - (WOxElemBuilder *)nextBuilder; /* component script parts */ - (WOComponentScript *)componentScript; - (void)addComponentScriptPart:(WOComponentScriptPart *)_part; - (void)addComponentScript:(NSString *)_script line:(unsigned)_line; /* subcomponent registry, created during parsing ... */ - (void)registerSubComponentWithId:(NSString *)_cid componentName:(NSString *)_name bindings:(NSMutableDictionary *)_bindings; - (NSArray *)subcomponentInfos; - (void)reset; /* support methods for subclasses */ - (id)lookupUniqueTag:(NSString *)_name inElement:(id)_elem; - (WOElement *)elementForRawString:(NSString *)_rawstr; - (WOElement *)elementForElementsAndStrings:(NSArray *)_elements; - (WOElement *)wrapElement:(WOElement *)_element inCondition:(WOAssociation *)_condition negate:(BOOL)_flag; - (WOElement *)wrapElements:(NSArray *)_sub inElementOfClass:(Class)_class; - (WOElement *)wrapChildrenOfElement:(id)_tag inElementOfClass:(Class)_class templateBuilder:(id)_b; @end @interface WOxElemBuilderComponentInfo : NSObject { NSString *cid; NSString *pageName; NSMutableDictionary *bindings; } - (id)initWithComponentId:(NSString *)_cid componentName:(NSString *)_name bindings:(NSMutableDictionary *)_bindings; /* accessors */ - (NSString *)componentId; - (NSString *)pageName; - (NSMutableDictionary *)bindings; /* create the component ... */ - (id)instantiateWithResourceManager:(WOResourceManager *)_rm languages:(NSArray *)_languages; @end /* Specialized superclass for builders which directly map DOM elements to NGObjWeb dynamic elements (which is usually the case ...). The classes returned must conform to the WOxTagClassInit protocol and can use the _builder argument to continue building for child nodes of the given DOM element. */ @interface NSObject(WOxTagClassInit) - (id)initWithElement:(id)_element templateBuilder:(WOxElemBuilder *)_builder; @end @interface WOxTagClassElemBuilder : WOxElemBuilder - (WOElement *)buildNextElement:(id)_elem templateBuilder:(id)_b; - (Class)classForElement:(id)_element; @end #endif /* WOxElemBuilder */ SOPE/sope-appserver/NGObjWeb/NGObjWeb/WOActionURL.h0000644000000000000000000000300712242733417020513 0ustar rootroot/* Copyright (C) 2007 OpenGroupware.org. This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGObjWeb_WOActionURL_H__ #define __NGObjWeb_WOActionURL_H__ #include @class WOAssociation; @class WOElement; @class NSDictionary; /* WOActionURL associations: pageName | action | (directActionName & actionClass) fragmentIdentifier queryDictionary */ @interface WOActionURL : WOHTMLDynamicElement { // WODynamicElement: extraAttributes // WODynamicElement: otherTagString @protected WOAssociation *fragmentIdentifier; WOElement *template; /* new in WO4: */ WOAssociation *queryDictionary; NSDictionary *queryParameters; /* associations beginning with ? */ } + (BOOL)containsLinkInAssociations:(NSDictionary *)_assocs; @end /* WOActionURL */ #endif /* __NGObjWeb_WOActionURL_H__ */ SOPE/sope-appserver/NGObjWeb/NGObjWeb/WOAssociation.h0000644000000000000000000000630212242733417021170 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGObjWeb_WOAssociation_H__ #define __NGObjWeb_WOAssociation_H__ #import @class WOComponent, WOContext; @interface WOAssociation : NSObject /* abstract/cluster */ { } + (WOAssociation *)associationWithKeyPath:(NSString *)_keyPath; + (WOAssociation *)associationWithValue:(id)_value; /* value */ - (void)setValue:(id)_value inContext:(WOContext *)_ctx; - (id)valueInContext:(WOContext *)_ctx; - (void)setValue:(id)_value inComponent:(WOComponent *)_component; - (id)valueInComponent:(WOComponent *)_component; - (BOOL)isValueConstant; - (BOOL)isValueSettable; /* deprecated methods */ - (void)setValue:(id)_value; // deprecated in WO4 - (id)value; // deprecated in WO4 @end @interface WOAssociation(SpecialsValues) - (void)setUnsignedCharValue:(unsigned char)_v inComponent:(WOComponent *)_c; - (void)setCharValue:(signed char)_value inComponent:(WOComponent *)_component; - (void)setUnsignedIntValue:(unsigned int)_v inComponent:(WOComponent *)_comp; - (void)setIntValue:(signed int)_value inComponent:(WOComponent *)_component; - (void)setBoolValue:(BOOL)_value inComponent:(WOComponent *)_component; - (unsigned char)unsignedCharValueInComponent:(WOComponent *)_component; - (signed char)charValueInComponent:(WOComponent *)_component; - (unsigned int)unsignedIntValueInComponent:(WOComponent *)_component; - (signed int)intValueInComponent:(WOComponent *)_component; - (BOOL)boolValueInComponent:(WOComponent *)_component; - (void)setStringValue:(NSString *)_v inComponent:(WOComponent *)_component; - (NSString *)stringValueInComponent:(WOComponent *)_component; /* special context values */ - (void)setUnsignedCharValue:(unsigned char)_v inContext:(WOContext *)_c; - (void)setCharValue:(signed char)_value inContext:(WOContext *)_ctx; - (void)setUnsignedIntValue:(unsigned int)_v inContext:(WOContext *)_c; - (void)setIntValue:(signed int)_value inContext:(WOContext *)_ctx; - (void)setBoolValue:(BOOL)_value inContext:(WOContext *)_ctx; - (unsigned char)unsignedCharValueInContext:(WOContext *)_ctx; - (signed char)charValueInContext:(WOContext *)_ctx; - (unsigned int)unsignedIntValueInContext:(WOContext *)_ctx; - (signed int)intValueInContext:(WOContext *)_ctx; - (BOOL)boolValueInContext:(WOContext *)_ctx; - (void)setStringValue:(NSString *)_v inContext:(WOContext *)_ctx; - (NSString *)stringValueInContext:(WOContext *)_ctx; @end #endif /* __NGObjWeb_WOAssociation_H__ */ SOPE/sope-appserver/NGObjWeb/NGObjWeb/WOTemplateBuilder.h0000644000000000000000000000242412242733417021777 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGObjWeb_WOTemplateBuilder_H__ #define __NGObjWeb_WOTemplateBuilder_H__ #import #include @class NSURL, NSDate, NSString, NSDictionary, NSMutableDictionary; @class NSEnumerator; @class WOTemplate, WOSubcomponentInfo, WOComponentScript; @interface WOTemplateBuilder : NSObject { } - (WOTemplate *)buildTemplateAtURL:(NSURL *)_url; @end #include #include #endif /* __NGObjWeb_WOTemplateBuilder_H__ */ SOPE/sope-appserver/NGObjWeb/NGObjWeb/WOTemplate.h0000644000000000000000000000451412242733417020472 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGObjWeb_WOTemplate_H__ #define __NGObjWeb_WOTemplate_H__ #import #include @class NSURL, NSDate, NSString, NSDictionary, NSMutableDictionary; @class NSEnumerator; @class WOTemplate, WOSubcomponentInfo, WOComponentScript; @interface WOTemplate : WOElement { /* should add some info about the logic of the component ... */ NSURL *url; WOElement *rootElement; NSDate *loadDate; NSMutableDictionary *subcomponentInfos; WOComponentScript *componentScript; NSDictionary *kvcTemplateVars; } - (id)initWithURL:(NSURL *)_url rootElement:(WOElement *)_element; /* component info */ - (void)setComponentScript:(WOComponentScript *)_script; - (WOComponentScript *)componentScript; - (void)setKeyValueArchivedTemplateVariables:(NSDictionary *)_vars; - (NSDictionary *)keyValueArchivedTemplateVariables; /* subcomponent info */ - (void)addSubcomponentWithKey:(NSString *)_key name:(NSString *)_name bindings:(NSDictionary *)_bindings; - (BOOL)hasSubcomponentInfos; - (NSEnumerator *)infoKeyEnumerator; - (WOSubcomponentInfo *)subcomponentInfoForKey:(NSString *)_key; /* accessors */ - (void)setRootElement:(WOElement *)_element; - (WOElement *)rootElement; - (NSURL *)url; @end @interface WOSubcomponentInfo : NSObject { NSString *componentName; NSDictionary *bindings; } - (id)initWithName:(NSString *)_name bindings:(NSDictionary *)_bindings; /* accessors */ - (NSString *)componentName; - (NSDictionary *)bindings; @end #endif /* __NGObjWeb_WOTemplate_H__ */ SOPE/sope-appserver/NGObjWeb/NGObjWeb/WODirectAction.h0000644000000000000000000000360112242733417021263 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGObjWeb_WODirectAction_H__ #define __NGObjWeb_WODirectAction_H__ #import #include @class NSString, NSDictionary, NSArray; @class WORequest, WOComponent, WOSession, WOContext; @interface WODirectAction : NSObject { WOContext *context; } - (id)initWithContext:(WOContext *)_context; - (id)initWithRequest:(WORequest *)_request; /* accessors */ - (WORequest *)request; - (id)session; - (id)existingSession; /* actions */ - (id)performActionNamed:(NSString *)_actionName; - (void)takeFormValuesForKeyArray:(NSArray *)_keys; - (void)takeFormValuesForKeys:(NSString *)_key1,...; - (void)takeFormValueArraysForKeyArray:(NSArray *)_keys; - (void)takeFormValueArraysForKeys:(NSString *)_key1,...; /* pages */ - (id)pageWithName:(NSString *)_name; @end @interface WODirectAction(NGObjWebAdditions) - (WOContext *)context; @end @interface WODirectAction(WODebugging) /* implemented in NGExtensions */ - (void)debugWithFormat:(NSString *)_format, ...; - (void)logWithFormat:(NSString *)_format, ...; @end #endif /* __NGObjWeb_WODirectAction_H__ */ SOPE/sope-appserver/NGObjWeb/NGObjWeb/WOComponent.h0000644000000000000000000001235312242733417020661 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGObjWeb_WOComponent_H__ #define __NGObjWeb_WOComponent_H__ #import #import #include @class NSBundle, NSString, NSDictionary, NSMutableDictionary, NSURL, NSException, NSURL; @class WOElement, WOContext, WOSession, WOApplication, WOResourceManager; @interface WOComponent : WOElement < WOActionResults, NSCoding > { @private NSDictionary *wocBindings; // bindings to parent component NSString *wocName; // name of component NSBundle *bundle; WOComponent *parentComponent; // non-retained; NSDictionary *subcomponents; // subcomponents NSMutableDictionary *wocVariables; // user variables struct { BOOL reloadTemplates:1; // component definition caching BOOL isAwake:1; } componentFlags; @protected // transient (non-retained) WOContext *context; WOApplication *application; WOSession *session; NSURL *wocBaseURL; id cycleContext; // was: _ODCycleCtx id wocClientObject; } - (id)initWithContext:(WOContext *)_ctx; - (void)awake; - (void)sleep; /* This method needs to be called before using a component cached by yourself. */ - (void)ensureAwakeInContext:(WOContext *)_ctx; /* accessors */ - (NSString *)name; - (NSString *)path; - (NSURL *)baseURL; - (id)application; - (id)session; - (WOContext *)context; - (BOOL)hasSession; // new in WO4 /* component definition caching */ - (void)setCachingEnabled:(BOOL)_flag; - (BOOL)isCachingEnabled; /* resources */ - (NSBundle *)componentBundle; - (NSString *)pathForResourceNamed:(NSString *)_name ofType:(NSString *)_ext; - (NSString *)frameworkName; /* templates */ - (WOElement *)templateWithName:(NSString *)_name; + (WOElement *)templateWithHTMLString:(NSString *)_html declarationString:(NSString *)_wod languages:(NSArray *)_languages; - (id)pageWithName:(NSString *)_name; // new in WO4 - (void)setTemplate:(id)_template; /* child components */ - (BOOL)synchronizesVariablesWithBindings; // new in WO4 - (void)setValue:(id)_value forBinding:(NSString *)_name; // new in WO4 - (id)valueForBinding:(NSString *)_name; // new in WO4 - (BOOL)hasBinding:(NSString *)_name; // new in WO4 - (BOOL)canSetValueForBinding:(NSString *)_name; // new in WO4 - (BOOL)canGetValueForBinding:(NSString *)_name; // new in WO4 - (id)performParentAction:(NSString *)_attributeName; - (id)parent; /* variables */ - (BOOL)isStateless; // new in WO4.5 - (void)reset; // new in WO4.5 - (void)setObject:(id)_object forKey:(NSString *)_key; - (id)objectForKey:(NSString *)_key; - (void)validationFailedWithException:(NSException *)_exception value:(id)_value keyPath:(NSString *)_keyPath; // new in WO4 /* logging */ - (BOOL)isEventLoggingEnabled; @end /* WOComponent */ @interface WOComponent(Logging) /* implemented in NGExtensions */ - (void)logWithFormat:(NSString *)_fmt arguments:(va_list)_arguments; - (void)logWithFormat:(NSString *)_fmt, ...; - (void)debugWithFormat:(NSString *)_fmt, ...; @end @interface WOComponent(SkyrixExtensions) - (WOResourceManager *)resourceManager; - (id)existingSession; - (id)redirectToLocation:(id)_loc; - (BOOL)shouldTakeValuesFromRequest:(WORequest *)_rq inContext:(WOContext*)_c; @end @interface WOComponent(DeprecatedMethodsInWO4) - (WOElement *)templateWithHTMLString:(NSString *)_html declarationString:(NSString *)_wod; - (NSString *)stringForKey:(NSString *)_key inTableNamed:(NSString *)_tableName withDefaultValue:(NSString *)_default; @end /* WOComponent(DeprecatedMethodsInWO4) */ @interface WOComponent(AdvancedBindingAccessors) - (void)setUnsignedIntValue:(unsigned)_value forBinding:(NSString *)_name; - (unsigned)unsignedIntValueForBinding:(NSString *)_name; - (void)setIntValue:(int)_value forBinding:(NSString *)_name; - (int)intValueForBinding:(NSString *)_name; @end /* WOComponent(AdvancedBindingAccessors) */ @interface WOComponent(Statistics) - (NSString *)descriptionForResponse:(WOResponse *)_response inContext:(WOContext *)_context; @end /* WOComponent(Statistics) */ @interface WOComponent(DirectActionExtensions) - (void)takeFormValuesForKeyArray:(NSArray *)_keys; - (void)takeFormValuesForKeys:(NSString *)_key1,...; - (id)defaultAction; - (id)performActionNamed:(NSString *)_actionName; @end /* WOComponent(DirectActionExtensions) */ #endif /* __NGObjWeb_WOComponent_H__ */ SOPE/sope-appserver/NGObjWeb/NGObjWeb/WOCoreApplication.h0000644000000000000000000001132312242733417021767 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGObjWeb_WOCoreApplication_H__ #define __NGObjWeb_WOCoreApplication_H__ #import #import #import #include @class NSArray, NSNumber, NSDictionary, NSRunLoop; @class WOAdaptor, WORequest, WOResponse, WORequestHandler; @class NSBundle; @class NGActiveSocket, NGPassiveSocket; NGObjWeb_EXPORT NSString *WOApplicationWillFinishLaunchingNotification; NGObjWeb_EXPORT NSString *WOApplicationDidFinishLaunchingNotification; NGObjWeb_EXPORT NSString *WOApplicationWillTerminateNotification; NGObjWeb_EXPORT NSString *WOApplicationDidTerminateNotification; @interface WOCoreApplication : NSObject < NSLocking > { NSRecursiveLock *lock; NSLock *requestLock; NGActiveSocket *controlSocket; NGPassiveSocket *listeningSocket; struct { BOOL isTerminating:1; } cappFlags; @protected NSArray *adaptors; } /* active application */ + (id)application; - (void)activateApplication; - (void)deactivateApplication; /* Watchdog helpers */ - (void)setControlSocket: (NGActiveSocket *) newSocket; - (NGActiveSocket *)controlSocket; - (void)setListeningSocket: (NGPassiveSocket *) newSocket; - (NGPassiveSocket *)listeningSocket; - (BOOL) shouldSetupSignalHandlers; /* adaptors */ - (NSArray *)adaptors; - (WOAdaptor *)adaptorWithName:(NSString *)_name arguments:(NSDictionary *)_args; - (BOOL)allowsConcurrentRequestHandling; - (BOOL)adaptorsDispatchRequestsConcurrently; /* multithreading */ - (void)lockRequestHandling; - (void)unlockRequestHandling; - (void)lock; - (void)unlock; - (BOOL)tryLock; /* request recording */ - (NSString *)recordingPath; /* runloop */ - (void)run; - (NSRunLoop *)mainThreadRunLoop; - (void)terminate; - (void)terminateAfterTimeInterval:(NSTimeInterval)_interval; - (BOOL)isTerminating; /* dispatching requests */ - (WORequestHandler *)handlerForRequest:(WORequest *)_request; - (WOResponse *)dispatchRequest:(WORequest *)_request; - (WOResponse *)dispatchRequest:(WORequest *)_request usingHandler:(WORequestHandler *)_handler;; - (void)setPrintsHTMLParserDiagnostics:(BOOL)_flag; - (BOOL)printsHTMLParserDiagnostics; @end int WOApplicationMain(NSString *_appClassName, int argc, const char *argv[]); int WOWatchDogApplicationMain (NSString *_appClassName, int argc, const char *argv[]); int WOWatchDogApplicationMainWithServerDefaults (NSString *_appClassName, int argc, const char *argv[], NSString *globalDomainPath, NSString *appDomainPath); @interface WOCoreApplication(DeprecatedMethodsInWO4) - (NSRunLoop *)runLoop; - (WOResponse *)handleRequest:(WORequest *)_request; @end @interface WOCoreApplication(Defaults) /* A hook to override/plugin into the registration of user defaults. NOTE: this is called by -init (as the first thing), so be extra cautious */ - (void)registerUserDefaults; /* WOAdaptor */ + (void)setAdaptor:(NSString *)_key; + (NSString *)adaptor; /* WOAdditionalAdaptors */ + (void)setAdditionalAdaptors:(NSArray *)_names; + (NSArray *)additionalAdaptors; /* WOPort */ + (void)setPort:(NSNumber *)_port; + (NSNumber *)port; /* WOWorkerThreadCount */ + (NSNumber *)workerThreadCount; /* WOListenQueueSize */ + (NSNumber *)listenQueueSize; @end @interface WOCoreApplication(Logging) /* implemented in NGExtensions */ - (void)logWithFormat:(NSString *)_fmt, ...; - (void)debugWithFormat:(NSString *)_fmt, ...; @end @interface WOCoreApplication(Bundle) /* application bundles (run bundles in the WOApp container ...) */ + (BOOL)didLoadDaemonBundle:(NSBundle *)_bundle; + (int)runApplicationBundle:(NSString *)_bundleName domainPath:(NSString *)_p arguments:(void *)_argv count:(int)_argc; + (int)runApplicationBundle:(NSString *)_bundleName arguments:(void *)_argv count:(int)_argc; + (int)loadApplicationBundle:(NSString *)_bundleName domainPath:(NSString *)_domain; @end @interface WOCoreApplication(ExtraHelpers) + (void) applicationWillStart; @end #endif /* __NGObjWeb_WOCoreApplication_H__ */ SOPE/sope-appserver/NGObjWeb/NGObjWeb/WOApplication.h0000644000000000000000000001535012242733417021162 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGObjWeb_WOApplication_H__ #define __NGObjWeb_WOApplication_H__ #import #import #import #include #include @class NSString, NSRunLoop, NSArray, NSTimer, NSException, NSNumber, NSURL; @class NSMutableDictionary, NSDictionary; @class WOResourceManager, WOComponent, WOContext, WOSession; @class WORequest, WOResponse, WOAdaptor, WORequestHandler; @class WOSessionStore, WODynamicElement, WOElement, WOStatisticsStore; @interface WOApplication : WOCoreApplication { @private int minimumActiveSessionsCount; NSString *name; NSString *path; WORequestHandler *defaultRequestHandler; NSMapTable *requestHandlerRegistry; WOSessionStore *iSessionStore; WOStatisticsStore *iStatisticsStore; WOResourceManager *resourceManager; void *_unused; NSTimer *expirationTimer; NSString *instanceNumber; short pageCacheSize; short permanentPageCacheSize; struct { BOOL doesRefuseNewSessions:1; BOOL isPageRefreshOnBacktrackEnabled:1; BOOL isCachingEnabled:1; } appFlags; } /* accessors */ - (NSString *)name; - (BOOL)monitoringEnabled; - (NSString *)path; - (NSString *)number; /* request handlers */ - (void)registerRequestHandler:(WORequestHandler *)_hdl forKey:(NSString *)_key; - (void)removeRequestHandlerForKey:(NSString *)_key; - (void)setDefaultRequestHandler:(WORequestHandler *)_hdl; - (WORequestHandler *)defaultRequestHandler; - (NSArray *)registeredRequestHandlerKeys; /* sessions */ - (id)createSessionForRequest:(WORequest *)_request; - (id)restoreSessionWithID:(NSString *)_id inContext:(WOContext *)_ctx; - (void)saveSessionForContext:(WOContext *)_ctx; - (void)setSessionStore:(WOSessionStore *)_store; - (WOSessionStore *)sessionStore; - (NSString *)sessionStoreClassName; - (void)refuseNewSessions:(BOOL)_flag; - (BOOL)isRefusingNewSessions; - (int)activeSessionsCount; - (void)setMinimumActiveSessionsCount:(int)_minimum; - (int)minimumActiveSessionsCount; - (WOResponse *)handleSessionCreationErrorInContext:(WOContext *)_context; - (WOResponse *)handleSessionRestorationErrorInContext:(WOContext *)_context; - (WOResponse *)handlePageRestorationErrorInContext:(WOContext *)_context; /* statistics */ - (void)setStatisticsStore:(WOStatisticsStore *)_statStore; - (WOStatisticsStore *)statisticsStore; - (bycopy NSDictionary *)statistics; /* resources */ - (void)setResourceManager:(WOResourceManager *)_manager; - (WOResourceManager *)resourceManager; - (NSURL *)baseURL; - (NSString *)pathForResourceNamed:(NSString *)_name ofType:(NSString *)_type; /* notifications */ - (void)awake; - (void)sleep; /* responder */ - (void)takeValuesFromRequest:(WORequest *)_req inContext:(WOContext *)_ctx; - (id)invokeActionForRequest:(WORequest *)_req inContext:(WOContext *)_ctx; - (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx; /* dynamic elements */ - (WOElement *)dynamicElementWithName:(NSString *)_name // element class name associations:(NSDictionary *)_associations // bindings template:(WOElement *)_template // child elements languages:(NSArray *)_languages; /* pages */ - (void)setPageRefreshOnBacktrackEnabled:(BOOL)_flag; - (BOOL)isPageRefreshOnBacktrackEnabled; - (void)setCachingEnabled:(BOOL)_flag; - (BOOL)isCachingEnabled; - (void)setPageCacheSize:(int)_size; - (int)pageCacheSize; - (void)setPermanentPageCacheSize:(int)_size; - (int)permanentPageCacheSize; - (id)pageWithName:(NSString *)_name inContext:(WOContext *)_ctx; - (id)pageWithName:(NSString *)_name forRequest:(WORequest *)_req; /* exceptions */ - (WOResponse *)handleException:(NSException *)_exc inContext:(WOContext *)_ctx; @end @interface WOApplication(DeprecatedMethodsInWO4) - (id)session; - (WOContext *)context; - (id)createSession; - (id)restoreSession; - (void)saveSession:(WOSession *)_session; - (WOResponse *)handleSessionCreationError; - (WOResponse *)handleSessionRestorationError; - (WOResponse *)handlePageRestorationError; - (void)savePage:(WOComponent *)_page; - (id)restorePageForContextID:(NSString *)_ctxId; - (id)pageWithName:(NSString *)_name; - (WOResponse *)handleException:(NSException *)_exception; - (WOResponse *)handleRequest:(WORequest *)_request; - (WOElement *)dynamicElementWithName:(NSString *)_name // element class name associations:(NSDictionary *)_associations // bindings template:(WOElement *)_template; // child elements - (NSString *)stringForKey:(NSString *)_key inTableNamed:(NSString *)_tableName withDefaultValue:(NSString *)_default; @end @interface WOApplication(NonWOMethods) - (WORequestHandler *)requestHandlerForKey:(NSString *)_key; - (NSString *)sessionIDFromRequest:(WORequest *)_request; - (NSString *)createSessionIDForSession:(WOSession *)_session; + (Class)eoEditingContextClass; + (BOOL)implementsEditingContexts; @end @interface WOApplication(Defaults) /* WOComponentRequestHandlerKey */ + (void)setComponentRequestHandlerKey:(NSString *)_key; + (NSString *)componentRequestHandlerKey; /* WODirectActionRequestHandlerKey */ + (void)setDirectActionRequestHandlerKey:(NSString *)_key; + (NSString *)directActionRequestHandlerKey; /* WOResourceRequestHandlerKey */ + (void)setResourceRequestHandlerKey:(NSString *)_key; + (NSString *)resourceRequestHandlerKey; /* WODefaultSessionTimeOut */ + (void)setSessionTimeOut:(NSNumber *)_timeOut; + (NSNumber *)sessionTimeOut; /* WOCachingEnabled */ + (BOOL)isCachingEnabled; /* WODebuggingEnabled */ + (BOOL)isDebuggingEnabled; + (BOOL)isDirectConnectEnabled; + (void)setCGIAdaptorURL:(NSString *)_url; + (NSString *)cgiAdaptorURL; @end @interface WOApplication(WODebugging) /* implemented in NGExtensions */ - (void)debugWithFormat:(NSString *)_format, ...; - (void)logWithFormat:(NSString *)_format, ...; @end #endif /* __NGObjWeb_WOApplication_H__ */ SOPE/sope-appserver/NGObjWeb/NGObjWeb/WOResponse.h0000644000000000000000000000317712242733417020521 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGObjWeb_WOResponse_H__ #define __NGObjWeb_WOResponse_H__ #import #include #include /* WOResponse This WOMessage subclass add functionality for HTTP responses, mostly the HTTP status. WOResponse also provides some methods for zipping itself. */ @class NSData; @class WORequest; @interface WOResponse : WOMessage < WOActionResults > { unsigned int status; } /* HTTP */ - (void)setStatus:(unsigned int)_status; - (unsigned int)status; @end @interface WOResponse(PrivateMethods) + (WOResponse *)responseWithRequest:(WORequest *)_request; - (id)initWithRequest:(WORequest *)_request; - (void)disableClientCaching; @end @interface WOResponse(Zipping) - (BOOL)shouldZipResponseToRequest:(WORequest *)_rq; - (NSData *)zipResponse; @end #endif /* __NGObjWeb_WOResponse_H__ */ SOPE/sope-appserver/NGObjWeb/NGObjWeb/WOCookie.h0000644000000000000000000000401312242733417020122 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGObjWeb_WOCookie_H__ #define __NGObjWeb_WOCookie_H__ #import @class NSString, NSDate; @interface WOCookie : NSObject < NSCopying > { @protected NSString *name; NSString *value; // cookie configuration NSDate *expireDate; // defines how long the cookies is valid NSString *path; // the root-path where the cookie is valid NSString *domainName; // the domain where the cookie is valid (def: hostname) BOOL onlyIfSecure; // send only if communication-channel is secure (SSL) } + (id)cookieWithName:(NSString *)_name value:(NSString *)_value; + (id)cookieWithName:(NSString *)_name value:(NSString *)_value path:(NSString *)_path domain:(NSString *)_domain expires:(NSDate *)_date isSecure:(BOOL)_secure; /* accessors */ - (void)setName:(NSString *)_name; - (NSString *)name; - (void)setValue:(NSString *)_value; - (NSString *)value; - (void)setExpires:(NSDate *)_date; - (NSDate *)expires; - (void)setPath:(NSString *)_path; - (NSString *)path; - (void)setDomain:(NSString *)_domain; - (NSString *)domain; - (void)setIsSecure:(BOOL)_flag; - (BOOL)isSecure; /* description */ - (NSString *)headerString; - (NSString *)stringValue; // called by HTTP server @end #endif /* __NGObjWeb_WOCookie_H__ */ SOPE/sope-appserver/NGObjWeb/NGObjWeb/NGObjWeb.h0000644000000000000000000000366512242733417020054 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGObjWeb_H__ #define __NGObjWeb_H__ #if NeXT_Foundation_LIBRARY || APPLE_Foundation_LIBRARY # include # include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // kit class @interface NGObjWeb : NSObject @end #define LINK_NGObjWeb \ static void __link_NGObjWeb(void) { \ [NGObjWeb self]; \ __link_NGObjWeb(); \ } #endif /* __NGObjWeb_H__ */ SOPE/sope-appserver/NGObjWeb/NGObjWeb/WOSessionStore.h0000644000000000000000000000361012242733417021353 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGObjWeb_WOSessionStore_H__ #define __NGObjWeb_WOSessionStore_H__ #import #import @class NSString, NSMutableSet, NSRecursiveLock, NSConditionLock, NSTimer; @class WOSession, WOContext, WORequest; @interface WOSessionStore : NSObject { @protected NSRecursiveLock *lock; NSConditionLock *checkoutLock; NSMutableSet *checkedOutSessions; } + (WOSessionStore *)serverSessionStore; /* checkin/out */ - (id)checkOutSessionWithSessionID:(NSString *)_id request:(WORequest *)_request; - (void)checkInSessionForContext:(WOContext *)_context; /* store (WO4) */ - (id)restoreSessionWithID:(NSString *)_id request:(WORequest *)_request; - (void)saveSessionForContext:(WOContext *)_context; /* store (deprecated in WO4) */ - (void)saveSession:(WOSession *)_session; // deprecated in WO4 - (id)restoreSessionWithID:(NSString *)_id; // deprecated in WO4 @end @interface WOSessionStore(PrivateMethods) - (int)activeSessionsCount; - (void)sessionExpired:(NSString *)_sessionID; - (void)sessionTerminated:(WOSession *)_session; @end #endif /* __NGObjWeb_WOSessionStore_H__ */ SOPE/sope-appserver/NGObjWeb/NGObjWeb/OWViewRequestHandler.h0000644000000000000000000000177612242733417022507 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGObjWeb_OWViewRequestHandler_H__ #define __NGObjWeb_OWViewRequestHandler_H__ #import @interface OWViewRequestHandler : WORequestHandler { } @end #endif /* __NGObjWeb_OWViewRequestHandler_H__ */ SOPE/sope-appserver/NGObjWeb/NGObjWeb/WOPageGenerationContext.h0000644000000000000000000000260112242733417023147 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGObjWeb_WOPageGenerationContext_H__ #define __NGObjWeb_WOPageGenerationContext_H__ #import @class NSString; @class WORequest, WOResponse; @protocol WOPageGenerationContext - (id)session; // creates new session if none was set - (BOOL)hasSession; - (id)page; - (id)component; - (NSString *)contextID; // returns nil if no session is set - (WORequest *)request; - (WOResponse *)response; - (void)setInForm:(BOOL)_form; - (BOOL)isInForm; /* cursor */ - (void)pushCursor:(id)_obj; - (id)popCursor; - (id)cursor; @end #endif /* __NGObjWeb_WOPageGenerationContext_H__ */ SOPE/sope-appserver/NGObjWeb/NGObjWeb/WOComponentScript.h0000644000000000000000000000305312242733417022043 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGObjWeb_WOComponentScript_H__ #define __NGObjWeb_WOComponentScript_H__ #import #include #include @class NSArray, NSString, NSURL; @class WOComponentScriptPart; @interface WOComponentScript : NSObject { NSArray *scriptParts; NSString *language; } - (id)initWithContentsOfFile:(NSString *)_path; /* accessors */ - (NSString *)language; /* operations */ - (void)addScriptPart:(WOComponentScriptPart *)_part; @end @interface WOComponentScriptPart : NSObject { NSURL *url; unsigned startLine; NSString *script; } - (id)initWithContentsOfFile:(NSString *)_path; - (id)initWithURL:(NSURL *)_url startLine:(unsigned)_ln script:(NSString *)_s; @end #endif /* __NGObjWeb_WOComponentScript_H__ */ SOPE/sope-appserver/NGObjWeb/NGObjWeb/WOMessage.h0000644000000000000000000000775112242733417020311 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGObjWeb_WOMessage_H__ #define __NGObjWeb_WOMessage_H__ #import #import #include /* WOMessage Abstract superclass of both, WORequest and WOResponse. */ @class NSDictionary, NSArray, NSData, NSMutableData, NSMutableArray; @class NGMutableHashMap; @class WOCookie; @interface WOMessage : NSObject { @private NSString *version; NSMutableData *content; NGMutableHashMap *header; NSDictionary *userInfo; NSMutableArray *cookies; NSStringEncoding contentEncoding; id contentStream; id domCache; struct { BOOL didStartWriting:1; // afterwards no headers may be changed int reserved:31; } womFlags; @public // cached selectors void (*addChar)(id, SEL, char); void (*addStr)(id, SEL, NSString *); void (*addHStr)(id, SEL, NSString *); void (*addCStr)(id, SEL, const unsigned char *); void (*addBytesLen)(id, SEL, const unsigned char *, unsigned); void (*addBytes)(id, SEL, const void *, unsigned); } /* accessors */ - (void)setUserInfo:(NSDictionary *)_userInfo; - (NSDictionary *)userInfo; /* HTTP */ - (void)setHTTPVersion:(NSString *)_httpVersion; - (NSString *)httpVersion; /* cookies (new in WO4) */ - (void)addCookie:(WOCookie *)_cookie; - (void)removeCookie:(WOCookie *)_cookie; - (NSArray *)cookies; /* header */ - (void)setHeader:(NSString *)_header forKey:(NSString *)_key; - (NSString *)headerForKey:(NSString *)_key; - (void)setHeaders:(NSArray *)_headers forKey:(NSString *)_key; - (NSArray *)headersForKey:(NSString *)_key; - (NSArray *)headerKeys; - (void)appendHeader:(NSString *)_header forKey:(NSString *)_key; - (void)appendHeaders:(NSArray *)_headers forKey:(NSString *)_key; - (void)setHeaders:(NSDictionary *)_headers; - (NSDictionary *)headers; - (NSString *)headersAsString; /* generic content */ - (void)setContent:(NSData *)_data; - (NSData *)content; - (void)setContentEncoding:(NSStringEncoding)_encoding; - (NSStringEncoding)contentEncoding; + (void)setDefaultEncoding:(NSStringEncoding)_encoding; + (NSStringEncoding)defaultEncoding; /* structured content */ - (void)appendContentBytes:(const void *)_bytes length:(unsigned)_length; - (void)appendContentCharacter:(unichar)_c; - (void)appendContentData:(NSData *)_data; - (void)appendContentString:(NSString *)_value; - (void)appendContentCString:(const unsigned char *)_value; - (void)appendContentHTMLAttributeValue:(NSString *)_value; - (void)appendContentHTMLString:(NSString *)_value; - (void)appendContentXMLAttributeValue:(NSString *)_value; - (void)appendContentXMLString:(NSString *)_value; @end @interface WOMessage(Escaping) /* this escapes '&', '"', '<' and '>' */ + (NSString *)stringByEscapingHTMLString:(NSString *)_string; /* this escapes '&', '"', '<', '>', '\t', '\r' and '\n' */ + (NSString *)stringByEscapingHTMLAttributeValue:(NSString *)_string; @end @interface WOMessage(NGObjWebExtensions) - (NSString *)contentAsString; - (BOOL)doesStreamContent; - (NSArray *)validateContent; @end @interface WOMessage(DOMXML) - (void)setContentDOMDocument:(id)_dom; - (void)appendContentDOMDocumentFragment:(id)_domfrag; - (id)contentAsDOMDocument; @end #endif /* __NGObjWeb_WOMessage_H__ */ SOPE/sope-appserver/NGObjWeb/NGObjWeb/WOMailDelivery.h0000644000000000000000000000277312242733417021312 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGObjWeb_WOMailDelivery_H__ #define __NGObjWeb_WOMailDelivery_H__ #import @class NSString, NSArray; @class WOComponent; @interface WOMailDelivery : NSObject { } + (id)sharedInstance; // composing mails - (id)composeEmailFrom:(NSString *)_senderAddress to:(NSArray *)_receiverAddresses cc:(NSArray *)_ccAddresses subject:(NSString *)_subject plainText:(NSString *)_text send:(BOOL)_sendFlag; - (id)composeEmailFrom:(NSString *)_senderAddress to:(NSArray *)_receiverAddresses cc:(NSArray *)_ccAddresses subject:(NSString *)_subject component:(WOComponent *)_component send:(BOOL)_sendFlag; // sending mails - (BOOL)sendEmail:(id)_email; @end #endif /* __NGObjWeb_WOMailDelivery_H__ */ SOPE/sope-appserver/NGObjWeb/NGObjWeb/WEClientCapabilities.h0000644000000000000000000000550612242733417022437 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __WEExtensions_WEClientCapabilities_H__ #define __WEExtensions_WEClientCapabilities_H__ #import @class NSString; @interface WEClientCapabilities : NSObject { NSString *userAgent; unsigned short browser; unsigned short os; unsigned short cpu; unsigned char browserMajorVersion; unsigned char browserMinorVersion; struct { int acceptUTF8:1; int reserved:31; } flags; } /* accessors */ - (NSString *)userAgent; - (NSString *)userAgentType; - (NSString *)os; - (NSString *)cpu; - (unsigned char)majorVersion; - (unsigned char)minorVersion; /* browser capabilities */ - (BOOL)isJavaScriptBrowser; - (BOOL)isVBScriptBrowser; - (BOOL)isFastTableBrowser; - (BOOL)isCSS1Browser; - (BOOL)isCSS2Browser; - (BOOL)ignoresCSSOnFormElements; - (BOOL)isTextModeBrowser; - (BOOL)isIFrameBrowser; - (BOOL)isXULBrowser; - (BOOL)isRobot; - (BOOL)isDAVClient; - (BOOL)isXmlRpcClient; - (BOOL)isBLogClient; - (BOOL)isRSSClient; - (BOOL)doesSupportCSSOverflow; - (BOOL)doesSupportDHTMLDragAndDrop; - (BOOL)doesSupportXMLDataIslands; - (BOOL)doesSupportUTF8Encoding; /* user-agent (it's better to use ^capabilities !) */ - (BOOL)isInternetExplorer; - (BOOL)isInternetExplorer5; - (BOOL)isNetscape; - (BOOL)isNetscape6; - (BOOL)isLynx; - (BOOL)isOpera; - (BOOL)isAmaya; - (BOOL)isEmacs; - (BOOL)isWget; - (BOOL)isWebFolder; - (BOOL)isMozilla; - (BOOL)isOmniWeb; - (BOOL)isICab; - (BOOL)isKonqueror; /* OS */ - (BOOL)isWindowsBrowser; - (BOOL)isLinuxBrowser; - (BOOL)isMacBrowser; - (BOOL)isSunOSBrowser; - (BOOL)isUnixBrowser; - (BOOL)isX11Browser; @end #include @interface WORequest(ClientCapabilities) /* the object is cached in the WORequest's userInfo */ - (WEClientCapabilities *)clientCapabilities; @end #include /* The following element uses JavaScript to find out even more about the client browser. */ @interface JSClientCapabilityDetector : WODynamicElement { WOAssociation *formName; WOAssociation *clientCaps; } @end #endif /* __WEExtensions_WEClientCapabilities_H__ */ SOPE/sope-appserver/NGObjWeb/NGObjWeb/WOSession.h0000644000000000000000000001006212242733417020335 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGObjWeb_WOSession_H__ #define __NGObjWeb_WOSession_H__ #import #import #import #include @class NSString, NSArray, NSRecursiveLock, NSMutableDictionary, NSDate; @class WOContext, WOApplication; @class WORequest, WOResponse, WOContext, WOComponent; struct WOSessionCacheEntry; NGObjWeb_EXPORT NSString *WOSessionDidTimeOutNotification; NGObjWeb_EXPORT NSString *WOSessionDidRestoreNotification; NGObjWeb_EXPORT NSString *WOSessionDidCreateNotification; NGObjWeb_EXPORT NSString *WOSessionDidTerminateNotification; @interface WOSession : NSObject < NSLocking > { @private NSArray *wosLanguages; BOOL isTerminating; NSRecursiveLock *wosLock; NSString *wosSessionId; NSMutableDictionary *wosVariables; // session variables NSTimeInterval wosTimeOut; id wosDefaultEditingContext; struct { BOOL storesIDsInURLs:1; BOOL storesIDsInCookies:1; BOOL isAwake:1; } wosFlags; @private struct { struct WOSessionCacheEntry *entries; unsigned short index; unsigned short size; } pageCache; struct { struct WOSessionCacheEntry *entries; unsigned short index; unsigned short size; } permanentPageCache; @protected // transients (non-retained) WOApplication *application; WOContext *context; } /* session */ - (NSString *)sessionID; - (void)setStoresIDsInURLs:(BOOL)_flag; - (BOOL)storesIDsInURLs; - (void)setStoresIDsInCookies:(BOOL)_flag; - (BOOL)storesIDsInCookies; - (NSString *)domainForIDCookies; - (NSDate *)expirationDateForIDCookies; - (void)setDistributionEnabled:(BOOL)_flag; - (BOOL)isDistributionEnabled; - (void)setTimeOut:(NSTimeInterval)_timeout; - (NSTimeInterval)timeOut; - (void)terminate; - (BOOL)isTerminating; - (WOContext *)context; /* editing context */ - (id)defaultEditingContext; /* localization */ - (void)setLanguages:(NSArray *)_langs; - (NSArray *)languages; /* notifications */ - (void)awake; - (void)sleep; /* pages */ - (id)restorePageForContextID:(NSString *)_idx; - (void)savePage:(WOComponent *)_page; - (void)savePageInPermanentCache:(WOComponent *)_page; // new in WO4 /* responder */ - (void)takeValuesFromRequest:(WORequest *)_request inContext:(WOContext *)_ctx; - (id)invokeActionForRequest:(WORequest *)_request inContext:(WOContext *)_ctx; - (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx; /* multithreading */ - (void)lock; - (void)unlock; - (BOOL)tryLock; /* session variables */ - (void)setObject:(id)_obj forKey:(NSString *)_key; - (id)objectForKey:(NSString *)_key; - (void)removeObjectForKey:(NSString *)_key; /* statistics */ - (NSArray *)statistics; @end @interface WOSession(DeprecatedMethodsInWO4) - (id)application; // use [WOApplication application] instead @end @interface WOSession(PrivateMethods) - (void)_awakeWithContext:(WOContext *)_ctx; - (void)_sleepWithContext:(WOContext *)_ctx; @end @interface WOSession(NSCoding) < NSCoding > @end @interface WOSession(Logging) - (void)logWithFormat:(NSString *)_format, ...; - (void)debugWithFormat:(NSString *)_format, ...; // new in WO4 @end #endif /* __NGObjWeb_WOSession_H__ */ SOPE/sope-appserver/NGObjWeb/NGObjWeb/WOComponentDefinition.h0000644000000000000000000000436312242733417022674 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGObjWeb_WOComponentDefinition_H__ #define __NGObjWeb_WOComponentDefinition_H__ #import #import @class NSString, NSMutableDictionary, NSArray, NSMutableArray, NSMutableSet; @class NSDictionary, NSURL; @class WOElement, WOComponent, WOResourceManager, WOTemplate; /* WOComponentDefinition Instances of this class are to WOComponents what Classes are to Objective-C objects. They are the description and factory of components. */ @interface WOComponentDefinition : NSObject { @private NSString *name; NSString *path; /* can also contain a URL! */ NSURL *baseUrl; NSString *frameworkName; Class componentClass; NSTimeInterval lastTouch; WOTemplate *template; } - (id)initWithName:(NSString *)_name path:(NSString *)_path baseURL:(NSURL *)_baseUrl frameworkName:(NSString *)_frameworkName; /* accessors */ - (Class)componentClass; - (NSString *)componentName; /* templates */ - (WOTemplate *)template; /* instantiation */ - (WOComponent *)instantiateWithResourceManager:(WOResourceManager *)_rm languages:(NSArray *)_languages; /* caching */ - (void)touch; /* mark as used .. */ - (NSTimeInterval)lastTouch; /* privates */ - (void)_finishInitializingComponent:(WOComponent *)_component; @end @interface NSObject(WOComponentInfo) - (NSString *)componentName; - (Class)componentClass; - (NSDictionary *)bindings; @end #endif /* __NGObjWeb_WOComponentDefinition_H__ */ SOPE/sope-appserver/NGObjWeb/NGObjWeb/OWResponder.h0000644000000000000000000000273412242733417020662 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGObjWeb_OWResponder_H__ #define __NGObjWeb_OWResponder_H__ #import @class WORequest, WOResponse, WOContext; @protocol OWResponder < NSObject > - (void)takeValuesFromRequest:(WORequest *)_request inContext:(WOContext *)_context; - (id)invokeActionForRequest:(WORequest *)_request inContext:(WOContext *)_context; - (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_context; @end typedef void (*OWTakeValuesMethod) (id, SEL, WORequest *, WOContext *); typedef id (*OWInvokeMethod) (id, SEL, WORequest *, WOContext *); typedef void (*OWAppendResponseMethod)(id, SEL, WOResponse *, WOContext *); #endif /* __NGObjWeb_OWResponder_H__ */ SOPE/sope-appserver/NGObjWeb/NGObjWeb/WOAdaptor.h0000644000000000000000000000271412242733417020311 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGObjWeb_WOAdaptor_H__ #define __NGObjWeb_WOAdaptor_H__ #import @class NSString, NSDictionary; @class WOCoreApplication; typedef enum { WOChildMessageAccept = 0, WOChildMessageReady, WOChildMessageShutdown, WOChildMessageMax } WOChildMessage; @interface WOAdaptor : NSObject { @protected NSString *name; WOCoreApplication *application; // not retained } /* Note: Arguments is a NSDictionary since WO4 */ - (id)initWithName:(NSString *)_name arguments:(NSDictionary *)_args application:(WOCoreApplication *)_application; // register - (void)registerForEvents; - (void)unregisterForEvents; @end #endif /* __NGObjWeb_WOAdaptor_H__ */ SOPE/sope-appserver/NGObjWeb/NGObjWeb/NGObjWebDecls.h0000644000000000000000000000232412242733417021016 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGObjWeb_NGObjWebDecls_H__ #define __NGObjWeb_NGObjWebDecls_H__ #if BUILD_libNGObjWeb_DLL # define NGObjWeb_EXPORT __declspec(dllexport) # define NGObjWeb_DECLARE __declspec(dllexport) #elif libNGObjWeb_ISDLL # define NGObjWeb_EXPORT extern __declspec(dllimport) # define NGObjWeb_DECLARE extern __declspec(dllimport) #else # define NGObjWeb_EXPORT extern # define NGObjWeb_DECLARE #endif #endif /* __NGObjWeb_NGObjWebDecls_H__ */ SOPE/sope-appserver/NGObjWeb/NGObjWeb/WODisplayGroup.h0000644000000000000000000001336412242733417021344 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGObjWeb_WODisplayGroup_H__ #define __NGObjWeb_WODisplayGroup_H__ #import @class NSDictionary, NSArray, NSNotification, NSMutableDictionary; @class EODataSource, EOQualifier; @interface WODisplayGroup : NSObject < NSCoding > { id delegate; /* non-retained ! */ EODataSource *dataSource; NSArray *sortOrderings; NSDictionary *insertedObjectDefaults; NSUInteger numberOfObjectsPerBatch; NSArray *selectionIndexes; NSArray *objects; NSArray *displayObjects; EOQualifier *qualifier; NSString *defaultStringMatchFormat; NSString *defaultStringMatchOperator; NSUInteger currentBatchIndex; NSMutableDictionary *_queryBindings; NSMutableDictionary *_queryMatch; NSMutableDictionary *_queryMin; NSMutableDictionary *_queryMax; NSMutableDictionary *_queryOperator; struct { BOOL fetchesOnLoad:1; BOOL selectFirstAfterFetch:1; BOOL validatesChangesImmediatly:1; BOOL inQueryMode:1; } flags; } /* accessors */ - (void)setDelegate:(id)_delegate; - (id)delegate; - (void)setDataSource:(EODataSource *)_ds; - (EODataSource *)dataSource; - (void)setSortOrderings:(NSArray *)_orderings; - (NSArray *)sortOrderings; - (void)setFetchesOnLoad:(BOOL)_flag; - (BOOL)fetchesOnLoad; - (void)setInsertedObjectDefaultValues:(NSDictionary *)_values; - (NSDictionary *)insertedObjectDefaultValues; - (void)setNumberOfObjectsPerBatch:(NSUInteger)_count; - (NSUInteger)numberOfObjectsPerBatch; - (void)setSelectsFirstObjectAfterFetch:(BOOL)_flag; - (BOOL)selectsFirstObjectAfterFetch; - (void)setValidatesChangesImmediatly:(BOOL)_flag; - (BOOL)validatesChangesImmediatly; /* display */ - (void)redisplay; /* batches */ - (BOOL)hasMultipleBatches; - (NSUInteger)batchCount; - (void)setCurrentBatchIndex:(NSUInteger)_currentBatchIndex; - (NSUInteger)currentBatchIndex; - (NSUInteger)indexOfFirstDisplayedObject; - (NSUInteger)indexOfLastDisplayedObject; - (id)displayNextBatch; - (id)displayPreviousBatch; - (id)displayBatchContainingSelectedObject; /* selection */ - (BOOL)setSelectionIndexes:(NSArray *)_selection; - (NSArray *)selectionIndexes; - (BOOL)clearSelection; - (id)selectNext; - (id)selectPrevious; - (void)setSelectedObject:(id)_obj; - (id)selectedObject; - (void)setSelectedObjects:(NSArray *)_objs; - (NSArray *)selectedObjects; - (BOOL)selectObject:(id)_obj; - (BOOL)selectObjectsIdenticalTo:(NSArray *)_objs; - (BOOL)selectObjectsIdenticalTo:(NSArray *)_objs selectFirstOnNoMatch:(BOOL)_flag; /* objects */ - (void)setObjectArray:(NSArray *)_objects; - (NSArray *)allObjects; - (NSArray *)displayedObjects; - (id)fetch; - (void)updateDisplayedObjects; /* query */ - (void)setInQueryMode:(BOOL)_flag; - (BOOL)inQueryMode; - (EOQualifier *)qualifierFromQueryValues; - (NSMutableDictionary *)queryBindings; - (NSMutableDictionary *)queryMatch; - (NSMutableDictionary *)queryMin; - (NSMutableDictionary *)queryMax; - (NSMutableDictionary *)queryOperator; - (void)setDefaultStringMatchFormat:(NSString *)_tmp; - (NSString *)defaultStringMatchFormat; - (void)setDefaultStringMatchOperator:(NSString *)_tmp; - (NSString *)defaultStringMatchOperator; + (NSString *)globalDefaultStringMatchFormat; + (NSString *)globalDefaultStringMatchOperator; /* qualifiers */ - (void)setQualifier:(EOQualifier *)_q; - (EOQualifier *)qualifier; - (NSArray *)allQualifierOperators; - (NSArray *)stringQualifierOperators; - (NSArray *)relationalQualifierOperators; - (void)qualifyDisplayGroup; - (void)qualifyDataSource; /* object creation */ - (id)insert; - (id)insertObjectAtIndex:(NSUInteger)_idx; - (void)insertObject:(id)_object atIndex:(NSUInteger)_idx; /* object deletion */ - (id)delete; - (BOOL)deleteSelection; - (BOOL)deleteObjectAtIndex:(NSUInteger)_idx; @end @interface NSObject(WODisplayGroupDelegate) - (void)displayGroup:(WODisplayGroup *)_dg createObjectFailedForDataSource:(EODataSource *)_ds; - (BOOL)displayGroupShouldFetch:(WODisplayGroup *)_dg; - (void)displayGroup:(WODisplayGroup *)_dg didFetchObjects:(NSArray *)_objects; - (BOOL)displayGroup:(WODisplayGroup *)_dg shouldInsertObject:(id)_object atIndex:(NSUInteger)_idx; - (void)displayGroup:(WODisplayGroup *)_dg didInsertObject:(id)_object; - (BOOL)displayGroup:(WODisplayGroup *)_dg shouldDeleteObject:(id)_object; - (void)displayGroup:(WODisplayGroup *)_dg didDeleteObject:(id)_object; - (void)displayGroup:(WODisplayGroup *)_dg didSetValue:(id)_value forObject:(id)_object key:(NSString *)_key; - (void)displayGroupDidChangeDataSource:(WODisplayGroup *)_dg; - (BOOL)displayGroup:(WODisplayGroup *)_dg shouldRedisplayForEditingContextChangeNotification:(NSNotification *)_not; - (BOOL)displayGroup:(WODisplayGroup *)_dg shouldChangeSelectionToIndexes:(NSArray *)_idxs; - (void)displayGroupDidChangeSelectedObjects:(WODisplayGroup *)_dg; - (void)displayGroupDidChangeSelection:(WODisplayGroup *)_dg; - (NSArray *)displayGroup:(WODisplayGroup *)_dg displayArrayForObjects:(NSArray *)_objects; @end #endif /* __NGObjWeb_WODisplayGroup_H__ */ SOPE/sope-appserver/NGObjWeb/NGObjWeb/WORequest.h0000644000000000000000000000743212242733417020351 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGObjWeb_WORequest_H__ #define __NGObjWeb_WORequest_H__ #import #include #include @class NSString, NSArray, NSData, NSDictionary, NSCalendarDate; @class NGHashMap; @class NGHttpRequest; NGObjWeb_EXPORT NSString *WORequestValueData; NGObjWeb_EXPORT NSString *WORequestValueInstance; NGObjWeb_EXPORT NSString *WORequestValuePageName; NGObjWeb_EXPORT NSString *WORequestValueContextID; NGObjWeb_EXPORT NSString *WORequestValueSenderID; NGObjWeb_EXPORT NSString *WORequestValueSessionID; NGObjWeb_EXPORT NSString *WORequestValueFragmentID; NGObjWeb_EXPORT NSString *WONoSelectionString; @interface WORequest : WOMessage { @private NGHttpRequest *request; // NGHttp Request id formContent; // FORM data (message content or URL paras) NSMutableArray *browserLanguages; // cached list of browser languages @private NSString *method; NSString *_uri; // TBD: why is this underscored? @protected NSString *adaptorPrefix; NSString *appName; NSString *requestHandlerKey; NSString *requestHandlerPath; @protected NSCalendarDate *startDate; id startStatistics; } - (id)initWithMethod:(NSString *)_method uri:(NSString *)_uri httpVersion:(NSString *)_version headers:(NSDictionary *)_headers content:(NSData *)_body userInfo:(NSDictionary *)_userInfo; /* WO accessors */ - (BOOL)isFromClientComponent; - (NSString *)applicationName; - (NSString *)adaptorPrefix; /* HTTP accessors */ - (NSString *)method; - (NSString *)uri; - (BOOL)isProxyRequest; /* check whether uri is a full URL */ /* forms */ - (NSStringEncoding)formValueEncoding; - (void)setDefaultFormValueEncoding:(NSStringEncoding)_enc; - (NSStringEncoding)defaultFormValueEncoding; - (void)setFormValueEncodingDetectionEnabled:(BOOL)_flag; - (BOOL)isFormValueEncodingDetectionEnabled; - (NSArray *)formValueKeys; - (NSString *)formValueForKey:(NSString *)_key; - (NSArray *)formValuesForKey:(NSString *)_key; - (NSDictionary *)formValues; /* HTTP header */ - (NSArray *)browserLanguages; // new in WO4 /* request handler */ - (NSString *)requestHandlerKey; // new in WO4 - (NSString *)requestHandlerPath; // new in WO4 - (NSArray *)requestHandlerPathArray; // new in WO4 /* cookie support (new in WO4) */ - (NSArray *)cookieValuesForKey:(NSString *)_key; - (NSString *)cookieValueForKey:(NSString *)_key; - (NSDictionary *)cookieValues; /* SOPE extensions */ - (NSString *)fragmentID; - (BOOL)isFragmentIDInRequest; @end #if COMPILING_NGOBJWEB @interface WORequest(PrivateMethods) - (NGHttpRequest *)httpRequest; /* accessors */ - (NGHashMap *)formParameters; @end #endif @interface WORequest(DeprecatedMethodsInWO4) - (NSString *)applicationHost; // use NSProcessInfo and/or NSTask - (NSString *)sessionID; // [[context session] sessionID] - (NSString *)senderID; // replaced by WOContext:-senderID - (NSString *)contextID; // use WOContext:-contextID @end #endif /* __NGObjWeb_WORequest_H__ */ SOPE/sope-appserver/NGObjWeb/NGObjWeb/WOContext.h0000644000000000000000000001252412242733417020343 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG Copyright (C) 2006 Helge Hess This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGObjWeb_WOContext_H__ #define __NGObjWeb_WOContext_H__ #import #include #include /* WOContext The WOContext is the central object for processing a single HTTP transaction. It manages request, response, the session, the current element id for component actions, the active component etc. */ @class NSString, NSMutableDictionary, NSMutableArray, NSMutableSet; @class NSArray, NSDictionary, NSURL; @class WOApplication, WOSession, WOComponent, WORequest, WOResponse; @class WOElementID; #define NGObjWeb_MAX_COMPONENT_NESTING_DEPTH 50 @interface WOContext : NSObject < WOPageGenerationContext > { @protected WOApplication *application; // non-retained NSString *ctxId; WORequest *request; WOResponse *response; NSMutableDictionary *variables; WOComponent *page; WOSession *session; NSMutableSet *awakeComponents; // components that were woken up /* URLs */ NSURL *baseURL; NSURL *appURL; /* element ids */ WOElementID *elementID; WOElementID *reqElementID; NSString *urlPrefix; /* cached URL prefix */ /* component stack */ id componentStack[NGObjWeb_MAX_COMPONENT_NESTING_DEPTH]; id contentStack[NGObjWeb_MAX_COMPONENT_NESTING_DEPTH]; signed char componentStackCount; /* misc */ id activeFormElement; NSString *qpJoin; @public /* need fast access to generation flags */ /* flags */ struct { int savePageRequired:1; /* tracking component actions */ int inForm:1; int xmlStyleEmptyElements:1; int allowEmptyAttributes:1; int hasNewSession:1; /* session was created during the run */ int isRenderingDisabled:1; int reserved:26; } wcFlags; @protected /* SOPE */ NSString *fragmentID; /* SoObjects */ id clientObject; NSMutableArray *traversalStack; NSString *soRequestType; // WebDAV, XML-RPC, METHOD id objectDispatcher; NSString *pathInfo; id rootURL; id objectPermissionCache; id activeUser; #if WITH_DEALLOC_OBSERVERS @private id *deallocObservers; unsigned short deallocObserverCount; unsigned short deallocObserverCapacity; #endif } + (id)contextWithRequest:(WORequest *)_request; - (id)initWithRequest:(WORequest *)_request; + (id)context; - (id)init; /* URLs */ - (NSURL *)baseURL; - (NSURL *)applicationURL; - (NSURL *)serverURL; - (NSURL *)urlForKey:(NSString *)_key; - (void)setGenerateXMLStyleEmptyElements:(BOOL)_flag; - (BOOL)generateXMLStyleEmptyElements; - (void)setGenerateEmptyAttributes:(BOOL)_flag; - (BOOL)generateEmptyAttributes; /* variables */ - (void)setObject:(id)_obj forKey:(NSString *)_key; - (id)objectForKey:(NSString *)_key; - (void)removeObjectForKey:(NSString *)_key; - (void)takeValue:(id)_value forKey:(NSString *)_key; - (id)valueForKey:(NSString *)_key; @end @interface WOContext(ElementIDs) < WOElementTrackingContext > @end @interface WOContext(URLs) - (NSString *)componentActionURL; - (NSString *)directActionURLForActionNamed:(NSString *)_actionName queryDictionary:(NSDictionary *)_queryDict; - (NSString *)urlWithRequestHandlerKey:(NSString *)_key path:(NSString *)_path queryString:(NSString *)_query; - (NSString *)completeURLWithRequestHandlerKey:(NSString *)_key path:(NSString *)_path queryString:(NSString *)_query isSecure:(BOOL)_isSecure port:(int)_port; - (NSString *)senderID; // new in WO4 - (NSString *)queryStringFromDictionary:(NSDictionary *)_queryDict; - (void)setQueryPathSeparator:(NSString *)_sp; - (NSString *)queryPathSeparator; @end @interface WOContext(PrivateMethods) - (void)setRequestSenderID:(NSString *)_rqsid; - (BOOL)savePageRequired; @end @interface WOContext(DeprecatedMethodsInWO4) - (id)application; // use WOApplication:+application - (void)setDistributionEnabled:(BOOL)_flag; // use methods in - (BOOL)isDistributionEnabled; // WOSession instead - (NSString *)url; // use componentActionURL methods - (NSString *)urlSessionPrefix; // use componentActionURL methods @end @interface WOContext(SOPEAdditions) - (BOOL)hasNewSession; /* languages for resource lookup (non-WO) */ - (NSArray *)resourceLookupLanguages; /* fragments */ - (void)setFragmentID:(NSString *)_fragmentID; - (NSString *)fragmentID; - (void)enableRendering; - (void)disableRendering; - (BOOL)isRenderingDisabled; @end #endif /* __NGObjWeb_WOContext_H__ */ SOPE/sope-appserver/NGObjWeb/NGObjWeb/WOElement.h0000644000000000000000000000235712242733417020313 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGObjWeb_WOElement_H__ #define __NGObjWeb_WOElement_H__ #import #include #include @class NSDictionary, NSString; @interface WOElement : NSObject < OWResponder > { @public // cached selectors OWTakeValuesMethod takeValues; OWAppendResponseMethod appendResponse; } NGObjWeb_DECLARE id OWGetProperty(NSDictionary *_set, NSString *_name); @end #endif /* __NGObjWeb_WOElement_H__ */ SOPE/sope-appserver/NGObjWeb/NGObjWeb/WOHTTPConnection.h0000644000000000000000000000424612242733417021520 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGObjWeb_WOHTTPConnection_H__ #define __NGObjWeb_WOHTTPConnection_H__ #import /* WOHTTPConnection This class can be used to access HTTP based services using the NGObjWeb infrastructure. */ @class NSURL; @class NGCTextStream; @class WORequest, WOResponse, NSException; @interface WOHTTPConnection : NSObject { NSURL *url; BOOL keepAlive; int connectTimeout; int sendTimeout; int receiveTimeout; BOOL useProxy; BOOL useSSL; id socket; id log; NGCTextStream *io; NSException *lastException; BOOL didRegisterForNotification; } - (id)initWithHost:(NSString *)_h onPort:(unsigned int)_p secure:(BOOL)_flag; - (id)initWithHost:(NSString *)_hostName onPort:(unsigned int)_port; - (id)initWithURL:(id)_url; /* IO */ - (BOOL)sendRequest:(WORequest *)_request; - (WOResponse *)readResponse; - (void)setKeepAliveEnabled:(BOOL)_flag; - (BOOL)keepAliveEnabled; /* timeouts */ - (void)setConnectTimeout:(int)_seconds; - (int)connectTimeout; - (void)setReceiveTimeout:(int)_seconds; - (int)receiveTimeout; - (void)setSendTimeout:(int)_seconds; - (int)sendTimeout; @end extern NSString *WOHTTPConnectionCanReadResponse; @interface WOHTTPConnection(SkyrixAdds) /* error handling */ - (NSException *)lastException; @end #endif /* __NGObjWeb_WOHTTPConnection_H__ */ SOPE/sope-appserver/NGObjWeb/WOHTTPConnection.m0000644000000000000000000005273712242733417020140 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #import #include "WOSimpleHTTPParser.h" #include "WOHttpAdaptor/WORecordRequestStream.h" @interface WOHTTPConnection(Privates) - (BOOL)_connect; - (void)_disconnect; @end @interface WOCookie(Privates) + (id)cookieWithString:(NSString *)_string; @end NSString *WOHTTPConnectionCanReadResponse = @"WOHTTPConnectionCanReadResponse"; @interface NSURL(SocketAddress) - (id)socketAddressForURL; - (BOOL)shouldUseWOProxyServer; @end @interface WOHTTPConnection(Privates2) + (NSString *)proxyServer; + (NSURL *)proxyServerURL; + (NSArray *)noProxySuffixes; @end @implementation WOHTTPConnection static Class SSLSocketClass = Nil; static BOOL useSimpleParser = YES; static NSString *proxyServer = nil; static NSArray *noProxy = nil; static BOOL doDebug = NO; static BOOL logStream = NO; + (void)initialize { NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; static BOOL didInit = NO; if (didInit) return; didInit = YES; useSimpleParser = [ud boolForKey:@"WOHTTPConnectionUseSimpleParser"]; proxyServer = [ud stringForKey:@"WOProxyServer"]; noProxy = [ud arrayForKey:@"WONoProxySuffixes"]; doDebug = [ud boolForKey:@"WODebugHTTPConnection"]; logStream = [ud boolForKey:@"WODebugHTTPConnectionLogStream"]; } + (NSString *)proxyServer { return proxyServer; } + (NSURL *)proxyServerURL { NSString *ps; ps = [self proxyServer]; if ([ps length] == 0) return nil; return [NSURL URLWithString:ps]; } + (NSArray *)noProxySuffixes { return noProxy; } - (id)initWithNSURL:(NSURL *)_url { if ((self = [super init])) { self->url = [_url retain]; self->useSSL = [[_url scheme] isEqualToString:@"https"]; self->useProxy = [_url shouldUseWOProxyServer]; if (self->useSSL) { static BOOL didCheck = NO; if (!didCheck) { didCheck = YES; SSLSocketClass = NSClassFromString(@"NGActiveSSLSocket"); } } } return self; } - (id)initWithURL:(id)_url { NSURL *lurl; /* create an NSURL object if necessary */ lurl = [_url isKindOfClass:[NSURL class]] ? _url : [NSURL URLWithString:[_url stringValue]]; if (lurl == nil) { if (doDebug) [self logWithFormat:@"could not construct URL from object '%@' !", _url]; [self release]; return nil; } if (doDebug) [self logWithFormat:@"init with URL: %@", lurl]; return [self initWithNSURL:lurl]; } - (id)initWithHost:(NSString *)_hostName onPort:(unsigned int)_port secure:(BOOL)_flag { NSString *s; s = [NSString stringWithFormat:@"http%s://%@:%i/", _flag ? "s" : "", _hostName, _port == 0 ? (_flag?443:80) : _port]; return [self initWithURL:s]; } - (id)initWithHost:(NSString *)_hostName onPort:(unsigned int)_port { return [self initWithHost:_hostName onPort:_port secure:NO]; } - (id)init { return [self initWithHost:@"localhost" onPort:80 secure:NO]; } - (void)dealloc { [self->lastException release]; [self->log release]; [self->io release]; [self->socket release]; [self->url release]; [super dealloc]; } /* error handling */ - (NSException *)lastException { return self->lastException; } - (BOOL)isDebuggingEnabled { return doDebug ? YES : NO; } - (NSString *)loggingPrefix { /* improve perf ... */ if (self->url) { return [NSString stringWithFormat:@"WOHTTP[0x%p]<%@>", self, [self->url absoluteString]]; } else return [NSString stringWithFormat:@"WOHTTP[0x%p]", self]; } /* accessors */ - (NSString *)hostName { return [self->url host]; } /* IO */ - (BOOL)_connect { id address; [self _disconnect]; #if DEBUG NSAssert(self->socket == nil, @"socket still available after disconnect"); NSAssert(self->io == nil, @"IO stream still available after disconnect"); #endif if (self->useSSL) { if (SSLSocketClass == Nil) { /* no SSL support is available */ static BOOL didLog = NO; if (!didLog) { didLog = YES; NSLog(@"NOTE: SSL support is not available !"); } return NO; } } if (self->useProxy) { NSURL *purl; purl = [[self class] proxyServerURL]; address = [purl socketAddressForURL]; } else { address = [self->url socketAddressForURL]; } if (address == nil) { [self debugWithFormat:@"got no address for connect .."]; return NO; } NS_DURING { self->socket = self->useSSL ? [SSLSocketClass socketConnectedToAddress:address] : [NGActiveSocket socketConnectedToAddress:address]; } NS_HANDLER { #if 0 fprintf(stderr, "couldn't create socket: %s\n", [[localException description] cString]); #endif ASSIGN(self->lastException, localException); self->socket = nil; } NS_ENDHANDLER; if (self->socket == nil) { [self debugWithFormat:@"socket is not setup: %@", [self lastException]]; return NO; } if (![self->socket isConnected]) { self->socket = nil; [self debugWithFormat:@"socket is not connected .."]; return NO; } self->socket = [self->socket retain]; [(NGActiveSocket *)self->socket setSendTimeout:[self sendTimeout]]; [(NGActiveSocket *)self->socket setReceiveTimeout:[self receiveTimeout]]; if (self->socket != nil) { NGBufferedStream *bStr; bStr = [NGBufferedStream alloc]; // keep gcc happy bStr = [bStr initWithSource:self->socket]; if (logStream) { self->log = [WORecordRequestStream alloc]; // keep gcc happy self->log = [(WORecordRequestStream *)self->log initWithSource:bStr]; } else self->log = nil; self->io = [NGCTextStream alloc]; // keep gcc happy self->io = [self->io initWithSource: (id)(self->log != nil ? self->log : (id)bStr)]; [bStr release]; bStr = nil; } return YES; } - (void)_disconnect { [self->log release]; self->log = nil; [self->io release]; self->io = nil; NS_DURING (void)[self->socket shutdown]; NS_HANDLER {} NS_ENDHANDLER; [self->socket release]; self->socket = nil; } /* logging IO */ - (void)logRequest:(WORequest *)_response data:(NSData *)_data { if (_data == nil) return; #if 1 NSLog(@"request is\n"); fflush(stderr); fwrite([_data bytes], 1, [_data length], stderr); fflush(stderr); fprintf(stderr,"\n"); fflush(stderr); #endif } - (void)logResponse:(WOResponse *)_response data:(NSData *)_data { if (_data == nil) return; #if 1 NSLog(@"response is\n"); fflush(stderr); fwrite([_data bytes], 1, [_data length], stderr); fflush(stderr); fprintf(stderr,"\n"); fflush(stderr); #endif } /* sending/receiving HTTP */ - (BOOL)sendRequest:(WORequest *)_request { NSData *content; BOOL isok = YES; if (doDebug) [self debugWithFormat:@"send request: %@", _request]; if (![self->socket isConnected]) { if (![self _connect]) { /* could not connect */ if (doDebug) [self debugWithFormat:@" could not connect socket"]; return NO; } /* now connected */ } content = [_request content]; /* write request line (eg 'GET / HTTP/1.0') */ if (doDebug) [self debugWithFormat:@" method: %@", [_request method]]; if (isok) isok = [self->io writeString:[_request method]]; if (isok) isok = [self->io writeString:@" "]; if (self->useProxy) { if (isok) // TODO: check whether this produces a '//' (may need to strip uri) isok = [self->io writeString:[self->url absoluteString]]; [self debugWithFormat:@" wrote proxy start ..."]; } if (isok) isok = [self->io writeString:[_request uri]]; if (isok) isok = [self->io writeString:@" "]; if (isok) isok = [self->io writeString:[_request httpVersion]]; if (isok) isok = [self->io writeString:@"\r\n"]; /* set content-length header */ if ([content length] > 0) { [_request setHeader:[NSString stringWithFormat:@"%d", [content length]] forKey:@"content-length"]; } if ([[self->url scheme] hasPrefix:@"http"]) { /* host header */ if (isok) isok = [self->io writeString:@"Host: "]; if (isok) isok = [self->io writeString:[self hostName]]; if (isok) isok = [self->io writeString:@"\r\n"]; [self debugWithFormat:@" wrote host header: %@", [self hostName]]; } /* write request headers */ if (isok) { NSEnumerator *fields; NSString *fieldName; int cnt; fields = [[_request headerKeys] objectEnumerator]; cnt = 0; while (isok && (fieldName = [fields nextObject])) { NSEnumerator *values; id value; if ([fieldName length] == 4) { if ([fieldName isEqualToString:@"host"]) /* did already write host ... */ continue; if ([fieldName isEqualToString:@"Host"]) /* did already write host ... */ continue; } values = [[_request headersForKey:fieldName] objectEnumerator]; while ((value = [values nextObject]) && isok) { if (isok) isok = [self->io writeString:fieldName]; if (isok) isok = [self->io writeString:@": "]; if (isok) isok = [self->io writeString:value]; if (isok) isok = [self->io writeString:@"\r\n"]; cnt++; } } [self debugWithFormat:@" wrote %i request headers ...", cnt]; } /* write some required headers */ if ([_request headerForKey:@"accept"] == nil) { if (isok) isok = [self->io writeString:@"Accept: */*\r\n"]; [self debugWithFormat:@" wrote accept header ..."]; } if ([_request headerForKey:@"user-agent"] == nil) { if (isok) { static NSString *s = nil; if (s == nil) { s = [[NSString alloc] initWithFormat:@"User-Agent: SOPE/%i.%i.%i\r\n", SOPE_MAJOR_VERSION, SOPE_MINOR_VERSION, SOPE_SUBMINOR_VERSION]; } isok = [self->io writeString:s]; } [self debugWithFormat:@" wrote user-agent header ..."]; } /* write cookie headers */ if ([[_request cookies] count] > 0 && isok) { NSEnumerator *cookies; WOCookie *cookie; BOOL isFirst; int cnt; [self->io writeString:@"set-cookie: "]; cnt = 0; cookies = [[_request cookies] objectEnumerator]; isFirst = YES; while (isok && (cookie = [cookies nextObject])) { if (isFirst) isFirst = NO; else if (isok) isok = [self->io writeString:@"; "]; if (isok) isok = [self->io writeString:[cookie stringValue]]; cnt ++; } if (isok) isok = [self->io writeString:@"\r\n"]; [self debugWithFormat:@" wrote %i cookies ...", cnt]; } /* flush request header on socket */ if (isok) isok = [self->io writeString:@"\r\n"]; if (isok) isok = [self->io flush]; [self debugWithFormat:@" flushed HTTP header."]; /* write content */ if ([content length] > 0) { [self debugWithFormat:@" writing HTTP entity (length=%i).", [content length]]; if ([content isKindOfClass:[NSString class]]) { if (isok) isok = [self->io writeString:(NSString *)content]; } else if ([content isKindOfClass:[NSData class]]) { if (isok) isok = [[self->io source] safeWriteBytes:[content bytes] count:[content length]]; } else { if (isok) isok = [self->io writeString:[content description]]; } if (isok) isok = [self->io flush]; } else if (doDebug) { [self debugWithFormat:@" no HTTP entity to write ..."]; } if (logStream) [self logRequest:_request data:[self->log writeLog]]; [self->log resetWriteLog]; [self debugWithFormat:@"=> finished:\n url: %@\n sock: %@", self->url, self->socket]; if (!isok) { ASSIGN(self->lastException, [self->socket lastException]); [self->socket shutdown]; return NO; } if (![self->socket isConnected]) return NO; return YES; } - (NSException *)handleResponseParsingError:(NSException *)_exception { fprintf(stderr, "%s: caught: %s\n", __PRETTY_FUNCTION__, [[_exception description] cString]); return nil; } - (WOResponse *)readResponse { /* TODO: split up method */ WOResponse *response; *(&response) = nil; if (self->socket == nil) { [self debugWithFormat:@"no socket available for reading response ..."]; return nil; } [self debugWithFormat:@"parsing response from socket: %@", self->socket]; if (useSimpleParser) { WOSimpleHTTPParser *parser; [self debugWithFormat:@" using simple HTTP parser ..."]; parser = [[WOSimpleHTTPParser alloc] initWithStream:[self->io source]]; if (parser == nil) return nil; parser = [parser autorelease]; if ((response = [parser parseResponse]) == nil) { if (doDebug) [self debugWithFormat:@"parsing failed: %@", [parser lastException]]; } } else { NGHttpMessageParser *parser; NGHttpResponse *mresponse; NGMimeType *ctype; id body; *(&mresponse) = nil; if ((parser = [[[NGHttpMessageParser alloc] init] autorelease]) == nil) return nil; [self debugWithFormat:@" using MIME HTTP parser (complex parser) ..."]; NS_DURING { [parser setDelegate:self]; mresponse = [parser parseResponseFromStream:self->socket]; } NS_HANDLER [[self handleResponseParsingError:localException] raise]; NS_ENDHANDLER; [self debugWithFormat:@"finished parsing response: %@", mresponse]; /* transform parsed MIME response to WOResponse */ body = [mresponse body]; if (body == nil) body = [NSData data]; response = [[[WOResponse alloc] init] autorelease]; [response setHTTPVersion:[mresponse httpVersion]]; [response setStatus:[mresponse statusCode]]; [response setUserInfo:[NSDictionary dictionaryWithObjectsAndKeys: self, @"NGHTTPConnection", mresponse, @"NGMimeResponse", body, @"NGMimeBody", nil]]; { /* check content-type */ id value; value = [[mresponse valuesOfHeaderFieldWithName:@"content-type"] nextObject]; if (value) { NSString *charset; ctype = [NGMimeType mimeType:[value stringValue]]; charset = [[ctype valueOfParameter:@"charset"] lowercaseString]; if ([charset length] == 0) { /* autodetect charset ... */ if ([[ctype type] isEqualToString:@"text"]) { if ([[ctype subType] isEqualToString:@"xml"]) { /* default XML encoding is UTF-8 */ [response setContentEncoding:NSUTF8StringEncoding]; } } } else { NSStringEncoding enc; enc = [NGMimeType stringEncodingForCharset:charset]; [response setContentEncoding:enc]; } [response setHeader:[ctype stringValue] forKey:@"content-type"]; } else { ctype = [NGMimeType mimeType:@"application/octet-stream"]; } } /* check content */ if ([body isKindOfClass:[NSData class]]) { [response setContent:body]; } else if ([body isKindOfClass:[NSString class]]) { NSData *data; data = [body dataUsingEncoding:[response contentEncoding]]; if (data) [response setContent:data]; } else if (body) { /* generate data from structured body .. */ NGMimeBodyGenerator *gen; NSData *data; gen = [[[NGMimeBodyGenerator alloc] init] autorelease]; data = [gen generateBodyOfPart:body additionalHeaders:nil delegate:self]; [response setContent:data]; } { /* transfer headers */ NSEnumerator *names; NSString *name; names = [mresponse headerFieldNames]; while ((name = [names nextObject])) { NSEnumerator *values; id value; if ([name isEqualToString:@"content-type"]) continue; if ([name isEqualToString:@"set-cookie"]) continue; values = [mresponse valuesOfHeaderFieldWithName:name]; while ((value = [values nextObject])) { value = [value stringValue]; [response appendHeader:value forKey:name]; } } } { /* transfer cookies */ NSEnumerator *cookies; NGHttpCookie *mcookie; cookies = [mresponse valuesOfHeaderFieldWithName:@"set-cookie"]; while ((mcookie = [cookies nextObject])) { WOCookie *woCookie; if (![mcookie isKindOfClass:[NGHttpCookie class]]) { /* parse cookie */ woCookie = [WOCookie cookieWithString:[mcookie stringValue]]; } else { woCookie = [WOCookie cookieWithName:[mcookie cookieName] value:[mcookie value] path:[mcookie path] domain:[mcookie domainName] expires:[mcookie expireDate] isSecure:[mcookie needsSecureChannel]]; } if (woCookie == nil) { [self logWithFormat: @"Couldn't create WOCookie from NGHttp cookie: %@", mcookie]; // could not create cookie continue; } [self debugWithFormat:@"adding cookie: %@", woCookie]; [response addCookie:woCookie]; } } } if (logStream) [self logResponse:response data:[self->log readLog]]; [self->log resetReadLog]; if (doDebug) [self debugWithFormat:@"processed response: %@", response]; /* check keep-alive */ { NSString *conn; conn = [response headerForKey:@"connection"]; conn = [conn lowercaseString]; if ([conn isEqualToString:@"close"]) { [self setKeepAliveEnabled:NO]; [self _disconnect]; } else if ([conn isEqualToString:@"keep-alive"]) { [self setKeepAliveEnabled:YES]; } else { [self setKeepAliveEnabled:NO]; [self _disconnect]; } } return response; } - (void)setKeepAliveEnabled:(BOOL)_flag { self->keepAlive = _flag; } - (BOOL)keepAliveEnabled { return self->keepAlive; } /* timeouts */ - (void)setConnectTimeout:(int)_seconds { self->connectTimeout = _seconds; } - (int)connectTimeout { return self->connectTimeout; } - (void)setReceiveTimeout:(int)_seconds { self->receiveTimeout = _seconds; } - (int)receiveTimeout { return self->receiveTimeout; } - (void)setSendTimeout:(int)_seconds { self->sendTimeout = _seconds; } - (int)sendTimeout { return self->sendTimeout; } /* description */ - (NSString *)description { NSMutableString *str; str = [NSMutableString stringWithCapacity:128]; [str appendFormat:@"<%@[0x%p]:", NSStringFromClass([self class]), self]; if (self->url) [str appendFormat:@" url=%@", self->url]; if (self->useProxy) [str appendString:@" proxy"]; if (self->useSSL) [str appendString:@" SSL"]; if (self->socket) [str appendFormat:@" socket=%@", self->socket]; [str appendString:@">"]; return str; } @end /* WOHTTPConnection */ @implementation NSURL(SocketAddress) - (id)socketAddressForURL { NSString *s; s = [self scheme]; if ([s isEqualToString:@"http"]) { int p; s = [self host]; if ([s length] == 0) s = @"localhost"; p = [[self port] intValue]; return [NGInternetSocketAddress addressWithPort:p == 0 ? 80 : p onHost:s]; } else if ([s isEqualToString:@"https"]) { int p; s = [self host]; if ([s length] == 0) s = @"localhost"; p = [[self port] intValue]; return [NGInternetSocketAddress addressWithPort:p == 0 ? 443 : p onHost:s]; } else if ([s isEqualToString:@"unix"] || [s isEqualToString:@"file"]) { return [NGLocalSocketAddress addressWithPath:[self path]]; } return nil; } - (BOOL)shouldUseWOProxyServer { if ([[self scheme] hasPrefix:@"http"]) { NSString *h; if ((h = [self host]) == nil) return NO; if ([h isEqualToString:@"127.0.0.1"]) return NO; if ([h isEqualToString:@"localhost"]) return NO; if ([[WOHTTPConnection proxyServer] length] > 0) { NSEnumerator *e; NSString *suffix; BOOL useProxy; useProxy = YES; e = [[WOHTTPConnection noProxySuffixes] objectEnumerator]; while ((suffix = [e nextObject])) { if ([h hasSuffix:suffix]) { useProxy = NO; break; } } return useProxy; } } return NO; } @end /* NSURL(SocketAddress) */ SOPE/sope-appserver/NGObjWeb/WOComponentRequestHandler.h0000644000000000000000000000200512242733417022124 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGObjWeb_WOComponentRequestHandler_H__ #define __NGObjWeb_WOComponentRequestHandler_H__ #include @interface WOComponentRequestHandler : WORequestHandler @end #endif /* __NGObjWeb_WORequestHandler_H__ */ SOPE/sope-appserver/NGObjWeb/COPYRIGHT0000644000000000000000000000010612242733417016167 0ustar rootrootCopyright (C) 2000-2005 SKYRIX Software AG Contact: info@skyrix.com SOPE/sope-appserver/NGObjWeb/WOComponent+JS.m0000644000000000000000000000424612242733417017603 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "common.h" #include /* WOComponent JavaScript object Properties String sessionID String name String path String baseURL Object context Object session Object application WOComponent parent bool hasSession bool cachingEnabled bool isEventLoggingEnabled bool isStateless bool synchronizesVariablesWithBindings Methods reset() WOComponent pageWithName(name) WOElement templateWithName(name) Object performParentAction(name) bool canGetValueForBinding(name) bool canSetValueForBinding(name) setValueForBinding(value,name) Object valueForBinding(name) bool hasBinding(name) print(string[,...string]) ResourceManager getResourceManager() */ static NSNumber *nYes = nil; static NSNumber *nNo = nil; #define ENSURE_BOOLNUMS {\ if (nYes == nil) nYes = [[NSNumber alloc] initWithBool:YES];\ if (nNo == nil) nNo = [[NSNumber alloc] initWithBool:NO];\ } @implementation WOComponent(JSKVC) #if 1 - (void)takeValue:(id)_value forJSPropertyNamed:(NSString *)_key { [self takeValue:_value forKey:_key]; } - (id)valueForJSPropertyNamed:(NSString *)_key { return [self valueForKey:_key]; } #endif @end /* WOComponent(JSKVC) */ SOPE/sope-appserver/NGObjWeb/WOResourceManager.m0000644000000000000000000010316412242733417020412 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include "WOComponent+private.h" #include #include #include "common.h" #import #include "_WOStringTable.h" /* Component Discovery and Page Creation All WO code uses either directly or indirectly the WOResourceManager's -pageWithName:languages: method to instantiate WO components. This methods works in three steps: 1. discovery of files associated with the component 2. creation of a proper WOComponentDefinition, which is some kind of 'blueprint' or 'class' for components 3. component instantiation using the definition All the instantiation/setup work is done by a component definition, the resource manager is only responsible for managing those 'blueprint' resources. If you want to customize component creation, you can supply your own WOComponentDefinition in a subclass of WOResourceManager by overriding: - (WOComponentDefinition *)definitionForComponent:(id)_name inFramework:(NSString *)_frameworkName languages:(NSArray *)_languages */ /* Note: this was #if !COMPILE_FOR_GSTEP_MAKE - but there is no difference between Xcode and gstep-make?! The only possible difference might be that .wo wrappers are directly in the bundle/framework root - but this doesn't relate to Resources. OK, this breaks gstep-make based template lookup which places .wo wrappers in .woa/Resources/xxx.wo. This is an issue because .wox are looked up in Contents/Resources but .wo ones in just Resources. This issue should be fixed in recent woapp-gs.make ... Update: since for SOPE 4.3 we only work with gstep-make 1.10, this seems to be fixed? */ #if COCOA_Foundation_LIBRARY || NeXT_Foundation_LIBRARY # define RSRCDIR_CONTENTS 1 #endif @implementation WOResourceManager static Class UrlClass = Nil; static NSString *resourcePrefix = @""; static NSString *rapidTurnAroundPath = nil; static NSString *suffix = nil; static NSNull *null = nil; static BOOL debugOn = NO; static BOOL debugComponentLookup = NO; static BOOL debugResourceLookup = NO; static BOOL genMissingResourceLinks = NO; + (void)initialize { NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; static BOOL isInitialized = NO; NSDictionary *defs; if (isInitialized) return; isInitialized = YES; null = [[NSNull null] retain]; UrlClass = [NSURL class]; defs = [NSDictionary dictionaryWithObjectsAndKeys: [NSArray arrayWithObject:@"wo"], @"WOComponentExtensions", nil]; [ud registerDefaults:defs]; debugOn = [WOApplication isDebuggingEnabled]; debugComponentLookup = [ud boolForKey:@"WODebugComponentLookup"]; debugResourceLookup = [ud boolForKey:@"WODebugResourceLookup"]; genMissingResourceLinks = [ud boolForKey:@"WOGenerateMissingResourceLinks"]; rapidTurnAroundPath = [[ud stringForKey:@"WOProjectDirectory"] copy]; suffix = [[ud stringForKey:@"WOApplicationSuffix"] copy]; } static inline BOOL _pathExists(WOResourceManager *self, NSFileManager *fm, NSString *path) { BOOL doesExist; if (self->existingPathes && (path != nil)) { int i; i = (int)(long)NSMapGet(self->existingPathes, path); if (i == 0) { doesExist = [fm fileExistsAtPath:path]; NSMapInsert(self->existingPathes, path, (void *)(doesExist ? 1L : 0xFFL)); } else doesExist = i == 1 ? YES : NO; } else doesExist = [fm fileExistsAtPath:path]; return doesExist; } + (void)setResourcePrefix:(NSString *)_prefix { [resourcePrefix autorelease]; resourcePrefix = [_prefix copy]; } - (id)initWithPath:(NSString *)_path { #if __APPLE__ if ([_path length] == 0) { [self errorWithFormat:@"(%s): missing path!", __PRETTY_FUNCTION__]; /* this doesn't work with subclasses which do not require a path ... */ #if 0 [self release]; return nil; #endif } #endif if ((self = [super init])) { NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; NSString *rprefix = nil; NSString *tmp; self->componentDefinitions = NSCreateMapTable(NSObjectMapKeyCallBacks, NSObjectMapValueCallBacks, 128); self->stringTables = NSCreateMapTable(NSObjectMapKeyCallBacks, NSObjectMapValueCallBacks, 16); tmp = [_path stringByStandardizingPath]; if (tmp) _path = tmp; self->base = [_path copy]; if ([WOApplication isCachingEnabled]) { self->existingPathes = NSCreateMapTable(NSObjectMapKeyCallBacks, NSIntMapValueCallBacks, 256); } rprefix = [ud stringForKey:@"WOResourcePrefix"]; if (rprefix) [[self class] setResourcePrefix:rprefix]; } return self; } - (id)init { return [self initWithPath:[[NGBundle mainBundle] bundlePath]]; } - (void)dealloc { if (self->existingPathes) NSFreeMapTable(self->existingPathes); if (self->stringTables) NSFreeMapTable(self->stringTables); if (self->componentDefinitions) NSFreeMapTable(self->componentDefinitions); if (self->keyedResources) NSFreeMapTable(self->keyedResources); [self->w3resources release]; [self->resources release]; [self->base release]; [super dealloc]; } /* debugging */ - (BOOL)isDebuggingEnabled { return debugOn; } - (NSString *)loggingPrefix { char buf[32]; sprintf(buf, "[wo-rm-0x%p]", self); return [NSString stringWithCString:buf]; } /* path methods */ - (NSFileManager *)fileManager { static NSFileManager *fm = nil; if (fm == nil) fm = [[NSFileManager defaultManager] retain]; return fm; } - (NSString *)basePath { return self->base; } - (NSString *)resourcesPath { NSFileManager *fm; if (self->resources) return self->resources; fm = [self fileManager]; if ([self->base length] > 0) { if (![fm fileExistsAtPath:self->base]) { [self warnWithFormat:@"(%s): Resources base path '%@' does not exist !", __PRETTY_FUNCTION__, self->base]; return nil; } } #if RSRCDIR_CONTENTS if ([rapidTurnAroundPath length] > 0) { /* In rapid turnaround mode, first check for a Resources subdir in the project directory, then directly in the project dir. Note: you cannot have both! Either put stuff in a Resources subdir *or* in the project dir. */ NSString *tmp; BOOL isDir; tmp = [rapidTurnAroundPath stringByAppendingPathComponent:@"Resources"]; if (![fm fileExistsAtPath:tmp isDirectory:&isDir]) isDir = NO; if (!isDir) tmp = rapidTurnAroundPath; self->resources = [tmp copy]; } else { self->resources = [[[self->base stringByAppendingPathComponent:@"Contents"] stringByAppendingPathComponent:@"Resources"] copy]; } #else self->resources = [[self->base stringByAppendingPathComponent:@"Resources"] copy]; #endif if ([self->resources length] > 0) { if (![fm fileExistsAtPath:self->resources]) { [self warnWithFormat: @"(%s): Resources path %@ does not exist !", __PRETTY_FUNCTION__, self->resources]; [self->resources release]; self->resources = nil; } else if (self->existingPathes && (self->resources != nil)) NSMapInsert(self->existingPathes, self->resources, (void*)1); } return self->resources; } - (NSString *)resourcesPathForFramework:(NSString *)_fw { if (_fw == nil || (_fw == rapidTurnAroundPath)) return [self resourcesPath]; #if RSRCDIR_CONTENTS return [[_fw stringByAppendingPathComponent:@"Contents"] stringByAppendingPathComponent:@"Resources"]; #else return [_fw stringByAppendingPathComponent:@"Resources"]; #endif } - (NSString *)webServerResourcesPath { NSFileManager *fm; if (self->w3resources) return self->w3resources; #if GNUSTEP_BASE_LIBRARY && 0 self->w3resources = [[self->base stringByAppendingPathComponent:@"Resources/WebServer"] copy]; #else self->w3resources = [[self->base stringByAppendingPathComponent:@"WebServerResources"] copy]; #endif fm = [self fileManager]; if ([self->w3resources length] == 0) return nil; if (![fm fileExistsAtPath:self->w3resources]) { static BOOL didLog = NO; if (!didLog) { didLog = YES; [self warnWithFormat: @"(%s): WebServerResources path '%@' does not exist !", __PRETTY_FUNCTION__, self->w3resources]; } [self->w3resources release]; self->w3resources = nil; } else if (self->existingPathes && (self->w3resources != nil)) NSMapInsert(self->existingPathes, self->w3resources, (void*)1); if (debugResourceLookup) [self logWithFormat:@"WebServerResources: '%@'", self->w3resources]; return self->w3resources; } - (NSString *)pathForResourceNamed:(NSString *)_name inFramework:(NSString *)_frameworkName languages:(NSArray *)_languages { NSFileManager *fm; NSString *resource = nil; unsigned langCount; NSString *w3rp, *rp; if (debugResourceLookup) { [self logWithFormat:@"lookup '%@' bundle=%@ languages=%@", _name, _frameworkName, [_languages componentsJoinedByString:@","]]; } fm = [self fileManager]; langCount = [_languages count]; if ((w3rp = [self webServerResourcesPath]) != nil) { NSString *langPath = nil; unsigned i; if (debugResourceLookup) [self logWithFormat:@" WebServerResources: %@", w3rp]; // first check Language.lproj in WebServerResources for (i = 0; i < langCount; i++) { langPath = [_languages objectAtIndex:i]; langPath = [langPath stringByAppendingPathExtension:@"lproj"]; langPath = [w3rp stringByAppendingPathComponent:langPath]; if (!_pathExists(self, fm, langPath)) { if (debugResourceLookup) { [self logWithFormat: @" no language project for '%@' in WebServerResources: %@", [_languages objectAtIndex:i], langPath]; } continue; } resource = [langPath stringByAppendingPathComponent:_name]; if (debugResourceLookup) [self logWithFormat:@" check in WebServerResources: %@", resource]; if (_pathExists(self, fm, resource)) return resource; } /* next check in WebServerResources itself */ resource = [w3rp stringByAppendingPathComponent:_name]; if (debugResourceLookup) [self logWithFormat:@" check in WebServerResources-flat: %@", resource]; if (_pathExists(self, fm, resource)) return resource; } if ((rp = [self resourcesPathForFramework:_frameworkName])) { NSString *langPath = nil; unsigned i; if (debugResourceLookup) [self logWithFormat:@" path %@", rp]; // first check Language.lproj in Resources for (i = 0; i < langCount; i++) { langPath = [_languages objectAtIndex:i]; langPath = [langPath stringByAppendingPathExtension:@"lproj"]; langPath = [rp stringByAppendingPathComponent:langPath]; if (_pathExists(self, fm, langPath)) { resource = [langPath stringByAppendingPathComponent:_name]; if (debugResourceLookup) [self logWithFormat:@" check in Resources: %@", resource]; if (_pathExists(self, fm, resource)) return resource; } } // next check in Resources itself resource = [rp stringByAppendingPathComponent:_name]; if (debugResourceLookup) [self logWithFormat:@" check in Resources-flat: %@", resource]; if (_pathExists(self, fm, resource)) { if (debugResourceLookup) [self logWithFormat:@" found => %@", resource]; return resource; } } /* and last check in the application directory */ if (_pathExists(self, fm, self->base)) { resource = [self->base stringByAppendingPathComponent:_name]; if (_pathExists(self, fm, resource)) return resource; } return nil; } - (NSString *)pathForResourceNamed:(NSString *)_name { IS_DEPRECATED; return [self pathForResourceNamed:_name inFramework:nil languages:nil]; } - (NSString *)pathForResourceNamed:(NSString *)_name ofType:(NSString *)_type { _name = [_name stringByAppendingPathExtension:_type]; return [self pathForResourceNamed:_name]; } /* URL methods */ - (NSString *)_urlForMissingResource:(NSString *)_name request:(WORequest *)_r{ WOApplication *app; app = [WOApplication application]; if (!genMissingResourceLinks) return nil; return [NSString stringWithFormat: @"/missingresource?name=%@&application=%@", _name, app ? [app name] : [_r applicationName]]; } - (NSString *)urlForResourceNamed:(NSString *)_name inFramework:(NSString *)_frameworkName languages:(NSArray *)_languages request:(WORequest *)_request { WOApplication *app; NSMutableString *url; NSString *resource = nil, *tmp; NSString *path = nil, *sbase; unsigned len; app = [WOApplication application]; if (_languages == nil) _languages = [_request browserLanguages]; resource = [self pathForResourceNamed:_name inFramework:_frameworkName languages:_languages]; #if RSRCDIR_CONTENTS if ([resource rangeOfString:@"/Contents/"].length > 0) { resource = [resource stringByReplacingString:@"/Contents" withString:@""]; } #endif #if 0 tmp = [resource stringByStandardizingPath]; if (tmp != nil) resource = tmp; #endif if (resource == nil) { if (debugResourceLookup) [self logWithFormat:@"did not find resource (cannot build URL)"]; return [self _urlForMissingResource:_name request:_request]; } sbase = self->base; tmp = [sbase commonPrefixWithString:resource options:0]; len = [tmp length]; path = [sbase substringFromIndex:len]; tmp = [resource substringFromIndex:len]; if (([path length] > 0) && ![tmp hasPrefix:@"/"] && ![tmp hasPrefix:@"\\"]) path = [path stringByAppendingString:@"/"]; path = [path stringByAppendingString:tmp]; #ifdef __WIN32__ { NSArray *cs; cs = [path componentsSeparatedByString:@"\\"]; path = [cs componentsJoinedByString:@"/"]; } #endif if (path == nil) return [self _urlForMissingResource:_name request:_request]; url = [[NSMutableString alloc] initWithCapacity:256]; #if 0 [url appendString:[_request adaptorPrefix]]; #endif if (resourcePrefix) [url appendString:resourcePrefix]; if (![url hasSuffix:@"/"]) [url appendString:@"/"]; [url appendString:app ? [app name] : [_request applicationName]]; [url appendString:suffix]; if (![path hasPrefix:@"/"]) [url appendString:@"/"]; [url appendString:path]; path = [url copy]; [url release]; return [path autorelease]; } - (NSString *)urlForResourceNamed:(NSString *)_name { IS_DEPRECATED; return [self urlForResourceNamed:_name inFramework:nil languages:nil request:nil]; } - (NSString *)urlForResourceNamed:(NSString *)_name ofType:(NSString *)_type { return [self urlForResourceNamed: [_name stringByAppendingPathExtension:_type]]; } /* string tables */ - (id)stringTableWithName:(NSString *)_tableName inFramework:(NSString *)_framework languages:(NSArray *)_languages { /* side effect: tables are cached (currently not affected by default!) */ NSFileManager *fm; _WOStringTable *table = nil; NSString *path = nil; fm = [self fileManager]; if (_tableName == nil) _tableName = @"Localizable"; /* take a look whether a matching table is already loaded */ path = [_tableName stringByAppendingPathExtension:@"strings"]; path = [self pathForResourceNamed:path inFramework:_framework languages:_languages]; if (path == nil) return nil; if ((table = NSMapGet(self->stringTables, path)) == NULL) { if ([fm fileExistsAtPath:path]) { table = [_WOStringTable allocWithZone:[self zone]]; /* for gcc */ table = [table initWithPath:path]; NSMapInsert(self->stringTables, path, table); [table release]; } } return table; } - (NSString *)stringForKey:(NSString *)_key inTableNamed:(NSString *)_tableName withDefaultValue:(NSString *)_defaultValue inFramework:(NSString *)_framework languages:(NSArray *)_languages { _WOStringTable *table = nil; table = [self stringTableWithName:_tableName inFramework:_framework languages:_languages]; return (table != nil) ? [table stringForKey:_key withDefaultValue:_defaultValue] : _defaultValue; } - (NSString *)stringForKey:(NSString *)_key inTableNamed:(NSString *)_tableName withDefaultValue:(NSString *)_default languages:(NSArray *)_languages { return [self stringForKey:_key inTableNamed:_tableName withDefaultValue:_default inFramework:nil languages:_languages]; } /* NSLocking */ - (void)lock { } - (void)unlock { } /* component definitions */ - (NSString *)pathToComponentNamed:(NSString *)_name inFramework:(NSString *)_framework { /* search for component wrapper .. */ // TODO: shouldn't we used that for WOx as well? NSEnumerator *e; NSString *ext; if (_name == nil) { #if DEBUG [self warnWithFormat: @"(%s): tried to get path to component with name !", __PRETTY_FUNCTION__]; #endif return nil; } /* scan for name.$ext resource ... */ e = [[[NSUserDefaults standardUserDefaults] arrayForKey:@"WOComponentExtensions"] objectEnumerator]; while ((ext = [e nextObject])) { NSString *specName; NSString *path; specName = [_name stringByAppendingPathExtension:ext]; path = [self pathForResourceNamed:specName inFramework:_framework languages:nil]; if (path) return path; } return nil; } - (NSString *)pathToComponentNamed:(NSString *)_name inFramework:(NSString *)_framework languages:(NSArray *)_langs { return [self pathToComponentNamed:_name inFramework:_framework]; } - (WOComponentDefinition *)_definitionForPathlessComponent:(NSString *)_name languages:(NSArray *)_languages { /* definition factory */ WOComponentDefinition *cdef; cdef = [[WOComponentDefinition allocWithZone:[self zone]] initWithName:_name path:nil baseURL:nil frameworkName:nil]; return [cdef autorelease]; } - (WOComponentDefinition *)_definitionWithName:(NSString *)_name url:(NSURL *)_url baseURL:(NSURL *)_baseURL frameworkName:(NSString *)_fwname { /* definition factory */ static Class DefClass; id cdef; if (DefClass == Nil) DefClass = [WOComponentDefinition class]; // TODO: is retained response intended? cdef = [[DefClass alloc] initWithName:_name path:[_url path] baseURL:_baseURL frameworkName:_fwname]; return cdef; } - (WOComponentDefinition *)_definitionWithName:(NSString *)_name path:(NSString *)_path baseURL:(NSURL *)_baseURL frameworkName:(NSString *)_fwname { NSURL *url; url = ([_path length] > 0) ? [[[NSURL alloc] initFileURLWithPath:_path] autorelease] : nil; return [self _definitionWithName:_name url:url baseURL:_baseURL frameworkName:_fwname]; } - (WOComponentDefinition *)_cachedDefinitionForComponent:(id)_name languages:(NSArray *)_languages { NSArray *cacheKey; id cdef; if (self->componentDefinitions == NULL) return nil; if (![[WOApplication application] isCachingEnabled]) return nil; cacheKey = [NSArray arrayWithObjects:_name, _languages, nil]; cdef = NSMapGet(self->componentDefinitions, cacheKey); return cdef; } - (WOComponentDefinition *)_cacheDefinition:(id)_cdef forComponent:(id)_name languages:(NSArray *)_languages { NSArray *cacheKey; if (self->componentDefinitions == NULL) return _cdef; if (![[WOApplication application] isCachingEnabled]) return _cdef; cacheKey = [NSArray arrayWithObjects:_name, _languages, nil]; NSMapInsert(self->componentDefinitions, cacheKey, _cdef ? _cdef : (id)null); return _cdef; } - (NSString *)resourceNameForComponentNamed:(NSString *)_name { return [_name stringByAppendingPathExtension:@"wox"]; } /* create component definition */ - (void)_getComponentURL:(NSURL **)url_ andName:(NSString **)name_ forNameOrURL:(id)_nameOrURL inFramework:(NSString *)_framework languages:(NSArray *)_languages { NSString *path; if ([_nameOrURL isKindOfClass:UrlClass]) { // TODO: where is this used currently? It probably was required for forms, // but might not be anymore? *url_ = _nameOrURL; *name_ = [*url_ path]; if (debugComponentLookup) [self debugWithFormat:@"using URL %@ for component %@", *url_, *name_]; return; } /* the _nameOrURL is a string containing the component name */ *name_ = _nameOrURL; if (_framework == nil && _nameOrURL != nil) { Class clazz; /* Note: this is a bit of a hack ..., actually this method should never be called without a framework and pages shouldn't be instantiated without specifying their framework. But for legacy reasons this needs to be done and seems to work without problems. It is required for loading components from bundles. */ if ((_framework = rapidTurnAroundPath) == nil) { if ((clazz = NSClassFromString(_nameOrURL))) _framework = [[NSBundle bundleForClass:clazz] bundlePath]; } } if (debugComponentLookup) { [self logWithFormat:@"component '%@' in framework '%@'", _nameOrURL, _framework]; } /* look for .wox component */ path = [self pathForResourceNamed: [self resourceNameForComponentNamed:*name_] inFramework:_framework languages:_languages]; if (debugComponentLookup) [self logWithFormat:@" .wox path: '%@'", path]; /* look for .wo component */ if ([path length] == 0) { path = [self pathToComponentNamed:*name_ inFramework:_framework languages:_languages]; if (debugComponentLookup) [self logWithFormat:@" .wo path: '%@'", path]; } /* make URL from path */ *url_ = ([path length] > 0) ? [[[UrlClass alloc] initFileURLWithPath:path] autorelease] : nil; } - (WOComponentDefinition *)definitionForFileURL:(NSURL *)componentURL componentName:(NSString *)_name inFramework:(NSString *)_framework languages:(NSArray *)_languages { NSFileManager *fm; NSString *componentPath; BOOL doesCache, isDir; NSEnumerator *languages; NSString *language; NSString *sname = nil; NSURL *appUrl; fm = [self fileManager]; componentPath = [componentURL path]; doesCache = [[WOApplication application] isCachingEnabled]; if (![fm fileExistsAtPath:componentPath isDirectory:&isDir]) { [[WOApplication application] debugWithFormat: @"%s: did not find component '%@' at path '%@' !", __PRETTY_FUNCTION__, _name, componentPath]; return nil; } /* if the component spec is a directory (eg a .wo), scan inside for stuff*/ if (!isDir) return nil; appUrl = [[WOApplication application] baseURL]; languages = [_languages objectEnumerator]; while ((language = [languages nextObject])) { WOComponentDefinition *cdef; NSString *compoundKey = nil; NSString *languagePath = nil; NSString *baseUrl = nil; BOOL isDirectory = NO; if (sname == nil) sname = [_name stringByAppendingString:@"\t"]; compoundKey = [sname stringByAppendingString:language]; if (doesCache) { cdef = NSMapGet(self->componentDefinitions, compoundKey); if (cdef == (id)null) /* resource does not exist */ continue; [cdef touch]; if (cdef != nil) return cdef; // found definition in cache } /* take a look into the file system */ languagePath = [language stringByAppendingPathExtension:@"lproj"]; languagePath = [componentPath stringByAppendingPathComponent:languagePath]; if (![fm fileExistsAtPath:languagePath isDirectory:&isDirectory]) { if (doesCache) { /* register null in cache, so that we know it's non-existent */ NSMapInsert(self->componentDefinitions, compoundKey, null); } continue; } if (!isDirectory) { [self warnWithFormat:@"(%s): language entry %@ is not a directory !", __PRETTY_FUNCTION__, languagePath]; if (doesCache && (compoundKey != nil)) { // register null in cache, so that we know it's non-existent NSMapInsert(self->componentDefinitions, compoundKey, null); } continue; } baseUrl = [NSString stringWithFormat:@"%@/%@.lproj/%@.wo", [appUrl absoluteString], language, _name]; /* found appropriate language project */ cdef = [self _definitionWithName:_name path:languagePath baseURL:[NSURL URLWithString:baseUrl] frameworkName:nil]; if (cdef == nil) { [self warnWithFormat: @"(%s): could not load component definition of " @"'%@' from language project: %@", __PRETTY_FUNCTION__, _name, languagePath]; if (doesCache && (compoundKey != nil)) { // register null in cache, so that we know it's non-existent NSMapInsert(self->componentDefinitions, compoundKey, null); } continue; } if (doesCache && (compoundKey != nil)) { // register in cache NSMapInsert(self->componentDefinitions, compoundKey, cdef); [cdef release]; } else { // don't register in cache cdef = [cdef autorelease]; } return cdef; } return nil; } - (WOComponentDefinition *)definitionForComponent:(id)_name inFramework:(NSString *)_framework languages:(NSArray *)_languages { // TODO: this method is definitely too big! => refacture WOApplication *app; WOComponentDefinition *cdef = nil; NSURL *componentURL; NSURL *appUrl; BOOL doesCache; app = [WOApplication application]; doesCache = [app isCachingEnabled]; /* lookup component path */ // TODO: Explain why _framework and _languages are NOT passed! [self _getComponentURL:&componentURL andName:&_name forNameOrURL:_name inFramework:nil languages:nil]; if (debugComponentLookup) { [self logWithFormat:@" component='%@' in framework='%@': url='%@'", _name, _framework, componentURL]; } appUrl = [app baseURL]; /* check whether it's a 'template-less' component ... */ if (componentURL == nil) { /* did not find component wrapper ! */ [app debugWithFormat:@" component '%@' has no template !", _name]; cdef = [self _definitionForPathlessComponent:_name languages:_languages]; return cdef; } /* ensure that the component exists */ if ([componentURL isFileURL]) { WOComponentDefinition *cdef; cdef = [self definitionForFileURL:componentURL componentName:_name inFramework:_framework languages:_languages]; if (cdef != nil && ![cdef isNotNull]) return nil; else if (cdef != nil) return cdef; } /* look flat */ if (doesCache) { cdef = NSMapGet(self->componentDefinitions, componentURL); if (cdef == (id)null) /* resource does not exist */ return nil; [cdef touch]; if (cdef) return cdef; // found definition in cache } /* take a look into the file system */ { NSString *baseUrl = nil; baseUrl = [NSString stringWithFormat:@"%@/%@", [appUrl absoluteString], [_name lastPathComponent]]; cdef = [self _definitionWithName:_name url:componentURL baseURL:[NSURL URLWithString:baseUrl] frameworkName:nil]; if (cdef == nil) { [self warnWithFormat: @"(%s): could not load component definition of '%@' from " @"component wrapper: '%@'", __PRETTY_FUNCTION__, _name, componentURL]; if (doesCache) { /* register null in cache, so that we know it's non-existent */ NSMapInsert(self->componentDefinitions, componentURL, null); } return nil; } if (doesCache) { /* register in cache */ NSMapInsert(self->componentDefinitions, componentURL, cdef); [cdef release]; } else /* don't register in cache, does not cache */ cdef = [cdef autorelease]; return cdef; } /* did not find component */ return nil; } - (WOComponentDefinition *)definitionForComponent:(id)_name languages:(NSArray *)_langs { // TODO: who uses that? Probably should be deprecated? return [self definitionForComponent:_name inFramework:nil languages:_langs]; } - (WOComponentDefinition *)__definitionForComponent:(id)_name languages:(NSArray *)_languages { /* First check whether the cdef is cached, otherwise create a new one. This method is used by the higher level methods and just implements the cache control. The definition itself is created by definitionForComponent:languages:. */ WOComponentDefinition *cdef; /* look into cache */ cdef = [self _cachedDefinitionForComponent:_name languages:_languages]; if (cdef != nil) { if (cdef == (id)null) /* component does not exist */ return nil; if ([cdef respondsToSelector:@selector(touch)]) [cdef touch]; return cdef; } /* not cached, create a definition */ cdef = [self definitionForComponent:_name languages:_languages]; /* cache created definition */ return [self _cacheDefinition:cdef forComponent:_name languages:_languages]; } - (WOElement *)templateWithName:(NSString *)_name languages:(NSArray *)_languages { WOComponentDefinition *cdef; cdef = [self __definitionForComponent:_name languages:_languages]; if (cdef == nil) return nil; return (WOElement *)[cdef template]; } - (id)pageWithName:(NSString *)_name languages:(NSArray *)_langs { /* TODO: this appears to be deprecated since the WOComponent initializer is now -initWithContext: and we have no context over here ... */ NSAutoreleasePool *pool; WOComponentDefinition *cdef; WOComponent *component = nil; pool = [[NSAutoreleasePool alloc] init]; { cdef = [self __definitionForComponent:_name languages:_langs]; if (cdef != nil) { // TODO: document what the resource manager is used for in the cdef component = [[cdef instantiateWithResourceManager:self languages:_langs] retain]; } } [pool release]; return [component autorelease]; } /* KeyedData */ - (void)setData:(NSData *)_data forKey:(NSString *)_key mimeType:(NSString *)_type session:(WOSession *)_session { if ((_key == nil) || (_data == nil)) return; if (_type == nil) _type = @"application/octet-stream"; [self lock]; if (self->keyedResources == NULL) { self->keyedResources = NSCreateMapTable(NSObjectMapKeyCallBacks, NSObjectMapValueCallBacks, 128); } NSMapInsert(self->keyedResources, _key, [NSDictionary dictionaryWithObjectsAndKeys: _type, @"mimeType", _key, @"key", _data, @"data", nil]); [self unlock]; } - (id)_dataForKey:(NSString *)_key sessionID:(NSString *)_sid { id tmp; [self lock]; if (self->keyedResources) tmp = NSMapGet(self->keyedResources, _key); else tmp = nil; tmp = [[tmp retain] autorelease]; [self unlock]; return tmp; } - (void)removeDataForKey:(NSString *)_key session:(WOSession *)_session { [self lock]; if (self->keyedResources) NSMapRemove(self->keyedResources, _key); [self unlock]; } - (void)flushDataCache { [self lock]; if (self->keyedResources) { NSFreeMapTable(self->keyedResources); self->keyedResources = NULL; } [self unlock]; } /* description */ - (NSString *)description { NSMutableString *ms; ms = [NSMutableString stringWithCapacity:32]; [ms appendFormat:@"<0x%p[%@]:", self, NSStringFromClass([self class])]; if ([self->base length] > 0) [ms appendFormat:@" path='%@'", self->base]; [ms appendString:@">"]; return ms; } @end /* WOResourceManager */ SOPE/sope-appserver/NGObjWeb/WOContext.m0000644000000000000000000007744212242733417016765 0ustar rootroot/* Copyright (C) 2000-2006 SKYRIX Software AG Copyright (C) 2006 Helge Hess This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include "NSObject+WO.h" #include "WOComponent+private.h" #include "WOContext+private.h" #include "WOApplication+private.h" #include #include #include #include #include #include "WOElementID.h" #include "common.h" #include @interface WOContext(Privates5) - (NSArray *)_componentStack; @end @interface WOComponent(Cursors) - (void)pushCursor:(id)_obj; - (id)popCursor; - (id)cursor; @end static Class WOAppClass = Nil; @implementation WOContext static Class WOContextClass = Nil; static Class MutableStrClass = Nil; static int contextCount = 0; static int logComponents = -1; static int relativeURLs = -1; static BOOL debugOn = NO; static int debugCursor = -1; static BOOL debugComponentAwake = NO; static BOOL testNSURLs = NO; static BOOL newCURLStyle = NO; static NSString *WOApplicationSuffix = nil; static NSURL *redirectURL = nil; + (void)initialize { static BOOL didInit = NO; NSUserDefaults *ud; NSString *cn; NSString *url; if (didInit) return; didInit = YES; ud = [NSUserDefaults standardUserDefaults]; if (WOAppClass == Nil) WOAppClass = [WOApplication class]; if (MutableStrClass == Nil) MutableStrClass = [NSMutableString class]; cn = [ud stringForKey:@"WOContextClass"]; WOContextClass = NSClassFromString(cn); NSAssert1(WOContextClass != Nil, @"Couldn't instantiate WOContextClass (%@)!", cn); logComponents = [[ud objectForKey:@"WOLogComponents"] boolValue] ? 1 : 0; relativeURLs = [[ud objectForKey:@"WOUseRelativeURLs"] boolValue]? 1 : 0; debugCursor = [ud boolForKey:@"WODebugCursor"] ? 1 : 0; debugComponentAwake = [ud boolForKey:@"WODebugComponentAwake"]; WOApplicationSuffix = [[ud stringForKey:@"WOApplicationSuffix"] copy]; url = [ud stringForKey:@"WOApplicationRedirectURL"]; if (url != nil) redirectURL = [NSURL URLWithString: url]; } + (id)contextWithRequest:(WORequest *)_r { return [[(WOContext *)[WOContextClass alloc] initWithRequest:_r] autorelease]; } - (id)initWithRequest:(WORequest *)_request { if ((self = [super init])) { char buf[24]; self->qpJoin = @"&"; sprintf(buf, "%03x%08x%08x", ++contextCount, (int)time(NULL), (unsigned int)(unsigned long)self); self->ctxId = [[NSString alloc] initWithCString:buf]; /* per default close tags in XML style */ self->wcFlags.xmlStyleEmptyElements = 1; self->wcFlags.allowEmptyAttributes = 0; self->elementID = [[WOElementID alloc] init]; self->awakeComponents = [[NSMutableSet alloc] initWithCapacity:64]; self->request = [_request retain]; self->response = [[WOResponse responseWithRequest:_request] retain]; if (_request && [_request isFragmentIDInRequest]) { [self setFragmentID:[_request fragmentID]]; [self disableRendering]; } } return self; } + (id)context { return [[[self alloc] init] autorelease]; } - (id)init { return [self initWithRequest:nil]; } /* components */ - (void)_addAwakeComponent:(WOComponent *)_component { if (_component == nil) return; if ([self->awakeComponents containsObject:_component]) return; /* wake up component */ if (debugComponentAwake) [self logWithFormat:@"mark component awake: %@", _component]; [self->awakeComponents addObject:_component]; } - (void)_awakeComponent:(WOComponent *)_component { if (_component == nil) return; if ([self->awakeComponents containsObject:_component]) return; /* wake up component */ if (debugComponentAwake) [self logWithFormat:@"awake component: %@", _component]; [_component _awakeWithContext:self]; [self _addAwakeComponent:_component]; if (debugComponentAwake) [self logWithFormat:@"woke up component: %@", _component]; } - (void)sleepComponents { NSEnumerator *e; WOComponent *component; BOOL sendSleepToPage; if (debugComponentAwake) { [self logWithFormat:@"sleep %d components ...", [self->awakeComponents count]]; } sendSleepToPage = YES; e = [self->awakeComponents objectEnumerator]; while ((component = [e nextObject])) { if (debugComponentAwake) [self logWithFormat:@" sleep component: %@", component]; [component _sleepWithContext:self]; if (component == self->page) sendSleepToPage = NO; } if (sendSleepToPage && (self->page != nil)) { if (debugComponentAwake) [self logWithFormat:@" sleep page: %@", self->page]; [self->page _sleepWithContext:self]; } if (debugComponentAwake) { [self logWithFormat:@"done sleep %d components.", [self->awakeComponents count]]; } [self->awakeComponents removeAllObjects]; } #if WITH_DEALLOC_OBSERVERS - (void)addDeallocObserver:(id)_observer { if (_observer == NULL) return; /* check array */ if (self->deallocObservers == NULL) { self->deallocObservers = calloc(8, sizeof(id)); self->deallocObserverCount = 0; self->deallocObserverCapacity = 8; } /* check capacity */ if (self->deallocObserverCapacity == self->deallocObserverCount) { /* need to increase array */ id *newa; newa = calloc(self->deallocObserverCapacity * 2, sizeof(id)); memcpy(newa, self->deallocObservers, sizeof(id) * self->deallocObserverCount); free(self->deallocObservers); self->deallocObservers = newa; self->deallocObserverCapacity *= 2; } /* register */ self->deallocObservers[self->deallocObserverCount] = _observer; self->deallocObserverCount++; } - (void)removeDeallocObserver:(id)_observer { /* the observer currently will only grow (this should be OK for WOContext) */ register int i; if (_observer == NULL) return; for (i = self->deallocObserverCount - 1; i >= 0; i++) { if ((self->deallocObservers[i]) == _observer) self->deallocObservers[i] = NULL; } } #endif - (void)dealloc { [self sleepComponents]; #if WITH_DEALLOC_OBSERVERS if (self->deallocObservers) { register int i; #if DEBUG printf("%s: dealloc observer capacity: %i\n", __PRETTY_FUNCTION__, self->deallocObserverCapacity); #endif /* GC!! process in reverse order ... */ for (i = self->deallocObserverCount - 1; i >= 0; i++) [self->deallocObservers[i] _objectWillDealloc:self]; free(self->deallocObservers); self->deallocObservers = NULL; } #endif [self->activeUser release]; [self->rootURL release]; [self->objectPermissionCache release]; [self->traversalStack release]; [self->clientObject release]; [self->objectDispatcher release]; [self->soRequestType release]; [self->pathInfo release]; [[NSNotificationCenter defaultCenter] postNotificationName:@"WOContextWillDeallocate" object:self->ctxId]; { /* release component stack */ int i; for (i = (self->componentStackCount - 1); i >= 0; i--) { [self->componentStack[i] release]; self->componentStack[i] = nil; [self->contentStack[i] release]; self->contentStack[i] = nil; } } [self->urlPrefix release]; [self->elementID release]; [self->reqElementID release]; [self->fragmentID release]; [self->activeFormElement release]; [self->page release]; [self->awakeComponents release]; [self->appURL release]; [self->baseURL release]; [self->session release]; [self->variables release]; [self->request release]; [self->response release]; [self->ctxId release]; [super dealloc]; } /* session */ - (void)setSession:(WOSession *)_session { ASSIGN(self->session, _session); } - (void)setNewSession:(WOSession *)_session { [self setSession:_session]; self->wcFlags.hasNewSession = 1; } - (id)session { /* in WO4 -session creates a new session if none is associated */ if (self->session == nil) { [[self application] _initializeSessionInContext:self]; if (self->session == nil) { [self logWithFormat:@"%s: missing session for context ..", __PRETTY_FUNCTION__]; } } return self->session; } - (NSString *)contextID { NSAssert(self->ctxId, @"context without id !"); #if 0 // in WO4 -contextID returns nil if there is no associated session return self->session ? self->ctxId : nil; #else /* IMHO the above isn't true, otherwise session cannot be automagically generated! TODO: well, we might want to generate component URLs which work without a session - at least in theory the ID tree should be stable even without a session (and if proper uids are used for dynamic content). eg this would be quite useful for SOPE. */ return self->ctxId; #endif } - (WORequest *)request { return self->request; } - (WOResponse *)response { return self->response; } - (BOOL)hasSession { return (self->session != nil) ? YES : NO; } - (BOOL)hasNewSession { if (!self->wcFlags.hasNewSession) return NO; return [self hasSession]; } - (BOOL)savePageRequired { return self->wcFlags.savePageRequired ? YES : NO; } /* cursors */ - (void)pushCursor:(id)_obj { if (debugCursor == -1) { debugCursor = [[NSUserDefaults standardUserDefaults] boolForKey:@"WODebugCursor"] ? 1 : 0; } if (debugCursor) [self logWithFormat:@"enter cursor: %@", _obj]; [[self component] pushCursor:_obj]; } - (id)popCursor { if (debugCursor) [self logWithFormat:@"leave cursor ..."]; return [[self component] popCursor]; } - (id)cursor { return [(id )[self component] cursor]; } /* components */ - (id)component { return (self->componentStackCount > 0) ? self->componentStack[self->componentStackCount - 1] : nil; } - (void)setPage:(WOComponent *)_page { [_page ensureAwakeInContext:self]; ASSIGN(self->page, _page); } - (id)page { return self->page; } void WOContext_enterComponent (WOContext *self, WOComponent *_component, WOElement *_content) { WOComponent *parent = nil; #if DEBUG NSCAssert(_component, @"missing component to enter ..."); #endif if (logComponents) { [self->application logWithFormat:@"enter component %@ (content=%@) ..", [_component name], _content]; } parent = self->componentStackCount > 0 ? self->componentStack[self->componentStackCount - 1] : nil; NSCAssert2(self->componentStackCount < NGObjWeb_MAX_COMPONENT_NESTING_DEPTH, @"exceeded maximum component nesting depth (%i):\n%@", NGObjWeb_MAX_COMPONENT_NESTING_DEPTH, [self _componentStack]); self->componentStack[(int)self->componentStackCount] = [_component retain]; self->contentStack[(int)self->componentStackCount] = [_content retain]; self->componentStackCount++; [self _awakeComponent:_component]; if (parent) { if ([_component synchronizesVariablesWithBindings]) WOComponent_syncFromParent(_component, parent); } } void WOContext_leaveComponent(WOContext *self, WOComponent *_component) { WOComponent *parent = nil; BEGIN_PROFILE; parent = (self->componentStackCount > 1) ? self->componentStack[self->componentStackCount - 2] : nil; if (parent) { if ([_component synchronizesVariablesWithBindings]) WOComponent_syncToParent(_component, parent); } PROFILE_CHECKPOINT("after sync"); /* remove last object */ self->componentStackCount--; NSCAssert(self->componentStackCount >= 0, @"tried to pop component from empty component stack !"); [self->componentStack[(int)self->componentStackCount] release]; self->componentStack[(int)self->componentStackCount] = nil; [self->contentStack[(int)self->componentStackCount] release]; self->contentStack[(int)self->componentStackCount] = nil; if (logComponents) [self->application logWithFormat:@"left component %@.", [_component name]]; END_PROFILE; } - (void)enterComponent:(WOComponent *)_comp content:(WOElement *)_content { WOContext_enterComponent(self, _comp, _content); } - (void)leaveComponent:(WOComponent *)_component { BEGIN_PROFILE; WOContext_leaveComponent(self, _component); END_PROFILE; } - (WOComponent *)parentComponent { return (self->componentStackCount > 1) ? self->componentStack[(int)self->componentStackCount - 2] : nil; } - (WODynamicElement *)componentContent { return (self->componentStackCount > 0) ? self->contentStack[(int)self->componentStackCount - 1] : nil; } - (unsigned)componentStackCount { return self->componentStackCount; } - (NSArray *)_componentStack { return [NSArray arrayWithObjects:self->componentStack count:self->componentStackCount]; } /* URLs */ - (NSURL *)serverURL { WORequest *rq; NSString *serverURL; NSURL *url; NSString *host; if ((rq = [self request]) == nil) { [self logWithFormat:@"missing request in -baseURL call .."]; return nil; } if (redirectURL != nil) { // Use URL from user defaults (WOApplicationRedirectURL) return redirectURL; } if ((serverURL = [rq headerForKey:@"x-webobjects-server-url"]) == nil) { if ((host = [rq headerForKey:@"host"])) serverURL = [@"http://" stringByAppendingString:host]; } else { // TODO: fix that (host is also broken for example with SOUP) /* sometimes the port is broken in the server URL ... */ if ([serverURL hasSuffix:@":0"]) { // bad bad bad if ((host = [rq headerForKey:@"host"])) { NSString *scheme; scheme = [serverURL hasPrefix:@"https://"] ? @"https://":@"http://"; serverURL = [scheme stringByAppendingString:host]; } } } if ([serverURL length] == 0) { [self errorWithFormat:@"could not find x-webobjects-server-url header !"]; return nil; } if ((url = [NSURL URLWithString:serverURL]) == nil) { [self logWithFormat:@"could not construct NSURL from string '%@'", serverURL]; return nil; } return url; } - (NSURL *)baseURL { WORequest *rq; NSURL *serverURL; if (self->baseURL) return self->baseURL; if ((rq = [self request]) == nil) { [self logWithFormat:@"missing request in -baseURL call .."]; return nil; } serverURL = [self serverURL]; self->baseURL = [[NSURL URLWithString:[rq uri] relativeToURL:serverURL] retain]; if (self->baseURL == nil) { [self logWithFormat: @"could not construct NSURL for uri '%@' and base '%@' ...", [rq uri], serverURL]; } return self->baseURL; } - (NSURL *)applicationURL { NSString *s; if (self->appURL != nil) return self->appURL; // TODO: we should ensure that the suffix (.woa) is in the URL s = [self->request adaptorPrefix]; if ([s length] > 0) { s = [[[s stringByAppendingString:@"/"] stringByAppendingString:[self->request applicationName]] stringByAppendingString:@"/"]; } else s = [[self->request applicationName] stringByAppendingString:@"/"]; self->appURL = [[NSURL URLWithString:s relativeToURL:[self serverURL]] retain]; return self->appURL; } - (NSURL *)urlForKey:(NSString *)_key { _key = [_key stringByAppendingString:@"/"]; return [NSURL URLWithString:_key relativeToURL:[self applicationURL]]; } /* forms */ - (void)setInForm:(BOOL)_form { self->wcFlags.inForm = _form ? 1 : 0; } - (BOOL)isInForm { return self->wcFlags.inForm ? YES : NO; } - (void)addActiveFormElement:(WOElement *)_formElement { if (self->activeFormElement) { [[self component] debugWithFormat:@"active form element already set !"]; return; } ASSIGN(self->activeFormElement, _formElement); [self setRequestSenderID:[self elementID]]; } - (WOElement *)activeFormElement { return self->activeFormElement; } /* context variables (transient) */ - (void)setObject:(id)_obj forKey:(NSString *)_key { if (self->variables == nil) { self->variables = [[NSMutableDictionary allocWithZone:[self zone]] initWithCapacity:16]; } if (_obj) [self->variables setObject:_obj forKey:_key]; else [self->variables removeObjectForKey:_key]; } - (id)objectForKey:(NSString *)_key { return [self->variables objectForKey:_key]; } - (void)removeObjectForKey:(NSString *)_key { [self->variables removeObjectForKey:_key]; } - (NSDictionary *)variableDictionary { return self->variables; } - (void)takeValue:(id)_value forKey:(NSString *)_key { if (WOSetKVCValueUsingMethod(self, _key, _value)) // method is used return; else if (WOGetKVCGetMethod(self, _key) == NULL) { if (_value == nil) _value = [NSNull null]; if (self->variables == nil) { self->variables = [[NSMutableDictionary allocWithZone:[self zone]] initWithCapacity:16]; } [self->variables setObject:_value forKey:_key]; return; } else { // only a 'get' method is defined for _key ! [self handleTakeValue:_value forUnboundKey:_key]; } } - (id)valueForKey:(NSString *)_key { id value; if ((value = WOGetKVCValueUsingMethod(self, _key))) return value; value = [self->variables objectForKey:_key]; return value; } /* NSCopying */ - (id)copyWithZone:(NSZone *)_zone { return [self retain]; } /* description */ - (NSString *)description { NSString *sid = nil; WOApplication *app = [self application]; if ([self hasSession]) sid = [[self session] sessionID]; return [NSString stringWithFormat: @"<0x%p[%@]: %@ app=%@ sn=%@ eid=%@ rqeid=%@>", self, NSStringFromClass([self class]), [self contextID], [app name], sid != nil ? sid : (NSString *)@"none", [self elementID], [self senderID]]; } /* ElementIDs */ - (NSString *)elementID { return [self->elementID elementID]; } - (void)appendElementIDComponent:(NSString *)_eid { [self->elementID appendElementIDComponent:_eid]; } - (void)appendZeroElementIDComponent { [self->elementID appendZeroElementIDComponent]; } - (void)deleteAllElementIDComponents { [self->elementID deleteAllElementIDComponents]; } - (void)deleteLastElementIDComponent { [self->elementID deleteLastElementIDComponent]; } - (void)incrementLastElementIDComponent { [self->elementID incrementLastElementIDComponent]; } - (void)appendIntElementIDComponent:(int)_eid { [self->elementID appendIntElementIDComponent:_eid]; } /* the following can be later moved to WOElementID */ - (id)currentElementID { return [self->reqElementID currentElementID]; } - (id)consumeElementID { return [self->reqElementID consumeElementID]; } /* URLs */ - (void)_generateCompleteURLs { /* described in Apple TIL article 70101 */ } - (void)setQueryPathSeparator:(NSString *)_sp { ASSIGNCOPY(self->qpJoin, _sp); } - (NSString *)queryPathSeparator { return self->qpJoin; } - (void)setGenerateXMLStyleEmptyElements:(BOOL)_flag { self->wcFlags.xmlStyleEmptyElements = _flag ? 1 : 0; } - (BOOL)generateXMLStyleEmptyElements { return self->wcFlags.xmlStyleEmptyElements ? YES : NO; } - (void)setGenerateEmptyAttributes:(BOOL)_flag { self->wcFlags.allowEmptyAttributes = _flag ? 1 : 0; } - (BOOL)generateEmptyAttributes { return self->wcFlags.allowEmptyAttributes ? YES : NO; } - (NSString *)queryStringFromDictionary:(NSDictionary *)_queryDict { NSEnumerator *keys; NSString *key; BOOL isFirst; NSMutableString *qs; qs = [MutableStrClass stringWithCapacity:256]; keys = [_queryDict keyEnumerator]; for (isFirst = YES; (key = [keys nextObject]) != nil; ) { id value; value = [_queryDict objectForKey:key]; /* check for multi-value parameter */ if ([value isKindOfClass:[NSArray class]]) { NSArray *a = value; unsigned i, count; for (i = 0, count = [a count]; i < count; i++) { value = [a objectAtIndex:i]; if (isFirst) isFirst = NO; else [qs appendString:self->qpJoin]; // TODO: code duplication ... value = ![value isNotNull] ? (NSString *)nil : [value stringValue]; key = [key stringByEscapingURL]; value = [value stringByEscapingURL]; [qs appendString:key]; if (value != nil) { [qs appendString:@"="]; [qs appendString:value]; } } continue; } /* regular, single-value parameter */ if (isFirst) isFirst = NO; else [qs appendString:self->qpJoin]; value = ![value isNotNull] ? (NSString *)nil : [value stringValue]; key = [key stringByEscapingURL]; value = [value stringByEscapingURL]; [qs appendString:key]; if (value != nil) { [qs appendString:@"="]; [qs appendString:value]; } } return qs; } - (NSString *)directActionURLForActionNamed:(NSString *)_actionName queryDictionary:(NSDictionary *)_queryDict { NSMutableString *url; NSString *qs; url = [MutableStrClass stringWithCapacity:256]; if (!testNSURLs) [url appendString:@"/"]; [url appendString:_actionName]; /* add query parameters */ qs = [self queryStringFromDictionary:_queryDict]; return [self urlWithRequestHandlerKey: [WOAppClass directActionRequestHandlerKey] path:url queryString:qs]; } - (NSString *)componentActionURL { // TODO: add a -cComponentActionURL // (without NSString for use with appendContentCString:) // Profiling: // 26% -urlWithRequestHandler... // 21% -elementID (was 40% !! :-) // ~20% mutable string ops /* This makes the request handler save the page in the session at the end of the request (only necessary if the page generates URLs which refer the context). */ self->wcFlags.savePageRequired = 1; if (newCURLStyle) { // TODO: who uses that? Its not enabled per default // TODO: what does this do? NSMutableString *qs; NSString *p; qs = [MutableStrClass stringWithCapacity:64]; [qs appendString:WORequestValueSenderID]; [qs appendString:@"="]; [qs appendString:[self elementID]]; [qs appendString:self->qpJoin]; [qs appendString:WORequestValueSessionID]; [qs appendString:@"="]; [qs appendString:[[self session] sessionID]]; [qs appendString:self->qpJoin]; [qs appendString:WORequestValueContextID]; [qs appendString:@"="]; [qs appendString:[self contextID]]; p = [[self page] componentActionURLForContext:self]; if (testNSURLs) { if ([p hasPrefix:@"/"]) p = [p substringFromIndex:1]; } return [self urlWithRequestHandlerKey: [WOAppClass componentRequestHandlerKey] path:p queryString:qs]; } else { /* old style URLs ... */ static NSMutableString *url = nil; // THREAD static IMP addStr = NULL; NSString *s; NSString *coRqhKey; coRqhKey = [WOAppClass componentRequestHandlerKey]; /* Optimization: use relative URL if the request already was a component action (with a valid session) */ if (!self->wcFlags.hasNewSession) { if ([[self->request requestHandlerKey] isEqualToString:coRqhKey]) return [self->elementID elementID]; } if (url == nil) { url = [[MutableStrClass alloc] initWithCapacity:256]; addStr = [url methodForSelector:@selector(appendString:)]; addStr(url, @selector(appendString:), @"/"); } else [url setString:@"/"]; /* Note: component actions *always* require sessions to be able to locate the request component ! */ addStr(url, @selector(appendString:), [[self session] sessionID]); addStr(url, @selector(appendString:), @"/"); addStr(url, @selector(appendString:), [self->elementID elementID]); s = [self urlWithRequestHandlerKey:coRqhKey path:url queryString:nil]; return s; } } - (NSString *)urlWithRequestHandlerKey:(NSString *)_key path:(NSString *)_path queryString:(NSString *)_query { if (testNSURLs) { /* use NSURLs for processing */ NSURL *rqUrl; if ([_path hasPrefix:@"/"]) { #if DEBUG [self warnWithFormat:@"got absolute path '%@'", _path]; #endif _path = [_path substringFromIndex:1]; } if (_key == nil) _key = [WOAppClass componentRequestHandlerKey]; rqUrl = [self urlForKey:_key]; if ([_query length] > 0) { NSMutableString *s; s = [_path mutableCopy]; [s appendString:@"?"]; [s appendString:_query]; rqUrl = [NSURL URLWithString:s relativeToURL:rqUrl]; [s release]; } else rqUrl = [NSURL URLWithString:_path relativeToURL:rqUrl]; //[self logWithFormat:@"constructed component URL: %@", rqUrl]; return [rqUrl stringValueRelativeToURL:[self baseURL]]; } else { NSMutableString *url; NSString *tmp; IMP addStr; if (_key == nil) _key = [WOAppClass componentRequestHandlerKey]; url = [MutableStrClass stringWithCapacity:256]; addStr = [url methodForSelector:@selector(appendString:)]; /* static part */ if (self->urlPrefix == nil) { if (!relativeURLs) { if ((tmp = [self->request headerForKey:@"x-webobjects-server-url"])) { if ([tmp hasSuffix:@":0"] && [tmp length] > 2) // TODO: BAD BAD BAD tmp = [tmp substringToIndex:([tmp length] - 2)]; addStr(url, @selector(appendString:), tmp); } else if ((tmp = [self->request headerForKey:@"host"])) { addStr(url, @selector(appendString:), @"http://"); addStr(url, @selector(appendString:), tmp); } } addStr(url, @selector(appendString:), [self->request adaptorPrefix]); addStr(url, @selector(appendString:), @"/"); tmp = [[self request] applicationName]; if ([tmp length] == 0) tmp = [(WOApplication *)[self application] name]; if ([tmp length] > 0) { addStr(url, @selector(appendString:), tmp); if (WOApplicationSuffix) addStr(url, @selector(appendString:), WOApplicationSuffix); addStr(url, @selector(appendString:), @"/"); } /* cache prefix */ self->urlPrefix = [url copy]; if (debugOn) [self debugWithFormat:@"URL prefix: '%@'", self->urlPrefix]; } else { /* prefix is cached :-) */ addStr(url, @selector(appendString:), self->urlPrefix); } /* variable part */ addStr(url, @selector(appendString:), _key); if (_path) addStr(url, @selector(appendString:), _path); if ([_query length] > 0) { addStr(url, @selector(appendString:), @"?"); addStr(url, @selector(appendString:), _query); } return url; } } - (NSString *)completeURLWithRequestHandlerKey:(NSString *)_key path:(NSString *)_path queryString:(NSString *)_query isSecure:(BOOL)_isSecure port:(int)_port { NSMutableString *url = [MutableStrClass stringWithCapacity:256]; [url appendString:_isSecure ? @"https://" : @"http://"]; [url appendString:[[self request] headerForKey:@"host"]]; if (_port > 0) { if (!(_isSecure && _port == 443) && !(!_isSecure && _port == 80)) [url appendFormat:@":%i", _port]; } [url appendString:[self urlWithRequestHandlerKey:_key path:_path queryString:_query]]; return url; } - (void)setRequestSenderID:(NSString *)_rid { WOElementID *eid; eid = [[WOElementID alloc] initWithString:_rid]; [self->reqElementID release]; self->reqElementID = eid; } - (NSString *)senderID { #if 1 return [self->reqElementID elementID]; #else NSMutableString *eid; IMP addStr; int i; eid = [MutableStrClass stringWithCapacity:(self->reqElementIdCount * 4) + 1]; addStr = [eid methodForSelector:@selector(appendString:)]; for (i = 0; i < self->reqElementIdCount; i++) { if (i != 0) addStr(eid, @selector(appendString:), @"."); addStr(eid, @selector(appendString:), [self->reqElementId[i] stringValue]); } return eid; #endif } /* languages for resource lookup (non-WO) */ - (NSArray *)resourceLookupLanguages { return [self hasSession] ? [[self session] languages] : [[self request] browserLanguages]; } /* fragments */ - (void)setFragmentID:(NSString *)_fragmentID { ASSIGNCOPY(self->fragmentID, _fragmentID); } - (NSString *)fragmentID { return self->fragmentID; } - (void)enableRendering { self->wcFlags.isRenderingDisabled = NO; } - (void)disableRendering { self->wcFlags.isRenderingDisabled = YES; } - (BOOL)isRenderingDisabled { return self->wcFlags.isRenderingDisabled; } /* DeprecatedMethodsInWO4 */ - (id)application { if (self->application == nil) self->application = [WOAppClass application]; if (self->application == nil) { [self logWithFormat: @"%s: missing application for context %@", __PRETTY_FUNCTION__, self]; } return self->application; } - (void)setDistributionEnabled:(BOOL)_flag { IS_DEPRECATED; [[self session] setDistributionEnabled:_flag]; } - (BOOL)isDistributionEnabled { IS_DEPRECATED; return [[self session] isDistributionEnabled]; } - (NSString *)url { return [self componentActionURL]; } - (NSString *)urlSessionPrefix { NSMutableString *url; NSString *tmp; url = [MutableStrClass stringWithCapacity:128]; [url appendString:[[self request] adaptorPrefix]]; [url appendString:@"/"]; tmp = [[self request] applicationName]; [url appendString: tmp ? tmp : [(WOApplication *)[self application] name]]; #if DEBUG if ([url length] == 0) { [self warnWithFormat:@"(%s): could not determine session URL prefix !", __PRETTY_FUNCTION__]; } #endif return url; } @end /* WOContext */ @implementation WOComponent(Cursors) - (void)pushCursor:(id)_obj { if (debugCursor) [self logWithFormat:@"enter cursor: %@", _obj]; if (!self->cycleContext) self->cycleContext = [[NSMutableArray alloc] initWithCapacity:8]; /* add to cursor stack */ [self->cycleContext addObject:(_obj != nil ? _obj : (id)[NSNull null])]; /* set active cursor */ [self setObject:_obj forKey:@"_"]; } - (id)popCursor { NSMutableArray *ctxStack; id old; /* retrieve last context */ old = [[self objectForKey:@"_"] retain]; [self setObject:nil forKey:@"_"]; /* restore old ctx */ if ((ctxStack = self->cycleContext) != nil) { unsigned count; if ((count = [ctxStack count]) > 0) { [ctxStack removeObjectAtIndex:(count - 1)]; count--; if (count > 0) { id obj; obj = [ctxStack objectAtIndex:(count - 1)]; if (![obj isNotNull]) obj = nil; [self setObject:obj forKey:@"_"]; } } } #if DEBUG else { [self warnWithFormat:@"-popCursor called without cycle ctx !"]; } #endif if (debugCursor) { [self logWithFormat:@"leave cursor: %@ (restored=%@)", old, [self cursor]]; } return [old autorelease]; } - (id)cursor { NSMutableArray *ctxStack; // TODO: why do we check for _ODCycleCtx, if we query '_' ? if ((ctxStack = self->cycleContext) == nil) /* no cycle context setup for component ... */ return self; if ([ctxStack count] == 0) /* nothing contained in cycle context ... */ return self; return [self objectForKey:@"_"]; } @end /* WOComponent(Cursors) */ SOPE/sope-appserver/NGObjWeb/WODirectAction.m0000644000000000000000000001210512242733417017672 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include "NSObject+WO.h" #include #include #include #include #include #include #include "common.h" #if !LIB_FOUNDATION_LIBRARY # define NG_USE_KVC_FALLBACK 1 #endif @implementation WODirectAction - (id)initWithRequest:(WORequest *)_request { if ((self = [super init]) != nil) { } return self; } - (id)initWithContext:(WOContext *)_ctx { if ((self = [self initWithRequest:[_ctx request]])) { self->context = _ctx; } return self; } - (id)init { return [self initWithRequest:nil]; } // - (void)dealloc { // [self->context release]; // [super dealloc]; // } /* accessors */ - (WOContext *)context { if (self->context == nil) self->context = [[WOApplication application] context]; return self->context; } - (WORequest *)request { return [[self context] request]; } - (id)session { return [[self context] session]; } - (id)existingSession { WOContext *ctx = [self context]; /* check whether the context has a session */ return [ctx hasSession] ? [ctx session] : nil; } /* perform actions */ - (id)performActionNamed:(NSString *)_actionName { SEL actionSel; NSRange rng; /* discard everything after a point in the URL */ rng = [_actionName rangeOfString:@"."]; if (rng.length > 0) _actionName = [_actionName substringToIndex:rng.location]; _actionName = [_actionName stringByAppendingString:@"Action"]; actionSel = NSSelectorFromString(_actionName); if ([self respondsToSelector:actionSel]) return [self performSelector:actionSel]; else { [self logWithFormat:@"DirectAction class %@ cannot handle action %@", NSStringFromClass([self class]), _actionName]; return nil; } } /* applying form values */ - (void)takeFormValuesForKeyArray:(NSArray *)_keys { NSEnumerator *keys; NSString *key; WORequest *rq; rq = [self request]; keys = [_keys objectEnumerator]; while ((key = [keys nextObject])) { NSString *value; value = [rq formValueForKey:key]; [self takeValue:value forKey:key]; } } - (void)takeFormValuesForKeys:(NSString *)_key1,... { va_list va; NSString *key; WORequest *rq; rq = [self request]; va_start(va, _key1); { for (key = _key1; key; key = va_arg(va, NSString *)) { NSString *value; value = [rq formValueForKey:key]; [self takeValue:value forKey:key]; } } va_end(va); } - (void)takeFormValueArraysForKeyArray:(NSArray *)_keys { NSEnumerator *keys; NSString *key; WORequest *rq; rq = [self request]; keys = [_keys objectEnumerator]; while ((key = [keys nextObject])) { NSArray *value; value = [rq formValuesForKey:key]; [self takeValue:value forKey:key]; } } - (void)takeFormValueArraysForKeys:(NSString *)_key1,... { va_list va; NSString *key; WORequest *rq; rq = [self request]; va_start(va, _key1); { for (key = _key1; key; key = va_arg(va, NSString *)) { NSArray *value; value = [rq formValuesForKey:key]; [self takeValue:value forKey:key]; } } va_end(va); } /* pages */ - (id)pageWithName:(NSString *)_name { return [[WOApplication application] pageWithName:_name inContext:[self context]]; } /* logging */ - (NSString *)loggingPrefix { return [NSString stringWithFormat:@">%@>", NSStringFromClass([self class])]; } - (BOOL)isDebuggingEnabled { static char showDebug = 2; if (showDebug == 2) showDebug = [WOApplication isDebuggingEnabled] ? 1 : 0; return showDebug ? YES : NO; } /* Key-Value coding */ - (void)takeValue:(id)_value forKey:(NSString *)_key { if (!WOSetKVCValueUsingMethod(self, _key, _value)) [self handleTakeValue:_value forUnboundKey:_key]; } - (id)valueForKey:(NSString *)_key { return WOGetKVCValueUsingMethod(self, _key); } #if !LIB_FOUNDATION_LIBRARY - (void)setValue:(id)_value forUndefinedKey:(NSString *)_key { [self warnWithFormat: @"tried to set value for undefined KVC key: '%@'", _key]; } - (id)valueForUndefinedKey:(NSString *)_key { [self warnWithFormat: @"tried to access undefined KVC key: '%@'", _key]; return nil; } #endif @end /* WODirectAction */ SOPE/sope-appserver/NGObjWeb/WOHTTPURLHandle.m0000644000000000000000000001337512242733417017612 0ustar rootroot/* Copyright (C) 2000-2008 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import // required by gstep-base #import #import @class WOResponse; /* An URLHandle class which uses WO classes (WOHTTPConnection, WORequest, ..) to get/set HTTP resources. */ @interface WOHTTPURLHandle : NSURLHandle { NSURL *url; BOOL shallCache; WOResponse *cachedResponse; NSURLHandleStatus status; } @end #include #include #include #include "common.h" @implementation WOHTTPURLHandle + (BOOL)canInitWithURL:(NSURL *)_url { return [[_url scheme] isEqualToString:@"http"]; } + (NSURLHandle*) cachedHandleForURL: (NSURL*)newUrl { NSURLHandle *obj = nil; NSLog(@"NOTE: WOHTTPURLHandle.m: cachedHandleForURL: caching not yet not yet implemented"); return obj; } - (id)initWithURL:(NSURL *)_url cached:(BOOL)_flag { if (![[_url scheme] hasPrefix:@"http"]) { NSLog(@"%s: invalid URL scheme %@ for WOHTTPURLHandle !", __PRETTY_FUNCTION__, [_url scheme]); RELEASE(self); return nil; } self->shallCache = _flag; self->url = [_url copy]; self->status = NSURLHandleNotLoaded; return self; } - (void)dealloc { [self->cachedResponse release]; [self->url release]; [super dealloc]; } - (WOResponse *)_fetchURL:(NSURL *)_url { WOHTTPConnection *connection; WORequest *request; WOResponse *response = nil; NSString *luri; connection = [[WOHTTPConnection alloc] initWithHost:[_url host] onPort:[[_url port] intValue]]; if (connection == nil) { self->status = NSURLHandleLoadFailed; return nil; } if ((luri = [_url path]) == nil) { self->status = NSURLHandleLoadFailed; return nil; } if ([[_url query] isNotEmpty]) { luri = [[luri stringByAppendingString:@"?"] stringByAppendingString:[_url query]]; } request = [[WORequest alloc] initWithMethod:@"GET" uri:luri httpVersion:@"HTTP/1.0" headers:nil content:nil userInfo:nil]; if (request == nil) { [connection release]; self->status = NSURLHandleLoadFailed; return nil; } if ([connection sendRequest:request]) { if ((response = [[connection readResponse] retain])) { if (self->shallCache) { ASSIGN(self->cachedResponse, response); } self->status = NSURLHandleLoadSucceeded; } else self->status = NSURLHandleLoadFailed; } else { self->status = NSURLHandleLoadFailed; } [request release]; [connection release]; return [response autorelease]; } - (NSData *)loadInForeground { WOResponse *response; NSData *data; response = [self _fetchURL:self->url]; data = [response content]; RETAIN(data); return AUTORELEASE(data); } - (void)loadInBackground { [self loadInForeground]; } - (void)flushCachedData { RELEASE(self->cachedResponse); self->cachedResponse = nil; } - (NSData *)resourceData { if (self->cachedResponse) { NSData *data; data = [self->cachedResponse content]; RETAIN(data); return AUTORELEASE(data); } return [self loadInForeground]; } - (NSData *)availableResourceData { NSData *data; data = [self->cachedResponse content]; RETAIN(data); return AUTORELEASE(data); } - (NSURLHandleStatus)status { return self->status; } - (NSString *)failureReason { if (self->status != NSURLHandleLoadFailed) return nil; return @"loading of HTTP URL failed"; } /* properties */ - (id)propertyForKey:(NSString *)_key { WOResponse *response; if (self->cachedResponse) return [self->cachedResponse headerForKey:_key]; response = [self _fetchURL:self->url]; return [response headerForKey:_key]; } - (id)propertyForKeyIfAvailable:(NSString *)_key { return [self->cachedResponse headerForKey:_key]; } /* writing */ - (BOOL)writeData:(NSData *)__data { WOHTTPConnection *connection; WORequest *request; WOResponse *response; [self flushCachedData]; connection = [[WOHTTPConnection alloc] initWithHost:[self->url host] onPort:[[self->url port] intValue]]; if (connection == nil) return NO; request = [[WORequest alloc] initWithMethod:@"PUT" uri:[self->url path] httpVersion:@"HTTP/1.0" headers:nil content:__data userInfo:nil]; if (request == nil) { RELEASE(connection); return NO; } if ([connection sendRequest:request]) response = [connection readResponse]; else response = nil; if (response) { if ([response status] != 200) response = nil; } RELEASE(request); RELEASE(connection); return response ? YES : NO; } @end /* WOHTTPURLHandle */ SOPE/sope-appserver/NGObjWeb/WOMessage+Validation.m0000644000000000000000000001026712242733417021003 0ustar rootroot/* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include "common.h" @interface WOMessageSaxValidator : SaxDefaultHandler < SaxErrorHandler > { id parser; NSMutableArray *issues; } + (id)validatorWithXmlReaderName:(NSString *)_name; - (NSArray *)validateContent:(NSData *)_content withType:(NSString *)_ctype; @end @implementation WOMessageSaxValidator static BOOL valDebugOn = NO; - (id)initWithXmlReaderName:(NSString *)_name { if ((self = [super init])) { SaxXMLReaderFactory *factory; factory = [SaxXMLReaderFactory standardXMLReaderFactory]; self->parser = [[factory createXMLReaderWithName:_name] retain]; if (self->parser == nil) { [self release]; return nil; } /* we are only interested in errors */ [self->parser setErrorHandler:self]; } return self; } + (id)validatorWithXmlReaderName:(NSString *)_name { return [[[self alloc] initWithXmlReaderName:_name] autorelease]; } - (void)dealloc { [self->issues release]; [self->parser release]; [super dealloc]; } /* issues */ - (void)addIssue:(id)_issue { if (_issue == nil) return; if (self->issues == nil) self->issues = [[NSMutableArray alloc] initWithCapacity:16]; [self->issues addObject:_issue]; } - (void)reset { [self->issues removeAllObjects]; } /* validation */ - (void)warning:(SaxParseException *)_exception { [self addIssue:_exception]; } - (void)error:(SaxParseException *)_exception { [self addIssue:_exception]; } - (void)fatalError:(SaxParseException *)_exception { [self addIssue:_exception]; } - (NSArray *)validateContent:(NSData *)_content withType:(NSString *)_ctype { NSArray *tmp; [self reset]; if (self->parser == nil) return nil; [self debugWithFormat:@"validate %@, content size %d", _ctype, [_content length]]; [self->parser parseFromSource:_content systemId:[@"validator://" stringByAppendingString:_ctype]]; tmp = [self->issues copy]; [self reset]; if (tmp == nil) [self debugWithFormat:@" no issues found :-)"]; else [self debugWithFormat:@" %d issues found :-|", [tmp count]]; return [tmp autorelease]; } /* debugging */ - (BOOL)isDebuggingEnabled { return valDebugOn; } @end /* WOMessageHTMLValidator */ @implementation WOMessage(Validation) - (id)validatorForContentType:(NSString *)_ctype { if ([_ctype hasPrefix:@"text/html"]) { // Note: the HTML driver does not report invalid tags return [WOMessageSaxValidator validatorWithXmlReaderName: @"libxmlHTMLSAXDriver"]; } if ([_ctype hasPrefix:@"text/xml"]) { return [WOMessageSaxValidator validatorWithXmlReaderName: @"libxmlSAXDriver"]; } if ([_ctype hasPrefix:@"image/"]) return nil; if ([_ctype hasPrefix:@"application/octet-stream"]) return nil; if ([_ctype hasPrefix:@"text/plain"]) return nil; [self logWithFormat:@"no validator for type: %@", _ctype]; return nil; } - (NSArray *)validateContent { NSString *ctype; id validator; #if 0 [self logWithFormat:@"should validate output"]; #endif if ((ctype = [self headerForKey:@"content-type"]) == nil) return [NSArray arrayWithObject:@"missing content type."]; if ((validator = [self validatorForContentType:ctype]) == nil) return nil; return [validator validateContent:[self content] withType:ctype]; } @end /* WOMessage(Validation) */ SOPE/sope-appserver/NGObjWeb/ChangeLog0000644000000000000000000051770312242733417016466 0ustar rootroot2013-06-20 Jean Raby * Defaults.plist: don't hardcode the loglevel for WOHttpTransactionLoggerConfig, use default * Templates/WOxElemBuilder.m: don't setLogLevel on the defaultLogger * WOApplication.m: don't setLogLevel on the defaultLogger * WOHttpAdaptor/WORequestParser.m: don't setLogLevel on the defaultLogger 2012-02-05 Jean Raby * WOHttpAdaptor/WOHttpTransaction.m (applyAdaptorHeadersWithHttpRequest): Use x-forward or x-forwarded for headers if remote-host isn't set Allows for more useful logging (SOGo #2229) 2012-09-10 Francis Lachapelle * NGHttp+WO.m (-_decodeFormContentURLParameters:): fixed decoding of unicode characters in URI. 2012-09-04 Francis Lachapelle * WEClientCapabilities.m (-initWithRequest): recognize OS X 10.8 useragents. 2012-01-31 Francis Lachapelle * WORequest.m (-languageForBrowserLanguageCode:): some browsers send the language name instead of the language code. * Languages.plist: Added mappings for nn and nn-no. 2011-10-17 Francis Lachapelle * WebDAV/SoObjectWebDAVDispatcher.m (-extractDestinationPath:fromContext:): Don't fail if none of the source and destination port is undefined. 2010-10-08 Wolfgang Sourdeau * WOHttpAdaptor/WOHttpAdaptor.m (-acceptControlMessage:): added some debugging messages when a control message fails to pass. * WOWatchDogApplicationMain.m (-_setupProcessName): removed method as differentiating between watchdog and children via -[NSProcessInfo processName] is not reliable. (-readMessage): added display of the [controlSocket lastException] when a status read error occurred. 2010-02-24 Wolfgang Sourdeau * WOWatchDogApplicationMain.m (_spawnChild:): we set a timeout of 1 second to the parent-side child control socket to avoid hang on status reads when the child dies before the message reaches the parent. 2010-02-18 Wolfgang Sourdeau * WOWatchDogApplicationMain.m (-run:argc:argv:): we assign the loop timer to an ivar so that it can be invalidated when a child process is spawned. Child processes are check at each loop, since receiving SIGCHILD is not guaranteed and we deadlock when all remaining processes are zombies. (-_setupSignals): SIGCHILD is no longer trapped. (-readMessage): we now setup a 10 minutes timer when the child accepts the request up to the moment its done with it. This provides a supplemental safety for deadlocked children. (WOWatchDogApplicationMain): we no longer care about the return values for fdreopen since this is useless and is not portable. 2010-02-03 Wolfgang Sourdeau * WOCookie.m (-stringValue): pass an minimal english locale dictionary when producing expiration date representation to avoid using the system locale. 2010-01-29 Wolfgang Sourdeau * Templates/WOxComponentElemBuilder.m (-buildElement:tempateBuilder:): "children" (local) is the result of a "buildXXX" method that we won't return, so we autorelease it to avoid leaks. * Templates/WOxTemplateBuilder.m (-buildTemplateAtURL): same as below for "root". * Templates/WOWrapperTemplateBuilder.m (-buildTemplateAtURL): avoid a leak by releasing "rootElement" (local) when used. * Templates/WOxElemBuilder.m (-buildNodes:templateBuilder:): the "buildXXX" methods return retained objects all through NGObjWeb, here too now. * DynamicElements/_WOTemporaryHyperlink.m (-initWithName:associations:contentElements:): same as below for "template". * DynamicElements/WOString.m (-initWithName:associations:template:): "avalue" and "aescape" are local variables and OWGetProperty always returns a retained object. Therefore we want to release them after their use. * DynamicElements/WOxHTMLElemBuilder.m (-buildContainer:templateBuilder:): same as below. * DynamicElements/WOConditional.m (-initWithNegateElement:templateBuilder:): same as below. * DynamicElements/WOGenericElement.m (-initWithElement:templateBuilder:): "children" is retained when returned from "buildNodesXX" but is not an ivar so we want to autorelease that result to avoid leaks. * WOComponentDefinition.m (-load): the "buildXX" methods already return retained objects. We don't want to retain them once more. 2010-01-28 Wolfgang Sourdeau * WOHttpAdaptor/WOHttpAdaptor.m (-registerForEvents): the controlSocket is now a retained ivar, that we further use for validation in -acceptControlMessage:. * WOHTTPConnection.m: got rid of "runloop based IO" code, which was useless and error prone. 2010-01-14 Wolfgang Sourdeau * SoObjects/SoObject.m (-isFolderish): now a real category method, defaulting to NO. * WebDAV/SoWebDAVRenderer.m (-renderSearchResultEntry:...): take the potential ending slash of the request to keep or remove the ending slash of the hrefs to the returned objects, in order to avoid confusing iCal with otherwise standard urls to DAV collections. 2009-12-22 Wolfgang Sourdeau * WOWatchDogApplicationMain.m (_listeningAddress): read "WOPort" from the user defaults rather than by invoking [WOApplication port], which returns an NSNumber. 2009-12-14 Wolfgang Sourdeau * WOWatchDogApplicationMain.m (-run:argc:argv:): added a repeatable timer, triggered every 0.5 seconds, that ensures the proper looping of the runloop when a signal was received. 2009-12-09 Wolfgang Sourdeau * WOWatchDogApplicationMain.m (_handleSIGCHLD:) (_handleTermination:, _handleSIGHUP:): the actual handling is now done elsewhere, in order to avoid messing with memory allocation and risking a dead lock. (-_handlePostTerminationSignal): we set "terminate" to YES if all children are already down, in order to avoid another deadlock where the process termination would stall waiting for SIGCHLD. (-receivedEvent:type:extra:forMode:): check that the control socket is still "alive" before reading from it. If not, we unregister the filedescriptor passed as "data" from the runloop listener. 2009-12-07 Wolfgang Sourdeau * WOCoreApplication.m (+initialize): we invoke "registerUserDefaults" from here now. This enables Defaults.plist to be registered as soon as the watchdog is active. * WOWatchDogApplicationMain.m (-terminate): we use a SIGTERM to terminate the children instead of passing a message. We also setup a timer that will send a SIGKILL after 5 minutes. (-_releaseListeningSocket): we close the socket here so that other processes can start listening. (WOWatchDogApplicationMain): we accept "-" as argument to "WOLogFile" so that we avoid redirecting the output and the error channels. 2009-11-11 Wolfgang Sourdeau * WOCoreApplication.m (-setControlSocket, -controlSocket) (-setListeningSocket, -listeningSocke): new helper accessors for the new watchdog mechanism. * WOHttpAdaptor/WOHttpAdaptor.m: slightly refactored to use the control socket provided by the watchdog. * WOWatchDogApplicationMain.m: rewritten the watchdog mechanism: - added WOWatchDog and WOWatchDogChild classes - make use of UnixSignalHandler - added support for preforked preocesses (WOWorkersCount) - detach watchdog processes from terminal by default (WONoDetach) - redirect stderr and stdout to file (WOLogFile = /var/log/[name]/[name].log) - write pid file (WOPidFile = /var/run/[name]/[name].pid) - use "127.0.0.1:port" as default bind address, unless WOHTTPAllowHost is specified - added support for delaying process respawning (WORespawnDelay = 5 seconds) 2009-10-26 Wolfgang Sourdeau * WOMessage+XML.m (-contentAsDOMDocument): do not retain "dom" as it will be assigned to self->domCache, to avoid a leak. 2009-10-21 Wolfgang Sourdeau * WebDAV/SoObjectResultEntry.m (-valueForKey:): we now take WOUseRelativeURLs into account when the "href" key is requested, to work around a bug in iCal 4. 2009-07-02 Wolfgang Sourdeau * WOMessage.m (-setHeaders:, -setHeader:forKey:, headerForKey:, -appendHeader:forKey:, -appendHeaders:forKey:, setHeaders:forKey:, -headersForKey:): convert the specified header key to lowercase, to ensure they are managed case-insensitively. * WOHttpAdaptor/WOHttpTransaction.m (-deliverResponse:toRequest:onStream:): if the content-type is specified and already has "text/plain" as prefix, we don't override it. 2009-07-01 Wolfgang Sourdeau * WOHttpAdaptor/WOHttpTransaction.m (-deliverResponse:toRequest:onStream:): we test the content-length and impose a content-type of text/plain when 0. This work-arounds a bug in Mozilla clients where empty responses with a content-type set to X/xml will trigger an exception. 2009-06-10 Helge Hess * DAVPropMap.plist: mapped {DAV:}current-user-principal (v4.9.37) 2009-04-30 Helge Hess * WOHttpAdaptor/WOHttpTransaction.m: added HTTP reason for 304 (v4.7.36) 2009-04-30 Helge Hess * SoPageInvocation.m, SoActionInvocation.m: retain behaviour of instantiateMethod: is now consistent (v4.7.35) 2009-03-24 Wolfgang Sourdeau * WebDAV: added support for dispatch of MKCALENDAR (v4.7.34) 2009-03-24 Wolfgang Sourdeau * SoObjects/SoObject+Traversal.m: added MKCALENDAR as a 'create' method (v4.7.33) 2009-03-24 Wolfgang Sourdeau * WOHttpAdaptor/WOHttpTransaction.m: implement parser:contentTypeOfPart: (returns text/plain) [TBD: explain] (v4.7.32) 2009-03-24 Wolfgang Sourdeau * Defaults.plist, NGHttp/NGHttpRequest.[hm]: added MKCALENDAR, MKADDRESSBOOK as known HTTP methods (v4.7.31) 2009-03-24 Wolfgang Sourdeau * DAVPropMap.plist: added a set of new DAV property to short name mappings, DeltaV, CalDAV and CardDAV (v4.7.30) 2009-03-24 Wolfgang Sourdeau * WOContext.m(-serverURL): added a way to override the server URL using the WOApplicationRedirectURL default (hh: when is this necessary?) (v4.7.29) 2009-03-24 Wolfgang Sourdeau * SoObjects/SoActionInvocation.m ([SoActionInvocation -bindToObject:inContext:]): do not retain methodObject when instantiated since it is not autoreleased. (v4.7.28) 2008-12-11 Helge Hess * WOHttpAdaptor/WOHttpAdaptor.m: properly embed threaded request handler in a top-level pool (v4.7.27) 2008-09-01 Ludovic Marcotte * WORequest.m ([WORequest -browserLanguages]): we ensure "language" never is an empty string, otherwise we ignore it. 2008-05-21 Sebastian Reitenbach * WOHTTPURLHandle.m: add 'query' component of URL to request path (OGo bug #1980) (v4.7.26) 2008-06-30 Adam Williams * WebDAV/SoObjectWebDAVDispatcher.m: allow application/xml as a content type for WebDAV REPORTs (OGo bug #1986) (v4.7.25) 2008-03-11 Helge Hess * WEClientCapabilities.m: added ZideOne connector as a known user agent (v4.7.24) 2008-03-11 Helge Hess * DAVPropMap.plist: added more GroupDAV2 properties (v4.7.23) 2008-03-11 Helge Hess * DAVPropMap.plist: mapped {http://www.groupdav.org/}component-set WebDAV property to gdavComponentSet (v4.7.22) 2008-02-15 Helge Hess * WOCookie.m: fixed bug pointed out by Stephane, use -UTF8String to decode the cookie (was -cString) (v4.7.21) 2008-02-05 Helge Hess * DynamicElements/_WOComplexHyperlink.m: use NO, not 'false', as suggested by Wolfgang (v4.7.20) 2008-02-02 Helge Hess * DynamicElements/_WOComplexHyperlink.m: do not attempt to rewrite pure fragment URLs (v4.7.19) 2007-11-26 Helge Hess * WOComponent+Sync.m: use -setValue:forKey: instead of -takeValue:forKey: on gnustep-base (might also make sense on Cocoa starting with 10.4). As suggested by Sebastian (v4.7.18) 2007-10-16 Helge Hess * WEClientCapabilities.m: added wdfs as a known (WebDAV) user agent (v4.7.17) 2007-09-27 Helge Hess * Associations/WOKeyPathAssociation.m: clarified some code (v4.7.16) 2007-09-14 Helge Hess * SoObjects/SoHTTPAuthenticator.m, SoCookieAuthenticator.m: be more tolerant about the formatting of 'basic' auth credentials (wrt OGo bug #1911) (v4.7.15) 2007-08-29 Helge Hess * WEClientCapabilities.m: added CookComputing XML-RPC.NET as a known user-agent (fixes OGo bug #1910) (v4.7.14) 2007-06-29 Adam Williams * WEClientCapabilities.m: added PHP PEAR as a known user-agent (fixes OGo bug #1882) (v4.7.13) 2007-07-19 Marcus Mueller * v4.7.12 * DynamicElements/*.[hm]: moved WOHTMLDynamicElement.h to the public headers. This is required for some future extensions in WEPrototype. * NGObjWeb/WOActionURL.h: exposed API for elements which require link generation 2007-05-31 Helge Hess * v4.7.11 * NGHttp+WO.m, WOSimpleHTTPParser.m: process the 'charset' parameter of the request content type to extract the content encoding of the request * WOMessage.m: print a warning if -contentAsString got called but the content could not be converted using the charset assigned to the WORequest * WORequest.m: minor code cleanups, use isNotEmpty 2007-05-28 Helge Hess * DAVPropMap.plist: added HTTPMail junkemail property (v4.7.10) 2007-05-07 Helge Hess * NGHttp+WO.m, WORequest.m, NGHttp: minor code cleanups (v4.7.9) 2007-05-07 Helge Hess * WOSession.m: do not attempt to process 'nil' keys when working on extra variables (lead to NSDictionary exceptions) (v4.7.8) 2007-05-08 Helge Hess * WOApplication.m: properly call +_setupSNS method (fixes OGo bug #1867) (v4.7.7) 2007-03-22 Helge Hess * WORequest.m, WebDAV/SoWebDAVRenderer.m: fixed a gcc 4.1 warning (v4.7.6) 2007-03-16 Marcus Mueller * v4.7.5 * WOContext.[hm]: added fragmentID API from JOPE. This API provides a means for conditionally suppressing the rendering of WOElements - this is triggered by a 'wofid' URL parameter; comes in very handy when dealing with AJAX. * WORequest.[hm]: added -fragmentID API. * WOResponse+private.h: added new convenience macros * DynamicElements/WOFragment.[m,api]: new dynamic element for triggering render state * WOChildComponentReference.m, WEClientCapabilities.m, DynamicElements/*.m: all elements obey WOContext's new -isRenderingDisabled flag now 2007-03-13 Marcus Mueller * WORepetition.m: Reverted 'list' binding extensions as this had side effects with existing code. I advise using 'asArray' trampolines in situations where the 'list extension' was helpful. (v4.7.4) 2007-03-06 Helge Hess * Templates/WOWrapperTemplateBuilder.m: allow component classes in <#hash/> references (eg <#Frame>) (v4.7.3) 2007-02-27 Marcus Mueller * WORepetition.m: minor code cleanup. Extended the 'list' binding so that it's possible now to bind any object as a list - this helps in cases where provided objects are either arrays or ordinary objects. (v4.7.2) 2007-02-08 Helge Hess * v4.5.266 * SoObject.m, SoWebDAVRenderer.m: made the URL generation honour the WOUseRelativeURLs default (which is on by default, so all generated WebDAV URLs now do not include the hostname) * DAVPropMap.plist: mapped calendar-color WebDAV property * WebDAV/SoWebDAVRenderer.m: added support for XML properties which contain values (v4.5.265) * DAVPropMap.plist: added mappings for calendar-home-set, dropbox-home-URL and notifications-URL CalDAV properties (v4.5.264) 2007-01-17 Helge Hess * WebDAV/SoObjectWebDAVDispatcher.m: never report 404 WebDAV properties in combination with requests (this hacks in the 'brief' header into the request) (v4.5.263) 2006-12-30 Marcus Mueller * v4.5.262 * WOCoreApplication.m: Removed the +_initDefaults class method and instead added a new -registerUserDefaults method which provides a sane hook to alter/extend registration of userDefaults in subclasses. Registration is called very early by -init, though, so subclassers must still act very carefully. Removed the braindead +_initializeClass method, instead moved the proper initialization code into -init. * WOCoreApplication.h: exposed -registerUserDefaults to subclassers. * WOApplication.m: removed +_initializeWOApp, instead moved initialization code to the proper place in -init (after super has been initialized and user defaults have been set in a proper manner). 2006-12-17 Marcus Mueller * DynamicElements/WORepetition.m: fixed another bug when using count without index and list (v4.5.261) 2006-12-14 Marcus Mueller * DynamicElements/WORepetition.m: fixed a bug when using count without index and list (v4.5.260) 2006-12-13 Helge Hess * Templates/WOHTMLParser.m: fixed a bug with lowercase NAME tags in wrapper templates (v4.5.259) 2006-11-23 Wolfgang Sourdeau * NGHttp: added DeltaV HTTP methods (v4.5.258) * SoObjects/SoProductClassInfo.m: enable the use of arrays in the declaration of default roles for a permission in product.plist files (v4.5.257) 2006-11-14 Helge Hess * WEClientCapabilities.m: added Sunbird as a known user-agent (v4.5.256) 2006-11-08 Helge Hess * DynamicElements/WOCopyValue.m: fixed an uninitialized local (v4.5.255) 2006-11-03 Helge Hess * v4.5.254 * DynamicElements/WOInput.m: changed to use -warnWithFormat: * DynamicElements/WOCheckBox.m: subminor code cleanup 2006-11-02 Helge Hess * woapp-gs.make: fixed a bug in a variable test for which_lib, note that WHICH_LIB_SCRIPT must be defined for older gnustep-make versions (v4.5.253) 2006-09-20 Helge Hess * DynamicElements: filter out -O% flags for files using exception handlers, enable -O2 per default (v4.5.252) 2006-09-18 Marcus Mueller * wobundle-gs.make: basically reverted to r103, but with the WHICH_LIB_SCRIPT check enabled - the rest was garbage which accidentaly got committed, unsure how that happened in the first place (v4.5.251) 2006-09-18 Helge Hess * removed deprecated woapp.make, wobundle.make (v4.5.250) 2006-09-12 Marcus Mueller * woapp-gs.make, wobundle-gs.make: play nicely with gnustep-make 1.13.0, where WHICH_LIB_SCRIPT has been removed (v4.5.249) 2006-09-10 Helge Hess * DynamicElements/WOForm.m: added 'fragmentIdentifier' binding to generate actions which contains a named link (#tasks) (v4.5.248) 2006-09-05 Helge Hess * DynamicElements/WOCheckBoxList.m: fixed a typo (v4.5.247) 2006-08-31 Helge Hess * WebDAV/SoObjectWebDAVDispatcher.m: code cleanups, use -isNotEmpty (v4.5.246) 2006-08-31 Wolfgang Sourdeau * DynamicElements/WOCheckBoxList.m: embed 'suffix' label binding in a label tag enclosing the checkbox (v4.5.245) 2005-08-15 Sebastian Reitenbach * WOWatchDogApplicationMain.m: include instead of , fixes warnings on BSD and works with Linux too (v4.5.244) 2006-08-15 Helge Hess * WEClientCapabilities.m: properly mark Safari as a JavaScript capable browser (v4.5.243) 2006-08-03 Wolfgang Sourdeau * WebDAV/SoWebDAVRenderer.m: added special handling for 0-port values in URLs (v4.5.242) 2006-07-25 Marcus Mueller * Templates/WODParser.m: fixed an infinite loop bug during comment scanning that occured when a multiline comment contained a '*' (v4.5.241) 2006-07-05 Helge Hess * v4.5.240 * SoObjects/SoProductRegistry.m, SoObjects/SoProductLoader.m: changed to find SoProducts on 64bit systems in lib64, added FHS_INSTALL_ROOT to lookup path * Templates/WOApplication+Builders.m: changed to find WOxBuilders on 64bit systems in lib64, added FHS_INSTALL_ROOT to lookup path 2006-07-03 Helge Hess * use %p for pointer formats, fixed gcc 4.1 warnings, use -warnWithFormat: when appropriate (v4.5.239) 2006-06-22 Helge Hess * DAVPropMap.plist: added three more WebDrive properties, "{DAV:}srt_lastaccesstime", "{DAV:}SRT_fileattributes", "{DAV:}BSI_isreadonly" (v4.5.238) 2006-06-21 Helge Hess * DAVPropMap.plist: added WebDrive WebDAV properties: {DAV:}srt_creationtime, {DAV:}srt_modifiedtime, {DAV:}srt_proptimestamp (v4.5.237) * v4.5.236 * WEClientCapabilities.m: added WebDrive as a known WebDAV client * fixed some gcc 4.1 warnings 2006-06-11 Helge Hess * v4.5.235 * WebDAV/SoWebDAVRenderer.m: added a hack for Cadaver so that it doesn't show errors on missing properties (enabled 'brief' mode), log missing properties if debug is enabled * fixed some gcc 4.1 warnings 2006-06-04 Helge Hess * WebDAV/SoWebDAVDispatcher.m: added some basic REPORT support, allows mapping of the top-level report XML element name to a SoMethod (v4.5.234) 2006-05-20 Marcus Mueller * DynamicElements/WOForm.api: added wosid parameter. There probably are a lot more parameters we want to add; also, it might be a good idea to mark them as such - this would enable proper validation in .wox files, as they must be prefixed with an underscore in the XML. 2006-05-16 Marcus Mueller * *m: changed EOControl related includes into imports to enable compilation against MulleEOF (v4.5.233) 2006-05-05 Helge Hess * WebDAV/SoWebDAVRenderer.m: deliver more lockinfo fields when a lock is acquired. This solves an issue with files being openened in Word 2003 in readonly mode. (v4.5.232) * v4.5.231 * WebDAV/SoWebDAVRenderer.m: major change: WebDAV properties which got NSNull as their value are now rendered in a 404-propstat element. So if you want to have empty properties delivered, return empty strings. * SoObjects/SoObjectRequestHandler.m: minor code cleanups * WEClientCapabilities.m: added support for Office 2003 2006-05-04 Helge Hess * v4.5.230 * WebDAV/SoObjectWebDAVDispatcher.m: added default 'SoWebDAVDisableCrossHostMoveCheck' to disable the check for the hostname on WebDAV MOVE/COPY operations. This can give issues when Apache is accessed with different DNS names or IPs. * WOHttpAdaptor/WOHttpTransaction.m: log HTTP request size after response size 2006-05-01 Helge Hess * v4.5.229 * DAVPropMap.plist: added some WebDAV mappings for Novell NetDrive * WebDAV: fixed some gcc 4.1 warnings 2006-04-23 Helge Hess * SoObjects/SoObjectMethodDispatcher.m: added support for x-http-method-override header (v4.5.228) * SoObjects/SoHTTPAuthenticator.m: prepared some Google login API support (v4.5.227) 2006-04-12 Marcus Mueller * WOHttpAdaptor/WOHttpAdaptor.m: shifted retrieval of WOPort default from +initialize to -addressFromDefaultsOfApplication:, so apps that may add adaptors on demand during runtime can do so. (v4.5.226) 2006-04-01 Helge Hess * v4.5.225 * SoObjects/SoSelectorInvocation.m: added default to enable debugging (SoSelectorInvocationDebugEnabled) * SoObjects/SoObjectSOAPDispatcher.m: improved to SOAP request dispatcher to work with iFolder generated requests 2006-03-15 Marcus Mueller * NGObjWeb.xcodeproj: latest additions added to Xcode build 2006-03-14 Helge Hess * v4.5.224 * Associations/WOKeyPathAssociation.m: fixed a crasher in a debug log * WOContext.m: changed to generate relative component action URLs in case the request already was a valid component action URL. added a way to detect whether the context session is a fresh one. * WOComponentRequestHandler.m, WOApplication.m: minor code cleanups, use -isNotEmpty 2006-03-12 Helge Hess * v4.5.223 * SoObjects: started SoCookieAuthenticator * SoObjects/SoHTTPAuthenticator.m: code cleanups * SoObjects/SoProductLoader.m: quickfix to API (v4.5.222) * SoObjects: added new class SoProductLoader which can be used to load SoProduct bundles for a given application (v4.5.221) 2006-02-26 Marcus Mueller * NGObjWeb.xcodeproj: UnixSignalHandler.h is public now 2006-02-23 Helge Hess * Associations/WOKeyPathAssociation.m: use logging framework (v4.5.220) 2006-02-22 Helge Hess * WOComponent.m, WODirectAction.m, DynamicElements/WOBrowser.m: minor code cleanups (v4.5.219) 2006-01-25 Marcus Mueller * SoObjects/SoObject+Traversal.m: stop traversal immediately if an exception was returned (v4.5.218) * SoObjects/SoObject+Traversal.m: minor code cleanups (v4.5.217) 2005-11-21 Helge Hess * WebDAV/SoObjectWebDAVDispatcher.m: set 'public' header in case the WebDAV client is WebFolders (v4.5.216) * WEClientCapabilities.m: added WebFolders WinXP SP2 as a known user agent (v4.5.215) * Associations/WOAssociation.[hm]. WOKeyPathAssociation.m: explicitly type signed char values to avoid gcc4 warnings (v4.5.214) 2005-11-20 Helge Hess * v4.5.213 * DynamicElements/_WOComplexHyperlink.m: fixed a logging bug of WODebugStaticLinkProcessing (#fixes OGo bug #1624) * SoObjects/SoObjectRequestHandler.m: minor code cleanups 2005-11-17 Helge Hess * v4.5.212 * DynamicElements/WOCopyValue.m: fixed a gcc3 warning * include string.h where required 2005-11-13 Helge Hess * DynamicElements/WORadioButton.m: added some comments and a warning about issues wrt request handling (v4.5.211) 2005-11-01 Helge Hess * WOSession.m ([WOSession -takeValuesFromRequest:inContext:]): changed handling of -takeValues in combination with directaction components (v4.5.210) 2005-10-16 Jean-Alexis Montignies * DynamicElements/WOSwitchComponent.m: properly consume element-id component in -invokeAction: (OGo bug #1590) (v4.5.209) 2005-10-06 Helge Hess * WebDAV/SoObjectWebDAVDispatcher.m: decode XML content of REPORT requests (v4.5.208) 2005-10-05 Helge Hess * DynamicElements/WOCompoundElement.m: setup defaults in +initialize (v4.5.207) 2005-10-05 Helge Hess * DynamicElements/WORadioButtonList.m: changed handling of 'disabled' during -takeValuesFromRequest:. Now the index/item bindings are pushed, and then the 'disabled' binding is checked prior setting the 'selection' to the item (the item will not get selected if its disabled). (v4.5.206) * DynamicElements/WOSubmitButton.m: disable KVC push for 'value' binding in -takeValuesFromRequest:inContext:. This is usually not required but results in issue #1568 on OSX. The old behaviour can be reenabled by setting the WOSubmitButtonEnableValueSync default to YES (v4.5.205) 2005-10-03 Helge Hess * WODisplayGroup.m: added -qualifyDataSourceAndReturnDisplayCount method to support qualification via .wod, make use of -isNotEmpty (v4.5.204) 2005-09-29 Marcus Mueller * DynamicElements/_WOComplexHyperlink.m: changed -shouldRewriteURLString:inContext: to only rewrite url strings which either do not bear a scheme or have an `http' scheme (v4.5.203) 2005-09-27 Helge Hess * DynamicElements/WOPopUpButton.m: fixed a bug in the 'selection' which occurred when the element is being used with the 'value' binding (returned the last item instead of nil for 'noSelectionString') (v4.5.202) 2005-09-18 Helge Hess * GNUmakefile.preamble: added missing linking path to NGMail (required on OSX) (v4.5.201) 2005-09-15 Helge Hess * started WOxTalElemBuilder (v4.5.200) 2005-09-13 Marcus Mueller * DynamicElements/_WOComplexHyperlink.m: do not generate hyperlink if "disabled" evaluates true. This matches the behaviour of WebObjects 4.5 and guarantees to do the right stuff in the context of SOPE applications also. (v4.5.199) 2005-09-07 Helge Hess * Templates/WOxElemBuilder.m: added several support methods to assist builder subclasses to build WOElements (moved in from OGo) (v4.5.198) 2005-09-06 Helge Hess * v4.5.197 * Templates/WOWrapperTemplateBuilder.m: attributes of or <#Element> tags are now added as associations to dynamic elements. The type of the association is determined by the prefix (hardcoded: var, const, so, rsrc). Tag attributes have precedence over wod associations so that you can define defaults in the .wod file and override them in the .html template. If the .wod file does not contain a definition for a given tagname, the parser will now attempt to treat the tagname as a class (eg: <#WOString var:value="name"/> now works w/o any .wod entry). * Templates/WOHTMLParser.m (_parseHashElement): parse attributes defined in hash tags (eg <#abc value="abc"/>) * DynamicElements/WOSwitchComponent.m, DynamicElements/WOComponentReference.m: minor code cleanups (v4.5.196) 2005-09-05 Marcus Mueller * v4.5.195 * DynamicElements/WOxMiscElemBuilder.m: mapped "set-header" to WOSetHeader element * DynamicElements/WOConditional.api: added SOPE extensions 2005-08-31 Helge Hess * v4.5.194 * DynamicElements/WOString.m: minor code cleanups * DynamicElements/WOxMiscElemBuilder.m: removed generation of radio-button-matrix (which is part of WOExtensions), added generation of WORadioButtonList () 2005-08-27 Helge Hess * GNUmakefile.preamble: improved dependency handling (v4.5.193) 2005-08-23 Helge Hess * v4.5.192 * DynamicElements/WOCopyValue.api: fixed required attribute * DynamicElements: added WOSetHeader dynamic element, this renders nothing and is used to manipulate the headers of the response being generated (or other objects with the same API) 2005-08-23 Marcus Mueller * DynamicElements/WOCopyValue.api: completed definition (v4.5.191) 2005-08-23 Helge Hess * v4.5.190 * GNUmakefile.preamble: added NGMail framework dependency * WODisplayGroup.m: fixed an issue with processing max qualifiers 2005-08-22 Helge Hess * v4.5.189 * DynamicElements/WOxComponentElemBuilder.m: expose WOCopyValue as in WOx * DynamicElements: added WOCopyValue dynamic element, this renders nothing and is used to copy KVC values at certain times during the template evaluation 2005-08-19 Helge Hess * v4.5.188 * WebDAV/SoObjectWebDAVDispatcher.m: reuse root-url construction method in SoObject.m * WebDAV/SoObjectDataSource.m, WebDAV/SoObjectResultEntry.m: removed two aborts * SoObjects/SoObject.m: added a hack to deal with buggy Debian apachessl (#1435), moved root-url construction method to a function 2005-08-16 Helge Hess * v4.5.187 * WOApplication.m: minor code cleanups * GNUmakefile, GNUmakefile.preamble: fixed installation of framework resources 2005-08-11 Helge Hess * ngobjweb.make: added support for OSX frameworks (v4.5.186) 2005-08-11 Marcus Mueller * Defaults.plist: changed 'NGLogDefaultAppenderClass' from 'NGLogStdoutAppender' to 'NGLogStderrAppender' (v4.5.185) 2005-08-06 Helge Hess * Templates/WOHTMLParser.m (_parseHashElement): fixed a bug in detecting errors (v4.5.184) 2005-08-05 Helge Hess * v4.5.183 * Templates/WOHTMLParser.m: improved error handling for hash-closetag typos (will warn when a slash follows a hash, eg "<#/blub>") * WODisplayGroup.m: implemented -setSelectedObject:/-selectedObject, changes -selectObject: to replace the full selection with the given object (correct?), added delete/insert operations * WOApplication.m: also check for CoreData NSManagedObjectContext when trying to locate an EOEditingContext like class 2005-08-04 Helge Hess * minor code cleanups (v4.5.182) 2005-08-03 Helge Hess * WODisplayGroup.m: detect whether an EOEditingContext is available at runtime (previously compile time), consolidated categories in the main class to allow for runtime overloading (v4.5.181) 2005-08-02 Helge Hess * v4.5.180 * WEClientCapabilities.m: added Google as a known user-agent * WOResourceManager.m, SoObjects/SoProductClassInfo.m: minor code cleanup * SoObjects/SoProductResourceManager.m: improved an error log 2005-07-23 Sebastian Reitenbach * GNUmakefile.preamble: added OpenBSD linking flags (v4.5.179) 2005-07-23 Helge Hess * WOContext.m: subminor code reformatting * NGHttp/NGUrlFormCoder.m: added some patch by Mont which changes URL handling on non-libFoundation platforms 2005-07-21 Helge Hess * SoObjects/WOContext+SoObjects.m: lookup SoUser using authenticator in case a clientObject is available and it wasn't set yet (when retrieving the user using -activeUser) (v4.5.178) 2005-07-20 Marcus Mueller * v4.5.177 * WOApplication.m: workaround the problem that context during page instantiation is always believed to be that of WOApplication. * WOResourceManager.m: added comment for possible resource lookup problem 2005-07-19 Helge Hess * WOContext.m: properly generate multivalue query parameters (value is an NSArray) (v4.5.176) * NGObjWeb/WOApplication.h: added +isDirectConnectEnabled, +setCGIAdaptorURL:, +cgiAdaptorURL prototypes (v4.5.175) * v4.5.174 * WOResourceManager.m: added method to retrieve a string-table object with a given name/framework/language * _WOStringTable.m: added methods to access a table like a dictionary, added -valueForKey: 2005-07-18 Helge Hess * v4.5.173 * DynamicElements/WOFileUpload.m: improved debug logging * DynamicElements/_WOComplexHyperlink.m: minor code cleanups * WOElement.m: improved handling of query parameters (now handles arrays of form values) 2005-07-13 Helge Hess * WebDAV/SoObject+SoDAV.m: changed not to return an etag per default (must be overridden by subclasses!) (v4.5.172) 2005-07-11 Helge Hess * v4.5.171 * WOComponentRequestHandler.m: stabilized session handling to properly deal with expired sessions and URLs without element-ids * WORequestHandler.m: properly register logger bound to 'WODebuggingEnabled' as debugLogger, not as the regular logger 2005-07-08 Helge Hess * SoObjects/SoHTTPAuthenticator.m: deprecated -authRealm, replaced with -authRealmInContext: (v4.5.170) * WOComponent.m: added support for WODebugTakeValues (v4.5.169) 2005-07-06 Helge Hess * WebDAV/SoObjectWebDAVDispatcher.m: fixed an issue when trying to call a WebDAV method on an object (v4.5.168) 2005-06-26 Helge Hess * v4.5.167 * WebDAV/SoWebDAVRenderer.m: improved reliability by checking the class of OPTIONS method results, deprecated array results * WebDAV/SoObjectWebDAVDispatcher.m: when receiving an OPTIONS request, the dispatcher will try to invoke a method with the same name on the object. If none is available, the dispatcher checks supported methods and DAV compliance classes * WebDAV/SoObject+SoDAV.m: added method to determine the WebDAV compliance classes supported by an object (davComplianceClassesInContext:). The method now only returns class 2 if the object returns a lock manager object. Also moved the 'allowed' processing to the object (-davAllowedMethodsInContext: method) 2005-06-24 Helge Hess * SoObjects/SoProductRegistry.m: fixed product lookup on MacOSX with GNUstep environment (v4.5.166) 2005-06-23 Stephane Corthesy * v4.5.165 * WOComponent.m: -synchronizesVariablesWithBindings now returns NO if the component is stateless (-isStateless returns YES) * WOComponent.m: -frameworkName now returns 'nil' if the component is located in the main bundle (this might affect resource lookups) * WOComponent.m: +templateWithHTMLString:declarationString:languages: is now a class method like in WO * WOComponent.m: -pathForResourceNamed: now checks whether a session is available and otherwise uses the browserLanguages array to perform a languages lookup 2005-06-10 Helge Hess * WEClientCapabilities.m: fixed a typo (v4.5.164) 2005-06-02 Helge Hess * WebDAV/SoObjectWebDAVDispatcher.m: prepared MKCALENDAR method (v4.5.163) 2005-06-01 Helge Hess * v4.5.162 * WebDAV/SoObjectWebDAVDispatcher.m: minor code cleanups, added support for PROPFIND without content (treated as ) * WebDAV/README: added content to the README 2005-05-30 Helge Hess * SoObjects/SoProductClassInfo.m: allow plain string values for slots in product.plist (v4.5.161) 2005-05-05 Helge Hess * WEClientCapabilities.m: added Perl HTTP::DAV as a known WebDAV user agent (v4.5.160) 2005-05-03 Helge Hess * Templates/WOApplication+Builders.m: fixed a typo (v4.5.159) 2005-05-03 Helge Hess * v4.5.158 * WOWatchDogApplicationMainOSX.m: fixed a gcc 4.0 warning * NGHttp, WOImage.m, WOString.m, _WOTemporaryHyperlink.m: fixed Tiger warnings * Templates/WOApplication+Builders.m: fixed an uninitialized variable on Cocoa (v4.5.157) 2005-04-25 Helge Hess * Templates/WODParser.m: fixed parsing of bool constants (got broken in v4.5.152) (OGo bug #1360) (v4.5.156) 2005-04-24 Helge Hess * v4.5.155 * WOMailDelivery.m: generate \r\n instead of \n when writing to the sendmail process * fixed gcc 4.0 warnings * WOHttpAdaptor, WebDAV: fixed gcc 4.0 warnings (v4.5.154) * v4.5.153 * Templates/WOHTMLParser.m: rewrote parser to use unichar * Templates: fixed gcc 4.0 warnings * v4.5.152 * Templates/WODParser.m: rewrote parser to use unichar * DynamicElements, WOResponse+private.h: fixed gcc 4.0 warnings 2005-04-12 Helge Hess * v4.5.151 * added generated manpages for all .api files * added woapi2man.py, a tool to generate man-pages from .api XML files (used for describing the bindings of dynamic elements) 2005-04-12 Helge Hess * v4.5.150 * fhs.make: install manpages * sope-ngobjweb-defaults: fixed a syntax error 2005-04-05 Helge Hess * DynamicElements/WOPopUpButton.m: added a template so that static