Add SQLClient bundle to StepTalk. Must be requested explicitly by

adding sqlclient=yes to the make command line.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/steptalk/trunk@35749 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Wolfgang Lux 2012-10-26 16:46:43 +00:00
parent 2da0d9a1bc
commit 43359d0766
14 changed files with 471 additions and 1 deletions

View file

@ -1,3 +1,21 @@
2012-10-26 Wolfgang Lux <wolfgang.lux@gmail.com>
* Modules/GNUmakefile:
* Modules/SQLClient/Functions.h:
* Modules/SQLClient/Functions.m:
* Modules/SQLClient/GNUmakefile:
* Modules/SQLClient/SQLClient+additions.m:
* Modules/SQLClient/SQLClientConstants.list:
* Modules/SQLClient/SQLClientConstants.m:
* Modules/SQLClient/STSQLClientModule.h:
* Modules/SQLClient/STSQLClientModule.m:
* Modules/SQLClient/ScriptingInfo.plist:
* Modules/SQLClient/create_constants.awk:
* Modules/SQLClient/footer.m:
* Modules/SQLClient/header.m:
Add SQLClient bundle. Must be requested explicitly by adding
sqlclient=yes to the make command line.
2012-10-26 Wolfgang Lux <wolfgang.lux@gmail.com>
* Modules/AppKit/GNUmakefile:

View file

@ -25,17 +25,22 @@
include $(GNUSTEP_MAKEFILES)/common.make
APPKIT=AppKit
SQLCLIENT=
ifeq ($(appkit),no)
APPKIT=
endif
ifeq ($(sqlclient),yes)
SQLCLIENT=SQLClient
endif
SUBPROJECTS = \
SimpleTranscript \
Foundation \
ObjectiveC \
GDL2 \
$(APPKIT)
$(APPKIT) \
$(SQLCLIENT)
-include GNUMakefile.preamble
include $(GNUSTEP_MAKEFILES)/aggregate.make

View file

@ -0,0 +1,41 @@
/**
Functions.m
Copyright (c) 2002 Free Software Foundation
Written by: Stefan Urbanek <urbanek@host.sk>
Date: 2001 Nov 14
This file is part of the StepTalk project.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
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
*/
@class NSDictionary;
@class NSString;
#define _STCreateConstantsDictionaryForType(t, v, n, c) \
_ST_##t##_namesDictionary(v, n, c);
#define function_header(type) \
NSDictionary *_ST_##type##_namesDictionary(type *vals, \
NSString **names, \
int count)
function_header(int);
function_header(float);
function_header(id);

View file

@ -0,0 +1,56 @@
/**
Functions.m
Copyright (c) 2002 Free Software Foundation
Written by: Stefan Urbanek <urbanek@host.sk>
Date: 2001 Nov 14
This file is part of the StepTalk project.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
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 <Foundation/NSDictionary.h>
#import <Foundation/NSString.h>
#define function_template(type, class, selector) \
NSDictionary *_ST_##type##_namesDictionary(type *vals, \
NSString **names, \
int count) \
{ \
NSMutableDictionary *dict = [NSMutableDictionary dictionary]; \
\
for(i = 0; i<count; i++) \
{ \
[dict addObject:[class selector:vals[i]] \
forKey:names[i]]; \
} \
\
return dict;\
}
function_template(int,NSNumber,numberWithInt)
function_template(float,NSNumber,numberWithFloat)
NSDictionary *_ST_id_namesDictionary(id *vals,
NSString **names,
int count)
{
return [NSDictionary dictionaryWithObjects:vals
forKeys:names
count:count];
}

View file

@ -0,0 +1,56 @@
#
# StepTalk tools
#
# Copyright (C) 2000,2001 Stefan Urbanek
#
# This file is part of the StepTalk.
#
# 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 02111, USA.
#
include $(GNUSTEP_MAKEFILES)/common.make
BUNDLE_NAME = SQLClient
SQLClient_OBJC_FILES = \
STSQLClientModule.m \
SQLClientConstants.m \
SQLClient+additions.m
SQLClient_PRINCIPAL_CLASS = STSQLClientModule
SQLClient_RESOURCE_FILES = ScriptingInfo.plist
BUNDLE_INSTALL_DIR:=$(GNUSTEP_LIBRARY)/StepTalk/Modules
ADDITIONAL_OBJCFLAGS = -Wall -Wno-import
BUNDLE_LIBS += -lStepTalk -lSQLClient
ADDITIONAL_INCLUDE_DIRS += -I../../Frameworks/
ADDITIONAL_LIB_DIRS += -L../../Frameworks/StepTalk/StepTalk.framework/Versions/Current/$(GNUSTEP_TARGET_LDIR)
-include GNUmakefile.preamble
include $(GNUSTEP_MAKEFILES)/bundle.make
-include GNUMakefile.postamble
SQLClientConstants.m : SQLClientConstants.list
%.m : %.list header.m footer.m
@( echo Creating $@ ...; \
cat header.m | sed "s/@@NAME@@/`basename $< .list`/g" > $@; \
cat $< | awk -f create_constants.awk >> $@;\
cat footer.m >> $@; )

View file

@ -0,0 +1,47 @@
/**
SQLClient+additions.m
File manager additions - GNUstep path functions
Copyright (c) 2002 Free Software Foundation
Written by: Stefan Urbanek <urbanek@host.sk>
Date: 2003 Jan 22
This file is part of the StepTalk project.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
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 <SQLClient/SQLClient.h>
@implementation SQLClient(STAdditions)
+ (NSTimeInterval)timeLast
{
return SQLClientTimeLast();
}
+ (NSTimeInterval)timeNow
{
return SQLClientTimeNow();
}
+ (NSTimeInterval)timeStart
{
return SQLClientTimeStart();
}
+ (unsigned)timeTick
{
return SQLClientTimeTick();
}
@end

View file

@ -0,0 +1,12 @@
# SQLClient Exceptions
id SQLException
id SQLConnectionException
id SQLEmptyException
id SQLUniqueException
# SQLClient Notifications
id SQLClientDidConnectNotification
id SQLClientDidDisconnectNotification

View file

@ -0,0 +1,73 @@
/**
SQLClientConstants.m
NOTE: Do not edit this file, it is automaticaly generated.
Copyright (c) 2002 Free Software Foundation
This file is part of the StepTalk project.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
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 <Foundation/NSArray.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSString.h>
#import <Foundation/NSValue.h>
#import <SQLClient/SQLClient.h>
NSDictionary *STGetSQLClientConstants(void)
{
NSMutableDictionary *dict = [NSMutableDictionary dictionary];
Class numberClass = [NSNumber class];
IMP numberWithInt;
IMP numberWithFloat;
IMP setObject_forKey;
SEL numberWithInt_sel = @selector(numberWithInt:);
SEL numberWithFloat_sel = @selector(numberWithFloat:);
SEL setObject_forKey_sel = @selector(setObject:forKey:);
numberWithInt = [numberClass methodForSelector:numberWithInt_sel];
numberWithFloat = [numberClass methodForSelector:numberWithFloat_sel];
setObject_forKey = [dict methodForSelector:setObject_forKey_sel];
#define ADD_id_OBJECT(obj, name) \
setObject_forKey(dict, setObject_forKey_sel, obj, name)
#define ADD_int_OBJECT(obj, name) \
setObject_forKey(dict, setObject_forKey_sel, \
numberWithInt(numberClass, numberWithInt_sel, obj), \
name)
#define ADD_float_OBJECT(obj, name) \
setObject_forKey(dict, setObject_forKey_sel, \
numberWithFloat(numberClass, numberWithInt_sel, obj), \
name)
ADD_id_OBJECT(SQLException,@"SQLException");
ADD_id_OBJECT(SQLConnectionException,@"SQLConnectionException");
ADD_id_OBJECT(SQLEmptyException,@"SQLEmptyException");
ADD_id_OBJECT(SQLUniqueException,@"SQLUniqueException");
ADD_id_OBJECT(SQLClientDidConnectNotification,@"SQLClientDidConnectNotification");
ADD_id_OBJECT(SQLClientDidDisconnectNotification,@"SQLClientDidDisconnectNotification");
return dict;
}
/* -- End of file -- */

