2013-03-31 15:44:48 -04:00
|
|
|
/* HexChat
|
|
|
|
* Copyright (C) 1998-2010 Peter Zelezny.
|
|
|
|
* Copyright (C) 2009-2013 Berke Viktor.
|
|
|
|
*
|
|
|
|
* 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 St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
2011-02-23 22:14:30 -05:00
|
|
|
/* cfgfiles.h */
|
|
|
|
|
2012-10-24 19:33:23 -04:00
|
|
|
#ifndef HEXCHAT_CFGFILES_H
|
|
|
|
#define HEXCHAT_CFGFILES_H
|
2011-02-23 22:14:30 -05:00
|
|
|
|
2012-10-24 15:33:02 -04:00
|
|
|
#include "hexchat.h"
|
2011-02-23 22:14:30 -05:00
|
|
|
|
2014-01-11 18:34:30 -05:00
|
|
|
#define LANGUAGES_LENGTH 53
|
2013-06-07 21:34:01 -04:00
|
|
|
|
2012-11-03 13:24:25 -04:00
|
|
|
extern char *xdir;
|
2013-11-22 16:25:34 -05:00
|
|
|
extern const char * const languages[LANGUAGES_LENGTH];
|
2011-02-23 22:14:30 -05:00
|
|
|
|
2012-10-30 16:25:58 -04:00
|
|
|
char *cfg_get_str (char *cfg, const char *var, char *dest, int dest_len);
|
2011-02-23 22:14:30 -05:00
|
|
|
int cfg_get_bool (char *var);
|
|
|
|
int cfg_get_int_with_result (char *cfg, char *var, int *result);
|
|
|
|
int cfg_get_int (char *cfg, char *var);
|
|
|
|
int cfg_put_int (int fh, int value, char *var);
|
|
|
|
int cfg_get_color (char *cfg, char *var, int *r, int *g, int *b);
|
|
|
|
int cfg_put_color (int fh, int r, int g, int b, char *var);
|
2012-11-03 13:24:25 -04:00
|
|
|
char *get_xdir (void);
|
2013-05-12 20:58:08 -04:00
|
|
|
int check_config_dir (void);
|
|
|
|
void load_default_config (void);
|
|
|
|
int make_config_dirs (void);
|
|
|
|
int make_dcc_dirs (void);
|
|
|
|
int load_config (void);
|
2011-02-23 22:14:30 -05:00
|
|
|
int save_config (void);
|
|
|
|
void list_free (GSList ** list);
|
|
|
|
void list_loadconf (char *file, GSList ** list, char *defaultconf);
|
|
|
|
int list_delentry (GSList ** list, char *name);
|
|
|
|
void list_addentry (GSList ** list, char *cmd, char *name);
|
|
|
|
int cmd_set (session *sess, char *tbuf, char *word[], char *word_eol[]);
|
2014-07-18 23:36:13 -04:00
|
|
|
int hexchat_open_file (const char *file, int flags, int mode, int xof_flags);
|
2012-10-30 06:35:39 -04:00
|
|
|
FILE *hexchat_fopen_file (const char *file, const char *mode, int xof_flags);
|
2013-06-07 21:34:01 -04:00
|
|
|
|
2011-02-23 22:14:30 -05:00
|
|
|
#define XOF_DOMODE 1
|
|
|
|
#define XOF_FULLPATH 2
|
|
|
|
|
|
|
|
#define STRUCT_OFFSET_STR(type,field) \
|
|
|
|
( (unsigned int) (((char *) (&(((type *) NULL)->field)))- ((char *) NULL)) )
|
|
|
|
|
|
|
|
#define STRUCT_OFFSET_INT(type,field) \
|
|
|
|
( (unsigned int) (((int *) (&(((type *) NULL)->field)))- ((int *) NULL)) )
|
|
|
|
|
2012-10-22 03:00:35 -04:00
|
|
|
#define P_OFFSET(field) STRUCT_OFFSET_STR(struct hexchatprefs, field),sizeof(prefs.field)
|
|
|
|
#define P_OFFSETNL(field) STRUCT_OFFSET_STR(struct hexchatprefs, field)
|
|
|
|
#define P_OFFINT(field) STRUCT_OFFSET_INT(struct hexchatprefs, field),0
|
|
|
|
#define P_OFFINTNL(field) STRUCT_OFFSET_INT(struct hexchatprefs, field)
|
2011-02-23 22:14:30 -05:00
|
|
|
|
|
|
|
struct prefs
|
|
|
|
{
|
|
|
|
char *name;
|
|
|
|
unsigned short offset;
|
|
|
|
unsigned short len;
|
|
|
|
unsigned short type;
|
|
|
|
};
|
|
|
|
|
|
|
|
#define TYPE_STR 0
|
|
|
|
#define TYPE_INT 1
|
|
|
|
#define TYPE_BOOL 2
|
|
|
|
|
2013-04-27 22:12:00 -04:00
|
|
|
#define HEXCHAT_SOUND_DIR "sounds"
|
|
|
|
|
2011-02-23 22:14:30 -05:00
|
|
|
#endif
|