[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
GDL2 - patches for OSX (3)
From: |
Stéphane Corthésy |
Subject: |
GDL2 - patches for OSX (3) |
Date: |
Tue, 25 Mar 2003 23:22:05 +0100 |
...and the last one tonight.
Stéphane
Changelog:
EOAccess/EODefines.h: new file providing macros for the "extern" clause
EOAccess/EODeprecated.h: new file declaring some deprecated methods;
methods are still implemented but should no longer be used; they are no
longer declared in their respective header files.
EOAccess/EOAccess.h: added EODefines.h
EOAccess/EODatabase.h: replaced extern by EOACCESS_EXPORT
EOAccess/EOEntity.h: replaced extern by EOACCESS_EXPORT
EOAccess/EOExpressionArray.m: use volatile in some exception handlers
(man longjmp for more info)
EOAccess/EOModel.h: replaced extern by EOACCESS_EXPORT
EOAccess/EOSchemaGeneration.h: replaced extern by EOACCESS_EXPORT
EOAccess/EOSQLExpression.h: replaced extern by EOACCESS_EXPORT
EOAccess/EOSQLExpression.m: renamed symbol EOPrimaryKeyContraintsKey
into EOPrimaryKeyConstraintsKey
EOAccess/EOUtilities.h: replaced extern by EOACCESS_EXPORT
Tools/eoutil.m: implemented use of -postinstall option; corrected bug
when getting adaptor's expression class; renamed symbol
EOPrimaryKeyContraintsKey into EOPrimaryKeyConstraintsKey
---
/*
EODefines.h
Copyright (C) 2003 Free Software Foundation, Inc.
Author: Stephane Corthesy <stephane@sente.ch>
Date: Feb 2003
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 __EOAccessDefines_h__
#define __EOAccessDefines_h__
#ifdef EOACCESS_WITH_DLL
#if BUILD_EOACCESS_DLL
# define EOACCESS_EXPORT __declspec(dllexport)
# define EOACCESS_DECLARE __declspec(dllexport)
#else
# define EOACCESS_EXPORT extern __declspec(dllimport)
# define EOACCESS_DECLARE __declspec(dllimport)
#endif
#else /* EOACCESS_WITH[OUT]_DLL */
# define EOACCESS_EXPORT extern
# define EOACCESS_DECLARE
#endif
#endif
---
/*
EODeprecated.h
Copyright (C) 2002 Free Software Foundation, Inc.
Author: Stephane Corthesy <stephane@sente.ch>
Date: Feb 2003
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 __EOAccessDeprecated_h__
#define __EOAccessDeprecated_h__
#import <EOAccess/EOModelGroup.h>
@interface EOModelGroup (EODeprecated)
+ (void)setDelegate: (id)delegate;
+ (id)delegate;
@end
@interface EOLoginPanel (EODeprecated)
- (NSDictionary *)runPanelForAdaptor:(EOAdaptor *)adaptor
validate:(BOOL)yn;
@end
@interface EOAdaptorContext (EODeprecated)
- (BOOL)canNestTransactions;
- (unsigned)transactionNestingLevel;
@end
#endif
---
Index: EOAccess.h
===================================================================
RCS file: /cvsroot/gnustep/gnustep/dev-libs/gdl2/EOAccess/EOAccess.h,v
retrieving revision 1.3
diff -r1.3 EOAccess.h
29a30
> #import <EOAccess/EODefines.h>
Index: EODatabase.h
===================================================================
RCS file: /cvsroot/gnustep/gnustep/dev-libs/gdl2/EOAccess/EODatabase.h,v
retrieving revision 1.2
diff -r1.2 EODatabase.h
49c49
< extern NSString *EOGeneralDatabaseException;
---
> EOACCESS_EXPORT NSString *EOGeneralDatabaseException;
Index: EOEntity.h
===================================================================
RCS file: /cvsroot/gnustep/gnustep/dev-libs/gdl2/EOAccess/EOEntity.h,v
retrieving revision 1.3
diff -r1.3 EOEntity.h
33a34
> #import <EOAccess/EODefines.h>
261,265c262,266
< extern NSString *EOFetchAllProcedureOperation;
< extern NSString *EOFetchWithPrimaryKeyProcedureOperation;
< extern NSString *EOInsertProcedureOperation;
< extern NSString *EODeleteProcedureOperation;
< extern NSString *EONextPrimaryKeyProcedureOperation;
---
> EOACCESS_EXPORT NSString *EOFetchAllProcedureOperation;
> EOACCESS_EXPORT NSString *EOFetchWithPrimaryKeyProcedureOperation;
> EOACCESS_EXPORT NSString *EOInsertProcedureOperation;
> EOACCESS_EXPORT NSString *EODeleteProcedureOperation;
> EOACCESS_EXPORT NSString *EONextPrimaryKeyProcedureOperation;
Index: EOExpressionArray.m
===================================================================
RCS file:
/cvsroot/gnustep/gnustep/dev-libs/gdl2/EOAccess/EOExpressionArray.m,v
retrieving revision 1.7
diff -r1.7 EOExpressionArray.m
322c322,323
< int i, count;
---
> volatile int i;
> int count;
Index: EOModel.h
===================================================================
RCS file: /cvsroot/gnustep/gnustep/dev-libs/gdl2/EOAccess/EOModel.h,v
retrieving revision 1.4
diff -r1.4 EOModel.h
34a35
> #import <EOAccess/EODefines.h>
183c184
< extern NSString *EOEntityLoadedNotification;
---
> EOACCESS_EXPORT NSString *EOEntityLoadedNotification;
Index: EOSchemaGeneration.h
===================================================================
RCS file:
/cvsroot/gnustep/gnustep/dev-libs/gdl2/EOAccess/EOSchemaGeneration.h,v
retrieving revision 1.2
diff -r1.2 EOSchemaGeneration.h
129,136c129,136
< extern NSString *EOCreateTablesKey;
< extern NSString *EODropTablesKey;
< extern NSString *EOCreatePrimaryKeySupportKey;
< extern NSString *EODropPrimaryKeySupportKey;
< extern NSString *EOPrimaryKeyContraintsKey;
< extern NSString *EOForeignKeyConstraintsKey;
< extern NSString *EOCreateDatabaseKey;
< extern NSString *EODropDatabaseKey;
---
> EOACCESS_EXPORT NSString *EOCreateTablesKey;
> EOACCESS_EXPORT NSString *EODropTablesKey;
> EOACCESS_EXPORT NSString *EOCreatePrimaryKeySupportKey;
> EOACCESS_EXPORT NSString *EODropPrimaryKeySupportKey;
> EOACCESS_EXPORT NSString *EOPrimaryKeyConstraintsKey;
> EOACCESS_EXPORT NSString *EOForeignKeyConstraintsKey;
> EOACCESS_EXPORT NSString *EOCreateDatabaseKey;
> EOACCESS_EXPORT NSString *EODropDatabaseKey;
Index: EOSQLExpression.h
===================================================================
RCS file:
/cvsroot/gnustep/gnustep/dev-libs/gdl2/EOAccess/EOSQLExpression.h,v
retrieving revision 1.2
diff -r1.2 EOSQLExpression.h
35a36
> #import <EOAccess/EODefines.h>
52,56c53,57
< extern NSString *EOBindVariableNameKey;
< extern NSString *EOBindVariableAttributeKey;
< extern NSString *EOBindVariableValueKey;
< extern NSString *EOBindVariablePlaceHolderKey;
< extern NSString *EOBindVariableColumnKey;
---
> EOACCESS_EXPORT NSString *EOBindVariableNameKey;
> EOACCESS_EXPORT NSString *EOBindVariableAttributeKey;
> EOACCESS_EXPORT NSString *EOBindVariableValueKey;
> EOACCESS_EXPORT NSString *EOBindVariablePlaceHolderKey;
> EOACCESS_EXPORT NSString *EOBindVariableColumnKey;
Index: EOSQLExpression.m
===================================================================
RCS file:
/cvsroot/gnustep/gnustep/dev-libs/gdl2/EOAccess/EOSQLExpression.m,v
retrieving revision 1.9
diff -r1.9 EOSQLExpression.m
2366c2366
< NSString *EOPrimaryKeyContraintsKey = @"EOPrimaryKeyContraintsKey";
---
> NSString *EOPrimaryKeyConstraintsKey = @"EOPrimaryKeyConstraintsKey";
2779c2779
< {EOPrimaryKeyContraintsKey , @"YES",
---
> {EOPrimaryKeyConstraintsKey , @"YES",
Index: EOUtilities.h
===================================================================
RCS file:
/cvsroot/gnustep/gnustep/dev-libs/gdl2/EOAccess/EOUtilities.h,v
retrieving revision 1.6
diff -r1.6 EOUtilities.h
33a34
> #import <EOAccess/EODefines.h>
45c46
< extern NSString *EOMoreThanOneException;
---
> EOACCESS_EXPORT NSString *EOMoreThanOneException;
Index: eoutil.m
===================================================================
RCS file: /cvsroot/gnustep/gnustep/dev-libs/gdl2/Tools/eoutil.m,v
retrieving revision 1.1
diff -r1.1 eoutil.m
41a42,52
> /*
> TODO
> Implement -ascii option
> Test multiple models
> Add new option -dateFormat ISO|Apple (has ISO enough precision for
microseconds?)
> Add new option -nullValue '__NULL__'
> Question: is it possible to save/restore sequences (for PK)?
> Replace all autorelease/release/retain by macros
> Document plist format
> Document usage
> */
173c184,185
<
---
> NSArray *postInstallSQLExpressions = nil;
>
507c519
< exprClass = [[EOAdaptor adaptorWithModel: srcModel]
defaultExpressionClass];
---
> exprClass = [[EOAdaptor adaptorWithModel: srcModel]
expressionClass];
514c526
< // ((schemaDropOptions & pkConstraintsOption) ?
@"YES":@"NO"), EOPrimaryKeyContraintsKey,
---
> // ((schemaDropOptions & pkConstraintsOption) ?
@"YES":@"NO"), EOPrimaryKeyConstraintsKey,
519c531
< ((schemaCreateOptions & pkConstraintsOption) ? @"YES":@"NO"),
EOPrimaryKeyContraintsKey,
---
> ((schemaCreateOptions & pkConstraintsOption) ? @"YES":@"NO"),
EOPrimaryKeyConstraintsKey,
709a722,728
> if (postInstall)
> {
> // Look for a key "AdaptorName"PostInstallExpressions
which
> // which have an array of SQL expressions
> postInstallSQLExpressions = [[srcModel userInfo]
objectForKey:[[[EOAdaptor adaptorWithModel: srcModel] name]
stringByAppendingString:@"PostInstallExpressions"]];
> }
>
767c786
< if (postInstall)
---
> if (postInstallSQLExpressions)
769c788
< #warning TODO: Append postInstall instructions to outputString
---
> [outputString appendString:[postInstallSQLExpressions
componentsJoinedByString:@"\n"]];
805a825
> // Let's use -[EOEntity attributesToFetch]?
812a833
> #warning Remove also derived attributes
815d835
<
936,938c956,1002
< if (postInstall)
< {
< #warning TODO: Append postInstall instructions to outputString
---
> if (postInstallSQLExpressions)
> {
> EODatabaseContext *databaseContext;
> EOEditingContext *anEC = [[EOEditingContext alloc] init];
>
> databaseContext =
> [EODatabaseContext registeredDatabaseContextForModel:
srcModel
>
editingContext: anEC];
>
> [databaseContext lock];
>
> NS_DURING
> {
> EODatabaseChannel *databaseChannel = [databaseContext
> availableChannel];
> EOAdaptorChannel *adaptorChannel = [databaseChannel
> adaptorChannel];
> NSString *aString;
> NSEnumerator *anEnum;
>
> if (![adaptorChannel isOpen])
> [adaptorChannel openChannel];
>
> anEnum = [postInstallSQLExpressions objectEnumerator];
>
> while ((aString = [anEnum nextObject]))
> {
> NS_DURING
> EOSQLExpression *aStatement = [exprClass
expressionForString:aString];
>
> [adaptorChannel evaluateExpression:
aStatement];
> NS_HANDLER
> if(!force)
> break;
> NS_ENDHANDLER;
> }
>
> [databaseContext unlock];
> [anEC release];
> }
> NS_HANDLER
> {
> [databaseContext unlock];
> [anEC release];
> [localException raise];
> }
> NS_ENDHANDLER;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- GDL2 - patches for OSX (3),
Stéphane Corthésy <=