Skip to content

Commit 27f0bf8

Browse files
committed
Add nullability attributes to Objective-C code
Just a small improvement for the code internally. Signed-off-by: Stephen Celis <stephen@stephencelis.com>
1 parent cd5567b commit 27f0bf8

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

SQLite/SQLite-Bridging.h

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,26 +28,29 @@ typedef struct SQLiteHandle SQLiteHandle;
2828
typedef struct SQLiteContext SQLiteContext;
2929
typedef struct SQLiteValue SQLiteValue;
3030

31+
NS_ASSUME_NONNULL_BEGIN
3132
typedef int (^_SQLiteBusyHandlerCallback)(int times);
32-
int _SQLiteBusyHandler(SQLiteHandle * handle, _SQLiteBusyHandlerCallback callback);
33+
int _SQLiteBusyHandler(SQLiteHandle * handle, _SQLiteBusyHandlerCallback __nullable callback);
3334

3435
typedef void (^_SQLiteTraceCallback)(const char * SQL);
35-
void _SQLiteTrace(SQLiteHandle * handle, _SQLiteTraceCallback callback);
36+
void _SQLiteTrace(SQLiteHandle * handle, _SQLiteTraceCallback __nullable callback);
3637

3738
typedef void (^_SQLiteUpdateHookCallback)(int operation, const char * db, const char * table, long long rowid);
38-
void _SQLiteUpdateHook(SQLiteHandle * handle, _SQLiteUpdateHookCallback callback);
39+
void _SQLiteUpdateHook(SQLiteHandle * handle, _SQLiteUpdateHookCallback __nullable callback);
3940

4041
typedef int (^_SQLiteCommitHookCallback)();
41-
void _SQLiteCommitHook(SQLiteHandle * handle, _SQLiteCommitHookCallback callback);
42+
void _SQLiteCommitHook(SQLiteHandle * handle, _SQLiteCommitHookCallback __nullable callback);
4243

4344
typedef void (^_SQLiteRollbackHookCallback)();
44-
void _SQLiteRollbackHook(SQLiteHandle * handle, _SQLiteRollbackHookCallback callback);
45+
void _SQLiteRollbackHook(SQLiteHandle * handle, _SQLiteRollbackHookCallback __nullable callback);
4546

46-
typedef void (^_SQLiteCreateFunctionCallback)(SQLiteContext * context, int argc, SQLiteValue ** argv);
47-
int _SQLiteCreateFunction(SQLiteHandle * handle, const char * name, int argc, int deterministic, _SQLiteCreateFunctionCallback callback);
47+
typedef void (^_SQLiteCreateFunctionCallback)(SQLiteContext * context, int argc, SQLiteValue * __nonnull * __nonnull argv);
48+
int _SQLiteCreateFunction(SQLiteHandle * handle, const char * name, int argc, int deterministic, _SQLiteCreateFunctionCallback __nullable callback);
4849

4950
typedef int (^_SQLiteCreateCollationCallback)(const char * lhs, const char * rhs);
50-
int _SQLiteCreateCollation(SQLiteHandle * handle, const char * name, _SQLiteCreateCollationCallback callback);
51+
int _SQLiteCreateCollation(SQLiteHandle * handle, const char * name, _SQLiteCreateCollationCallback __nullable callback);
52+
53+
typedef NSString * __nullable (^_SQLiteTokenizerNextCallback)(const char * input, int * inputOffset, int * inputLength);
54+
int _SQLiteRegisterTokenizer(SQLiteHandle * db, const char * module, const char * tokenizer, __nullable _SQLiteTokenizerNextCallback callback);
55+
NS_ASSUME_NONNULL_END
5156

52-
typedef NSString * (^_SQLiteTokenizerNextCallback)(const char * input, int * inputOffset, int * inputLength);
53-
int _SQLiteRegisterTokenizer(SQLiteHandle * db, const char * module, const char * tokenizer, _SQLiteTokenizerNextCallback callback);

0 commit comments

Comments
 (0)