From a6a6c5b76aad697d25420d8656b7e967e90d977c Mon Sep 17 00:00:00 2001 From: Jonathan Schleifer Date: Mon, 31 Aug 2020 21:33:32 +0000 Subject: [PATCH] Rename project to ObjSQLite3 FossilOrigin-Name: b821df3a30cc9a96f4d9ef2e3e35439610302312d5df3f7fd00ee69993d280ac --- Makefile | 2 +- ObjSQLite.oc.in | 3 -- ObjSQLite3.oc.in | 3 ++ configure.ac | 30 +++++++++---------- extra.mk.in | 6 ++-- src/Makefile | 10 +++---- src/{ObjSQLite.h => ObjSQLite3.h} | 4 +-- src/{SLConnection.h => SL3Connection.h} | 4 +-- src/{SLConnection.m => SL3Connection.m} | 15 +++++----- src/exceptions/Makefile | 2 +- .../{SLException.h => SL3Exception.h} | 14 ++++----- .../{SLException.m => SL3Exception.m} | 10 +++---- 12 files changed, 52 insertions(+), 51 deletions(-) delete mode 100644 ObjSQLite.oc.in create mode 100644 ObjSQLite3.oc.in rename src/{ObjSQLite.h => ObjSQLite3.h} (94%) rename src/{SLConnection.h => SL3Connection.h} (95%) rename src/{SLConnection.m => SL3Connection.m} (86%) rename src/exceptions/{SLException.h => SL3Exception.h} (78%) rename src/exceptions/{SLException.m => SL3Exception.m} (87%) diff --git a/Makefile b/Makefile index e0b1a61..b10f540 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ SUBDIRS = src -DISTCLEAN = ObjSQLite.oc \ +DISTCLEAN = ObjSQLite3.oc \ aclocal.m4 \ autom4te.cache \ buildsys.mk \ diff --git a/ObjSQLite.oc.in b/ObjSQLite.oc.in deleted file mode 100644 index d245dda..0000000 --- a/ObjSQLite.oc.in +++ /dev/null @@ -1,3 +0,0 @@ -package_format 1 -CPPFLAGS="$CPPFLAGS @SQLITE_CPPFLAGS@" -LIBS="-lobjsqlite @SQLITE_LIBS@ $LIBS" diff --git a/ObjSQLite3.oc.in b/ObjSQLite3.oc.in new file mode 100644 index 0000000..063d5ed --- /dev/null +++ b/ObjSQLite3.oc.in @@ -0,0 +1,3 @@ +package_format 1 +CPPFLAGS="$CPPFLAGS @SQLITE3_CPPFLAGS@" +LIBS="-lobjsqlite3 @SQLITE3_LIBS@ $LIBS" diff --git a/configure.ac b/configure.ac index 037f522..6e37533 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/extra.mk.in b/extra.mk.in index 565f27c..0f6ab5d 100644 --- a/extra.mk.in +++ b/extra.mk.in @@ -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@ diff --git a/src/Makefile b/src/Makefile index 0cea1d8..df02bed 100644 --- a/src/Makefile +++ b/src/Makefile @@ -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} diff --git a/src/ObjSQLite.h b/src/ObjSQLite3.h similarity index 94% rename from src/ObjSQLite.h rename to src/ObjSQLite3.h index 6986a8c..99f2068 100644 --- a/src/ObjSQLite.h +++ b/src/ObjSQLite3.h @@ -1,7 +1,7 @@ /* * Copyright (c) 2020, Jonathan Schleifer * - * 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" diff --git a/src/SLConnection.h b/src/SL3Connection.h similarity index 95% rename from src/SLConnection.h rename to src/SL3Connection.h index 1cefaac..c3617a8 100644 --- a/src/SLConnection.h +++ b/src/SL3Connection.h @@ -1,7 +1,7 @@ /* * Copyright (c) 2020, Jonathan Schleifer * - * 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; } diff --git a/src/SLConnection.m b/src/SL3Connection.m similarity index 86% rename from src/SLConnection.m rename to src/SL3Connection.m index f03c72c..460b6f4 100644 --- a/src/SLConnection.m +++ b/src/SL3Connection.m @@ -1,7 +1,7 @@ /* * Copyright (c) 2020, Jonathan Schleifer * - * 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,9 +42,10 @@ flags, NULL); if (errorCode != SQLITE_OK) - /* TODO: Use an SLException subclass. */ - @throw [SLException exceptionWithConnection: nil - errorCode: errorCode]; + /* TODO: Use an SL3Exception subclass. */ + @throw [SL3Exception + exceptionWithConnection: nil + errorCode: errorCode]; } @catch (id e) { [self release]; @throw e; diff --git a/src/exceptions/Makefile b/src/exceptions/Makefile index 75eb5b3..2f07ace 100644 --- a/src/exceptions/Makefile +++ b/src/exceptions/Makefile @@ -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} diff --git a/src/exceptions/SLException.h b/src/exceptions/SL3Exception.h similarity index 78% rename from src/exceptions/SLException.h rename to src/exceptions/SL3Exception.h index 2c11d2f..88faad5 100644 --- a/src/exceptions/SLException.h +++ b/src/exceptions/SL3Exception.h @@ -1,7 +1,7 @@ /* * Copyright (c) 2020, Jonathan Schleifer * - * 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 -#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 diff --git a/src/exceptions/SLException.m b/src/exceptions/SL3Exception.m similarity index 87% rename from src/exceptions/SLException.m rename to src/exceptions/SL3Exception.m index 9e5567b..c808386 100644 --- a/src/exceptions/SLException.m +++ b/src/exceptions/SL3Exception.m @@ -1,7 +1,7 @@ /* * Copyright (c) 2020, Jonathan Schleifer * - * 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];