Returns the real name of the module. If a given file has an extension, it will just return that filename. If the given file has no given extension, the system specific extension is concatted and returned.
| 276 | // just return that filename. If the given file has no given extension, the |
| 277 | // system specific extension is concatted and returned. |
| 278 | void mod_GetRealModuleName(const char *modfilename, char *realmodfilename) { |
| 279 | char pathname[_MAX_PATH], filename[_MAX_FNAME], extension[_MAX_EXT]; |
| 280 | dd_SplitPath(modfilename, pathname, filename, extension); |
| 281 | if (*extension == '\0') |
| 282 | #if defined(WIN32) |
| 283 | strcat(filename, ".dll"); |
| 284 | #elif defined(__LINUX__) |
| 285 | strcat(filename, ".so"); |
| 286 | #elif defined(MACOSX) |
| 287 | strcat(filename, ".dylib"); |
| 288 | #else |
| 289 | #error Unsupported platform! |
| 290 | #endif |
| 291 | else { |
| 292 | #if defined(WIN32) |
| 293 | if (!stricmp(extension, ".so") || !stricmp(extension, "msl") || !stricmp(extension, "dylib")) |
| 294 | strcat(filename, ".dll"); |
| 295 | else |
| 296 | strcat(filename, extension); |
| 297 | #elif defined(__LINUX__) |
| 298 | if (!stricmp(extension, ".dll") || !stricmp(extension, "msl") || !stricmp(extension, "dylib")) |
| 299 | strcat(filename, ".so"); |
| 300 | else |
| 301 | strcat(filename, extension); |
| 302 | #elif defined(MACOSX) |
| 303 | if (!stricmp(extension, ".dll") || !stricmp(extension, "msl") || !stricmp(extension, "so")) |
| 304 | strcat(filename, ".dylib"); |
| 305 | else |
| 306 | strcat(filename, extension); |
| 307 | #else |
| 308 | #error Unsupported platform! |
| 309 | #endif |
| 310 | } |
| 311 | if (*pathname != '\0') |
| 312 | dd_MakePath(realmodfilename, pathname, filename, NULL); |
| 313 | else |
no test coverage detected