View file

@ -0,0 +1,34 @@
/**
STSQLClientModule.h
SQLClient bindings
Copyright (c) 2002 Free Software Foundation
Written by: Stefan Urbanek <urbanek@host.sk>
Date: 2001 May 16
This file is part of the StepTalk project.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
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 <Foundation/NSObject.h>
@interface STSQLClientModule:NSObject
{
}
@end

View file

@ -0,0 +1,46 @@
/**
STSQLClientModule.m
SQLClient bindings
Copyright (c) 2002 Free Software Foundation
Written by: Stefan Urbanek <urbanek@host.sk>
Date: 2001 May 16
This file is part of the StepTalk project.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
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 "STSQLClientModule.h"
#import <Foundation/NSDictionary.h>
#import <Foundation/NSString.h>
@class NSApplication;
extern NSDictionary *STGetSQLClientConstants();
@implementation STSQLClientModule
+ (NSDictionary *)namedObjectsForScripting
{
NSMutableDictionary *dict = [NSMutableDictionary dictionary];
[dict addEntriesFromDictionary:STGetSQLClientConstants()];
return [NSDictionary dictionaryWithDictionary:dict];
}
@end

View file

@ -0,0 +1,10 @@
{
ScriptingInfoClass = STSQLClientModule;
Classes =
(
SQLClient,
SQLRecord,
SQLTransaction
);
}

View file

@ -0,0 +1,5 @@
($0 !~ /^[\t ]*#.*$/) && ($0 !~ /^[\t ]*$/) && (NF == 2) {
printf " ADD_%s_OBJECT(%s,@\"%s\");\n", $1, $2, $2
}

View file

@ -0,0 +1,5 @@
return dict;
}
/* -- End of file -- */

View file

@ -0,0 +1,62 @@
/**
@@NAME@@.m
NOTE: Do not edit this file, it is automaticaly generated.
Copyright (c) 2002 Free Software Foundation
This file is part of the StepTalk project.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
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 <Foundation/NSArray.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSString.h>
#import <Foundation/NSValue.h>
#import <SQLClient/SQLClient.h>
NSDictionary *STGet@@NAME@@(void)
{
NSMutableDictionary *dict = [NSMutableDictionary dictionary];
Class numberClass = [NSNumber class];
IMP numberWithInt;
IMP numberWithFloat;
IMP setObject_forKey;
SEL numberWithInt_sel = @selector(numberWithInt:);
SEL numberWithFloat_sel = @selector(numberWithFloat:);
SEL setObject_forKey_sel = @selector(setObject:forKey:);
numberWithInt = [numberClass methodForSelector:numberWithInt_sel];
numberWithFloat = [numberClass methodForSelector:numberWithFloat_sel];
setObject_forKey = [dict methodForSelector:setObject_forKey_sel];
#define ADD_id_OBJECT(obj, name) \
setObject_forKey(dict, setObject_forKey_sel, obj, name)
#define ADD_int_OBJECT(obj, name) \
setObject_forKey(dict, setObject_forKey_sel, \
numberWithInt(numberClass, numberWithInt_sel, obj), \
name)
#define ADD_float_OBJECT(obj, name) \
setObject_forKey(dict, setObject_forKey_sel, \
numberWithFloat(numberClass, numberWithInt_sel, obj), \
name)