2012-11-19 16:11:56 +00:00
|
|
|
/*
|
|
|
|
* This file is a part of Pcompress, a chunked parallel multi-
|
|
|
|
* algorithm lossless compression and decompression program.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2012 Moinak Ghosh. All rights reserved.
|
|
|
|
* Use is subject to license terms.
|
|
|
|
*
|
|
|
|
* This program 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.
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* moinakg@belenix.org, http://moinakg.wordpress.com/
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/param.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include <time.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <utils.h>
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
#include "initdb.h"
|
|
|
|
|
2012-11-29 16:58:50 +00:00
|
|
|
archive_config_t *
|
2012-11-19 16:11:56 +00:00
|
|
|
init_global_db(char *configfile)
|
|
|
|
{
|
2012-11-29 16:58:50 +00:00
|
|
|
archive_config_t *cfg;
|
|
|
|
int rv;
|
|
|
|
|
|
|
|
cfg = calloc(1, sizeof (archive_config_t));
|
|
|
|
if (!cfg) {
|
|
|
|
fprintf(stderr, "Memory allocation failure\n");
|
|
|
|
return (NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
rv = read_config(configfile, cfg);
|
|
|
|
if (rv != 0)
|
|
|
|
return (NULL);
|
2012-11-19 16:11:56 +00:00
|
|
|
}
|