~ubuntu-branches/ubuntu/quantal/wxwidgets2.8/quantal

« back to all changes in this revision

Viewing changes to src/iodbc/dlproc.c

  • Committer: Package Import Robot
  • Author(s): Stéphane Graber
  • Date: 2012-01-07 13:59:25 UTC
  • mfrom: (1.1.9) (5.1.10 sid)
  • Revision ID: package-import@ubuntu.com-20120107135925-2601miy9ullcon9j
Tags: 2.8.12.1-6ubuntu1
* Resync from Debian, changes that were kept:
  - debian/rules: re-enable mediactrl. This allows libwx_gtk2u_media-2.8 to be
    built, as this is required by some applications (LP: #632984)
  - debian/control: Build-dep on libxt-dev for mediactrl.
  - Patches
    + fix-bashism-in-example
* Add conflict on python-wxgtk2.8 (<< 2.8.12.1-6ubuntu1~) to python-wxversion
  to guarantee upgrade ordering when moving from pycentral to dh_python2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 *  dlproc.c
3
 
 *
4
 
 *  $Id: dlproc.c 2613 1999-06-01 15:32:12Z VZ $
5
 
 *
6
 
 *  Load driver and resolve driver's function entry point
7
 
 *
8
 
 *  The iODBC driver manager.
9
 
 *  
10
 
 *  Copyright (C) 1995 by Ke Jin <kejin@empress.com> 
11
 
 *
12
 
 *  This library is free software; you can redistribute it and/or
13
 
 *  modify it under the terms of the GNU Library General Public
14
 
 *  License as published by the Free Software Foundation; either
15
 
 *  version 2 of the License, or (at your option) any later version.
16
 
 *
17
 
 *  This library is distributed in the hope that it will be useful,
18
 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
19
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20
 
 *  Library General Public License for more details.
21
 
 *
22
 
 *  You should have received a copy of the GNU Library General Public
23
 
 *  License along with this library; if not, write to the Free
24
 
 *  Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25
 
 */
26
 
 
27
 
#include        "config.h"
28
 
 
29
 
#include        "isql.h"
30
 
#include        "isqlext.h"
31
 
 
32
 
#include        "dlproc.h"
33
 
 
34
 
#include        "herr.h"
35
 
#include        "henv.h"
36
 
#include        "hdbc.h"
37
 
 
38
 
#include        "itrace.h"
39
 
 
40
 
#include        "henv.ci"
41
 
 
42
 
HPROC 
43
 
_iodbcdm_getproc (HDBC hdbc, int idx)
44
 
{
45
 
  DBC_t FAR *pdbc = (DBC_t FAR *) hdbc;
46
 
  ENV_t FAR *penv;
47
 
  HPROC FAR *phproc;
48
 
 
49
 
  if (idx <= 0 || idx > SQL_EXT_API_LAST)
50
 
    /* first entry naver used */
51
 
    {
52
 
      return SQL_NULL_HPROC;
53
 
    }
54
 
 
55
 
  penv = (ENV_t FAR *) (pdbc->henv);
56
 
 
57
 
  if (penv == NULL)
58
 
    {
59
 
      return SQL_NULL_HPROC;
60
 
    }
61
 
 
62
 
  phproc = penv->dllproc_tab + idx;
63
 
 
64
 
  if (*phproc == SQL_NULL_HPROC)
65
 
    {
66
 
      int i, en_idx;
67
 
 
68
 
      for (i = 0;; i++)
69
 
        {
70
 
          en_idx = odbcapi_symtab[i].en_idx;
71
 
 
72
 
          if (en_idx == en_NullProc)
73
 
            {
74
 
              break;
75
 
            }
76
 
 
77
 
          if (en_idx == idx)
78
 
            {
79
 
              *phproc = _iodbcdm_dllproc (penv->hdll,
80
 
                  odbcapi_symtab[i].symbol);
81
 
 
82
 
              break;
83
 
            }
84
 
        }
85
 
    }
86
 
 
87
 
  return *phproc;
88
 
}
89
 
 
90
 
 
91
 
HDLL 
92
 
_iodbcdm_dllopen (char FAR * path)
93
 
{
94
 
  return (HDLL) DLL_OPEN (path);
95
 
}
96
 
 
97
 
 
98
 
HPROC 
99
 
_iodbcdm_dllproc (HDLL hdll, char FAR * sym)
100
 
{
101
 
  return (HPROC) DLL_PROC (hdll, sym);
102
 
}
103
 
 
104
 
 
105
 
int 
106
 
_iodbcdm_dllclose (HDLL hdll)
107
 
{
108
 
  DLL_CLOSE (hdll);
109
 
 
110
 
  return 0;
111
 
}
112
 
 
113
 
 
114
 
char *
115
 
_iodbcdm_dllerror ()
116
 
{
117
 
  return DLL_ERROR ();
118
 
}
119