Compare commits
4 commits
1.0-releas
...
main
Author | SHA1 | Date | |
---|---|---|---|
d8f53de646 | |||
b75455125a | |||
68fff75083 | |||
bf51ce812c |
19 changed files with 79 additions and 64 deletions
|
@ -1,5 +1,5 @@
|
|||
package_format 1
|
||||
CPPFLAGS="$CPPFLAGS @LIBPQ_CPPFLAGS@"
|
||||
CPPFLAGS="$CPPFLAGS -I@includedir@ @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"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
project('ObjPgSQL', 'objc',
|
||||
version: '1.0',
|
||||
version: '1.0.1',
|
||||
meson_version: '>= 1.5.0',
|
||||
default_options: {
|
||||
'warning_level': '3',
|
||||
|
@ -31,6 +31,7 @@ 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,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) 2012 - 2019, 2021, 2024 Jonathan Schleifer <js@nil.im>
|
||||
* Copyright (c) 2012 - 2019, 2021, 2024, 2025 Jonathan Schleifer <js@nil.im>
|
||||
*
|
||||
* https://fl.nil.im/objpgsql
|
||||
* https://git.nil.im/ObjFW/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
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) 2012 - 2019, 2021, 2024 Jonathan Schleifer <js@nil.im>
|
||||
* Copyright (c) 2012 - 2019, 2021, 2024, 2025 Jonathan Schleifer <js@nil.im>
|
||||
*
|
||||
* https://fl.nil.im/objpgsql
|
||||
* https://git.nil.im/ObjFW/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
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) 2012 - 2019, 2021, 2024 Jonathan Schleifer <js@nil.im>
|
||||
* Copyright (c) 2012 - 2019, 2021, 2024, 2025 Jonathan Schleifer <js@nil.im>
|
||||
*
|
||||
* https://fl.nil.im/objpgsql
|
||||
* https://git.nil.im/ObjFW/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
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) 2012 - 2019, 2021, 2024 Jonathan Schleifer <js@nil.im>
|
||||
* Copyright (c) 2012 - 2019, 2021, 2024, 2025 Jonathan Schleifer <js@nil.im>
|
||||
*
|
||||
* https://fl.nil.im/objpgsql
|
||||
* https://git.nil.im/ObjFW/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) {
|
||||
[self release];
|
||||
objc_release(self);
|
||||
@throw e;
|
||||
}
|
||||
|
||||
|
@ -43,7 +43,7 @@
|
|||
|
||||
- (void)dealloc
|
||||
{
|
||||
[_parameters release];
|
||||
objc_release(_parameters);
|
||||
|
||||
[self close];
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) 2012 - 2019, 2021, 2024 Jonathan Schleifer <js@nil.im>
|
||||
* Copyright (c) 2012 - 2019, 2021, 2024, 2025 Jonathan Schleifer <js@nil.im>
|
||||
*
|
||||
* https://fl.nil.im/objpgsql
|
||||
* https://git.nil.im/ObjFW/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
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) 2012 - 2019, 2021, 2024 Jonathan Schleifer <js@nil.im>
|
||||
* Copyright (c) 2012 - 2019, 2021, 2024, 2025 Jonathan Schleifer <js@nil.im>
|
||||
*
|
||||
* https://fl.nil.im/objpgsql
|
||||
* https://git.nil.im/ObjFW/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
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) 2012 - 2019, 2021, 2024 Jonathan Schleifer <js@nil.im>
|
||||
* Copyright (c) 2012 - 2019, 2021, 2024, 2025 Jonathan Schleifer <js@nil.im>
|
||||
*
|
||||
* https://fl.nil.im/objpgsql
|
||||
* https://git.nil.im/ObjFW/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,7 +26,8 @@
|
|||
|
||||
+ (instancetype)pg_resultWithResult: (PGresult *)result
|
||||
{
|
||||
return [[[self alloc] pg_initWithResult: result] autorelease];
|
||||
return objc_autoreleaseReturnValue(
|
||||
[[self alloc] pg_initWithResult: result]);
|
||||
}
|
||||
|
||||
- (instancetype)pg_initWithResult: (PGresult *)result
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) 2012 - 2019, 2021, 2024 Jonathan Schleifer <js@nil.im>
|
||||
* Copyright (c) 2012 - 2019, 2021, 2024, 2025 Jonathan Schleifer <js@nil.im>
|
||||
*
|
||||
* https://fl.nil.im/objpgsql
|
||||
* https://git.nil.im/ObjFW/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
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) 2012 - 2019, 2021, 2024 Jonathan Schleifer <js@nil.im>
|
||||
* Copyright (c) 2012 - 2019, 2021, 2024, 2025 Jonathan Schleifer <js@nil.im>
|
||||
*
|
||||
* https://fl.nil.im/objpgsql
|
||||
* https://git.nil.im/ObjFW/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
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) 2012 - 2019, 2021, 2024 Jonathan Schleifer <js@nil.im>
|
||||
* Copyright (c) 2012 - 2019, 2021, 2024, 2025 Jonathan Schleifer <js@nil.im>
|
||||
*
|
||||
* https://fl.nil.im/objpgsql
|
||||
* https://git.nil.im/ObjFW/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,23 +65,29 @@ convertType(PGresult *res, int column, OFString *string)
|
|||
@implementation PGSQLResultRow
|
||||
+ (instancetype)pg_rowWithResult: (PGSQLResult *)result row: (int)row
|
||||
{
|
||||
return [[[self alloc] pg_initWithResult: result row: row] autorelease];
|
||||
return objc_autoreleaseReturnValue(
|
||||
[[self alloc] pg_initWithResult: result row: row]);
|
||||
}
|
||||
|
||||
- (instancetype)pg_initWithResult: (PGSQLResult *)result row: (int)row
|
||||
{
|
||||
self = [super init];
|
||||
|
||||
_result = [result retain];
|
||||
_res = result.pg_result;
|
||||
_row = row;
|
||||
@try {
|
||||
_result = objc_retain(result);
|
||||
_res = result.pg_result;
|
||||
_row = row;
|
||||
} @catch (id e) {
|
||||
objc_release(self);
|
||||
@throw e;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[_result release];
|
||||
objc_release(_result);
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
@ -115,16 +121,16 @@ convertType(PGresult *res, int column, OFString *string)
|
|||
|
||||
- (OFEnumerator *)keyEnumerator
|
||||
{
|
||||
return [[[PGSQLResultRowKeyEnumerator alloc]
|
||||
initWithResult: _result
|
||||
row: _row] autorelease];
|
||||
return objc_autoreleaseReturnValue(
|
||||
[[PGSQLResultRowKeyEnumerator alloc] initWithResult: _result
|
||||
row: _row]);
|
||||
}
|
||||
|
||||
- (OFEnumerator *)objectEnumerator
|
||||
{
|
||||
return [[[PGSQLResultRowObjectEnumerator alloc]
|
||||
initWithResult: _result
|
||||
row: _row] autorelease];
|
||||
return objc_autoreleaseReturnValue(
|
||||
[[PGSQLResultRowObjectEnumerator alloc] initWithResult: _result
|
||||
row: _row]);
|
||||
}
|
||||
|
||||
- (int)countByEnumeratingWithState: (OFFastEnumerationState *)state
|
||||
|
@ -165,17 +171,22 @@ convertType(PGresult *res, int column, OFString *string)
|
|||
{
|
||||
self = [super init];
|
||||
|
||||
_result = [result retain];
|
||||
_res = result.pg_result;
|
||||
_row = row;
|
||||
_count = PQnfields(_res);
|
||||
@try {
|
||||
_result = objc_retain(result);
|
||||
_res = result.pg_result;
|
||||
_row = row;
|
||||
_count = PQnfields(_res);
|
||||
} @catch (id e) {
|
||||
objc_release(self);
|
||||
@throw e;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[_result release];
|
||||
objc_release(_result);
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) 2012 - 2019, 2021, 2024 Jonathan Schleifer <js@nil.im>
|
||||
* Copyright (c) 2012 - 2019, 2021, 2024, 2025 Jonathan Schleifer <js@nil.im>
|
||||
*
|
||||
* https://fl.nil.im/objpgsql
|
||||
* https://git.nil.im/ObjFW/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
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) 2012 - 2019, 2021, 2024 Jonathan Schleifer <js@nil.im>
|
||||
* Copyright (c) 2012 - 2019, 2021, 2024, 2025 Jonathan Schleifer <js@nil.im>
|
||||
*
|
||||
* https://fl.nil.im/objpgsql
|
||||
* https://git.nil.im/ObjFW/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
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) 2012 - 2019, 2021, 2024 Jonathan Schleifer <js@nil.im>
|
||||
* Copyright (c) 2012 - 2019, 2021, 2024, 2025 Jonathan Schleifer <js@nil.im>
|
||||
*
|
||||
* https://fl.nil.im/objpgsql
|
||||
* https://git.nil.im/ObjFW/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
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) 2012 - 2019, 2021, 2024 Jonathan Schleifer <js@nil.im>
|
||||
* Copyright (c) 2012 - 2019, 2021, 2024, 2025 Jonathan Schleifer <js@nil.im>
|
||||
*
|
||||
* https://fl.nil.im/objpgsql
|
||||
* https://git.nil.im/ObjFW/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,7 +29,8 @@
|
|||
|
||||
+ (instancetype)exceptionWithConnection: (PGSQLConnection *)connection
|
||||
{
|
||||
return [[[self alloc] initWithConnection: connection] autorelease];
|
||||
return objc_autoreleaseReturnValue(
|
||||
[[self alloc] initWithConnection: connection]);
|
||||
}
|
||||
|
||||
- (instancetype)init
|
||||
|
@ -42,12 +43,12 @@
|
|||
self = [super init];
|
||||
|
||||
@try {
|
||||
_connection = [connection retain];
|
||||
_connection = objc_retain(connection);
|
||||
_errorMessage = [[OFString alloc]
|
||||
initWithCString: PQerrorMessage([_connection pg_connection])
|
||||
encoding: [OFLocale encoding]];
|
||||
} @catch (id e) {
|
||||
[self release];
|
||||
objc_release(self);
|
||||
@throw e;
|
||||
}
|
||||
|
||||
|
@ -56,8 +57,8 @@
|
|||
|
||||
- (void)dealloc
|
||||
{
|
||||
[_connection release];
|
||||
[_errorMessage release];
|
||||
objc_release(_connection);
|
||||
objc_release(_errorMessage);
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) 2012 - 2019, 2021, 2024 Jonathan Schleifer <js@nil.im>
|
||||
* Copyright (c) 2012 - 2019, 2021, 2024, 2025 Jonathan Schleifer <js@nil.im>
|
||||
*
|
||||
* https://fl.nil.im/objpgsql
|
||||
* https://git.nil.im/ObjFW/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
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) 2012 - 2019, 2021, 2024 Jonathan Schleifer <js@nil.im>
|
||||
* Copyright (c) 2012 - 2019, 2021, 2024, 2025 Jonathan Schleifer <js@nil.im>
|
||||
*
|
||||
* https://fl.nil.im/objpgsql
|
||||
* https://git.nil.im/ObjFW/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,9 @@
|
|||
+ (instancetype)exceptionWithConnection: (PGSQLConnection *)connection
|
||||
command: (OFConstantString *)command
|
||||
{
|
||||
return [[[self alloc] initWithConnection: connection
|
||||
command: command] autorelease];
|
||||
return objc_autoreleaseReturnValue(
|
||||
[[self alloc] initWithConnection: connection
|
||||
command: command]);
|
||||
}
|
||||
|
||||
- (instancetype)initWithConnection: (PGSQLConnection *)connection
|
||||
|
@ -46,7 +47,7 @@
|
|||
@try {
|
||||
_command = [command copy];
|
||||
} @catch (id e) {
|
||||
[self release];
|
||||
objc_release(self);
|
||||
@throw e;
|
||||
}
|
||||
|
||||
|
@ -55,7 +56,7 @@
|
|||
|
||||
- (void)dealloc
|
||||
{
|
||||
[_command release];
|
||||
objc_release(_command);
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) 2012 - 2019, 2021, 2024 Jonathan Schleifer <js@nil.im>
|
||||
* Copyright (c) 2012 - 2019, 2021, 2024, 2025 Jonathan Schleifer <js@nil.im>
|
||||
*
|
||||
* https://fl.nil.im/objpgsql
|
||||
* https://git.nil.im/ObjFW/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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue