Files
kospm/include/kospm_pkgdb.h
Nikita Pikalov f76f191d62 Another commit of another iteration.
Another milestone: school project submission. Library doesn't work yet, though. Also licensing things, I guess
2025-04-19 03:33:07 +03:00

52 lines
1.4 KiB
C

/*
* kospm_pkgdb.h
*
* Copyright 2025 keXa <nikitospikalov2008@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*
*
*/
#ifndef KOSPM_PKGDB
#define KOSPM_PKGDB
#include "kospm_pkglist.h"
#define DB_FOLDER "/kospm/db"
typedef struct kospm_pkg_db {
char *root_path;
kospm_pkg_list_t *package_list;
} kospm_pkg_db_t;
kospm_pkg_db_t* kospm_db_init();
kospm_pkg_db_t* kospm_db_open(kospm_pkg_db_t *db, char *root_path);
int kospm_db_save(kospm_pkg_db_t *db);
int kospm_db_close(kospm_pkg_db_t *db);
int kospm_db_pkg_add(kospm_pkg_db_t *db, kospm_pkg_meta_t *package);
int kospm_db_pkg_remove(kospm_pkg_db_t *db, char *pkg_name);
int kospm_db_pkg_file_add(kospm_pkg_db_t *db, kospm_pkg_file_t *file);
int kospm_db_pkg_file_remove(kospm_pkg_db_t *db, char *file_name);
#endif