diff --git a/ObjPgSQL.oc.in b/ObjPgSQL.oc.in index b5c760d..40bb5e7 100644 --- a/ObjPgSQL.oc.in +++ b/ObjPgSQL.oc.in @@ -1,5 +1,5 @@ package_format 1 -CPPFLAGS="$CPPFLAGS -I@includedir@ @LIBPQ_CPPFLAGS@" +CPPFLAGS="$CPPFLAGS @LIBPQ_CPPFLAGS@" LIBS="-L@libdir@ -lobjpgsql @LIBPQ_LIBS@ $LIBS" FRAMEWORK_LIBS="-L@libdir@ -lobjpgsql @LIBPQ_LIBS@ $FRAMEWORK_LIBS" STATIC_LIBS="@libdir@/libobjpgsql.a @LIBPQ_LIBS@ $STATIC_LIBS" diff --git a/meson.build b/meson.build index 4bf27e2..ee2c9bd 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('ObjPgSQL', 'objc', - version: '1.0.1', + version: '1.0', meson_version: '>= 1.5.0', default_options: { 'warning_level': '3', @@ -31,7 +31,6 @@ configure_file( input: 'ObjPgSQL.oc.in', output: 'ObjPgSQL.oc', configuration: { - 'includedir': get_option('prefix') / get_option('includedir'), 'libdir': get_option('prefix') / get_option('libdir'), 'LIBPQ_CPPFLAGS': libpq_cflags, 'LIBPQ_LIBS': libpq_libs, diff --git a/src/ObjPgSQL.h b/src/ObjPgSQL.h index 902a6c0..15cc62e 100644 --- a/src/ObjPgSQL.h +++ b/src/ObjPgSQL.h @@ -1,7 +1,7 @@ /* - * Copyright (c) 2012 - 2019, 2021, 2024, 2025 Jonathan Schleifer + * Copyright (c) 2012 - 2019, 2021, 2024 Jonathan Schleifer * - * https://git.nil.im/ObjFW/ObjPgSQL + * https://fl.nil.im/objpgsql * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/src/PGSQLConnection+Private.h b/src/PGSQLConnection+Private.h index c8322a4..9138702 100644 --- a/src/PGSQLConnection+Private.h +++ b/src/PGSQLConnection+Private.h @@ -1,7 +1,7 @@ /* - * Copyright (c) 2012 - 2019, 2021, 2024, 2025 Jonathan Schleifer + * Copyright (c) 2012 - 2019, 2021, 2024 Jonathan Schleifer * - * https://git.nil.im/ObjFW/ObjPgSQL + * https://fl.nil.im/objpgsql * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/src/PGSQLConnection.h b/src/PGSQLConnection.h index 0da715b..d2add12 100644 --- a/src/PGSQLConnection.h +++ b/src/PGSQLConnection.h @@ -1,7 +1,7 @@ /* - * Copyright (c) 2012 - 2019, 2021, 2024, 2025 Jonathan Schleifer + * Copyright (c) 2012 - 2019, 2021, 2024 Jonathan Schleifer * - * https://git.nil.im/ObjFW/ObjPgSQL + * https://fl.nil.im/objpgsql * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/src/PGSQLConnection.m b/src/PGSQLConnection.m index 6703229..4d6321f 100644 --- a/src/PGSQLConnection.m +++ b/src/PGSQLConnection.m @@ -1,7 +1,7 @@ /* - * Copyright (c) 2012 - 2019, 2021, 2024, 2025 Jonathan Schleifer + * Copyright (c) 2012 - 2019, 2021, 2024 Jonathan Schleifer * - * https://git.nil.im/ObjFW/ObjPgSQL + * https://fl.nil.im/objpgsql * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -34,7 +34,7 @@ @try { _parameters = [[OFDictionary alloc] init]; } @catch (id e) { - objc_release(self); + [self release]; @throw e; } @@ -43,7 +43,7 @@ - (void)dealloc { - objc_release(_parameters); + [_parameters release]; [self close]; diff --git a/src/PGSQLResult+Private.h b/src/PGSQLResult+Private.h index 26c034a..ab31ad0 100644 --- a/src/PGSQLResult+Private.h +++ b/src/PGSQLResult+Private.h @@ -1,7 +1,7 @@ /* - * Copyright (c) 2012 - 2019, 2021, 2024, 2025 Jonathan Schleifer + * Copyright (c) 2012 - 2019, 2021, 2024 Jonathan Schleifer * - * https://git.nil.im/ObjFW/ObjPgSQL + * https://fl.nil.im/objpgsql * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/src/PGSQLResult.h b/src/PGSQLResult.h index 37daedc..82e3137 100644 --- a/src/PGSQLResult.h +++ b/src/PGSQLResult.h @@ -1,7 +1,7 @@ /* - * Copyright (c) 2012 - 2019, 2021, 2024, 2025 Jonathan Schleifer + * Copyright (c) 2012 - 2019, 2021, 2024 Jonathan Schleifer * - * https://git.nil.im/ObjFW/ObjPgSQL + * https://fl.nil.im/objpgsql * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/src/PGSQLResult.m b/src/PGSQLResult.m index a477c3e..9798f21 100644 --- a/src/PGSQLResult.m +++ b/src/PGSQLResult.m @@ -1,7 +1,7 @@ /* - * Copyright (c) 2012 - 2019, 2021, 2024, 2025 Jonathan Schleifer + * Copyright (c) 2012 - 2019, 2021, 2024 Jonathan Schleifer * - * https://git.nil.im/ObjFW/ObjPgSQL + * https://fl.nil.im/objpgsql * * 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,8 +26,7 @@ + (instancetype)pg_resultWithResult: (PGresult *)result { - return objc_autoreleaseReturnValue( - [[self alloc] pg_initWithResult: result]); + return [[[self alloc] pg_initWithResult: result] autorelease]; } - (instancetype)pg_initWithResult: (PGresult *)result diff --git a/src/PGSQLResultRow+Private.h b/src/PGSQLResultRow+Private.h index 263cc88..15b9509 100644 --- a/src/PGSQLResultRow+Private.h +++ b/src/PGSQLResultRow+Private.h @@ -1,7 +1,7 @@ /* - * Copyright (c) 2012 - 2019, 2021, 2024, 2025 Jonathan Schleifer + * Copyright (c) 2012 - 2019, 2021, 2024 Jonathan Schleifer * - * https://git.nil.im/ObjFW/ObjPgSQL + * https://fl.nil.im/objpgsql * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/src/PGSQLResultRow.h b/src/PGSQLResultRow.h index 3291bd8..06cd335 100644 --- a/src/PGSQLResultRow.h +++ b/src/PGSQLResultRow.h @@ -1,7 +1,7 @@ /* - * Copyright (c) 2012 - 2019, 2021, 2024, 2025 Jonathan Schleifer + * Copyright (c) 2012 - 2019, 2021, 2024 Jonathan Schleifer * - * https://git.nil.im/ObjFW/ObjPgSQL + * https://fl.nil.im/objpgsql * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/src/PGSQLResultRow.m b/src/PGSQLResultRow.m index c5cc316..edc1e4d 100644 --- a/src/PGSQLResultRow.m +++ b/src/PGSQLResultRow.m @@ -1,7 +1,7 @@ /* - * Copyright (c) 2012 - 2019, 2021, 2024, 2025 Jonathan Schleifer + * Copyright (c) 2012 - 2019, 2021, 2024 Jonathan Schleifer * - * https://git.nil.im/ObjFW/ObjPgSQL + * https://fl.nil.im/objpgsql * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -65,29 +65,23 @@ convertType(PGresult *res, int column, OFString *string) @implementation PGSQLResultRow + (instancetype)pg_rowWithResult: (PGSQLResult *)result row: (int)row { - return objc_autoreleaseReturnValue( - [[self alloc] pg_initWithResult: result row: row]); + return [[[self alloc] pg_initWithResult: result row: row] autorelease]; } - (instancetype)pg_initWithResult: (PGSQLResult *)result row: (int)row { self = [super init]; - @try { - _result = objc_retain(result); - _res = result.pg_result; - _row = row; - } @catch (id e) { - objc_release(self); - @throw e; - } + _result = [result retain]; + _res = result.pg_result; + _row = row; return self; } - (void)dealloc { - objc_release(_result); + [_result release]; [super dealloc]; } @@ -121,16 +115,16 @@ convertType(PGresult *res, int column, OFString *string) - (OFEnumerator *)keyEnumerator { - return objc_autoreleaseReturnValue( - [[PGSQLResultRowKeyEnumerator alloc] initWithResult: _result - row: _row]); + return [[[PGSQLResultRowKeyEnumerator alloc] + initWithResult: _result + row: _row] autorelease]; } - (OFEnumerator *)objectEnumerator { - return objc_autoreleaseReturnValue( - [[PGSQLResultRowObjectEnumerator alloc] initWithResult: _result - row: _row]); + return [[[PGSQLResultRowObjectEnumerator alloc] + initWithResult: _result + row: _row] autorelease]; } - (int)countByEnumeratingWithState: (OFFastEnumerationState *)state @@ -171,22 +165,17 @@ convertType(PGresult *res, int column, OFString *string) { self = [super init]; - @try { - _result = objc_retain(result); - _res = result.pg_result; - _row = row; - _count = PQnfields(_res); - } @catch (id e) { - objc_release(self); - @throw e; - } + _result = [result retain]; + _res = result.pg_result; + _row = row; + _count = PQnfields(_res); return self; } - (void)dealloc { - objc_release(_result); + [_result release]; [super dealloc]; } diff --git a/src/exceptions/PGSQLConnectionFailedException.h b/src/exceptions/PGSQLConnectionFailedException.h index 3d28302..be620ed 100644 --- a/src/exceptions/PGSQLConnectionFailedException.h +++ b/src/exceptions/PGSQLConnectionFailedException.h @@ -1,7 +1,7 @@ /* - * Copyright (c) 2012 - 2019, 2021, 2024, 2025 Jonathan Schleifer + * Copyright (c) 2012 - 2019, 2021, 2024 Jonathan Schleifer * - * https://git.nil.im/ObjFW/ObjPgSQL + * https://fl.nil.im/objpgsql * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/src/exceptions/PGSQLConnectionFailedException.m b/src/exceptions/PGSQLConnectionFailedException.m index a5e6bb7..1a21b17 100644 --- a/src/exceptions/PGSQLConnectionFailedException.m +++ b/src/exceptions/PGSQLConnectionFailedException.m @@ -1,7 +1,7 @@ /* - * Copyright (c) 2012 - 2019, 2021, 2024, 2025 Jonathan Schleifer + * Copyright (c) 2012 - 2019, 2021, 2024 Jonathan Schleifer * - * https://git.nil.im/ObjFW/ObjPgSQL + * https://fl.nil.im/objpgsql * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/src/exceptions/PGSQLException.h b/src/exceptions/PGSQLException.h index 8c373b1..7fb9485 100644 --- a/src/exceptions/PGSQLException.h +++ b/src/exceptions/PGSQLException.h @@ -1,7 +1,7 @@ /* - * Copyright (c) 2012 - 2019, 2021, 2024, 2025 Jonathan Schleifer + * Copyright (c) 2012 - 2019, 2021, 2024 Jonathan Schleifer * - * https://git.nil.im/ObjFW/ObjPgSQL + * https://fl.nil.im/objpgsql * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/src/exceptions/PGSQLException.m b/src/exceptions/PGSQLException.m index 907d285..1979851 100644 --- a/src/exceptions/PGSQLException.m +++ b/src/exceptions/PGSQLException.m @@ -1,7 +1,7 @@ /* - * Copyright (c) 2012 - 2019, 2021, 2024, 2025 Jonathan Schleifer + * Copyright (c) 2012 - 2019, 2021, 2024 Jonathan Schleifer * - * https://git.nil.im/ObjFW/ObjPgSQL + * https://fl.nil.im/objpgsql * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -29,8 +29,7 @@ + (instancetype)exceptionWithConnection: (PGSQLConnection *)connection { - return objc_autoreleaseReturnValue( - [[self alloc] initWithConnection: connection]); + return [[[self alloc] initWithConnection: connection] autorelease]; } - (instancetype)init @@ -43,12 +42,12 @@ self = [super init]; @try { - _connection = objc_retain(connection); + _connection = [connection retain]; _errorMessage = [[OFString alloc] initWithCString: PQerrorMessage([_connection pg_connection]) encoding: [OFLocale encoding]]; } @catch (id e) { - objc_release(self); + [self release]; @throw e; } @@ -57,8 +56,8 @@ - (void)dealloc { - objc_release(_connection); - objc_release(_errorMessage); + [_connection release]; + [_errorMessage release]; [super dealloc]; } diff --git a/src/exceptions/PGSQLExecuteCommandFailedException.h b/src/exceptions/PGSQLExecuteCommandFailedException.h index 4039d2f..6989735 100644 --- a/src/exceptions/PGSQLExecuteCommandFailedException.h +++ b/src/exceptions/PGSQLExecuteCommandFailedException.h @@ -1,7 +1,7 @@ /* - * Copyright (c) 2012 - 2019, 2021, 2024, 2025 Jonathan Schleifer + * Copyright (c) 2012 - 2019, 2021, 2024 Jonathan Schleifer * - * https://git.nil.im/ObjFW/ObjPgSQL + * https://fl.nil.im/objpgsql * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/src/exceptions/PGSQLExecuteCommandFailedException.m b/src/exceptions/PGSQLExecuteCommandFailedException.m index 04fbade..833b6c3 100644 --- a/src/exceptions/PGSQLExecuteCommandFailedException.m +++ b/src/exceptions/PGSQLExecuteCommandFailedException.m @@ -1,7 +1,7 @@ /* - * Copyright (c) 2012 - 2019, 2021, 2024, 2025 Jonathan Schleifer + * Copyright (c) 2012 - 2019, 2021, 2024 Jonathan Schleifer * - * https://git.nil.im/ObjFW/ObjPgSQL + * https://fl.nil.im/objpgsql * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -29,9 +29,8 @@ + (instancetype)exceptionWithConnection: (PGSQLConnection *)connection command: (OFConstantString *)command { - return objc_autoreleaseReturnValue( - [[self alloc] initWithConnection: connection - command: command]); + return [[[self alloc] initWithConnection: connection + command: command] autorelease]; } - (instancetype)initWithConnection: (PGSQLConnection *)connection @@ -47,7 +46,7 @@ @try { _command = [command copy]; } @catch (id e) { - objc_release(self); + [self release]; @throw e; } @@ -56,7 +55,7 @@ - (void)dealloc { - objc_release(_command); + [_command release]; [super dealloc]; } diff --git a/tests/Tests.m b/tests/Tests.m index 428ddb8..8b9fc89 100644 --- a/tests/Tests.m +++ b/tests/Tests.m @@ -1,7 +1,7 @@ /* - * Copyright (c) 2012 - 2019, 2021, 2024, 2025 Jonathan Schleifer + * Copyright (c) 2012 - 2019, 2021, 2024 Jonathan Schleifer * - * https://git.nil.im/ObjFW/ObjPgSQL + * https://fl.nil.im/objpgsql * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above