/**
 * Copyright (C), 2024, OpenKylin, Inc
 * @file  : common/KMConfig.h
 */
#ifndef KMCONFIG_H
#define KMCONFIG_H

#include <glib.h>

#if !GLIB_CHECK_VERSION (2, 49, 3)
#define KAIMING_VARIANT_BUILDER_INITIALIZER {{0, }}
#define KAIMING_VARIANT_DICT_INITIALIZER {{0, }}
#else
#define KAIMING_VARIANT_BUILDER_INITIALIZER {{{0, }}}
#define KAIMING_VARIANT_DICT_INITIALIZER {{{0, }}}
#endif

 /*
 * Version 4 guarantees that alt-id/eol/eolr/runtime/extension-of/appdata-content-rating
 *           are present if in the commit metadata or metadata file or appdata
 */
#define KAIMING_DEPLOY_VERSION_CURRENT 4

/* version 1 增加 附加数据下载大小
 * version 2 增加 ot.ts timestamps (to new format)
 */
#define KAIMING_XA_CACHE_VERSION 2

/* 版本0/missing是标准的ostree摘要，
 * 版本1是紧凑的格式，具有内联缓存，没有增量
 */
#define KAIMING_XA_SUMMARY_VERSION 1

#define KAIMING_SUMMARY_DIFF_HEADER "xadf"

/* 这些是摘要中每个引用元数据中的关键字名称 */
#define OSTREE_COMMIT_TIMESTAMP "ostree.commit.timestamp"
#define OSTREE_COMMIT_TIMESTAMP2 "ot.ts" /* 上述的较短版本 */


/**
 * KAIMING_SUMMARY_INDEX_GVARIANT_FORMAT:
 *
 * dict
 *   s: subset name
 *  ->
 *   ay - checksum of subsummary
 *   aay - previous subsummary checksums
 *   a{sv} - per subset metadata
 * a{sv} - metadata
 *
 */
#define KAIMING_SUMMARY_INDEX_GVARIANT_STRING "(a{s(ayaaya{sv})}a{sv})"
#define KAIMING_SUMMARY_INDEX_GVARIANT_FORMAT G_VARIANT_TYPE (KAIMING_SUMMARY_INDEX_GVARIANT_STRING)

#define REPO_NAME "kaiming-repo"
//#define REPO_URL "http://ostree.openkylin.top/openkylin-kaiming"
#define REPO_URL "https://archive2-source.kylinos.cn/KM/repo"

#define KAIMING_CONFIG_PATH "/usr/local/etc/kaiming"
#define KAIMING_SYSTEM_PATH "/opt/kaiming"
#define KAIMING_SYSTEM_EXPORTS_PATH "/var/opt/kaiming"
#define KAIMING_SYSTEM_FONT_PATH "/usr/share/fonts"
#define KAIMING_SYSTEM_FONT_CACHE_PATHS "/var/cache/fontconfig:/usr/lib/fontconfig/cache"

#define KAIMING_SESSION_HELPER_PATH "/org/freedesktop/Kaiming/SessionHelper"
#define KAIMING_SESSION_HELPER_NAME "org.freedesktop.Kaiming"

#define KAIMING_PROGRESS_NAME "kaiming"

#define KAIMING_BOX "/usr/bin/crun"
#define DBUSPROXY "/usr/bin/xdg-dbus-proxy"

// 最大日志文件大小和日志文件数量
#define LOG_FILE_MAX_SIZE (1024*1024*10)
#define LOG_FILE_MAX_COUNT 10

#endif // KMCONFIG_H
