Compare commits

..

No commits in common. "main" and "1.0-release" have entirely different histories.

19 changed files with 64 additions and 79 deletions

View file

@ -1,5 +1,5 @@
package_format 1 package_format 1
CPPFLAGS="$CPPFLAGS -I@includedir@ @LIBPQ_CPPFLAGS@" CPPFLAGS="$CPPFLAGS @LIBPQ_CPPFLAGS@"
LIBS="-L@libdir@ -lobjpgsql @LIBPQ_LIBS@ $LIBS" LIBS="-L@libdir@ -lobjpgsql @LIBPQ_LIBS@ $LIBS"
FRAMEWORK_LIBS="-L@libdir@ -lobjpgsql @LIBPQ_LIBS@ $FRAMEWORK_LIBS" FRAMEWORK_LIBS="-L@libdir@ -lobjpgsql @LIBPQ_LIBS@ $FRAMEWORK_LIBS"
STATIC_LIBS="@libdir@/libobjpgsql.a @LIBPQ_LIBS@ $STATIC_LIBS" STATIC_LIBS="@libdir@/libobjpgsql.a @LIBPQ_LIBS@ $STATIC_LIBS"

View file

@ -1,5 +1,5 @@
project('ObjPgSQL', 'objc', project('ObjPgSQL', 'objc',
version: '1.0.1', version: '1.0',
meson_version: '>= 1.5.0', meson_version: '>= 1.5.0',
default_options: { default_options: {
'warning_level': '3', 'warning_level': '3',
@ -31,7 +31,6 @@ configure_file(
input: 'ObjPgSQL.oc.in', input: 'ObjPgSQL.oc.in',
output: 'ObjPgSQL.oc', output: 'ObjPgSQL.oc',
configuration: { configuration: {
'includedir': get_option('prefix') / get_option('includedir'),
'libdir': get_option('prefix') / get_option('libdir'), 'libdir': get_option('prefix') / get_option('libdir'),
'LIBPQ_CPPFLAGS': libpq_cflags, 'LIBPQ_CPPFLAGS': libpq_cflags,
'LIBPQ_LIBS': libpq_libs, 'LIBPQ_LIBS': libpq_libs,

View file

@ -1,7 +1,7 @@
/* /*
* Copyright (c) 2012 - 2019, 2021, 2024, 2025 Jonathan Schleifer <js@nil.im> * Copyright (c) 2012 - 2019, 2021, 2024 Jonathan Schleifer <js@nil.im>
* *
* https://git.nil.im/ObjFW/ObjPgSQL * https://fl.nil.im/objpgsql
* *
* Permission to use, copy, modify, and/or distribute this software for any * Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above * purpose with or without fee is hereby granted, provided that the above

View file

@ -1,7 +1,7 @@
/* /*
* Copyright (c) 2012 - 2019, 2021, 2024, 2025 Jonathan Schleifer <js@nil.im> * Copyright (c) 2012 - 2019, 2021, 2024 Jonathan Schleifer <js@nil.im>
* *
* https://git.nil.im/ObjFW/ObjPgSQL * https://fl.nil.im/objpgsql
* *
* Permission to use, copy, modify, and/or distribute this software for any * Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above * purpose with or without fee is hereby granted, provided that the above

View file

@ -1,7 +1,7 @@
/* /*
* Copyright (c) 2012 - 2019, 2021, 2024, 2025 Jonathan Schleifer <js@nil.im> * Copyright (c) 2012 - 2019, 2021, 2024 Jonathan Schleifer <js@nil.im>
* *
* https://git.nil.im/ObjFW/ObjPgSQL * https://fl.nil.im/objpgsql
* *
* Permission to use, copy, modify, and/or distribute this software for any * Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above * purpose with or without fee is hereby granted, provided that the above

View file

@ -1,7 +1,7 @@
/* /*
* Copyright (c) 2012 - 2019, 2021, 2024, 2025 Jonathan Schleifer <js@nil.im> * Copyright (c) 2012 - 2019, 2021, 2024 Jonathan Schleifer <js@nil.im>
* *
* https://git.nil.im/ObjFW/ObjPgSQL * https://fl.nil.im/objpgsql
* *
* Permission to use, copy, modify, and/or distribute this software for any * Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above * purpose with or without fee is hereby granted, provided that the above
@ -34,7 +34,7 @@
@try { @try {
_parameters = [[OFDictionary alloc] init]; _parameters = [[OFDictionary alloc] init];
} @catch (id e) { } @catch (id e) {
objc_release(self); [self release];
@throw e; @throw e;
} }
@ -43,7 +43,7 @@
- (void)dealloc - (void)dealloc
{ {
objc_release(_parameters); [_parameters release];
[self close]; [self close];

View file

@ -1,7 +1,7 @@
/* /*
* Copyright (c) 2012 - 2019, 2021, 2024, 2025 Jonathan Schleifer <js@nil.im> * Copyright (c) 2012 - 2019, 2021, 2024 Jonathan Schleifer <js@nil.im>
* *
* https://git.nil.im/ObjFW/ObjPgSQL * https://fl.nil.im/objpgsql
* *
* Permission to use, copy, modify, and/or distribute this software for any * Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above * purpose with or without fee is hereby granted, provided that the above

View file

@ -1,7 +1,7 @@
/* /*
* Copyright (c) 2012 - 2019, 2021, 2024, 2025 Jonathan Schleifer <js@nil.im> * Copyright (c) 2012 - 2019, 2021, 2024 Jonathan Schleifer <js@nil.im>
* *
* https://git.nil.im/ObjFW/ObjPgSQL * https://fl.nil.im/objpgsql
* *
* Permission to use, copy, modify, and/or distribute this software for any * Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above * purpose with or without fee is hereby granted, provided that the above

View file

@ -1,7 +1,7 @@
/* /*
* Copyright (c) 2012 - 2019, 2021, 2024, 2025 Jonathan Schleifer <js@nil.im> * Copyright (c) 2012 - 2019, 2021, 2024 Jonathan Schleifer <js@nil.im>
* *
* https://git.nil.im/ObjFW/ObjPgSQL * https://fl.nil.im/objpgsql
* *
* Permission to use, copy, modify, and/or distribute this software for any * Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above * purpose with or without fee is hereby granted, provided that the above
@ -26,8 +26,7 @@
+ (instancetype)pg_resultWithResult: (PGresult *)result + (instancetype)pg_resultWithResult: (PGresult *)result
{ {
return objc_autoreleaseReturnValue( return [[[self alloc] pg_initWithResult: result] autorelease];
[[self alloc] pg_initWithResult: result]);
} }
- (instancetype)pg_initWithResult: (PGresult *)result - (instancetype)pg_initWithResult: (PGresult *)result

View file

@ -1,7 +1,7 @@
/* /*
* Copyright (c) 2012 - 2019, 2021, 2024, 2025 Jonathan Schleifer <js@nil.im> * Copyright (c) 2012 - 2019, 2021, 2024 Jonathan Schleifer <js@nil.im>
* *
* https://git.nil.im/ObjFW/ObjPgSQL * https://fl.nil.im/objpgsql
* *
* Permission to use, copy, modify, and/or distribute this software for any * Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above * purpose with or without fee is hereby granted, provided that the above

View file

@ -1,7 +1,7 @@
/* /*
* Copyright (c) 2012 - 2019, 2021, 2024, 2025 Jonathan Schleifer <js@nil.im> * Copyright (c) 2012 - 2019, 2021, 2024 Jonathan Schleifer <js@nil.im>
* *
* https://git.nil.im/ObjFW/ObjPgSQL * https://fl.nil.im/objpgsql
* *
* Permission to use, copy, modify, and/or distribute this software for any * Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above * purpose with or without fee is hereby granted, provided that the above

View file

@ -1,7 +1,7 @@
/* /*
* Copyright (c) 2012 - 2019, 2021, 2024, 2025 Jonathan Schleifer <js@nil.im> * Copyright (c) 2012 - 2019, 2021, 2024 Jonathan Schleifer <js@nil.im>
* *
* https://git.nil.im/ObjFW/ObjPgSQL * https://fl.nil.im/objpgsql
* *
* Permission to use, copy, modify, and/or distribute this software for any * Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above * 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 @implementation PGSQLResultRow
+ (instancetype)pg_rowWithResult: (PGSQLResult *)result row: (int)row + (instancetype)pg_rowWithResult: (PGSQLResult *)result row: (int)row
{ {
return objc_autoreleaseReturnValue( return [[[self alloc] pg_initWithResult: result row: row] autorelease];
[[self alloc] pg_initWithResult: result row: row]);
} }
- (instancetype)pg_initWithResult: (PGSQLResult *)result row: (int)row - (instancetype)pg_initWithResult: (PGSQLResult *)result row: (int)row
{ {
self = [super init]; self = [super init];
@try { _result = [result retain];
_result = objc_retain(result);
_res = result.pg_result; _res = result.pg_result;
_row = row; _row = row;
} @catch (id e) {
objc_release(self);
@throw e;
}
return self; return self;
} }
- (void)dealloc - (void)dealloc
{ {
objc_release(_result); [_result release];
[super dealloc]; [super dealloc];
} }
@ -121,16 +115,16 @@ convertType(PGresult *res, int column, OFString *string)
- (OFEnumerator *)keyEnumerator - (OFEnumerator *)keyEnumerator
{ {
return objc_autoreleaseReturnValue( return [[[PGSQLResultRowKeyEnumerator alloc]
[[PGSQLResultRowKeyEnumerator alloc] initWithResult: _result initWithResult: _result
row: _row]); row: _row] autorelease];
} }
- (OFEnumerator *)objectEnumerator - (OFEnumerator *)objectEnumerator
{ {
return objc_autoreleaseReturnValue( return [[[PGSQLResultRowObjectEnumerator alloc]
[[PGSQLResultRowObjectEnumerator alloc] initWithResult: _result initWithResult: _result
row: _row]); row: _row] autorelease];
} }
- (int)countByEnumeratingWithState: (OFFastEnumerationState *)state - (int)countByEnumeratingWithState: (OFFastEnumerationState *)state
@ -171,22 +165,17 @@ convertType(PGresult *res, int column, OFString *string)
{ {
self = [super init]; self = [super init];
@try { _result = [result retain];
_result = objc_retain(result);
_res = result.pg_result; _res = result.pg_result;
_row = row; _row = row;
_count = PQnfields(_res); _count = PQnfields(_res);
} @catch (id e) {
objc_release(self);
@throw e;
}
return self; return self;
} }
- (void)dealloc - (void)dealloc
{ {
objc_release(_result); [_result release];
[super dealloc]; [super dealloc];
} }

View file

@ -1,7 +1,7 @@
/* /*
* Copyright (c) 2012 - 2019, 2021, 2024, 2025 Jonathan Schleifer <js@nil.im> * Copyright (c) 2012 - 2019, 2021, 2024 Jonathan Schleifer <js@nil.im>
* *
* https://git.nil.im/ObjFW/ObjPgSQL * https://fl.nil.im/objpgsql
* *
* Permission to use, copy, modify, and/or distribute this software for any * Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above * purpose with or without fee is hereby granted, provided that the above

View file

@ -1,7 +1,7 @@
/* /*
* Copyright (c) 2012 - 2019, 2021, 2024, 2025 Jonathan Schleifer <js@nil.im> * Copyright (c) 2012 - 2019, 2021, 2024 Jonathan Schleifer <js@nil.im>
* *
* https://git.nil.im/ObjFW/ObjPgSQL * https://fl.nil.im/objpgsql
* *
* Permission to use, copy, modify, and/or distribute this software for any * Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above * purpose with or without fee is hereby granted, provided that the above

View file

@ -1,7 +1,7 @@
/* /*
* Copyright (c) 2012 - 2019, 2021, 2024, 2025 Jonathan Schleifer <js@nil.im> * Copyright (c) 2012 - 2019, 2021, 2024 Jonathan Schleifer <js@nil.im>
* *
* https://git.nil.im/ObjFW/ObjPgSQL * https://fl.nil.im/objpgsql
* *
* Permission to use, copy, modify, and/or distribute this software for any * Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above * purpose with or without fee is hereby granted, provided that the above

View file

@ -1,7 +1,7 @@
/* /*
* Copyright (c) 2012 - 2019, 2021, 2024, 2025 Jonathan Schleifer <js@nil.im> * Copyright (c) 2012 - 2019, 2021, 2024 Jonathan Schleifer <js@nil.im>
* *
* https://git.nil.im/ObjFW/ObjPgSQL * https://fl.nil.im/objpgsql
* *
* Permission to use, copy, modify, and/or distribute this software for any * Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above * purpose with or without fee is hereby granted, provided that the above
@ -29,8 +29,7 @@
+ (instancetype)exceptionWithConnection: (PGSQLConnection *)connection + (instancetype)exceptionWithConnection: (PGSQLConnection *)connection
{ {
return objc_autoreleaseReturnValue( return [[[self alloc] initWithConnection: connection] autorelease];
[[self alloc] initWithConnection: connection]);
} }
- (instancetype)init - (instancetype)init
@ -43,12 +42,12 @@
self = [super init]; self = [super init];
@try { @try {
_connection = objc_retain(connection); _connection = [connection retain];
_errorMessage = [[OFString alloc] _errorMessage = [[OFString alloc]
initWithCString: PQerrorMessage([_connection pg_connection]) initWithCString: PQerrorMessage([_connection pg_connection])
encoding: [OFLocale encoding]]; encoding: [OFLocale encoding]];
} @catch (id e) { } @catch (id e) {
objc_release(self); [self release];
@throw e; @throw e;
} }
@ -57,8 +56,8 @@
- (void)dealloc - (void)dealloc
{ {
objc_release(_connection); [_connection release];
objc_release(_errorMessage); [_errorMessage release];
[super dealloc]; [super dealloc];
} }

View file

@ -1,7 +1,7 @@
/* /*
* Copyright (c) 2012 - 2019, 2021, 2024, 2025 Jonathan Schleifer <js@nil.im> * Copyright (c) 2012 - 2019, 2021, 2024 Jonathan Schleifer <js@nil.im>
* *
* https://git.nil.im/ObjFW/ObjPgSQL * https://fl.nil.im/objpgsql
* *
* Permission to use, copy, modify, and/or distribute this software for any * Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above * purpose with or without fee is hereby granted, provided that the above

View file

@ -1,7 +1,7 @@
/* /*
* Copyright (c) 2012 - 2019, 2021, 2024, 2025 Jonathan Schleifer <js@nil.im> * Copyright (c) 2012 - 2019, 2021, 2024 Jonathan Schleifer <js@nil.im>
* *
* https://git.nil.im/ObjFW/ObjPgSQL * https://fl.nil.im/objpgsql
* *
* Permission to use, copy, modify, and/or distribute this software for any * Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above * purpose with or without fee is hereby granted, provided that the above
@ -29,9 +29,8 @@
+ (instancetype)exceptionWithConnection: (PGSQLConnection *)connection + (instancetype)exceptionWithConnection: (PGSQLConnection *)connection
command: (OFConstantString *)command command: (OFConstantString *)command
{ {
return objc_autoreleaseReturnValue( return [[[self alloc] initWithConnection: connection
[[self alloc] initWithConnection: connection command: command] autorelease];
command: command]);
} }
- (instancetype)initWithConnection: (PGSQLConnection *)connection - (instancetype)initWithConnection: (PGSQLConnection *)connection
@ -47,7 +46,7 @@
@try { @try {
_command = [command copy]; _command = [command copy];
} @catch (id e) { } @catch (id e) {
objc_release(self); [self release];
@throw e; @throw e;
} }
@ -56,7 +55,7 @@
- (void)dealloc - (void)dealloc
{ {
objc_release(_command); [_command release];
[super dealloc]; [super dealloc];
} }

View file

@ -1,7 +1,7 @@
/* /*
* Copyright (c) 2012 - 2019, 2021, 2024, 2025 Jonathan Schleifer <js@nil.im> * Copyright (c) 2012 - 2019, 2021, 2024 Jonathan Schleifer <js@nil.im>
* *
* https://git.nil.im/ObjFW/ObjPgSQL * https://fl.nil.im/objpgsql
* *
* Permission to use, copy, modify, and/or distribute this software for any * Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above * purpose with or without fee is hereby granted, provided that the above