mirror of
https://github.com/gnustep/libs-gdl2.git
synced 2025-02-22 10:51:04 +00:00
* *.h/m, *.h/m): Used #include instead of depricated #import. Avoid including entire library headers. Use export macro where applicable. * EOControl/GNUmakefile: Removed EOKeyValueCodingBase.m/h and EOUndoMananger.h. Added EOArrayDataSource.m/h, EODefines.h and EODepricated.h. * EOControl/EODefines.h: Updated for GDL2 & gnustep-make. * EOControl/EODebug.h: Updated. * EOControl/EODepricated.h: Updated for current state of GDL2. ([NSObject +flushClassKeyBindings]): Added declaration. ([EOClassDescription +setDelegate:]): Added declaration. ([EOClassDescription +delegate]): Added declaration. (EOUndoManager): Moved declaration of interface here. * EOControl/EOKeyValueCoding.m ([EOClassDescription +flushClassKeyBindings]): Added empty implementation. ([NSObject takeStoredValuesFromDictionary:]): Cache EONull instance and use it instead of isKindOfClass:. * EOControl/EOEditingContext.m ([EOEditingContext +initialize]): Tidied. ([EOEditingContest -deleteObject]): Use NSUndoManager instead of EOUndoManager. * EOControl/EOQualifier.m ([NSArray -filteredArrayUsingQualifier:]): Added minor optimization tweak. * EOControl/EOClassDescription.m: Removed inactive commented code. Added private declerations of EOAccess methods to avoid compiler warnings. ([EOClassDescription +initialize]): Tidied. ([EOClassDescription -classDescriptionForClass:]): Use GSObjCName() instead of objc runtime routines. * EOControl/EOFault.m: Exchanged direct usages of ObjC runtime routines with NS/GSObjCRuntime abstraction API. ([EOFault +superclass]): Ditto. ([EOFault +targetClassForFault:]): Ditto. ([EOFault -respondsToSelector:]): Ditto. ([EOFault +initialize]): Cache static class variable. ([EOFault +isKindOfClass]): Use static class variable. ([EOFault +handlerForFault:]): Ditto. ([EOFault +targetClassForFault:]): Ditto. ([EOFault -dealloc]): Ditto. * EOControl/EOGenericRecord.m: ([EOGenericRecord +initialize]): Tidied. * EOControl/EOKeyComparisonQualifier.m: Tidied documentation. * EOControl/EOKeyValueQualifier.m: Ditto. * EOControl/EONSAddOns.h/m: Added declarations to surpress compiler warnings. ([NSObject -eoCompareOnName:]): Adjusted casts to surpress compiler warnings. (GSUseStrictWO451Compatibility): Added function. (GDL2GlobalLock, GDL2GlobalRecursive): Ditto. * EOControl/EONull: Remove implementations for foundation libraries without key value coding and fully rely on NSNull. Added assertions in all intance methods as instances should never be created. ([EONull +allocWithZone:]) Corrected method name so it will actually be used. * EOControl/EOSortOrdering.m ([NSArray sortedArrayUsingKeyOrderArray:]): Tidied. ([NSMutableArray sortUsingKeyOrderArray:]): Ditto. ([EONull compareAscending:]): Sync with referencs implementation. ([EONull compareDescending:]): Ditto. ([EONull compareCaseInsensitiveAscending:]): Ditto. ([EONull compareCaseInsensitiveDescending:]): Ditto. * EOAccess/EOAdaptor.h: Added comment about API compatibility. * EOAccess/EOAdaptor.m ([EOAdaptor -contexts]): Return array of adaptor contexts rather tham GC-wrapper objects containing adaptor contexts. ([EOAdaptor -databaseEncoding]): Use GSEncodingName() instead of GetEncodingName(). * EOAccess/EODatabaseContext.m ([EODatabaseContext -_turnFault:gid:editingContext:isComplete:]): Use GSObjCClass() instead of trying to access isa by dereferencing from id with incorrect member. * EOAccess/EOModel.m ([EOModel -entityNames]): Sort returned array to insure comparable output. * EOAccess/EOSQLExpression.m ([EOSQLExpression sqlStringForArrayOfQualifiers:operation:]): Added cast to surpress compiler warning. * EOAccess/EOUtilities.m ([EOObjectStoreCoordinator setModelGroup:]): Ditto. * EOAccess/EORelationship.h ([EORelationship -docComment]): Added declaration. * EOAccess/GNUmakefile: Added EODefines.h and EODepricated.h. * Tools/*.m: Use RCS_ID macro. * Tools/EOAttribute+GSDoc.h: ([EOAttribute gsdocContentWithTagName:idPtr:]): Corrected Typo. * Tools/EOModel+GSDoc.h/m: ([EOModel gsdocContentSplittedByEntities:idPtr:]): Ditto. * Tools/EORelationship+GSDoc.m: ([EORelationship gsdocContentWithTagName:idPtr:]): Change variable type to supress compiler warnings. * Tools/eoutil.m (dump): Initialize variables to supress compiler warnings. * Tools/gsdoc-model.m: Include GSCategories.h to supress compiler warnings. (main): Added cast to supress compiler warning. Fixed typo in method invocation. 2003-03-25 Stephane Corthesy <stephane@sente.ch> * EOControl/EODefines.h: Added new file for export/win32 support. * EOControl/EODepricated.h: Added new file for depricated features. * EOControl/EOControl.h: Added EOArrayDataSource.h and EODefines.h. * EOControl/EOArrayDataSource.h/m: Added new files. Some methods (<NSCoding> and qualifier bindings) are empty stubs. * EOControl/EODebug.h: Use export macro instead of explicit extern for function and symbol declarations. * EOControl/EOGlobalID.h: Ditto. * EOControl/EONull.h: Ditto. * EOControl/EOObjectStore.h: Ditto. * EOControl/EOOrQualifier.m: Replaced autorelease by AUTORELEASE and fixed typo. * EOControl/EOQualifier.m ([NSArray -filteredArrayUsingQualifier:]): Implemented. * EOControl/EONSAddOns.m: Use volatile in some exception handlers (man longjmp for more info). * EOControl/EOSortOrdering.h/m ([EOSortOrdering -copyWithZone:]): Implemented <NSCopying>. ([EOSortOrdering -encodeWithKeyValueArchiver:]): Implemented. * EOAccess/EODefines.h: Added new file for export/win32 support. * EOAccess/EODepricated.h: Added new file for depricated features. * EOAccess/EOAccess.h: Added EODefines.h. * EOAccess/EOSQLExpression.h/m: Fixed typo for EOPrimaryKeyConstraintKey. * EOAccess/EOExpressionArray.h/m: Use volatile for variables usein in exception handlers. (man longjmp for more info) * EOAccess/EODatabase.h: Use export macro instead of explicit extern for function and symbol declarations. * EOAccess/EOEntity.h: Ditto. * EOAccess/EOModel.h: Ditto. * EOAccess/EOSchemaGeneration.h: Ditto. * EOAccess/EOSQLExpression.h: Ditto. * EOAccess/EOUtilities.h: Ditto. * Tools/eoutil.m (dump): Implemented use of -postinstall option. Corrected bug when getting adaptor's expression class. Renamed symbol EOPrimaryKeyContraintsKey into EOPrimaryKeyConstraintsKey. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@16298 72102866-910b-0410-8b05-ffd578937521
275 lines
11 KiB
C
275 lines
11 KiB
C
/* debug.h - debug
|
|
Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc.
|
|
|
|
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
|
Date: Jan 1999
|
|
|
|
This file is part of the GNUstep Web 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; if not, write to the Free
|
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
*/
|
|
|
|
// $Id$
|
|
|
|
#ifndef _EODebug_h__
|
|
#define _EODebug_h__
|
|
|
|
// call with --GNU-Debug=EOFFn
|
|
|
|
#ifdef DEBUG
|
|
|
|
#ifndef NeXT_Foundation_LIBRARY
|
|
#include <Foundation/NSDebug.h>
|
|
#include <Foundation/NSAutoreleasePool.h>
|
|
#else
|
|
#include <Foundation/Foundation.h>
|
|
#endif
|
|
|
|
#include <EOControl/EODefines.h>
|
|
|
|
|
|
GDL2CONTROL_EXPORT void EOFLogC_(const char* file,int line,const char* string);
|
|
GDL2CONTROL_EXPORT void EOFLogDumpObject_(const char* file,int line,
|
|
id object,int deep);
|
|
GDL2CONTROL_EXPORT void EOFLogAssertGood_(const char* file,int line,
|
|
NSObject* object);
|
|
|
|
#define EOFLogC(cString); EOFLogC_(__FILE__,__LINE__,cString);
|
|
#define EOFLogDumpObject(object,deep); EOFLogDumpObject_(__FILE__,__LINE__,object,deep);
|
|
#define EOFLogAssertGood(object); EOFLogAssertGood_(__FILE__,__LINE__,object);
|
|
#else // no DEBUG
|
|
#define EOFLogC(cString);
|
|
#define EOFLogDumpObject(object,deep);
|
|
#define EOFLogAssertGood(object);
|
|
#endif // DEBUG
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
// call in Class-Methods
|
|
|
|
#define EOFLOGClassFnStart() \
|
|
do { if (GSDebugSet(@"EOFFn") == YES) { \
|
|
NSAutoreleasePool *tmpPool = [NSAutoreleasePool new]; \
|
|
NSString *fmt = GSDebugFunctionMsg(__PRETTY_FUNCTION__, __FILE__, __LINE__,@"FNSTART"); \
|
|
NSLog(fmt); [tmpPool release]; }} while (0)
|
|
|
|
#define EOFLOGObjectFnStartCond(cond) \
|
|
do { if ((GSDebugSet(@"EOFFn") == YES) && GSDebugSet(cond) == YES) { \
|
|
NSAutoreleasePool *tmpPool = [NSAutoreleasePool new]; \
|
|
NSString *fmt = GSDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTART"); \
|
|
NSLog(fmt); [tmpPool release]; }} while (0)
|
|
|
|
#define EOFLOGClassFnStartOrCond(cond) \
|
|
do { if ((GSDebugSet(@"EOFFn") == YES) || (GSDebugSet(cond) == YES)) { \
|
|
NSAutoreleasePool *tmpPool = [NSAutoreleasePool new]; \
|
|
NSString *fmt = GSDebugFunctionMsg(__PRETTY_FUNCTION__, __FILE__, __LINE__,@"FNSTART"); \
|
|
NSLog(fmt); [tmpPool release]; }} while (0)
|
|
|
|
#define EOFLOGClassFnStartOrCond2(cond1,cond2) \
|
|
do { if ((GSDebugSet(@"EOFFn") == YES) || (GSDebugSet(cond1) == YES) || (GSDebugSet(cond2) == YES)) { \
|
|
NSAutoreleasePool *tmpPool = [NSAutoreleasePool new]; \
|
|
NSString *fmt = GSDebugFunctionMsg(__PRETTY_FUNCTION__, __FILE__, __LINE__,@"FNSTART"); \
|
|
NSLog(fmt); [tmpPool release]; }} while (0)
|
|
|
|
#define EOFLOGClassFnStop() \
|
|
do { if (GSDebugSet(@"EOFFn") == YES) { \
|
|
NSAutoreleasePool *tmpPool = [NSAutoreleasePool new]; \
|
|
NSString *fmt = GSDebugFunctionMsg(__PRETTY_FUNCTION__,__FILE__, __LINE__,@"FNSTOP"); \
|
|
NSLog(fmt); [tmpPool release]; }} while (0)
|
|
|
|
#define EOFLOGObjectFnStopCond(cond) \
|
|
do { if ((GSDebugSet(@"EOFFn") == YES) && GSDebugSet(cond) == YES) { \
|
|
NSAutoreleasePool *tmpPool = [NSAutoreleasePool new]; \
|
|
NSString *fmt = GSDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTOP"); \
|
|
NSLog(fmt); [tmpPool release]; }} while (0)
|
|
|
|
#define EOFLOGClassFnStopOrCond(cond) \
|
|
do { if ((GSDebugSet(@"EOFFn") == YES) || (GSDebugSet(cond) == YES)) { \
|
|
NSAutoreleasePool *tmpPool = [NSAutoreleasePool new]; \
|
|
NSString *fmt = GSDebugFunctionMsg(__PRETTY_FUNCTION__,__FILE__, __LINE__,@"FNSTOP"); \
|
|
NSLog(fmt); [tmpPool release]; }} while (0)
|
|
|
|
#define EOFLOGClassFnStopOrCond2(cond1,cond2) \
|
|
do { if ((GSDebugSet(@"EOFFn") == YES) || (GSDebugSet(cond1) == YES) || (GSDebugSet(cond2) == YES)) { \
|
|
NSAutoreleasePool *tmpPool = [NSAutoreleasePool new]; \
|
|
NSString *fmt = GSDebugFunctionMsg(__PRETTY_FUNCTION__,__FILE__, __LINE__,@"FNSTOP"); \
|
|
NSLog(fmt); [tmpPool release]; }} while (0)
|
|
|
|
#define EOFLOGClassLevel(level,format) \
|
|
do { if (GSDebugSet(level) == YES) { \
|
|
NSAutoreleasePool *tmpPool = [NSAutoreleasePool new]; \
|
|
NSString *fmt = GSDebugFunctionMsg( \
|
|
__PRETTY_FUNCTION__, __FILE__, __LINE__, format); \
|
|
NSLog(fmt); [tmpPool release]; }} while (0)
|
|
|
|
#define EOFLOGClassLevelArgs(level, format, args...) \
|
|
do { if (GSDebugSet(level) == YES) { \
|
|
NSAutoreleasePool *tmpPool = [NSAutoreleasePool new]; \
|
|
NSString *fmt = GSDebugFunctionMsg( \
|
|
__PRETTY_FUNCTION__, __FILE__, __LINE__, format); \
|
|
NSLog(fmt, ## args); [tmpPool release]; }} while (0)
|
|
|
|
#define EOFLOGClassFnNotImplemented() \
|
|
do { if (GSDebugSet(@"EOFdflt") == YES) { \
|
|
NSAutoreleasePool *tmpPool = [NSAutoreleasePool new]; \
|
|
NSString *fmt = GSDebugFunctionMsg(__PRETTY_FUNCTION__, __FILE__, __LINE__,@"NOT IMPLEMENTED"); \
|
|
NSLog(fmt); [tmpPool release]; }} while (0)
|
|
|
|
|
|
|
|
// call in Instance-Methods
|
|
|
|
#define EOFLOGObjectFnStart() \
|
|
do { if (GSDebugSet(@"EOFFn") == YES) { \
|
|
NSAutoreleasePool *tmpPool = [NSAutoreleasePool new]; \
|
|
NSString *fmt = GSDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTART"); \
|
|
NSLog(fmt); [tmpPool release]; }} while (0)
|
|
|
|
#define EOFLOGObjectFnStartOrCond(cond) \
|
|
do { if ((GSDebugSet(@"EOFFn") == YES) || (GSDebugSet(cond) == YES)) { \
|
|
NSAutoreleasePool *tmpPool = [NSAutoreleasePool new]; \
|
|
NSString *fmt = GSDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTART"); \
|
|
NSLog(fmt); [tmpPool release]; }} while (0)
|
|
|
|
#define EOFLOGObjectFnStartOrCond2(cond1,cond2) \
|
|
do { if ((GSDebugSet(@"EOFFn") == YES) || (GSDebugSet(cond1) == YES) || (GSDebugSet(cond2) == YES)) { \
|
|
NSAutoreleasePool *tmpPool = [NSAutoreleasePool new]; \
|
|
NSString *fmt = GSDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTART"); \
|
|
NSLog(fmt); [tmpPool release]; }} while (0)
|
|
|
|
#define EOFLOGObjectFnStop() \
|
|
do { if (GSDebugSet(@"EOFFn") == YES) { \
|
|
NSAutoreleasePool *tmpPool = [NSAutoreleasePool new]; \
|
|
NSString *fmt = GSDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTOP"); \
|
|
NSLog(fmt); [tmpPool release]; }} while (0)
|
|
|
|
#define EOFLOGObjectFnStopOrCond(cond) \
|
|
do { if ((GSDebugSet(@"EOFFn") == YES) || (GSDebugSet(cond) == YES)) { \
|
|
NSAutoreleasePool *tmpPool = [NSAutoreleasePool new]; \
|
|
NSString *fmt = GSDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTOP"); \
|
|
NSLog(fmt); [tmpPool release]; }} while (0)
|
|
|
|
#define EOFLOGObjectFnStopOrCond2(cond1,cond2) \
|
|
do { if ((GSDebugSet(@"EOFFn") == YES) || (GSDebugSet(cond1) == YES) || (GSDebugSet(cond2) == YES)) { \
|
|
NSAutoreleasePool *tmpPool = [NSAutoreleasePool new]; \
|
|
NSString *fmt = GSDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTOP"); \
|
|
NSLog(fmt); [tmpPool release]; }} while (0)
|
|
|
|
#define EOFLOGObjectFnStopPlain(fmt) \
|
|
do { if (GSDebugSet(@"EOFFn") == YES) { \
|
|
NSLog(fmt); }} while (0)
|
|
|
|
#define EOFLOGObjectFnStopOrCondPlain(cond,fmt) \
|
|
do { if ((GSDebugSet(@"EOFFn") == YES) || (GSDebugSet(cond) == YES)) { \
|
|
NSLog(fmt); }} while (0)
|
|
|
|
#define EOFLOGObjectFnStopOrCond2Plain(cond1,cond2,fmt) \
|
|
do { if ((GSDebugSet(@"EOFFn") == YES) || (GSDebugSet(cond1) == YES) || (GSDebugSet(cond2) == YES)) { \
|
|
NSLog(fmt); }} while (0)
|
|
|
|
#define EOFLOGObjectLevel(level,format) \
|
|
do { if (GSDebugSet(level) == YES) { \
|
|
NSAutoreleasePool *tmpPool = [NSAutoreleasePool new]; \
|
|
NSString *fmt = GSDebugMethodMsg( \
|
|
self, _cmd, __FILE__, __LINE__, format); \
|
|
NSLog(fmt); [tmpPool release]; }} while (0)
|
|
|
|
#define EOFLOGObjectLevelArgs(level, format, args...) \
|
|
do { if (GSDebugSet(level) == YES) { \
|
|
NSAutoreleasePool *tmpPool = [NSAutoreleasePool new]; \
|
|
NSString *fmt = GSDebugMethodMsg( \
|
|
self, _cmd, __FILE__, __LINE__, format); \
|
|
NSLog(fmt, ## args); [tmpPool release]; }} while (0)
|
|
|
|
#define EOFLOGObject(format) \
|
|
do { \
|
|
NSAutoreleasePool *tmpPool = [NSAutoreleasePool new]; \
|
|
NSString *fmt = GSDebugMethodMsg( \
|
|
self, _cmd, __FILE__, __LINE__, format); \
|
|
NSLog(fmt); [tmpPool release]; } while (0)
|
|
|
|
#define EOFLOGObjectArgs(format, args...) \
|
|
do { \
|
|
NSAutoreleasePool *tmpPool = [NSAutoreleasePool new]; \
|
|
NSString *fmt = GSDebugMethodMsg( \
|
|
self, _cmd, __FILE__, __LINE__, format); \
|
|
NSLog(fmt, ## args); [tmpPool release]; }while (0)
|
|
|
|
#define EOFLOGObjectFnNotImplemented() \
|
|
do { if (GSDebugSet(@"EOFdflt") == YES) { \
|
|
NSAutoreleasePool *tmpPool = [NSAutoreleasePool new]; \
|
|
NSString *fmt = GSDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"NOT IMPLEMENTED"); \
|
|
NSLog(fmt); [tmpPool release]; }} while (0)
|
|
|
|
|
|
|
|
// call everywhere
|
|
|
|
#define EOFLOGException(format) \
|
|
do { if (GSDebugSet(@"exception") == YES) { \
|
|
NSAutoreleasePool *tmpPool = [NSAutoreleasePool new]; \
|
|
NSString *fmt = GSDebugFunctionMsg(__PRETTY_FUNCTION__, __FILE__, __LINE__,format); \
|
|
NSString *fmt2 = [NSString stringWithFormat:@"*EXCEPTION*: %@",fmt]; \
|
|
NSLog(@"%@",fmt2); [tmpPool release]; }} while (0)
|
|
|
|
#define EOFLOGExceptionArgs(format, args...) \
|
|
do { if (GSDebugSet(@"exception") == YES) { \
|
|
NSAutoreleasePool *tmpPool = [NSAutoreleasePool new]; \
|
|
NSString *fmt = GSDebugFunctionMsg(__PRETTY_FUNCTION__, __FILE__, __LINE__,format); \
|
|
NSString *fmt2 = [NSString stringWithFormat:@"*EXCEPTION*: %@",fmt]; \
|
|
NSLog(fmt2, ## args); [tmpPool release]; }} while (0)
|
|
|
|
#else // no DEBUG
|
|
|
|
#define EOFLOGClassFnStart() {}
|
|
#define EOFLOGClassFnStartCond() {}
|
|
#define EOFLOGClassFnStartOrCond(cond) {}
|
|
#define EOFLOGClassFnStartOrCond2(cond1,cond2) {}
|
|
#define EOFLOGClassFnStop() {}
|
|
#define EOFLOGClassFnStopCond() {}
|
|
#define EOFLOGClassFnStopOrCond(cond) {}
|
|
#define EOFLOGClassFnStopOrCond2(cond1,cond2) {}
|
|
#define EOFLOGClassLevel(level,format) {}
|
|
#define EOFLOGClassLevelArgs(level,format,args...) {}
|
|
#define EOFLOGClassFnNotImplemented() {}
|
|
|
|
#define EOFLOGObjectFnStart() {}
|
|
#define EOFLOGObjectFnStartCond(cond) {}
|
|
#define EOFLOGObjectFnStartOrCond(cond) {}
|
|
#define EOFLOGObjectFnStartOrCond2(cond1,cond2) {}
|
|
#define EOFLOGObjectFnStop() {}
|
|
#define EOFLOGObjectFnStopCond(cond) {}
|
|
#define EOFLOGObjectFnStopOrCond(cond) {}
|
|
#define EOFLOGObjectFnStopOrCond2(cond1,cond2) {}
|
|
#define EOFLOGObjectFnStopPlain(fmt) {}
|
|
#define EOFLOGObjectFnStopOrCondPlain(cond,fmt) {}
|
|
#define EOFLOGObjectFnStopOrCond2Plain(cond1,cond2,fmt) {}
|
|
#define EOFLOGObjectLevel(level,format) {}
|
|
#define EOFLOGObjectLevelArgs(level,format,args...) {}
|
|
#define EOFLOGObject(format) {}
|
|
#define EOFLOGObjectArgs(format,args...) {}
|
|
#define EOFLOGObjectFnNotImplemented() {}
|
|
|
|
#define EOFLOGException(format) {}
|
|
#define EOFLOGExceptionArgs(format, args...) {}
|
|
|
|
#endif
|
|
|
|
#ifndef NSEmitTODO
|
|
#define NSEmitTODO(); NSLog(@"DVLP WARNING %s (%d): TODO",(char*)__FILE__,(int)__LINE__);
|
|
#endif
|
|
|
|
#endif // _EODebug_h__
|