mirror of
https://github.com/mdbtools/mdbtools.git
synced 2025-05-04 04:57:56 +08:00
Patch odbc.diff from Nirgal
This commit is contained in:
parent
29dc97e3d6
commit
230dfc8b2b
@ -23,6 +23,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
#include "connectparams.h"
|
#include "connectparams.h"
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
@ -46,10 +47,12 @@
|
|||||||
static char line[max_line];
|
static char line[max_line];
|
||||||
|
|
||||||
static guint HashFunction (gconstpointer key);
|
static guint HashFunction (gconstpointer key);
|
||||||
|
#if !HAVE_SQLGETPRIVATEPROFILESTRING
|
||||||
static GString* GetIniFileName ();
|
static GString* GetIniFileName ();
|
||||||
static int FileExists (const gchar* name);
|
static int FileExists (const gchar* name);
|
||||||
static int FindSection (FILE* stream, const char* section);
|
static int FindSection (FILE* stream, const char* section);
|
||||||
static int GetNextItem (FILE* stream, char** name, char** value);
|
static int GetNextItem (FILE* stream, char** name, char** value);
|
||||||
|
#endif //!HAVE_SQLGETPRIVATEPROFILESTRING
|
||||||
|
|
||||||
static void visit (gpointer key, gpointer value, gpointer user_data);
|
static void visit (gpointer key, gpointer value, gpointer user_data);
|
||||||
static gboolean cleanup (gpointer key, gpointer value, gpointer user_data);
|
static gboolean cleanup (gpointer key, gpointer value, gpointer user_data);
|
||||||
@ -360,6 +363,20 @@ gchar* ExtractDBQ (ConnectParams* params, const gchar* connectString)
|
|||||||
* Begin local function definitions
|
* Begin local function definitions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Make a hash from all the characters
|
||||||
|
*/
|
||||||
|
static guint HashFunction (gconstpointer key)
|
||||||
|
{
|
||||||
|
guint value = 0;
|
||||||
|
const char* s = key;
|
||||||
|
|
||||||
|
while (*s) value += *s++;
|
||||||
|
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if !HAVE_SQLGETPRIVATEPROFILESTRING
|
||||||
static GString* GetIniFileName ()
|
static GString* GetIniFileName ()
|
||||||
{
|
{
|
||||||
char* setting;
|
char* setting;
|
||||||
@ -438,19 +455,6 @@ static int FindSection (FILE* stream, const char* section)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Make a hash from all the characters
|
|
||||||
*/
|
|
||||||
static guint HashFunction (gconstpointer key)
|
|
||||||
{
|
|
||||||
guint value = 0;
|
|
||||||
const char* s = key;
|
|
||||||
|
|
||||||
while (*s) value += *s++;
|
|
||||||
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int GetNextItem (FILE* stream, char** name, char** value)
|
static int GetNextItem (FILE* stream, char** name, char** value)
|
||||||
{
|
{
|
||||||
char* s;
|
char* s;
|
||||||
@ -499,12 +503,12 @@ static int GetNextItem (FILE* stream, char** name, char** value)
|
|||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
#endif //!HAVE_SQLGETPRIVATEPROFILESTRING
|
||||||
|
|
||||||
static void visit (gpointer key, gpointer value, gpointer user_data)
|
static void visit (gpointer key, gpointer value, gpointer user_data)
|
||||||
{
|
{
|
||||||
FILE* output = (FILE*) user_data;
|
FILE* output = (FILE*) user_data;
|
||||||
|
fprintf(output, "Parameter: %s, Value: %s\n", (char*)key, (char*)value);
|
||||||
g_printerr ("Parameter: %s, Value: %s\n", key, value);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean cleanup (gpointer key, gpointer value, gpointer user_data)
|
static gboolean cleanup (gpointer key, gpointer value, gpointer user_data)
|
||||||
|
700
src/odbc/odbc.c
700
src/odbc/odbc.c
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user