gpt4 book ai didi

c - 如何在 C 中调用 “@” at-symbol 引用?

转载 作者:太空宇宙 更新时间:2023-11-04 01:16:31 25 4
gpt4 key购买 nike

看过 Fossil 的代码 [ https://fossil-scm.org/home/annotate?filename=src/schema.c&checkin=b03652382a327740 L27..]:

    /*
** The database schema for the ~/.fossil configuration database.
*/
const char zConfigSchema[] =
@ -- This file contains the schema for the database that is kept in the
@ -- ~/.fossil file and that stores information about the users setup.
@ --
@ CREATE TABLE global_config(
@ name TEXT PRIMARY KEY,
@ value TEXT
@ );
@
@ -- Identifier for this file type.
@ -- The integer is the same as 'FSLG'.
@ PRAGMA application_id=252006675;
;

我想知道什么是 @... 语法。我以前从未见过它,也不知道如何调用它来搜索网络。 “C 中的字符串文字扩展”和各种改写都没有结果。

请考虑留下这个问题,尽管它很琐碎,但为了更好的发现。谢谢。

最佳答案

来自项目的“BUILD.txt”:

  • Most *.c source files are preprocessed using a program called "translate". The sources to translate are found in src/translate.c. A header comment in src/translate.c explains in detail what it does.

更多信息可以直接在 referenced file 中找到, 但它似乎被用来更好地处理 C 中的 CGI 功能,尤其是在生成 HTML 时。

“src/translate.c”中提供的概要如下:

** Input lines that begin with the "@" character are translated into
** either cgi_printf() statements or string literals and the
** translated code is written on standard output.
**
** The problem this program is attempt to solve is as follows: When
** writing CGI programs in C, we typically want to output a lot of HTML
** text to standard output. In pure C code, this involves doing a
** printf() with a big string containing all that text. But we have
** to insert special codes (ex: \n and \") for many common characters,
** which interferes with the readability of the HTML.
**
** This tool allows us to put raw HTML, without the special codes, in
** the middle of a C program. This program then translates the text
** into standard C by inserting all necessary backslashes and other
** punctuation.

关于c - 如何在 C 中调用 “@” at-symbol 引用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57183799/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com