添加 echo() 并使用 @flavor 标注API参考依据

This commit is contained in:
Aoran Zeng 2025-08-20 11:42:45 +08:00
parent 34fa12edde
commit 6178b212a0
No known key found for this signature in database
GPG Key ID: 8F8BA8488E10ED98

View File

@ -2,18 +2,22 @@
* Copyright © 2023-2025 Aoran Zeng, Heng Guo * Copyright © 2023-2025 Aoran Zeng, Heng Guo
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* ------------------------------------------------------------- * -------------------------------------------------------------
* Lib Name : xy.h * Lib Name : xy.h
* Lib Authors : Aoran Zeng <ccmywish@qq.com> * Lib Authors : <ccmywish@qq.com>
* | Heng Guo <2085471348@qq.com> * | <2085471348@qq.com>
* Contributors : juzeon <skyjuzheng@gmail.com> * Contributors : juzeon <skyjuzheng@gmail.com>
* | Mikachu2333 <mikachu.23333@zohomail.com> * | Mikachu2333 <mikachu.23333@zohomail.com>
* | * |
* Created On : <2023-08-28> * Created On : <2023-08-28>
* Last Modified : <2025-08-18> * Last Modified : <2025-08-20>
* *
* xy: *
* Corss-Platform C11 utilities for CLI applications in mixed * xy:
* flavor (mostly Ruby) *
* C11 (utilities)
*
* ( Ruby) API
* 使 @flavor
* ------------------------------------------------------------*/ * ------------------------------------------------------------*/
#ifndef XY_H #ifndef XY_H
@ -145,8 +149,11 @@ static void _xy_println_const_str (const char *str) {printf ("%s\n", str);}
const char *: _xy_println_const_str, \ const char *: _xy_println_const_str, \
default: assert(!"Unsupported type for println()/say()!") \ default: assert(!"Unsupported type for println()/say()!") \
)(x) )(x)
/* @flavor Perl/Raku */
#define say println #define say println
/* @flavor PHP */
#define echo println
/* @flavor HTML */
void br () { puts (""); } void br () { puts (""); }
void p (const char *s) { printf ("%s\n", s); } void p (const char *s) { printf ("%s\n", s); }