/*
* 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 Library 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 <stdio.h>
#include <stdlib.h>
#include "globals.h"
static char *g_ip = NULL;
static char *g_config_file = NULL;
static unsigned int g_service_online = 1;
char * get_my_ip() {
/* -----------------------------------------------------------------------------
* Get static IP
*
* @return char *
* -------------------------------------------------------------------------- */
return g_ip;
}
void set_my_ip(char *p) {
/* -----------------------------------------------------------------------------
* Set static IP
* !! The pointer must contain a dynamicaly memory allocate
* and must not be freed after
*
* @param char *
* -------------------------------------------------------------------------- */
if (g_ip != NULL)
free(g_ip);
g_ip = p;
}
char * get_config_file() {
/* -----------------------------------------------------------------------------
* Get static config file
*
* @return char *
* -------------------------------------------------------------------------- */
return g_config_file;
}
void set_config_file(char *p) {
/* -----------------------------------------------------------------------------
* Set static config file
* !! The pointer must contain a dynamicaly memory allocate
* and must not be freed after
*
* @param char *
* -------------------------------------------------------------------------- */
if (g_config_file != NULL)
free(g_config_file);
g_config_file = p;
}
unsigned int is_service_online() {
/* -----------------------------------------------------------------------------
* Get static service status
*
* @return unsigned int
* -------------------------------------------------------------------------- */
return g_service_online;
}
void set_service_online(unsigned int status) {
/* -----------------------------------------------------------------------------
* Set static service status
*
* @param unsigned int
* -------------------------------------------------------------------------- */
g_service_online = status;
}
syntax highlighted by Code2HTML, v. 0.9.1