0da8993a367a5adf47bae90659e8d9e1cdb70362
[silc.git] / lib / silcsim / silcsimutil.c
1 /*
2
3   silcsimutil.c
4
5   Author: Pekka Riikonen <priikone@poseidon.pspt.fi>
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; either version 2 of the License, or
12   (at your option) any later version.
13   
14   This program is distributed in the hope that it will be useful,
15   but WITHOUT ANY WARRANTY; without even the implied warranty of
16   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17   GNU General Public License for more details.
18
19 */
20
21 #include "silcincludes.h"
22
23 #ifdef SILC_SIM                 /* SIM support enabled */
24
25 static char symname[256];
26
27 /* This is used to produce the function names that are then get from
28    SIM's. */
29
30 char *silc_sim_symname(char *symbol, char *function)
31 {
32   int len1, len2, len3;
33
34   len1 = strlen(symbol);
35   len2 = strlen(function);
36   len3 = strlen(SILC_SIM_SYMBOL_PREFIX);
37   memset(symname, 0, sizeof(symname));
38   silc_strncat(symname, sizeof(symname), SILC_SIM_SYMBOL_PREFIX, len3);
39   silc_strncat(symname, sizeof(symname), "_", 1);
40   silc_strncat(symname, sizeof(symname), symbol, len1);
41   silc_strncat(symname, sizeof(symname), "_", 1);
42   silc_strncat(symname, sizeof(symname), function, len2);
43
44   return symname;
45 }
46
47 #endif /* SILC_SIM */