Rename project to ObjSQLite3

FossilOrigin-Name: b821df3a30cc9a96f4d9ef2e3e35439610302312d5df3f7fd00ee69993d280ac
This commit is contained in:
Jonathan Schleifer 2020-08-31 21:33:32 +00:00
parent ac03d41ce8
commit a6a6c5b76a
12 changed files with 52 additions and 51 deletions

View file

@ -1,5 +1,5 @@
SUBDIRS = src
DISTCLEAN = ObjSQLite.oc \
DISTCLEAN = ObjSQLite3.oc \
aclocal.m4 \
autom4te.cache \
buildsys.mk \

View file

@ -1,3 +0,0 @@
package_format 1
CPPFLAGS="$CPPFLAGS @SQLITE_CPPFLAGS@"
LIBS="-lobjsqlite @SQLITE_LIBS@ $LIBS"

3
ObjSQLite3.oc.in Normal file
View file

@ -0,0 +1,3 @@
package_format 1
CPPFLAGS="$CPPFLAGS @SQLITE3_CPPFLAGS@"
LIBS="-lobjsqlite3 @SQLITE3_LIBS@ $LIBS"

View file

@ -1,4 +1,4 @@
AC_INIT(ObjSQLite, 0.1, js@nil.im)
AC_INIT(ObjSQLite3, 0.1, js@nil.im)
AC_CONFIG_SRCDIR(src)
AC_CONFIG_AUX_DIR(build-aux)
AC_CONFIG_MACRO_DIR(build-aux/m4)
@ -40,32 +40,32 @@ AC_ARG_ENABLE(shared,
AS_HELP_STRING([--disable-shared], [do not build shared library]))
AS_IF([test x"$enable_shared" != x"no"], [
BUILDSYS_SHARED_LIB
AC_SUBST(OBJSQLITE_SHARED_LIB, "${LIB_PREFIX}objsqlite${LIB_SUFFIX}")
AC_SUBST(OBJSQLITE3_SHARED_LIB, "${LIB_PREFIX}objsqlite3${LIB_SUFFIX}")
AC_SUBST(EXCEPTIONS_LIB_A, "exceptions.lib.a")
AC_SUBST(EXCEPTIONS_EXCEPTIONS_LIB_A, "exceptions/exceptions.lib.a")
BUILDSYS_FRAMEWORK([
AC_SUBST(OBJSQLITE_FRAMEWORK, "ObjSQLite.framework")
AC_SUBST(OBJSQLITE3_FRAMEWORK, "ObjSQLite3.framework")
])
])
AC_ARG_ENABLE(static, AS_HELP_STRING([--enable-static], [build static library]))
AS_IF([test x"$enable_static" = x"yes" -o x"$enable_shared" = x"no"], [
AC_SUBST(OBJSQLITE_STATIC_LIB, "libobjsqlite.a")
AC_SUBST(OBJSQLITE3_STATIC_LIB, "libobjsqlite3.a")
AC_SUBST(EXCEPTIONS_A, "exceptions.a")
AC_SUBST(EXCEPTIONS_EXCEPTIONS_A, "exceptions/exceptions.a")
])
AC_ARG_WITH(sqlite, AS_HELP_STRING([--with-sqlite=PREFIX],
[build with SQLite in the specified prefix]))
AS_IF([test x"$with_sqlite" != x"no" -a x"$with_sqlite" != x""], [
SQLITE_CPPFLAGS="-I$with_sqlite/include"
SQLITE_LIBS="-L$with_sqlite/lib"
CPPFLAGS="$CPPFLAGS $SQLITE_CPPFLAGS"
LIBS="$LIBS $SQLITE_LIBS"
AC_ARG_WITH(sqlite3, AS_HELP_STRING([--with-sqlite3=PREFIX],
[build with SQLite3 in the specified prefix]))
AS_IF([test x"$with_sqlite3" != x"no" -a x"$with_sqlite3" != x""], [
SQLITE3_CPPFLAGS="-I$with_sqlite3/include"
SQLITE3_LIBS="-L$with_sqlite3/lib"
CPPFLAGS="$CPPFLAGS $SQLITE3_CPPFLAGS"
LIBS="$LIBS $SQLITE3_LIBS"
])
AC_CHECK_LIB(sqlite3, main, [
SQLITE_LIBS="$SQLITE_LIBS -lsqlite3"
SQLITE3_LIBS="$SQLITE3_LIBS -lsqlite3"
LIBS="$LIBS -lsqlite3"
], [
AC_MSG_ERROR(You need SQLite3 and installed!)
@ -110,8 +110,8 @@ dnl and add OBJCPPFLAGS to CPPFLAGS, thus we need to AC_SUBST these ourself.
AC_SUBST(CPP)
AC_SUBST(CPPFLAGS)
AC_SUBST(SQLITE_CFLAGS)
AC_SUBST(SQLITE_LIBS)
AC_SUBST(SQLITE3_CPPFLAGS)
AC_SUBST(SQLITE3_LIBS)
AC_CONFIG_FILES([buildsys.mk extra.mk ObjSQLite.oc])
AC_CONFIG_FILES([buildsys.mk extra.mk ObjSQLite3.oc])
AC_OUTPUT

View file

@ -1,6 +1,6 @@
OBJSQLITE_SHARED_LIB = @OBJSQLITE_SHARED_LIB@
OBJSQLITE_STATIC_LIB = @OBJSQLITE_STATIC_LIB@
OBJSQLITE_FRAMEWORK = @OBJSQLITE_FRAMEWORK@
OBJSQLITE3_SHARED_LIB = @OBJSQLITE3_SHARED_LIB@
OBJSQLITE3_STATIC_LIB = @OBJSQLITE3_STATIC_LIB@
OBJSQLITE3_FRAMEWORK = @OBJSQLITE3_FRAMEWORK@
EXCEPTIONS_A = @EXCEPTIONS_A@
EXCEPTIONS_EXCEPTIONS_A = @EXCEPTIONS_EXCEPTIONS_A@

View file

@ -2,15 +2,15 @@ include ../extra.mk
SUBDIRS = exceptions
SHARED_LIB = ${OBJSQLITE_SHARED_LIB}
STATIC_LIB = ${OBJSQLITE_STATIC_LIB}
FRAMEWORK = ${OBJSQLITE_FRAMEWORK}
SHARED_LIB = ${OBJSQLITE3_SHARED_LIB}
STATIC_LIB = ${OBJSQLITE3_STATIC_LIB}
FRAMEWORK = ${OBJSQLITE3_FRAMEWORK}
LIB_MAJOR = 0
LIB_MINOR = 0
SRCS = SLConnection.m
SRCS = SL3Connection.m
INCLUDES := ${SRCS:.m=.h} \
ObjSQLite.h
ObjSQLite3.h
OBJS_EXTRA = ${EXCEPTIONS_EXCEPTIONS_A}
LIB_OBJS_EXTRA = ${EXCEPTIONS_EXCEPTIONS_LIB_A}

View file

@ -1,7 +1,7 @@
/*
* Copyright (c) 2020, Jonathan Schleifer <js@nil.im>
*
* https://fossil.nil.im/objsqlite
* https://fossil.nil.im/objsqlite3
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@ -20,4 +20,4 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#import "SLConnection.h"
#import "SL3Connection.h"

View file

@ -1,7 +1,7 @@
/*
* Copyright (c) 2020, Jonathan Schleifer <js@nil.im>
*
* https://fossil.nil.im/objsqlite
* https://fossil.nil.im/objsqlite3
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@ -26,7 +26,7 @@
OF_ASSUME_NONNULL_BEGIN
@interface SLConnection: OFObject
@interface SL3Connection: OFObject
{
sqlite3 *_database;
}

View file

@ -1,7 +1,7 @@
/*
* Copyright (c) 2020, Jonathan Schleifer <js@nil.im>
*
* https://fossil.nil.im/objsqlite
* https://fossil.nil.im/objsqlite3
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@ -20,11 +20,11 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#import "SLConnection.h"
#import "SL3Connection.h"
#import "SLException.h"
#import "SL3Exception.h"
@implementation SLConnection
@implementation SL3Connection
+ (instancetype)connectionWithPath: (OFString *)path
flags: (int)flags
{
@ -42,8 +42,9 @@
flags, NULL);
if (errorCode != SQLITE_OK)
/* TODO: Use an SLException subclass. */
@throw [SLException exceptionWithConnection: nil
/* TODO: Use an SL3Exception subclass. */
@throw [SL3Exception
exceptionWithConnection: nil
errorCode: errorCode];
} @catch (id e) {
[self release];

View file

@ -3,7 +3,7 @@ include ../../extra.mk
STATIC_PIC_LIB_NOINST = ${EXCEPTIONS_LIB_A}
STATIC_LIB_NOINST = ${EXCEPTIONS_A}
SRCS = SLException.m
SRCS = SL3Exception.m
INCLUDES = ${SRCS:.m=.h}

View file

@ -1,7 +1,7 @@
/*
* Copyright (c) 2020, Jonathan Schleifer <js@nil.im>
*
* https://fossil.nil.im/objsqlite
* https://fossil.nil.im/objsqlite3
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@ -22,22 +22,22 @@
#import <ObjFW/ObjFW.h>
#import "SLConnection.h"
#import "SL3Connection.h"
OF_ASSUME_NONNULL_BEGIN
@interface SLException: OFException
@interface SL3Exception: OFException
{
SLConnection *_connection;
SL3Connection *_connection;
int _errorCode;
}
@property OF_NULLABLE_PROPERTY (readonly, nonatomic) SLConnection *connection;
@property OF_NULLABLE_PROPERTY (readonly, nonatomic) SL3Connection *connection;
@property (readonly, nonatomic) int errorCode;
+ (instancetype)exceptionWithConnection: (nullable SLConnection *)connection
+ (instancetype)exceptionWithConnection: (nullable SL3Connection *)connection
errorCode: (int)errorCode;
- (instancetype)initWithConnection: (nullable SLConnection *)connection
- (instancetype)initWithConnection: (nullable SL3Connection *)connection
errorCode: (int)errorCode OF_DESIGNATED_INITIALIZER;
@end

View file

@ -1,7 +1,7 @@
/*
* Copyright (c) 2020, Jonathan Schleifer <js@nil.im>
*
* https://fossil.nil.im/objsqlite
* https://fossil.nil.im/objsqlite3
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@ -20,19 +20,19 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#import "SLException.h"
#import "SL3Exception.h"
@implementation SLException
@implementation SL3Exception
@synthesize connection = _connection, errorCode = _errorCode;
+ (instancetype)exceptionWithConnection: (SLConnection *)connection
+ (instancetype)exceptionWithConnection: (SL3Connection *)connection
errorCode: (int)errorCode
{
return [[[self alloc] initWithConnection: connection
errorCode: errorCode] autorelease];
}
- (instancetype)initWithConnection: (SLConnection *)connection
- (instancetype)initWithConnection: (SL3Connection *)connection
errorCode: (int)errorCode
{
self = [super init];