Added SILC Thread Queue API
[silc.git] / lib / silcsim / silcsimutil.c
1 /*
2
3   silcsimutil.c
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 #include "silc.h"
21
22 #ifdef SILC_SIM                 /* SIM support enabled */
23
24 static char symname[256];
25
26 /* This is used to produce the function names that are then get from
27    SIM's. */
28
29 char *silc_sim_symname(char *symbol, char *function)
30 {
31   int len1, len2, len3;
32
33   len1 = strlen(symbol);
34   len2 = strlen(function);
35   len3 = strlen(SILC_SIM_SYMBOL_PREFIX);
36   memset(symname, 0, sizeof(symname));
37   silc_strncat(symname, sizeof(symname), SILC_SIM_SYMBOL_PREFIX, len3);
38   silc_strncat(symname, sizeof(symname), "_", 1);
39   silc_strncat(symname, sizeof(symname), symbol, len1);
40   silc_strncat(symname, sizeof(symname), "_", 1);
41   silc_strncat(symname, sizeof(symname), function, len2);
42
43   return symname;
44 }
45
46 #endif /* SILC_SIM */