Below is the list of changes that have just been commited into a local
MyODBC 3.51 repository of 'pharvey'. When 'pharvey' does a push, they will
be propogaged to the main repository and within 2 hours after the push
into the public repository.
For more information on how to access the public repository see:
http://www.mysql.com/products/myodbc/faq_2.html#Development_ source
You can also browse the changes from public repository:
Complete repository: http://mysql.bkbits.net:8080/myodbc3/
This changeset : http://mysql.bkbits.net:8080/myodbc3/cset [at] 1.437
ChangeSet
1.437 05/01/21 22:43:42 peterh [at] mysql.com +2 -0
- ensuring files get into bk
util/MYODBCUtilGetDriverNames.c
1.1 05/01/21 22:43:04 peterh [at] mysql.com +66 -0
util/MYODBCUtilGetDataSourceNames.c
1.1 05/01/21 22:43:04 peterh [at] mysql.com +99 -0
util/MYODBCUtilGetDriverNames.c
1.0 05/01/21 22:43:04 peterh [at] mysql.com +0 -0
BitKeeper file /home/pharvey/SandBox/MySQL/myodbc-3.51/util/MYODBCUtilGetDr iverNames.c
util/MYODBCUtilGetDataSourceNames.c
1.0 05/01/21 22:43:04 peterh [at] mysql.com +0 -0
BitKeeper file /home/pharvey/SandBox/MySQL/myodbc-3.51/util/MYODBCUtilGetDa taSourceNames.c
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: peterh
# Host: peter.peterharvey.org
# Root: /home/pharvey/SandBox/MySQL/myodbc-3.51
--- New file ---
+++ util/MYODBCUtilGetDataSourceNames.c 05/01/21 22:43:04
/* Copyright (C) 2000-2004 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
There are special exceptions to the terms and conditions of the GPL as it
is applied to this software. View the full text of the exception in file
EXCEPTIONS in the directory of this software distribution.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "MYODBCUtil.h"
/*!
\internal
\brief Put a list of existing data source names in pszBuffer.
\note OSX
SQLGetPrivateProfileString() is broken but fortunately
the old GetPrivateProfileString() is available and seems
to work fine.
\note XP
SQLGetPrivateProfileString() with a NULL 1st arg does
not return anything - ever. This is contrary to the
specification :(
Using SQLDataSources() is not a real option here as we
would need to be calling into the DM for that and we
are supposed to be below the DM in the depend hierarchy.
*/
BOOL MYODBCUtilGetDataSourceNames( char *pszBuffer, int nBuffer, UWORD nScope )
{
int nChars = 0;
/*
sanity check
*/
if ( !pszBuffer || nBuffer < 1024 )
{
fprintf( stderr, "[%s][%d][ERROR] Insufficient buffer size. Please provide 1k or better yet - 32k.\n", __FILE__, __LINE__ );
return FALSE;
}
/* set scope */
switch ( nScope )
{
case ODBC_BOTH_DSN:
break;
case ODBC_USER_DSN:
case ODBC_SYSTEM_DSN:
if ( !SQLSetConfigMode( nScope ) )
return FALSE;
break;
default:
return FALSE;
}
#if defined(__APPLE__)
nChars = GetPrivateProfileString( NULL, NULL, "", pszBuffer, nBuffer - 1, "ODBC.INI" );
#elif defined(WIN32)
nChars = ( SQLGetInstalledDrivers( pszBuffer, nBuffer - 1, NULL ) ? 1 : 0 );
#else
nChars = SQLGetPrivateProfileString( NULL, NULL, "", pszBuffer, nBuffer - 1, "ODBC.INI" );
#endif
/* unset scope */
switch ( nScope )
{
case ODBC_BOTH_DSN:
break;
case ODBC_USER_DSN:
case ODBC_SYSTEM_DSN:
SQLSetConfigMode( ODBC_BOTH_DSN );
break;
}
if ( nChars < 1 )
{
fprintf( stderr, "[%s][%d][INFO] Call returned no data. Could be an error or just no data to return.\n", __FILE__, __LINE__ );
return FALSE;
}
return TRUE;
}
--- New file ---
+++ util/MYODBCUtilGetDriverNames.c 05/01/21 22:43:04
/* Copyright (C) 2000-2004 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
There are special exceptions to the terms and conditions of the GPL as it
is applied to this software. View the full text of the exception in file
EXCEPTIONS in the directory of this software distribution.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "MYODBCUtil.h"
/*!
\internal
\brief Put a list of installed drivers in pszBuffer.
\note OSX
SQLGetPrivateProfileString() is broken but fortunately
the old GetPrivateProfileString() is available.
\note XP
SQLGetPrivateProfileString() with a NULL 1st arg does
not return anything - ever. To return a list of drivers
we can use SQLGetInstalledDrivers() instead.
*/
BOOL MYODBCUtilGetDriverNames( char *pszBuffer, int nBuffer )
{
int nChars = 0;
/*
sanity check
*/
if ( !pszBuffer || nBuffer < 1024 )
{
fprintf( stderr, "[%s][%d][ERROR] Insufficient buffer size. Please provide 1k or better yet - 32k.\n", __FILE__, __LINE__ );
return FALSE;
}
#if defined(__APPLE__)
nChars = GetPrivateProfileString( NULL, NULL, "", pszBuffer, nBuffer - 1, "ODBCINST.INI" );
#elif defined(WIN32)
nChars = ( SQLGetInstalledDrivers( pszBuffer, nBuffer - 1, NULL ) ? 1 : 0 );
#else
nChars = SQLGetPrivateProfileString( NULL, NULL, "", pszBuffer, nBuffer - 1, "ODBCINST.INI" );
#endif
if ( nChars < 1 )
{
fprintf( stderr, "[%s][%d][INFO] Call returned no data. Could be an error or just no data to return.\n", __FILE__, __LINE__ );
return FALSE;
}
return TRUE;
}
--
MySQL ODBC Mailing List
For list archives: http://lists.mysql.com/myodbc
To unsubscribe: http://lists.mysql.com/myodbc?unsub=gcdmo-myodbc [at] m.gmane.org
