@@ -32,16 +32,16 @@ extern "C" unsigned fb_get_client_version(void *master_ptr)
3232 return util->getClientVersion ();
3333}
3434
35- extern " C" ISC_TIME fb_encode_time (unsigned hours, unsigned minutes, unsigned seconds, unsigned fractions)
35+ extern " C" ISC_TIME fb_encode_time (void *master_ptr, unsigned hours, unsigned minutes, unsigned seconds, unsigned fractions)
3636{
37- Firebird::IMaster* master = Firebird::fb_get_master_interface () ;
37+ Firebird::IMaster* master = ( Firebird::IMaster*)master_ptr ;
3838 Firebird::IUtil* util = master->getUtilInterface ();
3939 return util->encodeTime (hours, minutes, seconds, fractions);
4040}
4141
42- extern " C" ISC_DATE fb_encode_date (unsigned year, unsigned month, unsigned day)
42+ extern " C" ISC_DATE fb_encode_date (void *master_ptr, unsigned year, unsigned month, unsigned day)
4343{
44- Firebird::IMaster* master = Firebird::fb_get_master_interface () ;
44+ Firebird::IMaster* master = ( Firebird::IMaster*)master_ptr ;
4545 Firebird::IUtil* util = master->getUtilInterface ();
4646 return util->encodeDate (year, month, day);
4747}
@@ -57,10 +57,10 @@ static void fb_copy_status(const ISC_STATUS* from, ISC_STATUS* to, size_t maxLen
5757}
5858
5959/* Decodes a time with time zone into its time components. */
60- extern " C" void fb_decode_time_tz (const ISC_TIME_TZ* timeTz, unsigned * hours, unsigned * minutes, unsigned * seconds, unsigned * fractions,
60+ extern " C" void fb_decode_time_tz (void *master_ptr, const ISC_TIME_TZ* timeTz, unsigned * hours, unsigned * minutes, unsigned * seconds, unsigned * fractions,
6161 unsigned timeZoneBufferLength, char * timeZoneBuffer)
6262{
63- Firebird::IMaster* master = Firebird::fb_get_master_interface () ;
63+ Firebird::IMaster* master = ( Firebird::IMaster*)master_ptr ;
6464 Firebird::IUtil* util = master->getUtilInterface ();
6565 Firebird::IStatus* status = master->getStatus ();
6666 Firebird::CheckStatusWrapper st (status);
@@ -69,12 +69,12 @@ extern "C" void fb_decode_time_tz(const ISC_TIME_TZ* timeTz, unsigned* hours, un
6969}
7070
7171/* Decodes a timestamp with time zone into its date and time components */
72- extern " C" void fb_decode_timestamp_tz (const ISC_TIMESTAMP_TZ* timestampTz,
72+ extern " C" void fb_decode_timestamp_tz (void *master_ptr, const ISC_TIMESTAMP_TZ* timestampTz,
7373 unsigned * year, unsigned * month, unsigned * day,
7474 unsigned * hours, unsigned * minutes, unsigned * seconds, unsigned * fractions,
7575 unsigned timeZoneBufferLength, char * timeZoneBuffer)
7676{
77- Firebird::IMaster* master = Firebird::fb_get_master_interface () ;
77+ Firebird::IMaster* master = ( Firebird::IMaster*)master_ptr ;
7878 Firebird::IUtil* util = master->getUtilInterface ();
7979 Firebird::IStatus* status = master->getStatus ();
8080 Firebird::CheckStatusWrapper st (status);
@@ -83,18 +83,14 @@ extern "C" void fb_decode_timestamp_tz(const ISC_TIMESTAMP_TZ* timestampTz,
8383 timeZoneBufferLength, timeZoneBuffer);
8484}
8585
86- extern " C" int fb_insert_aliases (ISC_STATUS* st, ibase_query *ib_query)
86+ extern " C" int fb_insert_aliases (void *master_ptr, ISC_STATUS* st, ibase_query *ib_query, void *statement_ptr )
8787{
88- Firebird::IMaster* master = Firebird::fb_get_master_interface () ;
88+ Firebird::IMaster* master = ( Firebird::IMaster*)master_ptr ;
8989 Firebird::ThrowStatusWrapper status (master->getStatus ());
90- Firebird::IStatement* statement = NULL ;
90+ Firebird::IStatement* statement = (Firebird::IStatement *)statement_ptr ;
9191 Firebird::IMessageMetadata* meta = NULL ;
9292 ISC_STATUS res;
9393
94- if (res = fb_get_statement_interface (st, &statement, &ib_query->stmt )){
95- return res;
96- }
97-
9894 try {
9995 meta = statement->getOutputMetadata (&status);
10096 unsigned cols = meta->getCount (&status);
@@ -118,18 +114,15 @@ extern "C" int fb_insert_aliases(ISC_STATUS* st, ibase_query *ib_query)
118114 return 0 ;
119115}
120116
121- extern " C" int fb_insert_field_info (ISC_STATUS* st, ibase_query *ib_query, int is_outvar, int num, zval *into_array)
117+ extern " C" int fb_insert_field_info (void *master_ptr, ISC_STATUS* st, int is_outvar, int num,
118+ zval *into_array, void *statement_ptr)
122119{
123- Firebird::IMaster* master = Firebird::fb_get_master_interface () ;
120+ Firebird::IMaster* master = ( Firebird::IMaster*)master_ptr ;
124121 Firebird::ThrowStatusWrapper status (master->getStatus ());
125- Firebird::IStatement* statement = NULL ;
122+ Firebird::IStatement* statement = (Firebird::IStatement *)statement_ptr ;
126123 Firebird::IMessageMetadata* meta = NULL ;
127124 ISC_STATUS res;
128125
129- if (res = fb_get_statement_interface (st, &statement, &ib_query->stmt )){
130- return res;
131- }
132-
133126 try {
134127 if (is_outvar) {
135128 meta = statement->getOutputMetadata (&status);
@@ -157,4 +150,4 @@ extern "C" int fb_insert_field_info(ISC_STATUS* st, ibase_query *ib_query, int i
157150 return 0 ;
158151}
159152
160- #endif
153+ #endif // FB_API_VER >= 40
0 commit comments