⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 acct.c

📁 unix环境高级编程的源代码
💻 C
字号:
#include    "lprps.h"

/* Write the number of pages, hostname, and loginname to the
 * accounting file.  This function is called by main() at the end
 * (if all was OK, by printer_flushing(), and by handle_intr() if
 * an interrupt is received. */

void
do_acct(void)
{
    FILE    *fp;

    if (end_page > start_page &&
        acct_file != NULL &&
        (fp = fopen(acct_file, "a")) != NULL) {
            fprintf(fp, "%7.2f %s:%s\n",
                        (double)(end_page - start_page),
                        hostname, loginname);
            if (fclose(fp) == EOF)
                log_sys("do_acct: fclose error");
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -