/** @file /common/TCL/tcl_struct.cpp Implementace hlavickoveho souboru /common/TCL/tcl_struct.h @author Petr Wolf */ #include #include "common/compatibility.h" #include "common/types.h" #include "tcl_struct.h" char * TCL_path(char * result, const char * path, const char * name) { char temp[MAX_STRLEN]; // rozlisim 2 pripady: if (strchr(path, '(')) { // 1. cesta jiz obsahuje oteviraci zavorku -> pridam novou uroven s carkou na konec // a uzavru zavorkou // vykopiruju z path celou cestu bez posledni zavorky. if (strncpy(temp, path, strlen(path) - 1)) { temp[strlen(path) - 1] = '\0'; // slozim cestu if (snprintf(result, MAX_STRLEN, "%s, %s)", temp, name)) return result; else return NULL; } else return NULL; } else { // 2. vytvarim teprve prvni uroven zanoreni if (snprintf(result, MAX_STRLEN, "%s(%s)", path, name)) return result; else return NULL; } }