Added SILC Thread Queue API
[silc.git] / lib / silcsim / silcsim.h
1 /*
2
3   silcsim.h
4
5   Author: Pekka Riikonen <priikone@silcnet.org>
6
7   Copyright (C) 2000 Pekka Riikonen
8
9   This program is free software; you can redistribute it and/or modify
10   it under the terms of the GNU General Public License as published by
11   the Free Software Foundation; version 2 of the License.
12   
13   This program is distributed in the hope that it will be useful,
14   but WITHOUT ANY WARRANTY; without even the implied warranty of
15   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16   GNU General Public License for more details.
17
18 */
19
20 #ifndef SILCSIM_H
21 #define SILCSIM_H
22
23 typedef struct SilcSimStruct *SilcSim;
24
25 /* All SIM types. New types maybe freely added. */
26 typedef enum {
27   SILC_SIM_NONE = 0,
28   SILC_SIM_CIPHER,
29   SILC_SIM_HASH,
30 } SilcSimType;
31
32 /* Flags used to retrieve the symbols from the library file. Default
33    is that the symbols are resolved as they are loaded. However, if
34    system doesn't support this we have no other choice but to do it lazy
35    thus experience some overhead when using the symbol first time. */
36 #if defined(RTLD_NOW)
37 #define SILC_SIM_FLAGS RTLD_NOW
38 #elif defined(RTLD_LAZY)
39 #define SILC_SIM_FLAGS RTLD_LAZY
40 #else
41 #define SILC_SIM_FLAGS 0
42 #endif
43
44 /* Prototypes */
45 SilcSim silc_sim_alloc(SilcSimType type, const char *libname, 
46                        SilcUInt32 flags);
47 void silc_sim_free(SilcSim sim);
48 int silc_sim_load(SilcSim sim);
49 int silc_sim_close(SilcSim sim);
50 const char *silc_sim_error(SilcSim sim);
51 void *silc_sim_getsym(SilcSim sim, const char *symbol);
52
53 #endif