2005-03-14 20:51:43 -05:00
|
|
|
/*
|
|
|
|
* conf.c
|
|
|
|
*
|
2006-01-02 14:55:35 -05:00
|
|
|
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
2005-03-14 20:51:43 -05:00
|
|
|
*
|
|
|
|
* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|
|
|
* USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <limits.h>
|
2006-05-14 22:19:57 -04:00
|
|
|
#include <libintl.h>
|
2005-03-14 20:51:43 -05:00
|
|
|
|
|
|
|
#include <alpm.h>
|
|
|
|
/* pacman */
|
|
|
|
#include "util.h"
|
2005-03-19 04:00:40 -05:00
|
|
|
#include "log.h"
|
2005-03-14 20:51:43 -05:00
|
|
|
#include "sync.h"
|
2006-11-14 02:58:42 -05:00
|
|
|
#include "downloadprog.h"
|
2005-10-28 08:20:40 -04:00
|
|
|
#include "conf.h"
|
2005-03-14 20:51:43 -05:00
|
|
|
|
2005-10-29 03:00:56 -04:00
|
|
|
config_t *config_new()
|
2005-10-28 08:20:40 -04:00
|
|
|
{
|
2005-10-29 03:00:56 -04:00
|
|
|
config_t *config;
|
2005-10-28 08:20:40 -04:00
|
|
|
|
2006-02-14 13:48:13 -05:00
|
|
|
MALLOC(config, sizeof(config_t));
|
2005-10-28 08:20:40 -04:00
|
|
|
|
2005-10-29 03:00:56 -04:00
|
|
|
memset(config, 0, sizeof(config_t));
|
2005-10-28 08:20:40 -04:00
|
|
|
|
|
|
|
return(config);
|
|
|
|
}
|
|
|
|
|
2005-10-29 03:00:56 -04:00
|
|
|
int config_free(config_t *config)
|
2005-10-28 08:20:40 -04:00
|
|
|
{
|
|
|
|
if(config == NULL) {
|
|
|
|
return(-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
FREE(config->configfile);
|
|
|
|
free(config);
|
|
|
|
|
|
|
|
return(0);
|
|
|
|
}
|
|
|
|
|
2005-03-14 20:51:43 -05:00
|
|
|
/* vim: set ts=2 sw=2 noet: */
|