2025-07-21 22:46:20 +01:00
|
|
|
#ifndef _ROPKG_INSTANCE_H_
|
|
|
|
|
#define _ROPKG_INSTANCE_H_
|
|
|
|
|
|
2026-06-22 17:45:54 +01:00
|
|
|
#include <fx/io/directory.h>
|
|
|
|
|
#include <fx/io/file.h>
|
|
|
|
|
#include <ropkg/package-db.h>
|
|
|
|
|
#include <ropkg/system-state.h>
|
2025-07-21 22:46:20 +01:00
|
|
|
|
|
|
|
|
#define ROPKG_INSTANCE_DIRPATH_CONFIG "etc/ropkg"
|
|
|
|
|
#define ROPKG_INSTANCE_DIRPATH_CACHE "var/cache/ropkg"
|
|
|
|
|
#define ROPKG_INSTANCE_DIRPATH_DATABASE "var/lib/ropkg"
|
|
|
|
|
|
2026-06-22 17:45:54 +01:00
|
|
|
#define ROPKG_INSTANCE_DIRPATH_CONFIG_FILES \
|
2025-07-21 22:46:20 +01:00
|
|
|
ROPKG_INSTANCE_DIRPATH_CONFIG "/config"
|
2026-06-22 17:45:54 +01:00
|
|
|
#define ROPKG_INSTANCE_DIRPATH_SOURCES ROPKG_INSTANCE_DIRPATH_CONFIG "/sources"
|
2025-07-21 22:46:20 +01:00
|
|
|
#define ROPKG_INSTANCE_DIRPATH_ARCHIVES ROPKG_INSTANCE_DIRPATH_CACHE "/archives"
|
|
|
|
|
|
2026-06-22 17:45:54 +01:00
|
|
|
#define ROPKG_INSTANCE_FILEPATH_STATUS \
|
|
|
|
|
ROPKG_INSTANCE_DIRPATH_DATABASE "/status.rodb"
|
2025-07-21 22:46:20 +01:00
|
|
|
#define ROPKG_INSTANCE_FILEPATH_AVAILABLE \
|
2026-06-22 17:45:54 +01:00
|
|
|
ROPKG_INSTANCE_DIRPATH_DATABASE "/available.rodb"
|
|
|
|
|
#define ROPKG_INSTANCE_FILEPATH_LOCK ROPKG_INSTANCE_DIRPATH_DATABASE "/lock"
|
2025-07-21 22:46:20 +01:00
|
|
|
|
|
|
|
|
struct ropkg_instance {
|
2026-06-22 17:45:54 +01:00
|
|
|
fx_directory *inst_root;
|
2025-07-21 22:46:20 +01:00
|
|
|
|
2026-06-22 17:45:54 +01:00
|
|
|
fx_file *inst_lock;
|
|
|
|
|
fx_directory *inst_dir_config;
|
|
|
|
|
fx_directory *inst_dir_cache;
|
|
|
|
|
fx_directory *inst_dir_database;
|
|
|
|
|
|
|
|
|
|
struct ropkg_system_state *inst_status;
|
|
|
|
|
struct ropkg_package_db *inst_available;
|
2025-07-21 22:46:20 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|