mirror of
https://github.com/RubyMetric/chsrc
synced 2025-12-17 08:44:21 +08:00
Rename some functions
This commit is contained in:
12
chsrc.c
12
chsrc.c
@@ -2,7 +2,7 @@
|
|||||||
* File : chsrc.c
|
* File : chsrc.c
|
||||||
* Authors : Aoran Zeng <ccmywish@qq.com>
|
* Authors : Aoran Zeng <ccmywish@qq.com>
|
||||||
* Created on : <2023-08-28>
|
* Created on : <2023-08-28>
|
||||||
* Last modified : <2023-08-29>
|
* Last modified : <2023-08-30>
|
||||||
*
|
*
|
||||||
* chsrc:
|
* chsrc:
|
||||||
*
|
*
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
* 参考:https://mirrors.tuna.tsinghua.edu.cn/help/pypi/
|
* 参考:https://mirrors.tuna.tsinghua.edu.cn/help/pypi/
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
pl_chsrc_python (char* source_name)
|
pl_python_chsrc (char* source_name)
|
||||||
{
|
{
|
||||||
char* source_url = NULL;
|
char* source_url = NULL;
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ pl_chsrc_python (char* source_name)
|
|||||||
* 参考:https://gitee.com/RubyKids/rbenv-cn
|
* 参考:https://gitee.com/RubyKids/rbenv-cn
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
pl_chsrc_ruby (char* option)
|
pl_ruby_chsrc (char* option)
|
||||||
{
|
{
|
||||||
int selected = 0;
|
int selected = 0;
|
||||||
for (int i=0;i<sizeof(pl_ruby_sources);i++) {
|
for (int i=0;i<sizeof(pl_ruby_sources);i++) {
|
||||||
@@ -78,7 +78,7 @@ pl_chsrc_ruby (char* option)
|
|||||||
|
|
||||||
#define cmdfunc(func) (const char const*)func
|
#define cmdfunc(func) (const char const*)func
|
||||||
static const char const
|
static const char const
|
||||||
*pl_ruby[] = {"gem", "ruby", "rb", NULL, cmdfunc(pl_chsrc_ruby)},
|
*pl_ruby[] = {"gem", "ruby", "rb", NULL, cmdfunc(pl_ruby_chsrc)},
|
||||||
*pl_python[] = {"pip", "python", "py", NULL},
|
*pl_python[] = {"pip", "python", "py", NULL},
|
||||||
*pl_nodejs[] = {"npm", "node", "nodejs", "js", NULL},
|
*pl_nodejs[] = {"npm", "node", "nodejs", "js", NULL},
|
||||||
*pl_perl[] = {"perl", "cpan", NULL},
|
*pl_perl[] = {"perl", "cpan", NULL},
|
||||||
@@ -125,7 +125,7 @@ call_cmd (void* cmdptr, const char* arg)
|
|||||||
int
|
int
|
||||||
print_help ()
|
print_help ()
|
||||||
{
|
{
|
||||||
for (int i=0; i<ARRAY_SIZE(usage); i++) {
|
for (int i=0; i<Array_Size(usage); i++) {
|
||||||
puts(usage[i]);
|
puts(usage[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -164,7 +164,7 @@ main (int argc, char const *argv[])
|
|||||||
|
|
||||||
int matched = 0;
|
int matched = 0;
|
||||||
|
|
||||||
for (int i=0; i<ARRAY_SIZE(pl_packagers); i++) {
|
for (int i=0; i<Array_Size(pl_packagers); i++) {
|
||||||
const char const** packager = pl_packagers[i];
|
const char const** packager = pl_packagers[i];
|
||||||
int k = 0;
|
int k = 0;
|
||||||
const char* alias = packager[k];
|
const char* alias = packager[k];
|
||||||
|
|||||||
3
chsrc.h
3
chsrc.h
@@ -2,14 +2,13 @@
|
|||||||
* File : chsrc.h
|
* File : chsrc.h
|
||||||
* Authors : Aoran Zeng <ccmywish@qq.com>
|
* Authors : Aoran Zeng <ccmywish@qq.com>
|
||||||
* Created on : <2023-08-29>
|
* Created on : <2023-08-29>
|
||||||
* Last modified : <2023-08-29>
|
* Last modified : <2023-08-30>
|
||||||
*
|
*
|
||||||
* chsrc:
|
* chsrc:
|
||||||
*
|
*
|
||||||
* chsrc.c 头文件
|
* chsrc.c 头文件
|
||||||
* -------------------------------------------------------------*/
|
* -------------------------------------------------------------*/
|
||||||
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
const char* abbr;
|
const char* abbr;
|
||||||
const char* name;
|
const char* name;
|
||||||
|
|||||||
2
helper.h
2
helper.h
@@ -19,7 +19,7 @@
|
|||||||
#define xy_useutf8()
|
#define xy_useutf8()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
|
#define Array_Size(x) (sizeof(x) / sizeof(x[0]))
|
||||||
|
|
||||||
char*
|
char*
|
||||||
xy_strjoin (const char* str1, const char* str2)
|
xy_strjoin (const char* str1, const char* str2)
|
||||||
|
|||||||
Reference in New Issue
Block a user