27.10.2013 Views

Firebird 2.1 Release Notes

Firebird 2.1 Release Notes

Firebird 2.1 Release Notes

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Changes to the <strong>Firebird</strong> API and ODS<br />

New Function for Delivering Error Text<br />

C. Valderrama<br />

The new function fb_interpret() replaces the former isc_interprete() for extracting the text for a <strong>Firebird</strong><br />

error message from the error status vector to a client buffer.<br />

Important<br />

isc_interprete() is vulnerable to overruns and is deprecated as unsafe. The new function should be used instead.<br />

Accommodation of New Shutdown Parameters<br />

D. Yemanov<br />

API Access to database shutdown is through flags appended to the isc_dpb_shutdown parameter in the DBP<br />

argument passed to isc_attach_database(). The symbols for the flags are:<br />

#define isc_dpb_shut_cache 0x1<br />

#define isc_dpb_shut_attachment 0x2<br />

#define isc_dpb_shut_transaction 0x4<br />

#define isc_dpb_shut_force 0x8<br />

#define isc_dpb_shut_mode_mask 0x70<br />

#define isc_dpb_shut_default 0x0<br />

#define isc_dpb_shut_normal 0x10<br />

#define isc_dpb_shut_multi 0x20<br />

#define isc_dpb_shut_single 0x30<br />

#define isc_dpb_shut_full 0x40<br />

Example of Use in C/C++<br />

char dpb_buffer[256], *dpb, *p;<br />

ISC_STATUS status_vector[ISC_STATUS_LENGTH];<br />

isc_db_handle handle = NULL;<br />

dpb = dpb_buffer;<br />

*dpb++ = isc_dpb_version1;<br />

const char* user_name = “SYSDBA”;<br />

const int user_name_length = strlen(user_name);<br />

*dpb++ = isc_dpb_user_name;<br />

*dpb++ = user_name_length;<br />

memcpy(dpb, user_name, user_name_length);<br />

dpb += user_name_length;<br />

const char* user_password = “masterkey”;<br />

const int user_password_length = strlen(user_password);<br />

*dpb++ = isc_dpb_password;<br />

*dpb++ = user_password_length;<br />

memcpy(dpb, user_password, user_password_length);<br />

dpb += user_password_length;<br />

21

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!