Example #1
0
/**
 * Allocate a buffer for database module
 * No function should be called before this
 * \return zero on success, negative value on failure
 */
int db_mysql_alloc_buffer(void)
{
    if (db_api_init())
    {
        LM_ERR("Failed to initialise db api\n");
		return -1;
    }

    mysql_sql_buf = (char*)malloc(sql_buffer_size);
    if (mysql_sql_buf == NULL)
        return -1;
    else
        return 0;
}
Example #2
0
int mod_register(char *path, int *dlflags, void *p1, void *p2)
{
	if(db_api_init() < 0)
		return -1;
	return 0;
}