コード例 #1
0
ファイル: history.c プロジェクト: plredmond/vimb
/**
 * Write a new history entry to the end of history file.
 */
void history_add(HistoryType type, const char *value, const char *additional)
{
    const char *file;

    /* Don't write a history entry if the history max size is set to 0. Else
     * skip command history in case the command was not typed by the user. */
    if (!vb.config.history_max || (!vb.state.typed && type == HISTORY_COMMAND)) {
        return;
    }

    file = HIST_FILE(type);
    if (additional) {
        util_file_append(file, "%s\t%s\n", value, additional);
    } else {
        util_file_append(file, "%s\n", value);
    }
}
コード例 #2
0
ファイル: hsts.c プロジェクト: vlampreia/vimb
static void add_host_entry_to_file(HSTSProvider *provider, const char *host,
    HSTSEntry *entry)
{
    char *date = soup_date_to_string(entry->expires_at, SOUP_DATE_ISO8601_FULL);

    util_file_append(
        vb.files[FILES_HSTS], HSTS_FILE_FORMAT, host, date, entry->include_sub_domains ? 'y' : 'n'
    );
    g_free(date);
}