ascii-chat 0.11.33
Video chat in your terminal
Loading...
Searching...
No Matches
update_checker.h
Go to the documentation of this file.
1#pragma once
2
22#include <stdbool.h>
23#include <stdint.h>
24#include <time.h>
25#include "../common.h"
26
30typedef struct {
32 char latest_version[64];
33 char latest_sha[41];
34 char current_version[64];
35 char current_sha[41];
36 char release_url[512];
40
50
65
80
90
98
107
118void update_check_get_upgrade_suggestion(install_method_t method, const char *latest_version, char *buffer,
119 size_t buffer_size);
120
131void update_check_format_notification(const update_check_result_t *result, char *buffer, size_t buffer_size);
132
147
int buffer_size
Size of circular buffer.
Definition grep.c:90
asciichat_error_t
Error and exit codes - unified status values (0-255)
Definition error_codes.h:49
asciichat_error_t update_check_startup(update_check_result_t *result)
Perform startup update check with caching.
install_method_t
Installation method for suggesting upgrade command.
void update_check_get_upgrade_suggestion(install_method_t method, const char *latest_version, char *buffer, size_t buffer_size)
Get upgrade suggestion string.
bool update_check_is_cache_fresh(const update_check_result_t *result)
Check if cache is fresh (< 7 days old)
asciichat_error_t update_check_perform(update_check_result_t *result)
Check for updates from GitHub releases API.
asciichat_error_t update_check_save_cache(const update_check_result_t *result)
Save update check result to cache.
asciichat_error_t update_check_load_cache(update_check_result_t *result)
Load cached update check result.
install_method_t update_check_detect_install_method(void)
Detect installation method.
void update_check_format_notification(const update_check_result_t *result, char *buffer, size_t buffer_size)
Format update notification message.
@ INSTALL_METHOD_ARCH_AUR
Installed via Arch AUR (paru/yay)
@ INSTALL_METHOD_UNKNOWN
Unknown installation method.
@ INSTALL_METHOD_GITHUB
Manual install from GitHub releases.
@ INSTALL_METHOD_HOMEBREW
Installed via Homebrew.
ClangTool/LibTooling compatibility shim for stdbool.h.
Update check result data.
time_t last_check_time
Timestamp of last check.
bool update_available
True if newer version exists.
bool check_succeeded
True if check completed (even if no update)
⏱️ High-precision timing utilities using sokol_time.h and uthash