5 Author: Pekka Riikonen <priikone@poseidon.pspt.fi>
7 Copyright (C) 2000 Pekka Riikonen
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.
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.
21 #include "silcincludes.h"
23 #ifdef SILC_SIM /* SIM support enabled */
25 /* This puts two arguments together and returns a new allocated string.
26 This is used to produce the function names that are then get from
29 char *silc_sim_symname(char *symbol, char *function)
34 len1 = strlen(symbol);
35 len2 = strlen(function);
36 len3 = strlen(SILC_SIM_SYMBOL_PREFIX);
37 ret = silc_calloc(len1 + len2 + len3 + 2 + 1, sizeof(char));
39 strncpy(ret, SILC_SIM_SYMBOL_PREFIX, len3);
41 strncat(ret, symbol, len1);
43 strncat(ret, function, len2);