mirror of
https://github.com/itsPLK/ps5-payload-manager.git
synced 2026-10-19 02:19:53 -05:00
- Remove startup self-update check and chainloading in main.c - Remove self-update logic and ELF version inspection from repository.c and repository.h - Neuter /update_check route to return status none - Remove update banners, notifications, and settings toggle from frontend - Exclude pldmgr from repository payload listings and block installing pldmgr as a payload - Add launch guards in HTTP server and autoload worker preventing pldmgr self-execution
44 lines
1.3 KiB
C
44 lines
1.3 KiB
C
#ifndef REPOSITORY_H
|
|
#define REPOSITORY_H
|
|
|
|
#include <stddef.h>
|
|
|
|
/* Payload entry from a repository JSON */
|
|
typedef struct RepoPayload {
|
|
char id[128];
|
|
char name[128];
|
|
char filename[256];
|
|
char url[1024];
|
|
char source[1024];
|
|
char source_direct[1024];
|
|
char description[1024];
|
|
char last_update[64];
|
|
char version[64];
|
|
char checksum[65];
|
|
char source_name[256];
|
|
char category[128];
|
|
char icon[16384];
|
|
char release_notes[2048];
|
|
char author[128];
|
|
char details_url[1024];
|
|
} RepoPayload;
|
|
|
|
/* Download a URL to a local file. Returns 0 on success, -1 on failure. */
|
|
int download_to_file(const char *url, const char *out_path);
|
|
|
|
/* Parse a JSON string containing payload objects into a RepoPayload array.
|
|
* Caller must free *out_items. Returns 0 on success, -1 on failure. */
|
|
int parse_repository_payloads(const char *json, RepoPayload **out_items, size_t *out_count);
|
|
|
|
/* ── Repository cache management ────────────────────────── */
|
|
|
|
/* Ensure the repository cache is up-to-date. If force_refresh, always re-download. */
|
|
int repository_ensure_fresh(int force_refresh);
|
|
|
|
/* Build the /repository_payloads JSON response. Returns bytes written. */
|
|
size_t repository_list_json(char *json_buf, size_t buf_size, int force_refresh);
|
|
|
|
#endif
|
|
|
|
|