* Attempt to guess if the filename is a library or not. */
| 150 | * Attempt to guess if the filename is a library or not. |
| 151 | */ |
| 152 | bool isLibraryFilename(const char *filename) |
| 153 | { |
| 154 | const char *str; |
| 155 | while ((str = strchr(filename, '/')) != nullptr) |
| 156 | filename = str+1; |
| 157 | str = strstr(filename, "lib"); |
| 158 | if (str == nullptr) |
| 159 | return false; |
| 160 | str = strstr(str, ".so"); |
| 161 | if (str == nullptr) |
| 162 | return false; |
| 163 | str += 3; |
| 164 | while (*str != '\0') |
| 165 | { |
| 166 | if (*str != '.') |
| 167 | return false; |
| 168 | str++; |
| 169 | if (!isdigit(*str++)) |
| 170 | return false; |
| 171 | while (isdigit(*str)) |
| 172 | str++; |
| 173 | } |
| 174 | return true; |
| 175 | } |
| 176 | |
| 177 | /* |
| 178 | * Get path information. |