~ubuntu-branches/ubuntu/saucy/clamav/saucy

« back to all changes in this revision

Viewing changes to win32/compat/ltdl.c

  • Committer: Bazaar Package Importer
  • Author(s): Leonel Nunez
  • Date: 2008-02-11 22:52:13 UTC
  • mfrom: (1.1.6 upstream)
  • mto: This revision was merged to the branch mainline in revision 38.
  • Revision ID: james.westby@ubuntu.com-20080211225213-p2uwj4czso1w2f8h
Tags: upstream-0.92~dfsg
ImportĀ upstreamĀ versionĀ 0.92~dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 *  Copyright (C) 2009 Sourcefire, Inc.
3
 
 *
4
 
 *  Authors: aCaB <acab@clamav.net>
5
 
 *
6
 
 *  This program is free software; you can redistribute it and/or modify
7
 
 *  it under the terms of the GNU General Public License version 2 as
8
 
 *  published by the Free Software Foundation.
9
 
 *
10
 
 *  This program is distributed in the hope that it will be useful,
11
 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 
 *  GNU General Public License for more details.
14
 
 *
15
 
 *  You should have received a copy of the GNU General Public License
16
 
 *  along with this program; if not, write to the Free Software
17
 
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18
 
 *  MA 02110-1301, USA.
19
 
 */
20
 
 
21
 
#include "ltdl.h"
22
 
 
23
 
static DWORD lasterr = 0;
24
 
const lt_dlinfo dlinfo = {"libclamunrar_iface", "unrar", 1, 0, 0, 0 };
25
 
 
26
 
int lt_dlinit(void) {
27
 
        return 0;
28
 
}
29
 
 
30
 
lt_dlhandle lt_dlopen(const char *filename) {
31
 
        lt_dlhandle h = LoadLibrary(filename);
32
 
        if(!h) lasterr = GetLastError();
33
 
        return h;
34
 
}
35
 
 
36
 
void *lt_dlsym(lt_dlhandle handle, const char *name) {
37
 
        void *f = GetProcAddress(handle, name);
38
 
        if(!f) lasterr = GetLastError();
39
 
        return f;
40
 
}
41
 
 
42
 
const char *lt_dlerror(void) {
43
 
        char *err = "NO ERROR";
44
 
        if(lasterr)
45
 
                FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, lasterr, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&err, 0, NULL);
46
 
        return err;
47
 
}
48
 
 
49
 
int lt_dladdsearchdir(const char *search_dir) {
50
 
        return 0;
51
 
}
52
 
 
53
 
const char *lt_dlgetsearchpath(void) {
54
 
        return NULL;
55
 
}
56
 
 
57
 
const lt_dlinfo *lt_dlgetinfo(lt_dlhandle handle) {
58
 
        return &dlinfo;
59
 
}
 
 
b'\\ No newline at end of file'