7/6
This commit is contained in:
@@ -1,73 +1,44 @@
|
||||
/*
|
||||
* config.h - Config loading for Glacier
|
||||
*
|
||||
* This file is part of Glacier.
|
||||
* This file is part of Libglacier.
|
||||
*
|
||||
* Glacier is free software: you can redistribute it and/or modify it under the terms of the
|
||||
* Libglacier is free software: you can redistribute it and/or modify it under the terms of the
|
||||
* GNU Lesser General Public License as published by the Free Software Foundation, either
|
||||
* version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* Glacier is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* Libglacier 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License along with Glacier. If
|
||||
* You should have received a copy of the GNU Lesser General Public License along with libglacier. If
|
||||
* not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef GLACIERCONFIG_H_
|
||||
#define GLACIERCONFIG_H_
|
||||
|
||||
#include <libconfig.h>
|
||||
|
||||
/* Constants */
|
||||
#ifndef LG_VERBOSE
|
||||
#define LG_VERBOSE 0
|
||||
#endif
|
||||
|
||||
/*
|
||||
* gl_init_config
|
||||
*
|
||||
* DESCRIPTION: Initialize libconfig.
|
||||
* PARAMETERS: None.
|
||||
* RETURNS: 0 on success, EXIT_FAILURE on error
|
||||
*/
|
||||
int gl_init_config(void);
|
||||
typedef struct
|
||||
{
|
||||
char section[128];
|
||||
char key[128];
|
||||
char value[128];
|
||||
}
|
||||
config_entry_t;
|
||||
|
||||
/*
|
||||
* gl_die_config
|
||||
*
|
||||
* DESCRIPTION: Kill libconfig.
|
||||
* PARAMETERS: None.
|
||||
* RETURNS: EXIT_SUCCESS on success
|
||||
*/
|
||||
int gl_die_config(void);
|
||||
typedef struct
|
||||
{
|
||||
config_entry_t entries[64];
|
||||
size_t count;
|
||||
}
|
||||
config_storage_t;
|
||||
|
||||
/*
|
||||
* gl_load_all_from_config
|
||||
*
|
||||
* DESCRIPTION: Loads all settings from the Glacier config file.
|
||||
* PARAMETERS: None.
|
||||
* RETURNS: 0 on success, 1 on error
|
||||
*/
|
||||
int gl_load_all_from_config(void);
|
||||
|
||||
/*
|
||||
* gl_load_all_from_profile
|
||||
*
|
||||
* DESCRIPTION: Loads all settings from the Glacier system profile.
|
||||
* PARAMETERS: None.
|
||||
* RETURNS: 0 on success, 1 on error
|
||||
*/
|
||||
int gl_load_all_from_profile(void);
|
||||
|
||||
/*
|
||||
* gl_load_setting_from_config
|
||||
*
|
||||
* DESCRIPTION: Load a specified setting from the Glacier config file.
|
||||
* PARAMETERS: char SETTING[]
|
||||
* RETURNS: 0 on success, 1 on error
|
||||
*/
|
||||
int gl_load_setting_from_config(char SETTING[]);
|
||||
int gl_config_storage_callback(IniDispatch *dispatch, void *data);
|
||||
config_storage_t gl_store_config(FILE *config);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
/*
|
||||
* data.h - Data structures for libglacier
|
||||
*
|
||||
* This file is part of Glacier.
|
||||
* This file is part of libglacier.
|
||||
*
|
||||
* Glacier is free software: you can redistribute it and/or modify it under the terms of the
|
||||
* Libglacier is free software: you can redistribute it and/or modify it under the terms of the
|
||||
* GNU Lesser General Public License as published by the Free Software Foundation, either
|
||||
* version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* Glacier is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* Libglacier 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License along with Glacier. If
|
||||
* You should have received a copy of the GNU Lesser General Public License along with libglacier. If
|
||||
* not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,47 +1,29 @@
|
||||
/*
|
||||
* globals.h - Global variables for libglacier
|
||||
*
|
||||
* This file is part of Glacier.
|
||||
* This file is part of libglacier.
|
||||
*
|
||||
* Glacier is free software: you can redistribute it and/or modify it under the terms of the
|
||||
* Libglacier is free software: you can redistribute it and/or modify it under the terms of the
|
||||
* GNU Lesser General Public License as published by the Free Software Foundation, either
|
||||
* version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* Glacier is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* Libglacier 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License along with Glacier. If
|
||||
* You should have received a copy of the GNU Lesser General Public License along with libglacier. If
|
||||
* not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef GLOBALS_H_
|
||||
#define GLOBALS_H_
|
||||
|
||||
#include <libconfig.h>
|
||||
#include <stdio.h>
|
||||
|
||||
/* Constants */
|
||||
#define BUFFER_SIZE 1024
|
||||
#define MAX_SIZE 256
|
||||
|
||||
/* libconfig context */
|
||||
extern config_t cfg;
|
||||
extern config_setting_t *setting;
|
||||
|
||||
/* Configuration variables */
|
||||
extern int GLACIER_ALLOW_SERVICES;
|
||||
extern char *GLACIER_ALLOWED_LICENSES;
|
||||
extern int GLACIER_DO_INT_CHECK;
|
||||
extern int GLACIER_VERBOSE;
|
||||
|
||||
/* Profile variables */
|
||||
extern const char *GLACIER_REPO;
|
||||
extern const char *GLACIER_ARCH;
|
||||
extern const char *GLACIER_TARGET;
|
||||
extern const char *GLACIER_LOCALDB;
|
||||
extern const char *GLACIER_SYSTEM_PROFILE;
|
||||
|
||||
/* Required runtime files */
|
||||
extern const char *runtime_files[];
|
||||
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
/*
|
||||
* log.h - Logging function declarations for libglacier
|
||||
*
|
||||
* This file is part of Glacier.
|
||||
* This file is part of libglacier.
|
||||
*
|
||||
* Glacier is free software: you can redistribute it and/or modify it under the terms of the
|
||||
* Libglacier is free software: you can redistribute it and/or modify it under the terms of the
|
||||
* GNU Lesser General Public License as published by the Free Software Foundation, either
|
||||
* version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* Glacier is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* Libglacier 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License along with Glacier. If
|
||||
* You should have received a copy of the GNU Lesser General Public License along with libglacier. If
|
||||
* not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
/*
|
||||
* pkgops.h - Package-related function declarations for libglacier
|
||||
*
|
||||
* This file is part of Glacier.
|
||||
* This file is part of libglacier.
|
||||
*
|
||||
* Glacier is free software: you can redistribute it and/or modify it under the terms of the
|
||||
* Libglacier is free software: you can redistribute it and/or modify it under the terms of the
|
||||
* GNU Lesser General Public License as published by the Free Software Foundation, either
|
||||
* version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* Glacier is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* Libglacier 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License along with Glacier. If
|
||||
* You should have received a copy of the GNU Lesser General Public License along with libglacier. If
|
||||
* not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
@@ -24,6 +24,19 @@
|
||||
/* Maximum size for path buffers */
|
||||
#define PATH_MAX_SIZE 512
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char *name;
|
||||
char *ver;
|
||||
char *desc;
|
||||
char *maintainer;
|
||||
char *license;
|
||||
char *arch;
|
||||
char **deps;
|
||||
char **conflicts;
|
||||
}
|
||||
gl_package;
|
||||
|
||||
/*
|
||||
* gl_mkworkspace
|
||||
*
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
/*
|
||||
* runtime.h - Runtime function declarations for libglacier
|
||||
*
|
||||
* This file is part of Glacier.
|
||||
* This file is part of libglacier.
|
||||
*
|
||||
* Glacier is free software: you can redistribute it and/or modify it under the terms of the
|
||||
* Libglacier is free software: you can redistribute it and/or modify it under the terms of the
|
||||
* GNU Lesser General Public License as published by the Free Software Foundation, either
|
||||
* version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* Glacier is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* Libglacier 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License along with Glacier. If
|
||||
* You should have received a copy of the GNU Lesser General Public License along with libglacier. If
|
||||
* not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
/*
|
||||
* security.h - Runtime function declarations for libglacier
|
||||
*
|
||||
* This file is part of Glacier.
|
||||
* This file is part of libglacier.
|
||||
*
|
||||
* Glacier is free software: you can redistribute it and/or modify it under the terms of the
|
||||
* Libgacier is free software: you can redistribute it and/or modify it under the terms of the
|
||||
* GNU Lesser General Public License as published by the Free Software Foundation, either
|
||||
* version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* Glacier is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* Libglacier 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License along with Glacier. If
|
||||
* You should have received a copy of the GNU Lesser General Public License along with libglacier. If
|
||||
* not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
@@ -59,9 +59,13 @@ int gl_stash_hash(char *stored_hash, unsigned int stored_hash_size, const uchar
|
||||
/*
|
||||
* gl_hash_file
|
||||
*
|
||||
* DESCRIPTION: Performs a hashing operation on a file and stores the result
|
||||
* PARAMETERS: const char *filename, unsigned char *out_hash, unsigned int *out_length
|
||||
* RETURNS: 0 on success, 1-6 for different error conditions
|
||||
* DESCRIPTION: Performs a hashing operation on a file using libevhash and stores the result
|
||||
* PARAMETERS:
|
||||
* const char *filename - The path to the file to hash
|
||||
* uint8_t *out_hash - Buffer to store the resulting hash
|
||||
* unsigned int *out_length - Will be set to the length of the hash
|
||||
* RETURNS: 0 on success, non-zero on failure
|
||||
*
|
||||
*/
|
||||
int gl_hash_file(const char *filename, unsigned char *out_hash, unsigned int *out_length);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user