ascii-chat
Binary v0.16.50-198-g78f51665f
Library lib/v0.3.2-2240-g78f51665f
Video chat in your terminal
Loading...
Searching...
No Matches
update_checker.c File Reference

Update checker implementation with GitHub API and cache management. More...

Go to the source code of this file.

Macros

#define NETWORK_UPDATE_CHECKER_LINE_BUFFER_SIZE   512
#define NETWORK_UPDATE_CHECKER_LATEST_TAG_BUFFER_SIZE   64
#define NETWORK_UPDATE_CHECKER_LINE_SHORT_BUFFER_SIZE   256
#define NETWORK_UPDATE_CHECKER_SUGGESTION_BUFFER_SIZE   512
#define UPDATE_CHECK_CACHE_FILENAME   "last_update_check"
#define UPDATE_CHECK_CACHE_MAX_AGE_SECONDS   (7 * 24 * 60 * 60)
#define GITHUB_API_HOSTNAME   "api.github.com"
#define GITHUB_RELEASES_PATH   "/repos/zfogg/ascii-chat/releases/latest"

Functions

asciichat_error_t update_check_load_cache (update_check_result_t *result)
 Load cached update check result.
asciichat_error_t update_check_save_cache (const update_check_result_t *result)
 Save update check result to cache.
bool update_check_is_cache_fresh (const update_check_result_t *result)
 Check if cache is fresh (< 7 days old).
void update_check_dismiss_for_a_week (update_check_result_t *result)
bool update_check_is_dismissed (const update_check_result_t *result)
bool update_check_try_fresh_cache (update_check_result_t *result)
asciichat_error_t update_check_perform (update_check_result_t *result)
 Check for updates from GitHub releases API.
install_method_t update_check_detect_install_method (void)
 Detect installation method.
const char * update_check_get_aur_helper (void)
void update_check_get_upgrade_suggestion (install_method_t method, const char *latest_version, char *buffer, size_t buffer_size)
 Get upgrade suggestion string.
void update_check_format_notification (const update_check_result_t *result, char *buffer, size_t buffer_size)
 Format update notification message.
asciichat_error_t update_check_startup (update_check_result_t *result)
 Perform startup update check with caching.

Detailed Description

Update checker implementation with GitHub API and cache management.

Definition in file update_checker.c.

Macro Definition Documentation

◆ GITHUB_API_HOSTNAME

#define GITHUB_API_HOSTNAME   "api.github.com"

Definition at line 45 of file update_checker.c.

Referenced by update_check_perform().

◆ GITHUB_RELEASES_PATH

#define GITHUB_RELEASES_PATH   "/repos/zfogg/ascii-chat/releases/latest"

Definition at line 46 of file update_checker.c.

Referenced by update_check_perform().

◆ NETWORK_UPDATE_CHECKER_LATEST_TAG_BUFFER_SIZE

#define NETWORK_UPDATE_CHECKER_LATEST_TAG_BUFFER_SIZE   64

Definition at line 8 of file update_checker.c.

Referenced by update_check_perform().

◆ NETWORK_UPDATE_CHECKER_LINE_BUFFER_SIZE

#define NETWORK_UPDATE_CHECKER_LINE_BUFFER_SIZE   512

Definition at line 7 of file update_checker.c.

Referenced by update_check_load_cache().

◆ NETWORK_UPDATE_CHECKER_LINE_SHORT_BUFFER_SIZE

#define NETWORK_UPDATE_CHECKER_LINE_SHORT_BUFFER_SIZE   256

Definition at line 9 of file update_checker.c.

◆ NETWORK_UPDATE_CHECKER_SUGGESTION_BUFFER_SIZE

#define NETWORK_UPDATE_CHECKER_SUGGESTION_BUFFER_SIZE   512

Definition at line 10 of file update_checker.c.

Referenced by update_check_format_notification().

◆ UPDATE_CHECK_CACHE_FILENAME

#define UPDATE_CHECK_CACHE_FILENAME   "last_update_check"

Definition at line 37 of file update_checker.c.

◆ UPDATE_CHECK_CACHE_MAX_AGE_SECONDS

#define UPDATE_CHECK_CACHE_MAX_AGE_SECONDS   (7 * 24 * 60 * 60)