|
3 | 3 | * SPDX-License-Identifier: MIT |
4 | 4 | * ------------------------------------------------------------- |
5 | 5 | * Lib Name : xy.h |
6 | | - * Lib Authors : Aoran Zeng <ccmywish@qq.com> |
7 | | - * | Heng Guo <2085471348@qq.com> |
8 | | - * Contributors : juzeon <skyjuzheng@gmail.com> |
| 6 | + * Lib Authors : Aoran Zeng <ccmywish@qq.com> |
| 7 | + * | Heng Guo <2085471348@qq.com> |
| 8 | + * Contributors : juzeon <skyjuzheng@gmail.com> |
| 9 | + * | Mikachu2333 <mikachu.23333@zohomail.com> |
9 | 10 | * | |
10 | 11 | * Created On : <2023-08-28> |
11 | | - * Last Modified : <2025-07-19> |
| 12 | + * Last Modified : <2025-08-07> |
12 | 13 | * |
13 | 14 | * xy: 襄阳、咸阳 |
14 | | - * Corss-Platform C11 utilities for CLI applications in mixed flavor (mostly Ruby) |
| 15 | + * Corss-Platform C11 utilities for CLI applications in mixed |
| 16 | + * flavor (mostly Ruby) |
15 | 17 | * ------------------------------------------------------------*/ |
16 | 18 |
|
17 | 19 | #ifndef XY_H |
18 | 20 | #define XY_H |
19 | 21 |
|
20 | | -#define _XY_Version "v0.1.5.2-2025/07/19" |
| 22 | +#define _XY_Version "v0.1.5.3-2025/08/07" |
21 | 23 | #define _XY_Maintain_URL "https://github.com/RubyMetric/chsrc/blob/dev/lib/xy.h" |
22 | 24 | #define _XY_Maintain_URL2 "https://gitee.com/RubyMetric/chsrc/blob/dev/lib/xy.h" |
23 | 25 |
|
@@ -377,6 +379,31 @@ xy_streql (const char *str1, const char *str2) |
377 | 379 | return strcmp (str1, str2) == 0 ? true : false; |
378 | 380 | } |
379 | 381 |
|
| 382 | +static bool |
| 383 | +xy_streql_ic(const char *str1, const char *str2) |
| 384 | +{ |
| 385 | + if (NULL == str1 || NULL == str2) |
| 386 | + { |
| 387 | + return false; |
| 388 | + } |
| 389 | + |
| 390 | + size_t len1 = strlen(str1); |
| 391 | + size_t len2 = strlen(str2); |
| 392 | + if (len1 != len2) |
| 393 | + { |
| 394 | + return false; |
| 395 | + } |
| 396 | + |
| 397 | + for (size_t i = 0; i < len1; i++) |
| 398 | + { |
| 399 | + if (tolower(str1[i]) != tolower(str2[i])) |
| 400 | + { |
| 401 | + return false; |
| 402 | + } |
| 403 | + } |
| 404 | + return true; |
| 405 | +} |
| 406 | + |
380 | 407 | static char * |
381 | 408 | xy_str_to_quietcmd (const char *cmd) |
382 | 409 | { |
|
0 commit comments