Subject | Re: isc_interprete/fb_interprete...A Stupid Question... |
---|---|
Author | Iman S. H. Suyoto |
Post date | 2008-06-27T00:02:38Z |
--- In firebird-support@yahoogroups.com, "federonline"
<federonline@...> wrote:
the first parameter:
http://tech.groups.yahoo.com/group/firebird-support/message/81285
know whether this is idiomatic in C++. But I hope you get the idea).
===
char dpb_buffer[SHRT_MAX + 1] = {0};
char *dpb = dpb_buffer;
char *username = "username";
char *password = "password";
char username_len = strlen(username);
char password_len = strlen(password);
*dpb++ = isc_dpb_version1;
/* Set number of cache buffers */
*dpb++ = isc_dpb_num_buffers;
*dpb++ = 1;
*dpb++ = CHAR_MAX;
/* Set SQL dialect */
*dpb++ = isc_dpb_sql_dialect;
*dpb++ = 1;
*dpb++ = SQL_DIALECT_CURRENT;
/* Set username */
*dpb++ = isc_dpb_user_name;
*dpb++ = username_len;
strcpy(dpb, username);
dpb += username_len;
/* Set password */
*dpb++ = isc_dpb_password;
*dpb++ = password_len;
strcpy(dpb, password);
dpb += password_len;
===
HTH.
<federonline@...> wrote:
> I'm debugging with valgrind and got a warning that isc_interprete isThe second parameter specifies the length of the buffer supplied in
> depricated. In looking through the header file, I see that
> fb_interprete is there with an added argument. Is the difference
> documented in the FB Book or somewhere else?
the first parameter:
http://tech.groups.yahoo.com/group/firebird-support/message/81285
> Also, is there a better way to set USER/PASS than isc_expand_dpbHere's an example in C (sorry, I'm not really good in C++, so I don't
> (since it is also depricated)?
know whether this is idiomatic in C++. But I hope you get the idea).
===
char dpb_buffer[SHRT_MAX + 1] = {0};
char *dpb = dpb_buffer;
char *username = "username";
char *password = "password";
char username_len = strlen(username);
char password_len = strlen(password);
*dpb++ = isc_dpb_version1;
/* Set number of cache buffers */
*dpb++ = isc_dpb_num_buffers;
*dpb++ = 1;
*dpb++ = CHAR_MAX;
/* Set SQL dialect */
*dpb++ = isc_dpb_sql_dialect;
*dpb++ = 1;
*dpb++ = SQL_DIALECT_CURRENT;
/* Set username */
*dpb++ = isc_dpb_user_name;
*dpb++ = username_len;
strcpy(dpb, username);
dpb += username_len;
/* Set password */
*dpb++ = isc_dpb_password;
*dpb++ = password_len;
strcpy(dpb, password);
dpb += password_len;
===
HTH.